/* Grey House · Ego. Night, silver and gold. */
:root {
  --bg: #07090F; --panel: #0E121C; --panel2: #131826; --line: #222A3B; --line2: #313B52; --text: #ECEFF5; --soft: #C6CCD8; --muted: #8E97AA;
  --gold: #D9B26A; --gold2: #F1D9A6; --silver: #C9D2E3; --ok: #6FD3A2; --okbg: #11261D; --warn: #E8B45A; --bad: #F08A7E; --badbg: #2E1618;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; min-height: 100vh; }
h1, h2, h3, .serif { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; margin: 0; letter-spacing: .01em; }
h1 { font-size: 34px; } h2 { font-size: 24px; } h3 { font-size: 19px; }
a { color: var(--gold2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; cursor: pointer; }
button:hover { border-color: var(--gold); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button.gold { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1A1407; border: 0; font-weight: 600; }
button.ok { background: var(--ok); color: #06140D; border: 0; font-weight: 600; }
button.quiet { border-color: transparent; color: var(--muted); }
button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold2); }
input, select, textarea { background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; letter-spacing: .02em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { text-align: center; padding-top: 40vh; font-family: "Cormorant Garamond", serif; letter-spacing: .4em; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; }

/* sign in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(60% 50% at 50% 30%, #141a2a 0%, var(--bg) 70%); }
.login form, .login .box { width: min(400px, 100%); display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 30px; }
.mark { text-align: center; } .mark b { display: block; font-family: "Cormorant Garamond", serif; font-weight: 500; font-size: 15px; letter-spacing: .5em; color: var(--silver); }
.mark span { font-family: "Cormorant Garamond", serif; font-style: italic; color: var(--gold); font-size: 17px; }
.err { color: var(--bad); min-height: 20px; font-size: 14px; }
#qr { background: #fff; padding: 12px; border-radius: 12px; width: max-content; margin: 0 auto; }

/* shell */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 22px; background: rgba(7,9,15,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .mark { text-align: left; margin-right: auto; } .top .mark b { font-size: 13px; }
nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
nav.tabs a { text-decoration: none; color: var(--soft); padding: 8px 14px; border-radius: 999px; font-size: 14px; }
nav.tabs a.on { background: var(--panel2); color: var(--gold2); box-shadow: inset 0 0 0 1px var(--line2); }
nav.tabs a .n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--gold); color: #1A1407; font-size: 12px; text-align: center; }
.page { max-width: 1180px; margin: 0 auto; padding: 26px 22px 80px; }
.page > header { margin-bottom: 20px; } .page > header p { margin: 6px 0 0; color: var(--muted); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; min-width: 0; }
.card > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; border: 1px solid var(--line2); color: var(--soft); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: #2c5b45; background: var(--okbg); } .pill.gold { color: var(--gold2); border-color: #5b4a2b; }
.list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.list > li { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; }
.list > li .grow { flex: 1; min-width: 0; }
.empty { color: var(--muted); font-style: italic; }
dl.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin: 10px 0 0; font-size: 14px; } dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; text-align: right; }
.bots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.bots button { min-height: 32px; padding: 0 12px; font-size: 13px; }
.bots button.on { border-color: #2c5b45; color: var(--ok); background: var(--okbg); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--gold); color: var(--text); padding: 12px 18px; border-radius: 14px; z-index: 20; max-width: min(560px, 92vw); }

/* Ego: one calm full-screen scene. The pyramid fills the space between the top bar and the question bar. */
.page.full { max-width: none; padding: 0; }
.ego { display: flex; flex-direction: column; align-items: center; height: calc(100svh - 74px); min-height: 520px; }
.stage { position: relative; width: 100%; flex: 1 1 auto; min-height: 260px;
  background: radial-gradient(42% 52% at 50% 46%, #141c30 0%, rgba(9,12,20,0) 72%); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ego .below { width: 100%; display: grid; justify-items: center; gap: 12px; padding: 4px 18px 22px; }
.cap { width: min(760px, 100%); min-height: 64px; text-align: center; font-family: "Cormorant Garamond", serif; font-size: 23px; line-height: 1.35; color: var(--text); }
.cap .you { display: block; font-family: Inter, sans-serif; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chips button { min-height: 36px; font-size: 14px; color: var(--soft); }
.ask { width: min(760px, 100%); display: flex; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line2); border-radius: 999px; padding: 6px; }
.ask input { border: 0; background: transparent; min-height: 44px; }
.ask input:focus-visible { outline: none; }
.ask:focus-within { border-color: var(--gold); }
.round { width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; flex: none; }
.state { font-size: 13px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.state[data-s="Listening"] { color: var(--ok); } .state[data-s="Thinking"], .state[data-s="Speaking"] { color: var(--gold2); }

@media (max-width: 640px) {
  .top { padding: 10px 14px 8px; gap: 8px 12px; }
  .top #out { min-height: 34px; padding: 0 10px; font-size: 13px; }
  nav.tabs { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs a { white-space: nowrap; padding: 7px 12px; font-size: 13px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: 100%; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chips button { white-space: nowrap; }
 .page { padding: 18px 14px 70px; } .page.full { padding: 0; } h1 { font-size: 28px; } .ego { height: calc(100svh - 112px); } .cap { font-size: 20px; min-height: 52px; } .chips button { min-height: 34px; font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
