/* MindForm Console -- styles.
 *
 * The cockpit shell, header, chat, orb and bars follow the original MindForm
 * Console design; the bars are center-zero because OCEAN traits are signed
 * [-1, 1] (the original's were unsigned). A start screen (character picker /
 * creation) is added on top in the same visual language. No build step, no
 * framework -- plain CSS.
 */

/* ---------- tokens (verbatim from the handoff) ---------- */
:root {
  --bone: #FAF7F1; --bone-2: #F2EDE3; --bone-3: #E6DECD;
  --ink: #1A0E2E; --ink-2: #2E1F4A;
  --muted: #8B7BA0; --muted-2: #6A597F;
  --hairline: rgba(26,14,46,0.10);
  --hairline-2: rgba(26,14,46,0.16);
  --belief: #F0386B; --belief-soft: #FF6F94;
  --trait: #5B3FE0;
  --warm: #F5B341;
  --moral: #1FA89A;
  --drive: #2F9E5E;
  --self: #3E86C0;
  --voice: #C2603E;
  --behav: #A63A5B;
  --surface: #ffffff; --surface-2: #FBF8F2;
  --track: rgba(26,14,46,0.07);
  --serif: "Instrument Serif", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bone: #0B0617; --bone-2: #120B24; --bone-3: #1C1235;
  --ink: #F2EAD6; --ink-2: #C9C0AA;
  --muted: #9B8DB0; --muted-2: #B5A8C7;
  --hairline: rgba(242,234,214,0.10);
  --hairline-2: rgba(242,234,214,0.18);
  --belief: #FF6F94; --belief-soft: #FF6F94;
  --trait: #9A7FFF;
  --warm: #F5B341;
  --moral: #54D6C4;
  --drive: #56D98A;
  --self: #6FB0EF;
  --voice: #EF9670;
  --behav: #E17296;
  --surface: #14102A; --surface-2: #0F0A20;
  --track: rgba(242,234,214,0.08);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { transition: background-color .25s ease, color .25s ease; }
html, body { margin: 0; height: 100%; background: var(--bone); color: var(--ink);
  font-family: var(--body); font-size: 17px; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--ink); color: var(--bone); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted-2); }
.t-belief { color: var(--belief); }
.t-trait { color: var(--trait); }
.t-warm { color: var(--warm); }
.t-drive { color: var(--drive); }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.cockpit { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

/* ---------- header ---------- */
.head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 26px; border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bone) 88%, transparent); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 24px; cursor: pointer; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--belief);
  box-shadow: 0 0 12px var(--belief); animation: pulse 2.4s ease-in-out infinite; }
.brand-chip { font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--hairline-2); border-radius: 999px; padding: 3px 9px; margin-left: 2px; }
@keyframes pulse { 0%,100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.25); } }
.head-status { display: flex; align-items: center; gap: 16px; font-family: var(--mono); font-size: 12px; }
.hs-item { display: inline-flex; align-items: baseline; gap: 8px; color: var(--ink); letter-spacing: 0.04em; }
.hs-k { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-2); }
.hs-sep { width: 1px; height: 16px; background: var(--hairline-2); }
.hs-mood { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 4px 11px; border-radius: 999px; border: 1px solid currentColor; color: var(--trait); }
.hs-mood-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 8px currentColor; animation: pulse 2s ease-in-out infinite; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.ghost-btn { background: transparent; border: 1px solid var(--hairline-2); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; transition: border-color .15s, background .15s, color .15s; }
.ghost-btn:hover { border-color: var(--belief); color: var(--belief); }
.icon-btn { width: 38px; padding: 8px 0; font-size: 15px; }

/* ---------- cockpit grid ---------- */
.grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.12fr 0.92fr 0.96fr;
  gap: 16px; padding: 16px 26px 22px; }
.col { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

/* ---------- chat ---------- */
.chat-col { padding: 0; }
.col-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 24px 16px; border-bottom: 1px solid var(--hairline); }
.agent-name { font-size: 30px; line-height: 1; }
.agent-tag { font-size: 14.5px; color: var(--muted-2); margin-top: 5px; max-width: 320px; font-style: italic; }
.agent-live { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-2); white-space: nowrap; }
.agent-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--trait); box-shadow: 0 0 8px var(--trait); }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px; display: flex;
  flex-direction: column; gap: 18px; }
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 92%; }
.msg-who { font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-2); }
.msg-text { font-family: var(--serif); font-size: 21px; line-height: 1.32; letter-spacing: -0.005em; }
.msg-agent { align-self: flex-start; padding-left: 16px; border-left: 2px solid var(--belief); }
.msg-agent .msg-who { color: var(--belief); }
.msg-user { align-self: flex-end; text-align: right; padding-right: 16px; border-right: 2px solid var(--hairline-2); }
.msg-user .msg-text { color: var(--ink-2); font-style: italic; }
.msg-system { align-self: center; text-align: center; max-width: 100%; }
.msg-system .msg-text { font-family: var(--body); font-style: italic; font-size: 14px; color: var(--muted-2); }
.typing { display: inline-flex; gap: 6px; align-items: center; height: 26px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--belief); opacity: .4;
  animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.composer { flex: none; border-top: 1px solid var(--hairline); padding: 14px 18px 16px; background: var(--surface-2); }
.suggest-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.suggest-row::-webkit-scrollbar { display: none; }
.chip { flex: none; background: transparent; border: 1px solid var(--hairline-2); color: var(--muted-2);
  border-radius: 999px; padding: 7px 13px; font-family: var(--body); font-size: 13px; white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s; }
.chip:hover:not(:disabled) { border-color: var(--belief); color: var(--belief); }
.chip:disabled { opacity: .4; cursor: default; }
.composer-in { display: flex; gap: 10px; align-items: flex-end; }
.composer-in textarea { flex: 1; resize: none; font-family: var(--body); font-size: 16px; line-height: 1.4;
  color: var(--ink); background: var(--bone-2); border: 1px solid var(--hairline-2); border-radius: 12px;
  padding: 12px 14px; outline: none; max-height: 120px; transition: border-color .15s; }
.composer-in textarea:focus { border-color: var(--belief); }
.send-btn { flex: none; background: var(--belief); color: #fff; border: none; border-radius: 12px;
  padding: 12px 20px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  transition: background .15s, opacity .15s; height: 46px; }
.send-btn:hover:not(:disabled) { background: var(--belief-soft); }
.send-btn:disabled { opacity: .4; cursor: default; }

/* ---------- orb ---------- */
.orb-col { padding: 18px; align-items: stretch; }
.orb-label { flex: none; text-align: center; padding-bottom: 4px; }
.orb-wrap { flex: 1; min-height: 0; position: relative; }
.orb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.orb-legend { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; gap: 20px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); }
.orb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.refl-banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center;
  gap: 12px; padding: 9px 14px; border-radius: 999px; background: color-mix(in srgb, var(--trait) 16%, var(--surface));
  border: 1px solid var(--trait); max-width: 96%; animation: reflIn .4s ease both; }
@keyframes reflIn { from { opacity: 0; transform: translate(-50%,-8px); } to { opacity: 1; transform: translate(-50%,0); } }
.refl-k { font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--trait); white-space: nowrap; }
.refl-body { font-family: var(--mono); font-size: 11px; color: var(--ink); letter-spacing: 0.02em; }
.refl-body b { color: var(--trait); }
.refl-body em { color: var(--muted-2); font-style: italic; font-family: var(--body); font-size: 13px; }
.mood-panel { flex: none; display: flex; flex-direction: column; gap: 9px; padding-top: 14px;
  border-top: 1px solid var(--hairline); margin-top: 6px; }
.mood-cap { font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted-2); text-align: center; margin-bottom: 2px; }
.mood-legend { display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 9px; }
.mood-legend .ml-tick { width: 2px; height: 9px; background: var(--ink-2); opacity: .55; border-radius: 2px; }
.mood-legend .ml-bar { width: 12px; height: 5px; background: var(--trait); border-radius: 999px; }
.mood-legend .ml-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--hairline-2); margin: 0 2px; }
.mood-meter { display: grid; grid-template-columns: 72px 1fr 42px; align-items: center; gap: 10px; }
.mood-meter-l { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.mood-meter-track { position: relative; height: 7px; background: var(--track); border-radius: 999px; overflow: hidden; }
.mood-meter-zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--hairline-2); }
.mood-meter-ghost { position: absolute; top: 0; bottom: 0; width: 2px; z-index: 2; background: var(--ink-2);
  opacity: .55; border-radius: 2px; transform: translateX(-1px); transition: left .6s cubic-bezier(.4,0,.2,1); }
.mood-meter-fill { position: absolute; top: 0; bottom: 0; z-index: 1; border-radius: 999px;
  transition: width .6s cubic-bezier(.4,0,.2,1), left .6s cubic-bezier(.4,0,.2,1); }
.mood-meter-fill.t-belief { background: var(--belief); }
.mood-meter-fill.t-trait { background: var(--trait); }
.mood-meter-fill.t-warm { background: var(--warm); }
.mood-meter-fill.t-muted { background: var(--muted); opacity: .6; }
.mood-meter-fill.t-drive { background: var(--drive); }
.mood-meter-val { font-family: var(--mono); font-size: 10px; color: var(--muted); text-align: right;
  white-space: nowrap; transition: color .3s; }
.mood-meter-val.moved { color: var(--trait); }

/* ---------- state column ---------- */
.state-col { padding: 20px 22px; gap: 8px; overflow-y: auto; }
.state-block + .state-block { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--hairline); }
.block-head { display: flex; align-items: center; justify-content: space-between; }
.block-title { font-family: var(--serif); font-size: 26px; }
.block-badge { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.block-badge.fast { background: color-mix(in srgb, var(--belief) 16%, transparent); color: var(--belief); }
.block-badge.slow { background: color-mix(in srgb, var(--trait) 22%, transparent); color: var(--trait); }
.block-sub { font-size: 14px; color: var(--muted-2); margin: 4px 0 16px; font-style: italic; }
.block-sub em { color: var(--ink-2); }
.block-meta { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted-2); margin: -6px 0 14px; }
.block-meta b { color: var(--ink-2); font-weight: 400; }
.bars { display: flex; flex-direction: column; gap: 14px; }

/* center-zero bars (shared geometry: zero in the middle, signed fill).
 * .cbar--belief = the push (magenta);  .cbar--trait = OCEAN personality (violet). */
.cbar { transition: opacity .3s; }
.cbar.is-new { animation: barIn .5s ease both; }
@keyframes barIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.cbar-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 10px; }
.cbar-name { font-family: var(--mono); font-size: 12px; color: var(--ink-2); letter-spacing: 0.02em;
  display: inline-flex; align-items: baseline; gap: 9px; min-width: 0; }
.cbar-name em { font-family: var(--body); font-style: italic; font-size: 12px; color: var(--muted);
  letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbar-val { font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.cbar-val.pos { color: var(--belief); } .cbar-val.neg { color: var(--muted); }
.cbar--trait .cbar-val { color: var(--trait); }
.cbar-track { position: relative; height: 9px; background: var(--track); border-radius: 3px; transition: opacity .4s; }
.cbar-zero { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--hairline-2); }
.cbar-ghost { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--muted);
  opacity: .5; border-radius: 2px; transform: translateX(-1px); }
/* the aspired self (Higgins): an amber tick at who they WANT to be */
.cbar-ideal { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--warm);
  opacity: .8; border-radius: 2px; transform: translateX(-1px); }
.cbar-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px;
  transition: left .65s cubic-bezier(.4,0,.2,1), width .65s cubic-bezier(.4,0,.2,1); }
.cbar--belief .cbar-fill { background: var(--belief); box-shadow: 0 0 10px -2px var(--belief); }
/* the personality bars move on the slow clock -- deliberately slower than the push */
.cbar--trait .cbar-fill { background: var(--trait); box-shadow: 0 0 10px -3px var(--trait);
  transition: left 1.1s cubic-bezier(.4,0,.2,1), width 1.1s cubic-bezier(.4,0,.2,1); }
.cbar.is-flash .cbar-fill { animation: flashGlow 1.3s ease; }
@keyframes flashGlow { 0% { box-shadow: 0 0 0 0 var(--belief); } 30% { box-shadow: 0 0 16px 2px var(--belief); } 100% { box-shadow: 0 0 10px -2px var(--belief); } }
.cbar.is-flash .cbar-name { color: var(--belief); transition: color .3s; }
.cbar.is-pulse .cbar-fill { animation: traitGlow 1.4s ease; }
@keyframes traitGlow { 0%,100% { box-shadow: 0 0 10px -3px var(--trait); } 50% { box-shadow: 0 0 18px 2px var(--trait); } }
.cbar-pulse { position: absolute; inset: -4px; border: 1px solid var(--trait); border-radius: 5px;
  animation: traitRing 1.4s ease-out; pointer-events: none; }
@keyframes traitRing { 0% { opacity: .9; transform: scale(.98); } 100% { opacity: 0; transform: scale(1.04); } }

/* ---------- character: values (amber) + moral (teal), beliefs, habits ---------- */
.bars--compact { gap: 11px; }
.block-badge.char { background: color-mix(in srgb, var(--warm) 20%, transparent); color: var(--warm); }
/* values + moral are formed, not innate -> no baseline ghost; they fill from center 0. */
.cbar--value .cbar-val { color: var(--warm); }
.cbar--value .cbar-fill { background: var(--warm); box-shadow: 0 0 10px -3px var(--warm);
  transition: left .9s cubic-bezier(.4,0,.2,1), width .9s cubic-bezier(.4,0,.2,1); }
.cbar--moral .cbar-val { color: var(--moral); }
.cbar--moral .cbar-fill { background: var(--moral); box-shadow: 0 0 10px -3px var(--moral);
  transition: left .9s cubic-bezier(.4,0,.2,1), width .9s cubic-bezier(.4,0,.2,1); }

/* Motivation: the three SDT needs. tension fills from the left (unsigned); the ghost tick
   marks the resting level. A green pulse (is-sat) when the experience fed the need, the
   shared magenta is-flash when it denied it. */
.cbar--drive .cbar-val { color: var(--drive); }
.cbar--drive .cbar-fill { background: var(--drive); box-shadow: 0 0 10px -3px var(--drive);
  transition: left .8s cubic-bezier(.4,0,.2,1), width .8s cubic-bezier(.4,0,.2,1); }
.cbar.is-sat .cbar-fill { animation: satGlow 1.3s ease; }
@keyframes satGlow { 0% { box-shadow: 0 0 0 0 var(--drive); } 30% { box-shadow: 0 0 16px 2px var(--drive); }
  100% { box-shadow: 0 0 10px -3px var(--drive); } }
.cbar.is-sat .cbar-name { color: var(--drive); transition: color .3s; }
.block-badge.drive { background: color-mix(in srgb, var(--drive) 20%, transparent); color: var(--drive); }

/* Self-concept: signed center-zero bars. Self-worth's ghost is the dispositional baseline;
   each self-image bar's ghost sits at the ACTUAL trait, so the fill-vs-ghost gap is self-image.
   is-sat (green) = the experience affirmed the self / lifted regard; is-flash (magenta) = it
   contradicted the self / lowered regard. */
.cbar--self .cbar-val { color: var(--self); }
.cbar--self .cbar-fill { background: var(--self); box-shadow: 0 0 10px -3px var(--self);
  transition: left .9s cubic-bezier(.4,0,.2,1), width .9s cubic-bezier(.4,0,.2,1); }
.block-badge.self { background: color-mix(in srgb, var(--self) 22%, transparent); color: var(--self); }

/* Social Expression: the outward voice. Signed center-zero manner dims, no ghost -- there
   is no baseline for a derived voice, only the current manner. */
.cbar--voice .cbar-val { color: var(--voice); }
.cbar--voice .cbar-fill { background: var(--voice); box-shadow: 0 0 10px -3px var(--voice);
  transition: left .8s cubic-bezier(.4,0,.2,1), width .8s cubic-bezier(.4,0,.2,1); }
.block-badge.voice { background: color-mix(in srgb, var(--voice) 20%, transparent); color: var(--voice); }

/* Behavior: the enacted stance. Two signed system bars (approach / inhibition) with the
   trait-anchored disposition as the ghost tick; green/magenta flash on this turn's move. */
.cbar--behav .cbar-val { color: var(--behav); }
.cbar--behav .cbar-fill { background: var(--behav); box-shadow: 0 0 10px -3px var(--behav);
  transition: left .8s cubic-bezier(.4,0,.2,1), width .8s cubic-bezier(.4,0,.2,1); }
.block-badge.behav { background: color-mix(in srgb, var(--behav) 20%, transparent); color: var(--behav); }

.belief-list { display: flex; flex-direction: column; gap: 9px; }
.belief-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline;
  padding: 8px 11px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-2); }
.belief-item.is-new { animation: barIn .5s ease both; border-color: var(--belief); }
.belief-conf { font-family: var(--mono); font-size: 11px; color: var(--warm); white-space: nowrap; }
.belief-conf.neg { color: var(--muted); }
.belief-text { font-family: var(--body); font-size: 14px; color: var(--ink-2); line-height: 1.35; }
.belief-count { font-family: var(--mono); font-size: 9px; color: var(--muted); white-space: nowrap; }

.habit-list { display: flex; flex-wrap: wrap; gap: 8px; }
.habit-chip { display: inline-flex; align-items: baseline; gap: 7px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--hairline-2); background: var(--surface-2); }
.habit-text { font-family: var(--body); font-size: 13px; color: var(--ink-2); }
.habit-x { font-family: var(--mono); font-size: 9px; color: var(--muted); }
.char-empty { font-family: var(--body); font-style: italic; font-size: 13px; color: var(--muted-2); }

/* recalled memories: what this message brought up */
.recall-list { display: flex; flex-direction: column; gap: 8px; }
.recall-item { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline;
  padding: 7px 10px; border: 1px solid var(--hairline); border-radius: 9px; background: var(--surface-2);
  animation: barIn .4s ease both; }
.recall-score { font-family: var(--mono); font-size: 10px; color: var(--trait); white-space: nowrap; }
.recall-text { font-family: var(--body); font-size: 13.5px; color: var(--ink-2); line-height: 1.3; }
/* motivated retrieval: the active need that pulled this memory up */
.recall-need { grid-column: 2; font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--drive); }
.lens-line { font-family: var(--body); font-style: italic; font-size: 12.5px; color: var(--muted-2);
  text-align: center; line-height: 1.4; margin-top: 4px; }

/* scrollbars */
.chat-scroll::-webkit-scrollbar, .state-col::-webkit-scrollbar, .start-scroll::-webkit-scrollbar { width: 8px; }
.chat-scroll::-webkit-scrollbar-thumb, .state-col::-webkit-scrollbar-thumb,
.start-scroll::-webkit-scrollbar-thumb { background: var(--hairline-2); border-radius: 99px; }

/* ======================================================================
 * Start screen -- choose or create a character (same design language).
 * ====================================================================== */
.start { position: absolute; inset: 0; display: flex; flex-direction: column; height: 100dvh; }
.start-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column;
  align-items: center; padding: 40px 22px 64px; }
.start-inner { width: 100%; max-width: 760px; }
.start-hero { text-align: center; margin-bottom: 30px; }
.start-hero h1 { font-size: 52px; line-height: 1.02; margin-bottom: 12px; }
.start-hero p { font-family: var(--body); font-size: 17px; color: var(--muted-2); max-width: 520px;
  margin: 0 auto; line-height: 1.5; }
.start-hero p em { color: var(--ink-2); font-style: italic; }

/* tabs */
.tabs { display: flex; gap: 6px; justify-content: center; margin: 26px 0 22px; flex-wrap: wrap; }
.tab { background: transparent; border: 1px solid var(--hairline-2); color: var(--muted-2);
  border-radius: 999px; padding: 9px 18px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; transition: border-color .15s, color .15s, background .15s; }
.tab:hover { color: var(--ink); }
.tab.active { border-color: var(--belief); color: var(--belief);
  background: color-mix(in srgb, var(--belief) 10%, transparent); }
.panel { display: none; }
.panel.active { display: block; animation: barIn .35s ease both; }

/* existing roster */
#roster-note { margin-bottom: 14px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.char-card { text-align: left; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 18px 18px 16px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.char-card:hover { border-color: var(--trait); transform: translateY(-2px);
  box-shadow: 0 10px 30px -18px var(--trait); }
.char-card h3 { font-size: 25px; margin-bottom: 2px; }
.char-facts { font-family: var(--body); font-size: 13px; color: var(--muted-2); font-style: italic;
  margin-bottom: 4px; min-height: 18px; }
.char-count { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px; }
.mini-ocean { display: flex; flex-direction: column; gap: 5px; }
.mini-row { display: grid; grid-template-columns: 16px 1fr; align-items: center; gap: 8px; }
.mini-k { font-family: var(--mono); font-size: 9px; color: var(--muted-2); }
.mini-track { position: relative; height: 5px; background: var(--track); border-radius: 999px; }
.mini-zero { position: absolute; left: 50%; top: -1px; bottom: -1px; width: 1px; background: var(--hairline-2); }
.mini-fill { position: absolute; top: 0; bottom: 0; background: var(--trait); border-radius: 999px; opacity: .85; }
.roster-empty { text-align: center; color: var(--muted-2); font-family: var(--body); font-style: italic;
  padding: 40px 0; font-size: 15px; }

/* creation forms */
.form-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px;
  padding: 26px 26px 24px; }
.form-lead { font-family: var(--body); font-size: 15px; color: var(--muted-2); line-height: 1.5;
  margin-bottom: 20px; }
.form-lead em { color: var(--ink-2); font-style: italic; }
.field { margin-bottom: 16px; }
.field > label { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 7px; }
.field input[type="text"], .field textarea { width: 100%; font-family: var(--body); font-size: 16px;
  color: var(--ink); background: var(--bone-2); border: 1px solid var(--hairline-2); border-radius: 12px;
  padding: 12px 14px; outline: none; transition: border-color .15s; }
.field input[type="text"]:focus, .field textarea:focus { border-color: var(--trait); }
.field textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.id-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.id-grid .field { margin-bottom: 4px; }

/* OCEAN sliders (questionnaire) */
.slider-list { display: flex; flex-direction: column; gap: 16px; margin-top: 6px; }
.slider-row { display: block; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; gap: 10px; }
.slider-name { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.slider-val { font-family: var(--body); font-style: italic; font-size: 13px; color: var(--trait); text-align: right; }
.slider-row input[type="range"] { width: 100%; accent-color: var(--trait); cursor: pointer; }
.slider-poles { display: flex; justify-content: space-between; font-family: var(--body); font-size: 12px;
  color: var(--muted); font-style: italic; margin-top: 3px; }

.form-foot { margin-top: 22px; display: flex; align-items: center; gap: 14px; }
.primary-btn { background: var(--trait); color: #fff; border: none; border-radius: 12px; padding: 13px 24px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  transition: opacity .15s, transform .1s; }
.primary-btn:hover:not(:disabled) { opacity: .9; }
.primary-btn:active:not(:disabled) { transform: translateY(1px); }
.primary-btn:disabled { opacity: .4; cursor: default; }
.form-note { font-family: var(--body); font-size: 13px; color: var(--muted-2); font-style: italic; }
.form-note.err { color: var(--belief); font-style: normal; font-family: var(--mono); font-size: 11px; }

/* ---------- responsive ---------- */
/* ---------- offline state: kill-switch page + overlay when the API is down ---------- */
.offline-page { justify-content: center; }
.offline-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center;
  justify-content: center; padding: 24px 16px; overflow-y: auto;
  background: var(--bone); background: color-mix(in srgb, var(--bone) 90%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.offline-card { width: 100%; max-width: 540px; margin: 0 auto; text-align: center; }
.offline-card .eyebrow { margin-bottom: 16px; }
.offline-card h1 { font-size: 52px; line-height: 1.02; margin-bottom: 14px; }
.offline-card h1 em { font-style: italic; color: var(--belief); }
.offline-card p:not(.eyebrow) { font-size: 17px; color: var(--muted-2); line-height: 1.5;
  max-width: 460px; margin: 0 auto; }
.offline-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 10px; margin-top: 28px; }
.offline-actions a { display: inline-flex; align-items: center; }
@media (max-width: 480px) { .offline-card h1 { font-size: 40px; } }

@media (max-width: 1180px) {
  .grid { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(0, 1fr); }
  .orb-col { grid-column: 1; } .state-col { grid-column: 2; }
  .chat-col { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .cockpit { height: auto; min-height: 100vh; }
  .grid { display: flex; flex-direction: column; padding: 14px; gap: 14px; }
  .col { min-height: 420px; }
  .orb-col { min-height: 380px; }
  .head { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .head-status { order: 3; width: 100%; justify-content: flex-start; }
  .agent-name { font-size: 26px; }
  .msg-text { font-size: 19px; }
  .start-hero h1 { font-size: 40px; }
  .id-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
