/* ELORA design system — dark-first, premium, minimal. Fonts are bundled locally (no CDN). */
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-latin.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-latin-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #08090d; --bg-2: #0c0e14; --surface: #12141b; --surface-2: #181b24; --surface-3: #212531;
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.13);
  --text: #eceef4; --muted: #99a0b2; --faint: #666d80;
  --gold: #e6c07e; --gold-2: #c8923f; --gold-soft: rgba(230,192,126,.11);
  --teal: #5fd3c0; --violet: #a597ff; --rose: #ff7f95; --green: #72d69d; --amber: #f2b65c; --blue: #6fa9ff;
  --r: 16px; --r-sm: 10px; --r-lg: 22px;
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI Variable', 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --ease: cubic-bezier(.22,.8,.3,1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--ui); -webkit-font-smoothing: antialiased; min-height: 100vh; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 500px at 85% -10%, rgba(230,192,126,.07), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(165,151,255,.06), transparent 60%); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 .6em; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 500 .88em ui-monospace, 'Cascadia Code', Consolas, monospace; background: var(--surface-3); padding: .1em .4em; border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .86rem; } .xs { font-size: .78rem; }
.display { font-family: var(--display); font-weight: 500; letter-spacing: -.02em; }
.ipa { font-family: 'Segoe UI', 'Noto Sans', 'Arial Unicode MS', sans-serif; letter-spacing: .02em; color: var(--gold); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #1a1205; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- Shell ---------- */
.shell { position: relative; display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(18,20,27,.85), rgba(10,11,16,.9)); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-name { font: 600 1.35rem/1 var(--display); letter-spacing: -.02em; display: flex; flex-direction: column; gap: 5px; }
.brand-name small { font: 500 .66rem/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 500; transition: background .2s, color .2s; }
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--text); text-decoration: none; }
.nav-item.is-active { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(230,192,126,.18); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 8px; }
.engine-chip { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; width: fit-content; }
.engine-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.main { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 16px 32px; background: rgba(8,9,13,.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.page-title { font: 500 1.5rem/1.2 var(--display); letter-spacing: -.02em; }
.topbar-right { margin-left: auto; }
.user-chip { font-size: .82rem; color: var(--muted); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; }
.view { padding: 28px 32px 64px; max-width: 1280px; width: 100%; outline: none; }
.only-mobile, .icon-btn.only-mobile { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40; }

/* ---------- Primitives ---------- */
.card { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; position: relative; }
.card.flat { background: var(--surface); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title { font-size: .72rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); }
.card-head .spacer { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 14px; } .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .between { justify-content: space-between; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }

.btn, .btn-primary, .btn-ghost, .btn-danger { font: 600 .92rem/1 var(--ui); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s; text-decoration: none; white-space: nowrap; }
.btn:hover, .btn-ghost:hover { background: var(--surface-3); text-decoration: none; }
.btn:active, .btn-primary:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, #f0d29c, #c8923f); color: #1b1204; border-color: transparent; box-shadow: 0 6px 24px rgba(200,146,63,.28); }
.btn-primary:hover { box-shadow: 0 8px 30px rgba(200,146,63,.4); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-danger { background: rgba(255,127,149,.1); border-color: rgba(255,127,149,.35); color: var(--rose); }
.btn-danger:hover { background: rgba(255,127,149,.18); }
.btn[disabled], .btn-primary[disabled], .btn-ghost[disabled], .btn-danger[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.small.btn, .btn.small, .btn-ghost.small, .btn-primary.small, .btn-danger.small { padding: 8px 12px; font-size: .82rem; border-radius: 10px; }
.block { display: flex; width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); cursor: pointer; transition: background .2s, transform .15s; flex: none; }
.icon-btn:hover { background: var(--surface-3); } .icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.on { background: var(--gold-soft); color: var(--gold); border-color: rgba(230,192,126,.3); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--muted); border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.chip.gold { color: var(--gold); border-color: rgba(230,192,126,.3); background: var(--gold-soft); }
.chip.teal { color: var(--teal); border-color: rgba(95,211,192,.3); background: rgba(95,211,192,.08); }
.chip.rose { color: var(--rose); border-color: rgba(255,127,149,.3); background: rgba(255,127,149,.08); }
.chip.green { color: var(--green); border-color: rgba(114,214,157,.3); background: rgba(114,214,157,.08); }
.chip.violet { color: var(--violet); border-color: rgba(165,151,255,.3); background: rgba(165,151,255,.08); }
.chip.btnlike { cursor: pointer; } .chip.btnlike:hover { color: var(--text); border-color: var(--line-2); }
.chip.btnlike.on { color: var(--gold); border-color: rgba(230,192,126,.35); background: var(--gold-soft); }

.seg { display: inline-flex; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; gap: 2px; flex-wrap: wrap; }
.seg button { font: 600 .84rem var(--ui); color: var(--muted); background: transparent; border: 0; padding: 8px 14px; border-radius: 9px; cursor: pointer; transition: all .2s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.seg button .n { color: var(--faint); font-weight: 500; margin-left: 4px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: .8rem; font-weight: 500; color: var(--muted); }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=search], input:not([type]), select, textarea {
  width: 100%; font: 400 .95rem var(--ui); color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 11px; padding: 11px 13px; transition: border-color .2s, box-shadow .2s; }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(230,192,126,.6); box-shadow: 0 0 0 3px rgba(230,192,126,.12); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2399a0b2' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input[type=range] { width: 100%; accent-color: var(--gold); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .2s; flex: none; border: 1px solid var(--line-2); }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #cfd3de; transition: transform .2s var(--ease), background .2s; }
.switch input:checked { background: rgba(230,192,126,.35); border-color: rgba(230,192,126,.5); }
.switch input:checked::after { transform: translateX(18px); background: var(--gold); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-error { color: var(--rose); background: rgba(255,127,149,.08); border: 1px solid rgba(255,127,149,.25); border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin: 0; }
.notice { display: flex; gap: 12px; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; color: var(--muted); }
.notice.warn { border-color: rgba(242,182,92,.3); background: rgba(242,182,92,.06); color: #e8c58d; }
.notice.bad { border-color: rgba(255,127,149,.3); background: rgba(255,127,149,.06); color: #ffb0be; }
.notice.good { border-color: rgba(114,214,157,.3); background: rgba(114,214,157,.06); color: #a6e7c2; }
.notice b { color: var(--text); }
.kbd { font: 600 .72rem ui-monospace, Consolas, monospace; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); }
.empty { text-align: center; padding: 34px 16px; color: var(--faint); }
.empty b { display: block; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Stats ---------- */
.stat { padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.stat .k { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.stat .v { font: 500 1.9rem/1.1 var(--display); margin-top: 6px; letter-spacing: -.02em; }
.stat .v small { font: 500 .8rem var(--ui); color: var(--muted); margin-left: 4px; }
.stat .d { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.up { color: var(--green); } .down { color: var(--rose); }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; flex: none; }
.ring::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--bg-2); }
.ring span { position: relative; font: 500 1.5rem var(--display); }
.ring span small { display: block; font: 500 .66rem var(--ui); color: var(--faint); text-align: center; letter-spacing: .06em; text-transform: uppercase; }
.streak-flame { font: 500 2.6rem/1 var(--display); background: linear-gradient(180deg, #f6dca5, #c8923f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.strip { display: flex; gap: 5px; }
.strip i { flex: 1; height: 26px; border-radius: 6px; background: var(--surface-3); position: relative; }
.strip i.on { background: linear-gradient(180deg, #e6c07e, #b98334); }
.hello { font: 500 clamp(1.7rem, 3vw, 2.4rem)/1.15 var(--display); letter-spacing: -.025em; }
.hello em { color: var(--gold); font-style: italic; }

/* ---------- Lists / items ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 600; } .item .s { color: var(--muted); font-size: .86rem; }
.item.done .t { color: var(--green); }
.tick { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; }
.item.done .tick { background: rgba(114,214,157,.15); border-color: var(--green); color: var(--green); }
.fix { display: grid; gap: 4px; }
.fix .bad { color: var(--rose); text-decoration: line-through; text-decoration-color: rgba(255,127,149,.5); }
.fix .good { color: var(--green); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; color: var(--muted); font: 600 .9rem var(--ui); padding: 11px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); } .tabs button.on { color: var(--gold); border-color: var(--gold); }

/* ---------- Voice stage (orb) ---------- */
.stage { --lvl: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 26px 20px 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: radial-gradient(520px 260px at 50% 0%, var(--glow, rgba(230,192,126,.09)), transparent 70%), linear-gradient(180deg, var(--surface), var(--bg-2)); overflow: hidden; --c: var(--gold); --glow: rgba(230,192,126,.09); }
.stage[data-state=listening] { --c: var(--teal); --glow: rgba(95,211,192,.14); }
.stage[data-state=thinking] { --c: var(--violet); --glow: rgba(165,151,255,.14); }
.stage[data-state=speaking] { --c: var(--gold); --glow: rgba(230,192,126,.14); }
.stage[data-state=error] { --c: var(--rose); --glow: rgba(255,127,149,.14); }
.status { display: inline-flex; align-items: center; gap: 9px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--c); padding: 7px 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.stage[data-state=listening] .status i, .stage[data-state=speaking] .status i { animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.orb-wrap { position: relative; width: 190px; height: 190px; display: grid; place-items: center; }
.orb-wrap::before, .orb-wrap::after { content: ''; position: absolute; inset: 14px; border-radius: 50%; border: 1px solid var(--c); opacity: 0; }
.stage[data-state=listening] .orb-wrap::before { animation: ring 2.2s var(--ease) infinite; }
.stage[data-state=listening] .orb-wrap::after { animation: ring 2.2s var(--ease) .9s infinite; }
.stage[data-state=speaking] .orb-wrap::before { animation: ring 3s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.85); opacity: .55; } 100% { transform: scale(1.35); opacity: 0; } }
.orb { position: relative; width: 132px; height: 132px; border-radius: 50%; border: 0; cursor: pointer; color: #0b0c11; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c) 55%, white), var(--c) 55%, color-mix(in srgb, var(--c) 60%, black));
  box-shadow: 0 0 calc(30px + var(--lvl) * 70px) color-mix(in srgb, var(--c) 55%, transparent), inset 0 -10px 30px rgba(0,0,0,.25);
  transform: scale(calc(1 + var(--lvl) * .1)); transition: transform .08s linear, box-shadow .12s linear, background .4s; }
.orb:active { transform: scale(.96); }
.orb svg { width: 46px; height: 46px; }
.stage[data-state=thinking] .orb { animation: breathe 1.6s ease-in-out infinite; }
.stage[data-state=thinking] .orb-wrap::before { opacity: 1; border: 2px solid transparent; border-top-color: var(--c); inset: 8px; animation: spin 1s linear infinite; }
.stage[data-state=speaking] .orb { animation: speakpulse 1.1s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(.94); } }
@keyframes speakpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.wave { width: 100%; max-width: 640px; height: 64px; display: block; }
.caption { min-height: 2.9em; max-width: 640px; text-align: center; font: 400 1.05rem/1.45 var(--display); color: var(--muted); }
.caption b { color: var(--text); font-weight: 500; }
.stage-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.typebox { display: flex; gap: 8px; width: 100%; max-width: 640px; }
.typebox input { flex: 1; }

/* ---------- Transcript ---------- */
.transcript { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.msg { max-width: 86%; padding: 12px 15px; border-radius: 16px; font-size: .97rem; line-height: 1.55; position: relative; }
.msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-top-left-radius: 5px; }
.msg.me { align-self: flex-end; background: linear-gradient(180deg, rgba(230,192,126,.14), rgba(230,192,126,.07)); border: 1px solid rgba(230,192,126,.22); border-top-right-radius: 5px; }
.msg .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; align-items: center; }
.msg .who { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 4px; }
.msg.pending { opacity: .6; }
.fb-section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fb-section:last-child { border-bottom: 0; }
.fb-section h4 { font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.fb-good { font: 400 1.05rem/1.5 var(--display); color: var(--green); }
.panel { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }

/* ---------- Diff (repeat after me) ---------- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.compare h4 { font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.sentence { font: 400 1.35rem/1.7 var(--display); letter-spacing: -.005em; }
.sentence.big { font-size: 1.8rem; line-height: 1.5; }
.w { display: inline-block; padding: 0 5px; margin: 1px 1px; border-radius: 7px; }
.w.ok { color: var(--green); background: rgba(114,214,157,.09); }
.w.wrong { color: var(--amber); background: rgba(242,182,92,.1); }
.w.miss { color: var(--rose); background: rgba(255,127,149,.09); text-decoration: line-through; text-decoration-color: rgba(255,127,149,.55); }
.w.extra { color: var(--blue); background: rgba(111,169,255,.1); }
.w[title] { cursor: help; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: currentColor; }
.legend .ok { color: var(--green); } .legend .wrong { color: var(--amber); } .legend .miss { color: var(--rose); } .legend .extra { color: var(--blue); }
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.metric { padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.metric .k { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.metric .v { font: 500 1.4rem var(--display); margin-top: 3px; }
.metric .d { font-size: .76rem; color: var(--muted); }
.tips li { margin: 0 0 8px; } .tips { padding-left: 18px; margin: 0; color: var(--muted); }
.tips b, .tips strong { color: var(--text); }
canvas.pitch { width: 100%; height: 90px; display: block; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.exlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.excard { text-align: left; padding: 13px 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; color: var(--text); font: inherit; transition: border-color .2s, transform .15s, background .2s; }
.excard:hover { border-color: rgba(230,192,126,.4); background: var(--surface-2); transform: translateY(-1px); }
.excard.sel { border-color: var(--gold); background: var(--gold-soft); }
.excard .w1 { font: 500 1.25rem var(--display); }
.excard .p { font-size: .82rem; color: var(--gold); margin-top: 2px; }
.dotm { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 6px; }
.dotm.good { background: var(--green); } .dotm.mid { background: var(--amber); } .dotm.low { background: var(--rose); }
.bigword { font: 500 clamp(2.4rem, 6vw, 3.6rem)/1.1 var(--display); letter-spacing: -.03em; }
.bar-h { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-h i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #c8923f, #f0d29c); }
.sound-card { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.sound-card h4 { font: 500 1.1rem var(--display); margin-bottom: 6px; }
.sound-card p { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }
.sound-card .ex { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: 190px; display: block; }
.chart text { font: 500 10px var(--ui); fill: var(--faint); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: url(#gbar); } .chart .bar.dim { fill: var(--surface-3); }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dotp { fill: var(--gold); stroke: var(--bg); stroke-width: 2; }
.chart .area { fill: url(#garea); }
.heat { display: grid; grid-template-columns: repeat(auto-fill, 18px); gap: 4px; }
.heat i { width: 18px; height: 18px; border-radius: 5px; background: var(--surface-3); }
.heat i.l1 { background: rgba(230,192,126,.3); } .heat i.l2 { background: rgba(230,192,126,.6); } .heat i.l3 { background: var(--gold); }

/* ---------- Overlays ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(4,5,8,.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal { width: min(560px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); animation: pop .25s var(--ease); }
.modal.wide { width: min(780px, 100%); }
.modal h2 { font: 500 1.5rem var(--display); margin-bottom: 6px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 15px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: .9rem; animation: pop .25s var(--ease); }
.toast.err { border-color: rgba(255,127,149,.45); } .toast.ok { border-color: rgba(114,214,157,.45); }
.stars { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.stars button { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); font: 500 1.3rem var(--display); cursor: pointer; transition: all .2s; }
.stars button:hover, .stars button.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Auth ---------- */
.auth-body { display: grid; place-items: center; padding: 24px; min-height: 100vh; }
.auth-card { position: relative; z-index: 1; width: min(420px, 100%); background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line-2); border-radius: 24px; padding: 34px 30px; box-shadow: var(--shadow); overflow: hidden; }
.auth-card.wide { width: min(640px, 100%); }
.auth-glow { position: absolute; inset: -40% -20% auto; height: 260px; background: radial-gradient(closest-side, rgba(230,192,126,.18), transparent); pointer-events: none; }
.auth-brand { text-align: center; margin-bottom: 24px; position: relative; }
.auth-brand h1 { font: 500 2.2rem var(--display); letter-spacing: -.03em; margin-top: 8px; }
.auth-brand p { color: var(--muted); margin: 4px 0 0; font-size: .92rem; }
.auth-foot { text-align: center; color: var(--faint); font-size: .78rem; margin: 20px 0 0; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
legend { padding: 0 8px; font-size: .78rem; font-weight: 600; color: var(--gold); letter-spacing: .04em; }
ul.req { list-style: none; padding: 0; margin: 0 0 18px; font-size: .86rem; display: grid; gap: 4px; }
ul.req li.ok span { color: var(--green); } ul.req li.bad span { color: var(--rose); } ul.req li.warn span { color: var(--amber); } ul.req em { color: var(--faint); font-style: normal; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .panel { position: static; max-height: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 285px; z-index: 50; transform: translateX(-102%); transition: transform .3s var(--ease); background: var(--bg-2); }
  body.nav-open .sidebar { transform: none; } body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .only-mobile, .icon-btn.only-mobile { display: inline-grid; } .topbar { padding: 12px 16px; } .view { padding: 20px 16px 56px; }
  .g2, .g3, .compare { grid-template-columns: 1fr; } .page-title { font-size: 1.25rem; }
  .msg { max-width: 94%; } .user-chip { display: none; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr; } .sentence.big { font-size: 1.4rem; } .stage { padding: 20px 12px 16px; } .toasts { left: 16px; right: 16px; bottom: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* conversation layout */
#liveGrid { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 960px) { #liveGrid { grid-template-columns: minmax(0, 1fr) !important; } #feedback.panel { position: static; max-height: none; } }
#labGrid { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); align-items: start; }
@media (max-width: 960px) { #labGrid { grid-template-columns: minmax(0, 1fr); } }
.orb-wrap::before, .orb-wrap::after { pointer-events: none; }
.orb { z-index: 1; }
