:root {
  --bg: #e9eef1;
  --surface: #f8fafb;
  --ink: #16222a;
  --muted: #5b6b75;
  --line: #c9d3d9;
  --accent: #0f4c5c;
  --accent-ink: #ffffff;
  --reply: #dce6ea;
  --danger: #9b2c2c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12191e;
    --surface: #1a242b;
    --ink: #e6edf1;
    --muted: #93a3ad;
    --line: #2c3a43;
    --accent: #6fb7c9;
    --accent-ink: #0c1317;
    --reply: #22313a;
    --danger: #e08a8a;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 40rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
h1, h2 {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); margin: 0 0 1rem; }
h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
p { margin: 0 0 1rem; max-width: 36rem; }
.muted { color: var(--muted); }
a { color: var(--accent); }
label { display: block; font-weight: 600; margin: 1.5rem 0 0.4rem; }
input, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem 0.8rem;
}
textarea { min-height: 5.5rem; resize: vertical; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 6px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
}
button:disabled { opacity: 0.55; cursor: progress; }
button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
button.danger { color: var(--danger); }
.status { min-height: 1.5rem; margin-top: 1rem; color: var(--muted); }
.status.error { color: var(--danger); }

/* чат */
.chat { margin: 1.5rem 0; display: flex; flex-direction: column; gap: 0.6rem; }
.msg { max-width: 85%; padding: 0.6rem 0.9rem; border-radius: 10px; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.msg.ai { align-self: flex-start; background: var(--reply); }
.composer { display: flex; gap: 0.5rem; }
.composer input { flex: 1; }
.owner {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: none;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.owner.on { display: flex; }
.note { font-size: 0.9rem; color: var(--muted); margin-top: 1.5rem; }

/* 3D-шар */
main.wide { max-width: 64rem; }
.hero { display: grid; gap: 1rem; align-items: center; }
@media (min-width: 52rem) {
  .hero { grid-template-columns: 1.05fr 1fr; gap: 2rem; }
}
.orb-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 26rem;
  order: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent 72%);
}
@media (min-width: 52rem) { .orb-stage { order: 0; max-height: none; } }
.orb-stage canvas, .orb-small canvas { display: block; width: 100%; height: 100%; }
.profile-head { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 0.5rem; }
.profile-head h1 { margin: 0; }
.orb-small {
  flex: none;
  width: 6.5rem;
  height: 6.5rem;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent 72%);
}
@media (prefers-reduced-motion: reduce) { .button, button { transition: none; } }
