:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --ink: #17212b;
  --muted: #647180;
  --line: #d7dde3;
  --line-dark: #bcc5ce;
  --nav: #111b25;
  --blue: #2169a8;
  --blue-dark: #164d7d;
  --blue-soft: #e8f1f8;
  --green: #247348;
  --green-soft: #e6f3eb;
  --red: #b13b32;
  --red-soft: #f8e9e7;
  --amber: #8b6818;
  --shadow: 0 1px 2px rgba(16, 31, 44, .06);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar { height: 58px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; background: var(--nav); border-bottom: 1px solid #293643; position: sticky; top: 0; z-index: 20; }
.brand { color: #f4f7fa; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand > span:last-child { display: flex; align-items: center; gap: 9px; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small { color: #94a4b3; font-size: 12px; border-left: 1px solid #41505e; padding-left: 9px; }
.brand-mark { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #668198; background: #21374a; color: #dbe8f2; font: 700 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.environment-badge { color: #9cb0c1; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }

.button { min-height: 34px; border: 1px solid transparent; border-radius: 3px; padding: 7px 13px; font-weight: 600; font-size: 12px; transition: background .12s, border-color .12s; }
.button:hover { filter: brightness(.97); }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button.ghost { border-color: #536677; color: #e1e9f0; background: #1b2a37; }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue-dark); }
.button.secondary { color: #1b5687; background: #edf4f9; border-color: #b8ccdc; }
.button.danger { color: #fff; background: var(--red); border-color: #933028; }
.button.wide { width: 100%; }
.record-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #fff; }

main { width: min(1440px, calc(100% - 48px)); margin: 0 auto 56px; }
.console-heading { padding: 26px 0 22px; border-bottom: 1px solid var(--line); }
.breadcrumb { margin-bottom: 15px; color: #73808d; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.heading-row h1 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 650; letter-spacing: -.02em; }
.heading-row p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.system-state { min-width: 210px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.system-state > span { width: 8px; height: 8px; border-radius: 50%; background: #2f9a61; }
.system-state b, .system-state small { display: block; }.system-state b { font-size: 11px; }.system-state small { margin-top: 2px; color: var(--muted); font: 9px ui-monospace, monospace; }
.section-label { height: 35px; margin-top: 18px; display: flex; align-items: center; gap: 10px; }
.section-label span { font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .09em; }.section-label small { color: var(--muted); font-size: 11px; }

.provider-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.provider-card { min-height: 70px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 13px 15px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.provider-symbol { width: 34px; height: 34px; border-radius: 2px; display: grid; place-items: center; background: #e9edf1; border: 1px solid #d4dbe1; color: #344554; font-weight: 700; font-size: 13px; }
.provider-card > div:nth-child(2) { flex: 1; }.provider-card strong { display: block; font-size: 12px; }.provider-card small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #aeb7bf; }.status-dot.ready { background: #2f925c; box-shadow: 0 0 0 3px rgba(47,146,92,.12); }

.workspace { display: grid; grid-template-columns: minmax(0, 1.78fr) minmax(300px, .62fr); gap: 12px; align-items: start; }
.lab-panel, .metric-card, .voice-card { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); }
.lab-panel { padding: 20px; }.panel-heading, .card-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.panel-heading h2, .drawer h2 { margin: 0; font-size: 17px; font-weight: 650; }.card-heading h3 { margin: 0; font-size: 14px; font-weight: 650; }
.kicker { margin: 0 0 6px; color: var(--blue); font: 700 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; }
.session-state { display: flex; gap: 7px; align-items: center; padding: 6px 9px; border: 1px solid #d3d9de; border-radius: 2px; background: #f3f5f6; color: #64717d; font-size: 10px; font-weight: 650; }
.session-state i { width: 6px; height: 6px; border-radius: 50%; background: #9ca6ae; }.session-state.live { color: #8f312a; background: var(--red-soft); border-color: #ecc5c1; }.session-state.live i { background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.controls-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 10px; }
.controls-grid label, .token-field { color: #52606d; font-size: 10px; font-weight: 650; }
.controls-grid select { width: 100%; height: 36px; margin-top: 6px; padding: 0 31px 0 10px; border: 1px solid var(--line-dark); border-radius: 2px; background: var(--surface); color: var(--ink); font-size: 12px; }
.controls-grid select:focus, input:focus { outline: 2px solid rgba(33,105,168,.2); border-color: var(--blue); }

.source-row { min-height: 68px; border: 1px solid var(--line); background: var(--surface-subtle); border-radius: 2px; padding: 11px; display: flex; align-items: center; gap: 11px; }
.source-info { flex: 1; min-width: 120px; }.source-info strong, .source-info span { display: block; }.source-info strong { font-size: 12px; }.source-info span { color: var(--muted); margin-top: 4px; font: 9px ui-monospace, monospace; }
.mic-visual { width: 38px; height: 38px; border: 1px solid #c7d5e0; background: #edf4f8; display: flex; align-items: center; justify-content: center; gap: 2px; }
.mic-visual span { width: 2px; height: 7px; background: var(--blue); }.mic-visual span:nth-child(2), .mic-visual span:nth-child(6) { height: 12px; }.mic-visual span:nth-child(3), .mic-visual span:nth-child(5) { height: 18px; }.mic-visual span:nth-child(4) { height: 25px; }.mic-visual.active span { animation: meter .55s ease-in-out infinite alternate; }.mic-visual.active span:nth-child(even) { animation-delay: .18s; }
@keyframes meter { to { transform: scaleY(.4); } }

.transcript-shell { min-height: 390px; margin-top: 10px; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; background: var(--surface); }
.transcript-toolbar { height: 39px; border-bottom: 1px solid var(--line); padding: 0 11px; display: flex; align-items: center; justify-content: space-between; color: #5f6c78; background: #f4f6f8; font: 700 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.icon-button, .text-button { border: 0; background: transparent; color: var(--blue); font-size: 10px; font-weight: 650; }.icon-button + .icon-button { margin-left: 8px; }
.empty-transcript { height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty-transcript strong { color: #465360; font-size: 13px; font-weight: 600; }.empty-transcript span { margin-top: 6px; font-size: 10px; }
.empty-wave { height: 36px; display: flex; align-items: center; gap: 3px; margin-bottom: 13px; }.empty-wave i { width: 2px; background: #9bb7cc; height: 9px; }.empty-wave i:nth-child(2), .empty-wave i:nth-child(4) { height: 21px; }.empty-wave i:nth-child(3) { height: 31px; }
.transcript-list { padding: 12px; display: grid; gap: 7px; }
.utterance { display: grid; grid-template-columns: 96px minmax(0, 1fr) 55px; gap: 11px; align-items: start; padding: 10px 11px; border: 1px solid #e0e5e9; border-left: 3px solid var(--blue); background: #fbfcfd; }
.utterance.partial { opacity: .7; border-left-style: dashed; }.utterance .speaker { font: 700 9px ui-monospace, monospace; color: var(--blue-dark); text-transform: uppercase; }.utterance .text { font-size: 12px; line-height: 1.55; }.utterance .time { color: #7b8792; font: 9px ui-monospace, monospace; text-align: right; }.utterance .translation { display: block; margin-top: 5px; color: #734f12; font-size: 12px; }

.side-column { display: grid; gap: 12px; }.metric-card, .voice-card { padding: 17px; }.card-heading #session-clock { color: var(--blue); font: 11px ui-monospace, monospace; }
.metric-grid { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); overflow: hidden; }
.metric-grid div { padding: 12px; background: var(--surface-subtle); }.metric-grid span, .metric-grid strong { display: block; }.metric-grid span { color: var(--muted); font: 8px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; }.metric-grid strong { margin-top: 6px; font: 600 16px ui-monospace, monospace; }
.metric-hint, .privacy-note { color: var(--muted); font-size: 9px; line-height: 1.6; margin: 12px 0 0; }
.voice-list { margin: 14px 0; display: grid; gap: 6px; }.voice-row { display: flex; align-items: center; gap: 9px; padding: 8px; border: 1px solid #e1e5e8; background: #fafbfc; }.voice-avatar { width: 28px; height: 28px; display: grid; place-items: center; background: #dfeaf2; border: 1px solid #c2d3df; color: #2f5877; font-weight: 700; font-size: 11px; }.voice-row div:nth-child(2) { flex: 1; }.voice-row strong, .voice-row small { display: block; }.voice-row strong { font-size: 11px; }.voice-row small { color: var(--muted); font: 8px ui-monospace, monospace; margin-top: 2px; }.voice-delete { border: 0; background: transparent; color: var(--red); }
.voice-register input, .token-field input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-dark); border-radius: 2px; background: var(--surface); margin-bottom: 8px; font-size: 12px; }
.record-progress { height: 34px; margin-top: 8px; position: relative; overflow: hidden; background: #e9edf0; display: flex; align-items: center; justify-content: center; }.record-progress span { position: absolute; inset: 0 auto 0 0; width: 0; background: #dce9f3; transition: width .1s linear; }.record-progress b { z-index: 1; font: 10px ui-monospace, monospace; }

.drawer { position: fixed; z-index: 42; right: 0; top: 0; height: 100vh; width: min(430px, 94vw); background: var(--surface); padding: 24px; transform: translateX(102%); transition: transform .2s ease; box-shadow: -8px 0 28px rgba(10, 25, 32, .18); overflow-y: auto; border-left: 1px solid var(--line-dark); }.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; }.close-button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: #41505d; font-size: 19px; }.drawer-intro { color: var(--muted); font-size: 11px; line-height: 1.7; margin: 21px 0; }
.token-field div { margin-top: 6px; display: flex; }.token-field input { margin: 0; border-radius: 2px 0 0 2px; }.token-field button { border: 0; padding: 0 16px; color: #fff; background: var(--blue); border-radius: 0 2px 2px 0; font-weight: 650; font-size: 11px; }
.setup-status { margin: 20px 0; display: grid; }.setup-row { display: flex; justify-content: space-between; font-size: 11px; padding: 9px 0; border-bottom: 1px solid #e1e5e8; }.setup-row b { color: var(--red); }.setup-row b.ready { color: var(--green); }.setup-file { padding: 11px; border: 1px solid var(--line); background: #f5f7f8; }.setup-file span { display: block; color: var(--muted); font-size: 9px; }.setup-file code { display: block; margin-top: 5px; font-size: 11px; }.setup-links { margin-top: 24px; }.setup-links h3 { font-size: 12px; }.setup-links a { color: var(--ink); text-decoration: none; display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(9, 17, 24, .42); opacity: 0; pointer-events: none; transition: opacity .18s; }.scrim.open { opacity: 1; pointer-events: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 12px); opacity: 0; background: #182632; color: #fff; border: 1px solid #334656; border-radius: 3px; padding: 9px 13px; font-size: 11px; pointer-events: none; transition: .18s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }.muted { color: var(--muted); font-size: 10px; }

@media (max-width: 900px) { .provider-strip { grid-template-columns: 1fr; }.workspace { grid-template-columns: 1fr; }.side-column { grid-template-columns: 1fr 1fr; } }
@media (max-width: 650px) { main { width: min(100% - 24px, 1440px); }.topbar { height: 54px; padding: 0 12px; }.brand small, .environment-badge { display: none; }.heading-row { align-items: stretch; flex-direction: column; }.system-state { width: 100%; }.controls-grid { grid-template-columns: 1fr; }.source-row { align-items: stretch; flex-wrap: wrap; }.source-info { min-width: calc(100% - 54px); }.source-row .button { flex: 1; }.lab-panel { padding: 13px; }.side-column { grid-template-columns: 1fr; }.utterance { grid-template-columns: 72px 1fr; }.utterance .time { display: none; } input, select, button { font-size: 16px; }.controls-grid label, .token-field { font-size: 12px; } }
