/* alpha UI — flat, not boxed. Simplified token set.
   One source per concern; hairlines + whitespace instead of nested cards. */

:root {
  --tile-bg: #ffffff;
  --tile-fg: #0d1117;
  --bg: #061224;
  --bg-elevated: #0a1c33;
  --bg-soft: #122a4d;
  --bg-input: #0a1a30;
  --text-1: rgba(235, 244, 255, 0.95);
  --text-2: rgba(210, 228, 255, 0.75);
  --text-3: rgba(180, 205, 245, 0.55);
  --stroke: rgba(90, 150, 255, 0.18);
  --stroke-strong: rgba(110, 170, 255, 0.38);
  --accent: #2e7bff;
  --accent-soft: rgba(46, 123, 255, 0.22);
  --accent-glow: rgba(46, 123, 255, 0.45);
  --danger: #ff5f57;
  --ok: #2fd27d;
  --radius-sm: 10px;
  --radius-md: 13px;
  --radius-tile: 22.5%;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --tile-bg: #ffffff;
    --tile-fg: #0d1117;
    --bg: #f4f8ff;
    --bg-elevated: #e9f1ff;
    --bg-soft: #d9e7ff;
    --bg-input: #ffffff;
    --text-1: rgba(10, 26, 60, 0.94);
    --text-2: rgba(15, 35, 75, 0.74);
    --text-3: rgba(20, 45, 95, 0.54);
    --stroke: rgba(30, 90, 200, 0.16);
    --stroke-strong: rgba(30, 90, 200, 0.32);
    --accent: #1a5fe0;
    --accent-soft: rgba(46, 123, 255, 0.16);
    --accent-glow: rgba(46, 123, 255, 0.30);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
}

#app { display: flex; height: 100vh; }

/* ---- left rail (section nav) ---- */

#rail {
  width: 168px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 10px;
  background: linear-gradient(180deg, rgba(46, 123, 255, 0.10), rgba(46, 123, 255, 0.02) 220px),
    var(--bg-elevated);
  border-right: 1px solid var(--stroke-strong);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 8px;
}

.wordmark {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-shadow: 0 0 14px rgba(46, 123, 255, 0.45);
}

.tile {
  display: inline-flex;
  width: 32px; height: 32px;
  flex: none;
  background: #ffffff;
  color: #0d1117;
  border-radius: var(--radius-tile);
  overflow: hidden;
}
.tile img { width: 100%; height: 100%; display: block; }
.tile.large { width: 88px; height: 88px; }

#nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }

.nav-btn {
  font: inherit;
  text-align: left;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: background-color 100ms;
}
.nav-btn:hover { background: var(--bg-soft); transition: none; }
.nav-btn.active {
  background: var(--accent-soft);
  color: var(--text-1);
  box-shadow: inset 0 0 0 1px var(--accent-glow), 0 0 12px rgba(46, 123, 255, 0.22);
}

.nav-gap { height: 8px; border-top: 1px solid var(--stroke); margin-top: 6px; }

.nav-disabled {
  padding: 5px 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  opacity: 0.55;
  cursor: help;
}

.rail-footer {
  position: relative;
  border-top: 1px solid var(--stroke);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#model-btn {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: left;
  padding: 6px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 100ms;
}
#model-btn:hover { background: var(--bg-soft); transition: none; }
#model-btn .caret { color: var(--text-3); }

#model-menu {
  position: absolute;
  bottom: 36px;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 10;
}
.model-opt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.model-opt:hover:not(:disabled) { background: var(--accent-soft); color: var(--text-1); }
.model-opt:disabled { opacity: 0.45; cursor: default; }
.model-opt .sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.model-opt.active { background: var(--accent-soft); color: var(--text-1); }

.status-line { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }

/* ---- main + views ---- */

#main { flex: 1; min-width: 0; position: relative; }

.view { display: none; height: 100%; }
.view.active { display: flex; flex-direction: column; }

.page {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px;
  max-width: 860px;
}
.page.wide { max-width: 1200px; }

.page h2 { margin: 0 0 4px; font-size: 20px; }
.page-sub { margin: 0 0 18px; color: var(--text-3); font-size: 13px; }

/* ---- chat view ---- */

#view-chat.active { display: block; }
#chat-cols { display: flex; height: 100%; }

#sidebar {
  width: 240px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(46, 123, 255, 0.06), transparent 180px),
    var(--bg-elevated);
  border-right: 1px solid var(--stroke-strong);
}

#session-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }

.session-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  width: 100%;
  transition: background-color 100ms;
}
.session-row:hover { background: var(--bg-soft); transition: none; }
.session-row.active {
  background: var(--accent-soft);
  color: var(--text-1);
  box-shadow: inset 0 0 0 1px var(--accent-glow);
}
.session-row .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-row .del { visibility: hidden; border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 13px; padding: 0 2px; border-radius: 4px; }
.session-row:hover .del { visibility: visible; }
.session-row .del:hover { color: var(--danger); }

#maincol { flex: 1; display: flex; flex-direction: column; min-width: 0; }

#topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--stroke-strong);
  font-weight: 600;
}
#topbar-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chip {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-2);
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  padding: 1px 9px;
}
.chip.oracle { color: var(--accent); border-color: var(--accent); }
.chip.blocked { color: var(--danger); border-color: var(--danger); }

#empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  /* theme navy fills the whole chat panel on a new session, like the splash */
  background: var(--bg, #061224);
}
.empty-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty-logo { width: 96px; height: 96px; border-radius: 22px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5), 0 0 26px var(--accent-glow, rgba(46, 123, 255, 0.45)); }
.empty-word { font-size: 26px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--text-1, #e8ebf0); }
#empty-state .new-session-label { margin: 0; color: var(--text-3); font-size: 14px; }

#topbar-tier, .msg-meta .tier { display: none; }

#empty-state[hidden], #transcript[hidden] { display: none !important; }

#transcript { flex: 1; overflow-y: auto; padding: 20px 20px 8px; display: flex; flex-direction: column; gap: 18px; }

.msg-user { align-self: flex-end; max-width: 72%; background: var(--bg-soft); border-radius: var(--radius-md); padding: 9px 13px; white-space: pre-wrap; }
.msg-assistant { align-self: stretch; display: flex; gap: 10px; }
.msg-assistant .tile { width: 26px; height: 26px; margin-top: 2px; }
.msg-body { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.msg-meta .who { font-weight: 600; font-size: 13px; }
.msg-meta .tier { font-size: 11px; font-family: var(--font-mono); color: var(--text-3); }

.steps { margin: 6px 0; border: 1px solid var(--stroke); border-radius: var(--radius-sm); overflow: hidden; }
.steps-details summary { cursor: pointer; font-size: 12px; color: var(--text-3); margin: 4px 0; user-select: none; }
.steps-details summary:hover { color: var(--text-2); }
.ref-thumbs { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.ref-thumbs img { height: 54px; border-radius: 6px; border: 1px solid var(--stroke); }
.ref-thumbs .ref-label { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.step { display: flex; gap: 8px; align-items: baseline; padding: 5px 10px; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.step + .step { border-top: 1px solid var(--stroke); }
.step .glyph { flex: none; }
.step .tool { color: var(--text-2); flex: none; }
.step .args { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.step .summary { flex: 1; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.failed .summary { color: var(--danger); }
.msg-error .msg-answer { color: var(--danger); }

.msg-answer { white-space: pre-wrap; }
.msg-answer p { margin: 0 0 8px; }
.msg-answer p:last-child { margin-bottom: 0; }
.msg-answer h1, .msg-answer h2, .msg-answer h3, .msg-answer h4 { margin: 10px 0 6px; font-size: 15px; }
.msg-answer ul, .msg-answer ol { margin: 4px 0 8px; padding-left: 22px; }
.msg-answer li { margin: 2px 0; }
.msg-answer code { font-family: var(--font-mono); font-size: 12.5px; background: var(--bg-soft); border-radius: 4px; padding: 1px 5px; }
.msg-answer pre { background: var(--bg-elevated); border: 1px solid var(--stroke); border-radius: var(--radius-sm); padding: 10px 12px; overflow-x: auto; margin: 6px 0 10px; }
.msg-answer pre code { background: none; padding: 0; font-size: 12px; line-height: 1.5; }
.msg-answer a { color: var(--accent); }

#composer { display: flex; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--stroke); align-items: flex-end; }
#attach-btn { flex: none; width: 38px; height: 38px; border-radius: var(--radius-md); border: 1px solid var(--stroke); background: var(--bg-input); color: var(--text-2); font-size: 20px; line-height: 1; cursor: pointer; }
#attach-btn:hover { color: var(--text-1); border-color: var(--accent); }
#attach-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 20px 0; }
.attach-chip { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--bg-input); font-size: 12px; color: var(--text-2); }
.attach-chip img { height: 34px; border-radius: 4px; }
.attach-chip .rm { cursor: pointer; color: var(--text-3); padding: 0 2px; }
.attach-chip .rm:hover { color: var(--danger); }
.attach-chip.uploading { opacity: 0.55; }
.msg-attach { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.msg-attach img { height: 90px; border-radius: 6px; border: 1px solid var(--stroke); }
.msg-attach .file-chip { font-size: 11px; font-family: var(--font-mono); color: var(--text-3); border: 1px solid var(--stroke); border-radius: 6px; padding: 4px 8px; }
#input { flex: 1; resize: none; max-height: 160px; padding: 9px 12px; font: inherit; color: var(--text-1); background: var(--bg-input); border: 1px solid var(--stroke); border-radius: var(--radius-md); outline: none; }
#input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow), 0 0 10px rgba(46, 123, 255, 0.18); }

/* ---- shared page components ---- */

.rows { display: flex; flex-direction: column; border: 1px solid var(--stroke); border-radius: var(--radius-sm); overflow: hidden; }

.row-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  border: none;
  background: none;
  color: var(--text-2);
  text-align: left;
  font: inherit;
  cursor: pointer;
  width: 100%;
  transition: background-color 100ms;
}
.row-item:hover { background: var(--bg-soft); transition: none; }
.row-item + .row-item { border-top: 1px solid var(--stroke); }
.row-item .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .dim { color: var(--text-3); font-size: 12px; font-family: var(--font-mono); }
.row-item .mini { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 12px; padding: 1px 5px; border-radius: 4px; }
.row-item .mini:hover { color: var(--text-1); background: var(--bg-soft); }
.row-item .mini.danger:hover { color: var(--danger); }

.doc-view {
  flex: 1;
  margin: 0;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text-2);
}

#skills-cols, #files-cols, #coder-cols { display: flex; gap: 14px; margin-top: 12px; min-height: 300px; }
#coder-cols .doc-view { flex: 1; max-height: 480px; overflow: auto; }
#skills-list, #files-list { flex: 1; max-width: 380px; overflow-y: auto; }
#skills-search {
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  font: inherit;
  color: var(--text-1);
  background: var(--bg-input);
  border: none;
  border-bottom: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  outline: none;
}
#skills-search:focus { border-bottom-color: var(--stroke-strong); }

.crumbs { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); margin: 8px 0; }
.crumbs a { color: var(--accent); cursor: pointer; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--stroke); border-radius: var(--radius-sm); padding: 14px 16px; }
.card h3 { margin: 0 0 6px; font-size: 14px; }
.card .big { font-size: 24px; font-weight: 700; font-family: var(--font-mono); }
.card p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-3); }
.card .ok { color: var(--ok); }
.card .bad { color: var(--danger); }

.log-buttons { display: flex; gap: 8px; margin-bottom: 12px; }

.pipeline { display: flex; align-items: stretch; gap: 8px; margin: 12px 0 18px; flex-wrap: wrap; }
.pipe-node { border: 1px solid var(--stroke); border-radius: var(--radius-sm); padding: 10px 12px; flex: 1 1 160px; }
.pipe-node strong { display: block; font-size: 13px; margin-bottom: 2px; }
.pipe-node .dim { font-size: 11px; }
.pipe-node p { margin: 6px 0 0; font-size: 12px; color: var(--text-3); }
.pipe-arrow { align-self: center; color: var(--text-3); font-size: 16px; }
#bot-run-form { display: flex; gap: 8px; margin: 14px 0 6px; }
#bot-run-form input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--stroke);
  border-radius: var(--radius-sm); background: var(--bg-2, transparent); color: inherit; font: inherit;
}
.img-thumb { width: 100%; border-radius: var(--radius-sm); display: block; }
.img-result { max-width: 520px; width: 100%; border-radius: var(--radius-sm); margin-top: 12px; display: block; }

#config-editor {
  width: 100%;
  height: 420px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
}
.row-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

/* ---- buttons ---- */

.btn { font: inherit; font-weight: 550; border-radius: var(--radius-sm); padding: 7px 14px; cursor: pointer; border: none; transition: background-color 100ms; }
.btn-secondary { background: var(--bg-soft); color: var(--text-1); text-align: left; }
.btn-secondary:hover { filter: brightness(1.12); transition: none; }
.btn-primary {
  background: linear-gradient(180deg, #3f88ff, #1a5fe0);
  color: #fff;
  box-shadow: 0 0 12px rgba(46, 123, 255, 0.35);
}
.btn-primary:hover { filter: brightness(1.1); transition: none; }
.btn-primary:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

.busy #input { opacity: 0.6; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- appearance settings: forced themes + accents ---- */
body.theme-dark {
  --bg: #061224; --bg-elevated: #0a1c33; --bg-soft: #122a4d; --bg-input: #0a1a30;
  --text-1: rgba(235, 244, 255, 0.95); --text-2: rgba(210, 228, 255, 0.75);
  --text-3: rgba(180, 205, 245, 0.55);
  --stroke: rgba(90, 150, 255, 0.18); --stroke-strong: rgba(110, 170, 255, 0.38);
}
body.theme-light {
  --bg: #f4f8ff; --bg-elevated: #e9f1ff; --bg-soft: #d9e7ff; --bg-input: #ffffff;
  --text-1: rgba(10, 26, 60, 0.94); --text-2: rgba(15, 35, 75, 0.74);
  --text-3: rgba(20, 45, 95, 0.54);
  --stroke: rgba(30, 90, 200, 0.16); --stroke-strong: rgba(30, 90, 200, 0.32);
}
body[data-accent="green"] { --accent: #1fae62; --accent-soft: rgba(47, 210, 125, 0.20); --accent-glow: rgba(47, 210, 125, 0.40); }
body[data-accent="purple"] { --accent: #8b5cf6; --accent-soft: rgba(139, 92, 246, 0.20); --accent-glow: rgba(139, 92, 246, 0.40); }
body[data-accent="orange"] { --accent: #e8792e; --accent-soft: rgba(232, 121, 46, 0.20); --accent-glow: rgba(232, 121, 46, 0.40); }

/* ---- settings layout ---- */
#settings-wrap { display: flex; gap: 22px; align-items: flex-start; }
#settings-nav { min-width: 190px; display: flex; flex-direction: column; gap: 2px; }
.settings-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); margin: 12px 0 4px; }
.settings-group:first-child { margin-top: 0; }
.settings-nav-btn { text-align: left; background: none; border: none; color: var(--text-2);
  font: inherit; padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.settings-nav-btn:hover { background: var(--accent-soft); }
.settings-nav-btn.active { background: var(--accent-soft); color: var(--text-1); font-weight: 600; }
#settings-pane { flex: 1; min-width: 0; }
#settings-pane h3 { margin: 18px 0 8px; font-size: 14px; }
#settings-pane h3:first-child { margin-top: 0; }
.setting-field { margin-bottom: 12px; }
.setting-field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; }
.setting-field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.setting-input { width: 100%; max-width: 420px; padding: 8px 11px; border: 1px solid var(--stroke);
  border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-1); font: inherit; }
.setting-textarea { width: 100%; max-width: 560px; height: 160px; padding: 10px 12px;
  border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text-1); font: inherit; }
.setting-textarea.tall { height: 380px; font-family: var(--font-mono); font-size: 12px; }
.ok { color: var(--ok); }
.bad { color: var(--danger); }

/* ---- kanban ---- */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.kanban-col { border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  padding: 10px; min-height: 120px; }
.kanban-col h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-3); }
.kanban-card { display: flex; gap: 6px; align-items: center; background: var(--bg-elevated);
  border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  padding: 8px 10px; margin-bottom: 6px; font-size: 13px; }
.kanban-actions { display: flex; gap: 2px; }
.kanban-actions button { background: none; border: none; color: var(--text-3);
  cursor: pointer; font-size: 12px; padding: 2px 4px; }
.kanban-actions button:hover { color: var(--text-1); }
#kanban-add-form { display: flex; gap: 8px; }
#kanban-add-form input { flex: 1; max-width: 420px; padding: 9px 12px;
  border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text-1); font: inherit; }

/* ---- achievements ---- */
.badge { opacity: 0.45; }
.badge.unlocked { opacity: 1; border-color: var(--accent); }

/* ---- busy spinner + stop button (chat composer) ---- */
.spinner { display: inline-block; width: 18px; height: 18px; flex: none;
  border: 2px solid var(--accent-soft, #2a3a55); border-top-color: var(--accent, #4f8cff);
  border-radius: 50%; animation: alpha-spin 0.8s linear infinite; }
@keyframes alpha-spin { to { transform: rotate(360deg); } }
.thinking-row { display: flex; align-items: center; padding: 10px 4px; }
.btn-stop { background: var(--bg-elevated, #1c2230); color: var(--danger, #e5534b);
  border: 1px solid var(--stroke, #2a2f3a); border-radius: 8px; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 9px 13px; }
.btn-stop:hover { border-color: var(--danger, #e5534b); }
.spinner[hidden] { display: none; }

/* ---- startup splash ---- */
#splash { position: fixed; inset: 0; z-index: 999; display: flex; align-items: center;
  justify-content: center; background:
    radial-gradient(ellipse 60% 45% at 50% 42%, var(--accent-soft, rgba(46, 123, 255, 0.22)) 0%, transparent 70%),
    var(--bg, #061224);
  transition: opacity 0.5s ease, visibility 0.5s; }
#splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }
#splash .splash-inner { display: flex; flex-direction: column; align-items: center;
  gap: 16px; transition: transform 0.5s ease, opacity 0.5s ease; }
#splash.gone .splash-inner { transform: scale(1.08); opacity: 0; }

.splash-logo-wrap { position: relative; }
.splash-logo { width: 92px; height: 92px; border-radius: 22px; position: relative; z-index: 1;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 34px var(--accent-glow, rgba(46, 123, 255, 0.45));
  animation: splash-logo-in 0.85s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
.splash-ring { position: absolute; inset: -9px; border-radius: 30px; z-index: 0;
  border: 2px solid var(--accent, #2e7bff); opacity: 0;
  animation: splash-ring 1.6s ease-out 0.55s infinite; }

.splash-word { font-size: 24px; font-weight: 700; letter-spacing: 0.22em;
  color: var(--text-1, #e8ebf0); }
.splash-word span { display: inline-block; opacity: 0; transform: translateY(12px);
  animation: splash-letter 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.2) forwards; }
.splash-word span:nth-child(1) { animation-delay: 0.55s; }
.splash-word span:nth-child(2) { animation-delay: 0.64s; }
.splash-word span:nth-child(3) { animation-delay: 0.73s; }
.splash-word span:nth-child(4) { animation-delay: 0.82s; }
.splash-word span:nth-child(5) { animation-delay: 0.91s; }

.splash-bar { width: 148px; height: 3px; border-radius: 3px;
  background: var(--accent-soft, #22304a); overflow: hidden;
  opacity: 0; animation: splash-fade-in 0.4s ease 1s forwards; }
.splash-bar span { display: block; height: 100%; width: 40%; border-radius: 3px;
  background: var(--accent, #2e7bff); animation: splash-slide 1.1s ease-in-out 1s infinite; }

@keyframes splash-logo-in {
  0% { transform: scale(0.4) rotate(-10deg); opacity: 0; }
  60% { transform: scale(1.06) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; } }
@keyframes splash-ring {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 0; } }
@keyframes splash-letter {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); } }
@keyframes splash-fade-in { to { opacity: 1; } }
@keyframes splash-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ---- working animation (transcript) ---- */
.thinking-row { gap: 9px; }
.thinking-row .work-dots { display: inline-flex; gap: 4px; align-items: center; }
.thinking-row .work-dots i { width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent, #4f8cff); animation: work-dot 1.2s ease-in-out infinite; }
.thinking-row .work-dots i:nth-child(2) { animation-delay: 0.15s; }
.thinking-row .work-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes work-dot { 0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-4px); opacity: 1; } }
