:root {
  --bg: #f4f6fa;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --ink: #172035;
  --muted: #6f788d;
  --line: #e5e8ef;
  --line-strong: #d8dce7;
  --accent: #6558df;
  --accent-2: #8f83ff;
  --accent-soft: #efedff;
  --cyan: #2bbdc5;
  --green: #1da778;
  --green-soft: #e4f8f0;
  --red: #db5566;
  --red-soft: #fff0f2;
  --amber: #d99024;
  --shadow: 0 22px 65px rgba(30, 39, 71, 0.09);
  --shadow-soft: 0 10px 30px rgba(30, 39, 71, 0.06);
  --radius: 22px;
  --radius-sm: 13px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 5%, rgba(117, 102, 244, 0.08), transparent 34rem),
    linear-gradient(180deg, #f8f9fc 0%, var(--bg) 35%, #f4f6fa 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.ambient-a { width: 310px; height: 310px; top: 90px; right: -170px; border: 1px solid rgba(101, 88, 223, 0.14); }
.ambient-b { width: 180px; height: 180px; top: 470px; left: -100px; border: 1px solid rgba(43, 189, 197, 0.17); }

.app-shell { min-height: 100vh; }
.topbar {
  height: 74px;
  padding: 0 max(28px, calc((100vw - 1480px) / 2));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(221, 225, 235, 0.8);
  background: rgba(248, 249, 252, 0.82);
  backdrop-filter: blur(20px);
}
.brand { display: inline-flex; width: fit-content; gap: 11px; align-items: center; text-decoration: none; }
.brand strong { display: block; letter-spacing: -0.02em; font-size: 15px; }
.brand small { display: block; color: var(--muted); margin-top: 2px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.brand-mark { width: 34px; height: 34px; position: relative; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #7a6fee, #4c3ec2); box-shadow: 0 8px 20px rgba(91, 76, 211, 0.26); overflow: hidden; }
.brand-mark span { position: absolute; width: 18px; height: 2px; border-radius: 10px; background: white; transform-origin: center; opacity: 0.94; }
.brand-mark span:first-child { transform: rotate(0deg); }
.brand-mark span:nth-child(2) { transform: rotate(60deg); }
.brand-mark span:nth-child(3) { transform: rotate(-60deg); }
.brand-mark.large { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 24px; }
.brand-mark.large span { width: 28px; height: 3px; }
.topbar-center { display: flex; gap: 8px; justify-content: center; }
.model-chip, .service-status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.model-chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.72); font: 600 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; color: #596178; }
.model-chip i, .service-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(101,88,223,.11); }
.model-chip.live i { background: var(--cyan); box-shadow: 0 0 0 3px rgba(43,189,197,.12); }
.topbar-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.service-status { color: var(--green); font-size: 11px; font-weight: 650; margin-right: 5px; }
.service-status i { background: var(--green); box-shadow: 0 0 0 3px rgba(29,167,120,.12); }

main { width: min(1424px, calc(100% - 56px)); margin: 0 auto; padding: 54px 0 80px; }
.hero { display: grid; grid-template-columns: .77fr 1.23fr; gap: 50px; align-items: center; margin-bottom: 46px; }
.eyebrow, .section-kicker { margin: 0; color: var(--accent); font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.hero-copy { padding-left: 8px; }
.hero-copy h1 { margin: 17px 0 19px; max-width: 570px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(37px, 4.1vw, 62px); font-weight: 500; line-height: 1.08; letter-spacing: -.045em; }
.hero-copy h1 em { font-style: normal; color: var(--accent); }
.hero-copy > p:last-child { color: var(--muted); font-size: 15px; line-height: 1.8; max-width: 500px; }
.usage-overview { padding: 24px; border: 1px solid rgba(218,222,233,.82); border-radius: 26px; background: rgba(255,255,255,.76); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.usage-title-row, .panel-heading, .detail-title-row, .history-heading, .modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.usage-title-row h2, .panel-heading h2, .history-heading h2, .modal-heading h2 { margin: 7px 0 0; font-size: 20px; letter-spacing: -.025em; }
.usage-title-row > span { font-size: 10px; }
.usage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.metric-card { position: relative; min-width: 0; padding: 16px 15px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-strong); overflow: hidden; }
.metric-card > span { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; }
.metric-card strong { display: block; margin: 9px 0 6px; font-size: clamp(16px, 1.5vw, 23px); letter-spacing: -.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-card small { display: block; color: #9299aa; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-card.accent { border-color: transparent; color: white; background: linear-gradient(145deg, #7669e9, #5546c8); box-shadow: 0 12px 28px rgba(92,75,210,.24); }
.metric-card.accent::after { content: ""; position: absolute; width: 100px; height: 100px; right: -45px; top: -45px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; }
.metric-card.accent > span, .metric-card.accent small { color: rgba(255,255,255,.72); }
.total-card { background: linear-gradient(145deg, #f7f5ff, #fff); }
.usage-footer { display: grid; grid-template-columns: .7fr .7fr 1.6fr; gap: 10px; margin-top: 14px; padding: 13px 4px 0; border-top: 1px solid var(--line); }
.usage-footer > div { min-width: 0; padding: 0 12px; border-right: 1px solid var(--line); }
.usage-footer > div:last-child { border: 0; }
.usage-footer span { display: block; color: var(--muted); font-size: 9px; }
.usage-footer strong { display: block; margin-top: 5px; font-size: 12px; }
.spark-wrap { display: grid !important; grid-template-columns: auto 1fr; align-items: end; gap: 12px; }
.spark-wrap > span { align-self: center; }
.spark { height: 30px; display: flex; align-items: end; gap: 3px; }
.spark i { flex: 1; min-width: 3px; max-width: 10px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--accent-2), rgba(101,88,223,.22)); transition: height .35s ease; }

.workspace-tabs { display: flex; align-items: center; gap: 30px; border-bottom: 1px solid var(--line-strong); }
.tab { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 15px 2px 17px; border: 0; background: transparent; color: #858da0; font-size: 13px; font-weight: 650; cursor: pointer; }
.tab span { font: 600 9px/1 ui-monospace, monospace; opacity: .65; }
.tab b { min-width: 20px; padding: 3px 6px; border-radius: 999px; background: #e8eaf0; color: #7a8294; font-size: 9px; }
.tab::after { content: ""; position: absolute; height: 2px; left: 50%; right: 50%; bottom: -1px; border-radius: 2px; background: var(--accent); transition: left .25s, right .25s; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); }
.tab.active span { color: var(--accent); opacity: 1; }
.tab.active::after { left: 0; right: 0; }
.tab-panel { display: none; padding-top: 26px; }
.tab-panel.active { display: block; animation: panel-in .28s ease; }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.workspace-grid { display: grid; grid-template-columns: minmax(0, .93fr) minmax(0, 1.07fr); gap: 20px; align-items: start; }
.panel { border: 1px solid rgba(218,222,233,.95); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.setup-panel, .result-panel, .live-control-panel, .live-transcript-panel { padding: 26px; }
.panel-heading { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 18px; }
.step-badge { padding: 6px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 750; }
.source-switch { width: 100%; padding: 4px; margin: 22px 0 15px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 12px; background: #f0f2f6; }
.source-switch button { padding: 9px 12px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 650; cursor: pointer; }
.source-switch button.active { color: var(--ink); background: white; box-shadow: 0 3px 10px rgba(30,39,71,.08); }
.source-pane { display: none; }
.source-pane.active { display: block; }
.drop-zone { min-height: 160px; padding: 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 1.5px dashed #ced3df; border-radius: 17px; background: linear-gradient(180deg, #fbfcfe, #f8f9fc); cursor: pointer; transition: .2s; text-align: center; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { width: 36px; height: 36px; margin-bottom: 11px; display: grid; place-items: center; border-radius: 12px; color: var(--accent); background: var(--accent-soft); font-size: 21px; font-weight: 350; }
.drop-zone strong { font-size: 13px; }
.drop-zone > span:not(.upload-icon) { margin-top: 4px; color: var(--muted); font-size: 11px; }
.drop-zone small { margin-top: 12px; color: #9aa1b1; font-size: 8px; letter-spacing: .05em; }
.selected-file { margin-top: 10px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid #dcd8ff; border-radius: 12px; background: #f8f7ff; }
.selected-file div { min-width: 0; }
.selected-file strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.selected-file span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.selected-file button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.field-label { display: block; margin: 0 0 8px; color: #555e73; font-size: 10px; font-weight: 750; }
.field-help { margin: 7px 0 0; color: #9198a8; font-size: 9px; line-height: 1.55; }
.input-with-icon { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 11px; background: white; }
.input-with-icon span { padding-left: 12px; color: var(--accent); }
.input-with-icon input { border: 0; }
input, textarea, select { width: 100%; border: 1px solid var(--line-strong); border-radius: 11px; outline: none; color: var(--ink); background: white; transition: border .2s, box-shadow .2s; }
input, select { height: 41px; padding: 0 12px; font-size: 11px; }
textarea { resize: vertical; min-height: 70px; padding: 11px 12px; line-height: 1.55; font-size: 11px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(101,88,223,.1); }
input::placeholder, textarea::placeholder { color: #adb3c0; }
.input-with-icon input:focus { box-shadow: none; }
.input-with-icon:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(101,88,223,.1); }
.form-section { margin-top: 23px; }
.form-section-title, .label-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.form-section-title span { color: #555e73; font-size: 10px; font-weight: 750; }
.form-section-title small, .label-row > span { color: #9aa1b0; font-size: 8px; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 9px; }
.mode-card { position: relative; min-height: 76px; padding: 14px 12px 12px 37px; border: 1px solid var(--line); border-radius: 13px; background: #fcfcfd; cursor: pointer; transition: .2s; }
.mode-card:hover { border-color: #bbb4f6; }
.mode-card.selected { border-color: var(--accent); background: #f8f7ff; box-shadow: 0 0 0 2px rgba(101,88,223,.07); }
.mode-card input { position: absolute; opacity: 0; }
.mode-radio { position: absolute; left: 13px; top: 15px; width: 14px; height: 14px; border: 1px solid #c8cdd8; border-radius: 50%; background: white; }
.mode-card.selected .mode-radio { border: 4px solid var(--accent); }
.mode-card strong { display: block; font-size: 11px; }
.mode-card small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 21px 0; }
.toggle-row { height: 41px; display: flex; align-items: center; gap: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; color: #626b7e; font-size: 9px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span { width: 27px; height: 16px; padding: 2px; border-radius: 999px; background: #d7dae2; transition: .2s; }
.toggle span::after { content: ""; display: block; width: 12px; height: 12px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: .2s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(11px); }
.toggle input:disabled + span { opacity: .45; }
.limit-note { margin: 18px 0 14px; padding: 11px 12px; display: flex; align-items: flex-start; gap: 9px; border-radius: 11px; color: #716b90; background: #f5f3ff; font-size: 9px; line-height: 1.5; }
.limit-note i { width: 15px; height: 15px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #bcb3ef; border-radius: 50%; font: 700 9px/1 Georgia, serif; }

.primary, .ghost, .danger, .icon-button { border: 0; cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s, background .15s; }
.primary { color: white; background: linear-gradient(135deg, #7164e8, #5747ca); box-shadow: 0 9px 22px rgba(87,71,202,.23); font-weight: 700; }
.primary:hover, .danger:hover { transform: translateY(-1px); }
.primary:disabled, .danger:disabled { opacity: .5; cursor: wait; transform: none; }
.compact { padding: 9px 15px; border-radius: 10px; font-size: 10px; }
.submit-button { width: 100%; height: 47px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-radius: 12px; font-size: 12px; }
.submit-button b { font-size: 18px; font-weight: 400; }
.ghost { padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(255,255,255,.75); color: #657086; font-size: 10px; }
.ghost:hover { color: var(--ink); border-color: #bcc2d0; background: white; }
.tiny { padding: 5px 8px; border-radius: 8px; font-size: 8px; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.7); color: #687084; }
.icon-button:hover { background: white; color: var(--accent); transform: translateY(-1px); }
.danger { color: white; background: linear-gradient(135deg, #e36673, #c94256); box-shadow: 0 9px 22px rgba(201,66,86,.2); }

.result-panel { position: sticky; top: 98px; min-height: 650px; }
.empty-state { min-height: 540px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.empty-state strong { margin-top: 22px; font-size: 13px; }
.empty-state p { max-width: 280px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.empty-orbit { position: relative; width: 90px; height: 90px; border: 1px solid #ddd9ff; border-radius: 50%; }
.empty-orbit::before, .empty-orbit::after { content: ""; position: absolute; border: 1px solid #e9e7fb; border-radius: 50%; inset: 12px; }
.empty-orbit::after { inset: 27px; background: var(--accent-soft); }
.empty-orbit span { position: absolute; z-index: 2; width: 8px; height: 8px; top: 11px; left: 20px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(101,88,223,.1); }
.empty-orbit i { position: absolute; z-index: 2; width: 6px; height: 6px; right: 9px; bottom: 26px; border-radius: 50%; background: var(--cyan); }
.job-detail { padding-top: 20px; }
.detail-title-row { align-items: flex-start; }
.detail-title-actions { display: flex; align-items: center; gap: 7px; }
.detail-title-row h3 { max-width: 440px; margin: 9px 0 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 8px; font-weight: 750; }
.status-pill.running { color: var(--accent); background: var(--accent-soft); }
.status-pill.failed { color: var(--red); background: var(--red-soft); }
.status-pill.cancelled, .status-pill.neutral { color: #767f91; background: #eef0f4; }
.duration-chip { padding: 6px 8px; border-radius: 8px; color: #727b8d; background: #f2f3f6; font: 600 9px/1 ui-monospace, monospace; }
.detail-progress { margin: 18px 0; }
.detail-progress > div { height: 5px; overflow: hidden; border-radius: 99px; background: #eceef3; }
.detail-progress > div span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width .4s; }
.detail-progress small { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; }
.detail-usage { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 16px; }
.detail-usage > div { padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; }
.detail-usage span { display: block; color: var(--muted); font-size: 8px; }
.detail-usage strong { display: block; margin-top: 5px; font-size: 11px; }
.media-player { margin: 12px 0; }
.media-player audio { width: 100%; height: 36px; }
.detail-error { margin: 10px 0; padding: 10px 12px; border-radius: 10px; color: #a73a49; background: var(--red-soft); font-size: 9px; line-height: 1.55; }
.transcript-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 17px 0 9px; }
.transcript-toolbar strong { font-size: 10px; }
.transcript-toolbar > div { display: flex; gap: 5px; }
.transcript-view { height: 294px; padding: 15px 16px; overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: #fbfbfd; color: #374057; font-size: 11px; line-height: 1.9; white-space: pre-wrap; }
.transcript-view p { margin: 0; }
.speaker-block { margin-bottom: 15px; }
.speaker-label { position: sticky; top: -15px; z-index: 2; display: inline-block; margin: 0 0 6px -3px; padding: 3px 7px; border-radius: 6px; color: var(--accent); background: #eeebff; font-size: 8px; font-weight: 800; }
.word-token { padding: 1px 2px; border: 0; border-radius: 3px; background: transparent; color: inherit; cursor: pointer; font-size: inherit; line-height: inherit; }
.word-token:hover { color: var(--accent); background: var(--accent-soft); }
.export-bar { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.export-bar span { margin-right: auto; color: var(--muted); font-size: 9px; }
.export-bar a { padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; color: #626b7e; background: white; text-decoration: none; font: 650 8px/1 ui-monospace, monospace; }
.export-bar a:hover { border-color: var(--accent); color: var(--accent); }

.live-grid { display: grid; grid-template-columns: .78fr 1.22fr; gap: 20px; align-items: stretch; }
.live-control-panel, .live-transcript-panel { min-height: 650px; }
.live-stage { padding: 38px 10px 25px; display: flex; flex-direction: column; align-items: center; }
.live-orb { width: 164px; height: 164px; position: relative; display: grid; place-items: center; }
.orb-ring { position: absolute; inset: 0; border: 1px solid #d9d5ff; border-radius: 50%; }
.orb-ring::before, .orb-ring::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid #eceafd; inset: 14px; }
.orb-ring::after { inset: 29px; background: linear-gradient(145deg, rgba(239,237,255,.85), rgba(255,255,255,.8)); }
.orb-core { z-index: 2; width: 80px; height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: white; box-shadow: 0 10px 32px rgba(92,76,210,.16); }
.orb-core span { font: 650 18px/1 ui-monospace, monospace; letter-spacing: -.04em; }
.orb-core small { margin-top: 7px; color: var(--muted); font-size: 8px; }
.live-orb.recording .orb-ring { border-color: rgba(101,88,223,.55); animation: pulse-ring 1.7s infinite; }
.live-orb.recording .orb-ring::before { animation: pulse-ring 1.7s .25s infinite; }
.live-orb.recording .orb-core { color: white; background: linear-gradient(145deg,#7568e9,#5343c5); }
.live-orb.recording .orb-core small { color: rgba(255,255,255,.7); }
@keyframes pulse-ring { 0% { transform: scale(.95); opacity: .9; } 70%,100% { transform: scale(1.12); opacity: 0; } }
.level-bars { height: 22px; margin: 7px 0 5px; display: flex; align-items: center; gap: 3px; }
.level-bars i { width: 2px; height: 5px; border-radius: 2px; background: #c8c4ec; }
.recording + .level-bars i { background: var(--accent); animation: level .75s ease-in-out infinite alternate; }
.recording + .level-bars i:nth-child(2), .recording + .level-bars i:nth-child(6) { animation-delay: .15s; }
.recording + .level-bars i:nth-child(3), .recording + .level-bars i:nth-child(5) { animation-delay: .3s; }
.recording + .level-bars i:nth-child(4) { animation-delay: .45s; }
@keyframes level { to { height: 20px; } }
.live-stage > p { margin: 5px 0 16px; color: var(--muted); font-size: 9px; }
.live-button { min-width: 190px; height: 42px; padding: 0 18px; border-radius: 12px; font-size: 11px; }
.live-button span { margin-right: 7px; font-size: 9px; }
.ptt-button { width: 190px; height: 42px; margin-top: 9px; border: 1px solid #cfc9fa; border-radius: 12px; color: var(--accent); background: #f5f3ff; font-size: 11px; font-weight: 700; cursor: pointer; user-select: none; touch-action: none; }
.ptt-button.pressed { color: white; border-color: var(--accent); background: var(--accent); transform: scale(.98); }
.live-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; padding-top: 20px; margin-bottom: 16px; border-top: 1px solid var(--line); }
.live-transcript-panel { display: flex; flex-direction: column; }
.live-transcript { flex: 1; min-height: 430px; max-height: 500px; padding: 22px 18px; overflow-y: auto; border-bottom: 1px solid var(--line); color: #313b52; font-family: Georgia, "Noto Serif SC", serif; font-size: 16px; line-height: 1.9; }
.live-transcript p { margin: 0 0 14px; }
.live-transcript p::before { content: attr(data-index); display: inline-block; min-width: 25px; margin-right: 8px; color: #aaa5ce; font: 650 8px/1 ui-monospace, monospace; vertical-align: middle; }
.live-placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #a0a6b5; text-align: center; }
.live-placeholder span { color: #d5d1f8; font: 70px/1 Georgia, serif; }
.live-placeholder p { max-width: 340px; font: 11px/1.7 ui-sans-serif, sans-serif; }
.live-interim { min-height: 48px; padding: 12px 18px; color: #9a94bd; background: #faf9ff; font-size: 11px; line-height: 1.6; }
.live-usage-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line); }
.live-usage-strip > div { padding: 13px 14px; background: #fbfbfd; }
.live-usage-strip span { display: block; color: var(--muted); font-size: 8px; }
.live-usage-strip strong { display: block; margin-top: 5px; font-size: 10px; }

.history-panel { min-height: 500px; overflow: hidden; }
.history-heading { padding: 25px 26px 20px; border-bottom: 1px solid var(--line); }
.history-tools { display: flex; align-items: center; gap: 8px; }
.history-tools select { width: 115px; height: 36px; }
.search-box { width: 235px; height: 36px; display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: white; }
.search-box span { padding-left: 10px; color: #8c94a5; }
.search-box input { height: 34px; border: 0; background: transparent; }
.search-box input:focus { box-shadow: none; }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th { padding: 13px 16px; color: #8d94a4; background: #fafbfc; text-align: left; font-size: 8px; font-weight: 750; letter-spacing: .04em; white-space: nowrap; }
.history-table td { padding: 14px 16px; border-top: 1px solid var(--line); font-size: 10px; vertical-align: middle; white-space: nowrap; }
.history-table tbody tr { cursor: pointer; transition: background .15s; }
.history-table tbody tr:hover, .history-table tbody tr.selected { background: #faf9ff; }
.history-name { max-width: 280px; }
.history-name strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.history-name small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.kind-pill { padding: 4px 6px; border-radius: 6px; color: #5c54ab; background: #eeecff; font-size: 8px; font-weight: 700; }
.kind-pill.live { color: #18828a; background: #e7f9fa; }
.row-actions { display: flex; gap: 5px; }
.row-actions button { width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 7px; color: #7b8394; background: white; cursor: pointer; }
.row-actions button:hover { color: var(--red); border-color: #f0b8c0; }
.history-empty { padding: 80px 20px; color: var(--muted); text-align: center; font-size: 11px; }

footer { width: min(1424px, calc(100% - 56px)); margin: 0 auto; padding: 22px 0 30px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: #9299a8; font-size: 9px; }

.login-overlay { min-height: 100vh; padding: 24px; display: grid; place-items: center; }
.login-card { width: min(430px, 100%); padding: 46px 42px 38px; border: 1px solid rgba(216,220,232,.9); border-radius: 28px; background: rgba(255,255,255,.9); box-shadow: 0 35px 90px rgba(35,44,78,.13); backdrop-filter: blur(24px); text-align: center; }
.login-card h1 { margin: 10px 0 8px; font-family: Georgia, serif; font-size: 33px; font-weight: 500; letter-spacing: -.035em; }
.login-copy { margin: 0 0 29px; color: var(--muted); font-size: 11px; }
.login-card .field-label { text-align: left; }
.password-row { display: flex; gap: 8px; }
.password-row button { flex: 0 0 auto; }
.form-error { min-height: 18px; margin: 9px 0; color: var(--red); font-size: 9px; }
.login-note { display: flex; align-items: center; justify-content: center; gap: 7px; color: #9097a7; font-size: 8px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.modal { width: min(550px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 40px 110px rgba(25,32,58,.25); }
.modal::backdrop { background: rgba(27,32,49,.38); backdrop-filter: blur(3px); }
.modal form { padding: 26px; }
.modal-heading { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.modal form > p { margin: 18px 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.baseline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.baseline-grid label span { display: block; margin-bottom: 7px; color: #626b7f; font-size: 9px; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.toast-stack { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 250px; max-width: 380px; padding: 12px 15px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 11px; color: #4a5368; background: rgba(255,255,255,.96); box-shadow: 0 15px 45px rgba(30,39,71,.14); font-size: 10px; line-height: 1.5; animation: toast-in .25s ease; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .topbar-center { display: none; }
  .topbar { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero-copy h1 { max-width: none; }
  .usage-grid { grid-template-columns: repeat(4,1fr); }
  .workspace-grid, .live-grid { grid-template-columns: 1fr; }
  .result-panel { position: relative; top: 0; }
  .live-control-panel, .live-transcript-panel { min-height: auto; }
}

@media (max-width: 760px) {
  .topbar { height: 66px; padding: 0 16px; }
  .service-status, #baselineButton { display: none; }
  main { width: calc(100% - 24px); padding-top: 30px; }
  .hero { margin-bottom: 28px; }
  .hero-copy { padding: 0 4px; }
  .hero-copy h1 { font-size: 38px; }
  .usage-overview { padding: 15px; border-radius: 20px; }
  .usage-grid { grid-template-columns: 1fr 1fr; }
  .usage-footer { grid-template-columns: 1fr 1fr; }
  .spark-wrap { display: none !important; }
  .workspace-tabs { gap: 14px; overflow-x: auto; }
  .tab { min-width: max-content; }
  .setup-panel, .result-panel, .live-control-panel, .live-transcript-panel { padding: 18px; border-radius: 18px; }
  .two-column, .mode-cards, .live-options { grid-template-columns: 1fr; }
  .toggle-row { height: auto; padding: 7px 0; }
  .empty-state { min-height: 360px; }
  .result-panel { min-height: 500px; }
  .live-usage-strip { grid-template-columns: 1fr 1fr; }
  .history-heading { align-items: flex-start; flex-direction: column; }
  .history-tools { width: 100%; }
  .search-box { flex: 1; min-width: 0; }
  footer { width: calc(100% - 24px); gap: 12px; flex-direction: column; }
  .login-card { padding: 36px 24px 30px; }
  .baseline-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
