/* Atlas / Earshot — white frosted glass. One stylesheet, every page.
   Principles: near-white canvas with soft color fields behind glass; hairline borders; one ink color for actions;
   generous space; sentence-case headings; quiet text. */

:root {
  --canvas: #f2f2f4;
  --ink: #0b0d12;
  --text: #16181d;
  --muted: #6b7280;
  --faint: #9ca3af;
  --hair: rgba(17, 24, 39, 0.07);
  --hair-strong: rgba(17, 24, 39, 0.12);
  --glass: rgba(255, 255, 255, 0.56);
  --glass-hi: rgba(255, 255, 255, 0.78);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --blur: blur(28px) saturate(180%);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 12px 40px -12px rgba(17, 24, 39, 0.12);
  --accent: #5b5bd6;
  --ok: #0f9f6e;
  --warn: #c2410c;
  --live: #ef4444;
  --r-lg: 22px;
  --r: 16px;
  --r-sm: 12px;
  --side: 268px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  background-color: var(--canvas);
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14.5px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--faint); font-size: 13px; margin: 6px 4px 0; }
.warn { color: var(--warn); }

/* ---------- glass ---------- */
.glass, .task, .connector, .entries li, .sidebar, .composer, .ambient-card, .insight-card, .menu {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border-radius: var(--r);
}
.pad { padding: 20px; }

/* ---------- app shell: left sidebar on every page ---------- */
body.shell { padding-left: calc(var(--side) + 24px); }
.side-account { display: contents; }
.sidebar {
  position: fixed; z-index: 20; top: 12px; bottom: 12px; left: 12px; width: var(--side);
  border-radius: var(--r-lg); padding: 14px 10px; display: flex; flex-direction: column; gap: 6px;
}
.side-brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 10px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; color: var(--ink); }
.logo-mark { width: 24px; height: 24px; border-radius: 8px; background: var(--ink); box-shadow: inset 0 0 0 5px var(--ink), inset 0 0 0 7px #fff; }
.side-section { font-size: 12px; color: var(--faint); padding: 14px 12px 4px; font-weight: 500; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  color: var(--text); font-size: 14px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.side-link svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.side-link:hover { background: rgba(17, 24, 39, 0.045); text-decoration: none; box-shadow: none; }
button.side-link { font-family: inherit; font-weight: 400; }
.side-link.active { background: rgba(255, 255, 255, 0.85); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--hair); font-weight: 500; }
.side-link .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-scroll { flex: 1; overflow-y: auto; margin: 0 -2px; padding: 0 2px; }
.side-foot { border-top: 1px solid var(--hair); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.vault-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-left: auto; }
.vault-dot.ok { background: var(--ok); }
.vault-dot.locked { background: var(--warn); }
.menu-btn { display: none; }

@media (max-width: 860px) {
  body.shell { padding-left: 0; padding-top: 64px; }
  .sidebar { transform: translateX(calc(-100% - 24px)); transition: transform 0.25s ease; }
  body.nav-open .sidebar { transform: none; }
  .menu-btn {
    display: inline-flex; position: fixed; z-index: 21; top: 12px; left: 12px;
  }
}

/* ---------- page scaffolding ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 28px 24px 120px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 4px; }
.section-head.spaced { margin-top: 22px; }
.spaced-sm { margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.actions-row { display: flex; justify-content: flex-end; gap: 8px; }
.grow { flex: 1 1 180px; }
.short { width: 96px; }

.banner {
  position: fixed; z-index: 30; top: 16px; left: 50%; transform: translateX(-50%);
  max-width: min(640px, calc(100% - 32px)); padding: 10px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.9); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow); border: 1px solid var(--glass-edge); font-size: 13.5px; color: var(--text);
}
.banner.error { color: var(--warn); }

/* ---------- controls ---------- */
button, .linkbtn {
  font: inherit; font-size: 14px; font-weight: 500; border-radius: 999px; padding: 8px 16px; cursor: pointer;
  border: 1px solid var(--hair-strong); background: rgba(255, 255, 255, 0.7); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
button:hover, .linkbtn:hover { background: #fff; box-shadow: var(--shadow-sm); text-decoration: none; }
button:active { transform: translateY(1px); }
button.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
button.primary:hover { background: #262a33; }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: rgba(17, 24, 39, 0.05); box-shadow: none; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.icon-btn svg { width: 18px; height: 18px; }
.small-btn { padding: 4px 12px; font-size: 13px; }
.small-btn.active { border-color: var(--accent); color: var(--accent); }

input, select, textarea {
  font: inherit; color: var(--text); width: 100%;
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--hair-strong); border-radius: var(--r-sm); padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; background: #fff; border-color: rgba(91, 91, 214, 0.5); box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.12); }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--ink); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
label.row { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 400; font-size: 14px; }
select[multiple] { padding: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 4px 12px; font-size: 12.5px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(17, 24, 39, 0.05); align-self: flex-start; }
.seg label { flex-direction: row; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); font-size: 13.5px; }
.seg label:has(input:checked) { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.seg input { display: none; }
button.primary.danger { background: var(--warn); border-color: var(--warn); }

/* vault modal (vault.js) */
.modal {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 22px;
  border: 1px solid var(--hair); border-radius: var(--r); background: #fff; color: var(--text); box-shadow: var(--shadow);
  display: none; flex-direction: column; gap: 14px;
}
.modal[open] { display: flex; }
.modal::backdrop { background: rgba(17, 24, 39, 0.28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-close { font-size: 20px; line-height: 1; padding: 2px 10px; }
.modal p { margin: 0; }
.modal-msg { font-size: 13.5px; color: var(--ok); }
.modal-msg.error { color: var(--warn); }

/* Settings → Reset or restore the vault (vault.js renderRecovery) */
.recovery summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.recovery[open] summary { margin-bottom: 12px; }
.recovery h3 { margin: 0 0 4px; }
.recovery .hint { margin: 0 0 10px; }
.recovery .modal-msg { margin: 0 0 10px; }

/* Settings → AI: radio list, each option expands to its model and key */
.ai-options { display: flex; flex-direction: column; gap: 8px; }
.ai-option { border: 1px solid var(--hair-strong); border-radius: var(--r-sm); background: var(--glass-hi); }
.ai-option.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.1); }
.ai-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.ai-head input[type="radio"] { margin: 0; flex: none; }
.ai-title { flex: 1; min-width: 0; }
.ai-title .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-tag { font-size: 11.5px; color: var(--muted); background: rgba(17, 24, 39, 0.05); padding: 1px 8px; border-radius: 999px; margin-left: 4px; }
.ai-caret { color: var(--faint); font-size: 18px; transition: transform 0.15s; }
.ai-caret.open { transform: rotate(90deg); }
.ai-body { padding: 0 14px 14px 40px; gap: 10px; }
.ai-body p { margin: 0; }
.seg label:has(input:disabled) { cursor: default; }
.seg label:has(input:disabled:not(:checked)) { opacity: 0.45; }
#storage .seg label { padding: 4px 12px; font-size: 13px; }

.compose { display: flex; gap: 6px; padding: 6px 6px 6px 16px; border-radius: 999px; align-items: center; }
.compose input { border: 0; background: transparent; box-shadow: none; padding: 8px 0; }
.compose input:focus { box-shadow: none; background: transparent; }
.answer { padding: 14px 18px; white-space: pre-wrap; }

/* ---------- lists & cards ---------- */
.list, .tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.task { padding: 16px 18px; }
.task .head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.task .instr { font-weight: 500; }
.task .result { margin-top: 8px; white-space: pre-wrap; }
.task .steps { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); max-height: 200px; overflow-y: auto; }
.task .links { margin-top: 10px; display: flex; gap: 10px; font-size: 13px; flex-wrap: wrap; align-items: center; color: var(--faint); }
.task details summary { cursor: pointer; margin-top: 8px; color: var(--muted); font-size: 13px; }
.state { font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: rgba(17, 24, 39, 0.05); color: var(--muted); white-space: nowrap; }
.state.running { background: rgba(91, 91, 214, 0.1); color: var(--accent); }
.state.awaiting_approval { background: rgba(194, 65, 12, 0.08); color: var(--warn); }
.state.done { background: rgba(15, 159, 110, 0.1); color: var(--ok); }
.state.failed, .state.rejected { background: rgba(194, 65, 12, 0.08); color: var(--warn); }
.approval { margin-top: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(194, 65, 12, 0.2); display: flex; flex-direction: column; gap: 8px; }
.approval .amount { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.approval label { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
.approval input.short { width: 110px; }
.draft .fields { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.draft textarea { min-height: 110px; }
.entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.entries li { padding: 12px 14px; border-radius: var(--r-sm); display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; box-shadow: var(--shadow-sm); background: var(--glass-hi); }
.entries .name { font-weight: 500; }
.entries .kind { font-size: 11.5px; color: var(--faint); margin-left: 8px; }
.entries .meta { grid-column: 1; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.entries .btns { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 4px; align-items: start; }

/* ---------- plugins ---------- */
.plugin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.connector { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.connector b { font-weight: 600; font-size: 15px; color: var(--ink); }
.connector > div:first-child .muted { display: block; margin-top: 2px; }
.connector.on { background: var(--glass-hi); }
.connector.on b::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-left: 8px; vertical-align: middle; }
.connector .warn { font-size: 12.5px; color: var(--muted); padding-left: 10px; border-left: 2px solid rgba(194, 65, 12, 0.35); }
.connector .qr svg, .connector .qr img { width: 190px; height: 190px; background: #fff; padding: 8px; border-radius: 12px; }
.connector .devcode code { font-size: 16px; font-weight: 600; letter-spacing: 0.12em; }

/* ---------- chat ---------- */
.chat-main { min-height: 100vh; display: flex; flex-direction: column; }
.chat-top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 24px 10px; }
.chat-top .model { font-size: 13px; color: var(--muted); }
.chat-top .right { display: flex; gap: 6px; align-items: center; }
.thread { flex: 1; width: min(780px, calc(100% - 32px)); margin: 0 auto; padding: 8px 0 18px; display: flex; flex-direction: column; gap: 18px; }
.msg { line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: 78%; background: var(--ink); color: #f5f5f7; padding: 10px 16px; border-radius: 20px 20px 6px 20px; }
.msg.assistant { align-self: stretch; padding: 0 2px; }
.msg.assistant.pending { color: var(--faint); }
.msg .tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tool-chip { font-size: 12px; color: var(--muted); padding: 3px 10px; border-radius: 999px; background: rgba(17, 24, 39, 0.05); white-space: nowrap; }
.insight-card { align-self: flex-start; max-width: 86%; padding: 12px 16px; border-radius: 18px; display: flex; gap: 12px; align-items: flex-start; }
.insight-card .ear { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; background: rgba(91, 91, 214, 0.12); color: var(--accent); }
.insight-card .ear svg { width: 14px; height: 14px; }
.insight-card .body { font-weight: 500; color: var(--ink); }
.insight-card .meta { font-size: 12px; color: var(--faint); margin-top: 2px; }
.insight-card.answer .ear { background: rgba(15, 159, 110, 0.12); color: var(--ok); }
.heard { align-self: center; font-size: 12.5px; color: var(--faint); max-width: 80%; text-align: center; }

.empty-hero { margin: 16vh auto 0; text-align: center; width: min(640px, calc(100% - 32px)); }
.empty-hero h1 { font-size: 30px; letter-spacing: -0.03em; }
.empty-hero p { color: var(--muted); margin: 8px 0 0; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.suggest button { font-weight: 400; color: var(--muted); }

.composer {
  position: fixed; z-index: 10; bottom: 20px;
  left: calc(var(--side) + 24px + (100% - var(--side) - 24px) / 2); transform: translateX(-50%);
  width: min(780px, calc(100% - var(--side) - 64px));
  /* Single line = 40px buttons + 2×6px padding + 2×1px border = 54px tall, so a 27px radius is an exact pill.
     Multi-line input grows the bar and keeps the same corner radius. */
  --btn: 40px;
  border-radius: calc(var(--btn) / 2 + 7px); padding: 6px; display: flex; align-items: flex-end; gap: 4px; background: var(--glass-hi);
}
@media (max-width: 860px) { .composer { left: 50%; width: calc(100% - 24px); } }
/* flex: none stops the textarea (width: 100%) from squeezing the buttons into ovals. */
.composer .icon-btn { flex: none; width: var(--btn); height: var(--btn); aspect-ratio: 1; border-radius: 50%; }
.composer .icon-btn:active { transform: none; }
.composer textarea {
  border: 0; border-radius: 0; background: transparent; resize: none; display: block;
  height: var(--btn); min-height: var(--btn); max-height: 200px; padding: 9px 8px; line-height: 22px; font-size: 15px;
}
.composer textarea:focus { box-shadow: none; background: transparent; }
.mic-toggle { position: relative; }
.mic-toggle.on { background: var(--live); border-color: var(--live); color: #fff; }
.mic-toggle.on::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(239, 68, 68, 0.35); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { from { transform: scale(0.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.listen-status { position: fixed; z-index: 10; bottom: 86px; left: calc(var(--side) + 24px + (100% - var(--side) - 24px) / 2); transform: translateX(-50%); font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
@media (max-width: 860px) { .listen-status { left: 50%; } }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); }

/* ---------- AI billing (settings) ---------- */
.budget-line { font-weight: 500; color: var(--ink); }
.budget-track { height: 6px; border-radius: 999px; background: rgba(17, 24, 39, 0.07); overflow: hidden; }
.budget-fill { height: 100%; width: 0; background: var(--ink); border-radius: 999px; transition: width 0.4s; }
.budget-fill.over { background: var(--live); }
.key-row { display: flex; gap: 8px; align-items: flex-end; }
.key-row label { flex: 1; }
.key-row .small-btn { margin-bottom: 6px; }

/* ---------- usage page ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; border-radius: 18px; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.usage-block { margin-bottom: 26px; }
.usage-block > .section-head { margin-bottom: 10px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; margin-top: 12px; overflow-x: auto; }
.bar { flex: 1 0 18px; max-width: 42px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar-fill { width: 100%; border-radius: 5px 5px 2px 2px; background: var(--ink); opacity: 0.82; }
.bar:hover .bar-fill { opacity: 1; }
.bar-day { font-size: 10.5px; color: var(--faint); }
.table-wrap { overflow-x: auto; border-radius: 18px; }
.usage-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.usage-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 12px 14px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.usage-table td { padding: 10px 14px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.usage-table tr:last-child td { border-bottom: 0; }
.usage-table tr.current td { color: var(--muted); }
.usage-table tr.picked td { font-weight: 600; color: var(--ink); }
.usage-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
#modelPick { flex: 1; min-width: 240px; }

/* ---------- live activity ("looking it up…") ---------- */
/* also the spacer that keeps the last message clear of the fixed composer */
.activity { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: min(780px, calc(100% - 32px)); margin: 0 auto; padding: 0 0 168px; }
.act-pill {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 14px; border-radius: 999px;
  font-size: 13.5px; color: var(--muted); background: var(--glass-hi); border: 1px solid var(--hair);
  transition: opacity 0.4s, transform 0.4s; animation: act-in 0.25s ease-out;
}
.act-pill .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-pill.research { background: transparent; border-style: dashed; font-size: 12.5px; padding: 5px 12px; }
.act-pill.none, .act-pill.failed { color: var(--faint); }
.act-pill.failed .mark { color: var(--live); }
.act-pill.leaving { opacity: 0; transform: translateY(4px); }
.spin { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1.6px solid var(--hair-strong); border-top-color: var(--ink); animation: spin 0.8s linear infinite; }
.mark { flex: none; width: 12px; text-align: center; font-size: 12px; line-height: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes act-in { from { opacity: 0; transform: translateY(4px); } }

/* chat: live steps inside the pending reply */
.steps { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }
.step { display: flex; align-items: center; gap: 10px; }
.step.done { color: var(--faint); }
.step .mark { color: var(--faint); }

/* ---------- ambient (glanceable) ---------- */
.ambient { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 32px; background: rgba(247, 247, 248, 0.55); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%); }
.ambient .close { position: absolute; top: 20px; right: 20px; }
.orb { width: 112px; height: 112px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); border: 1px solid var(--hair-strong); box-shadow: var(--shadow), inset 0 0 0 10px rgba(255, 255, 255, 0.9), inset 0 0 0 11px var(--hair-strong); cursor: pointer; transition: transform 0.3s; }
.orb.on { animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.08), var(--shadow), inset 0 0 0 10px rgba(255,255,255,.9), inset 0 0 0 11px rgba(239, 68, 68, 0.5); } }
.ambient .state-line { color: var(--muted); font-size: 14px; }
.ambient-card { max-width: 760px; padding: 26px 32px; text-align: center; font-size: clamp(22px, 3.4vw, 34px); line-height: 1.3; letter-spacing: -0.025em; font-weight: 500; color: var(--ink); border-radius: 28px; }
.ambient-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; color: var(--muted); font-size: 15px; }
.ambient-recent li:nth-child(2) { opacity: 0.7; }
.ambient-recent li:nth-child(3) { opacity: 0.45; }

/* page fade-in */
.page, .thread { animation: fade 0.25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.avatar { width: 18px; height: 18px; border-radius: 50%; flex: none; }
