:root {
  color-scheme: light;
  --bg: #f4f0e7;
  --surface: #fbfaf6;
  --surface-strong: #ffffff;
  --ink: #18201d;
  --muted: #68716c;
  --line: #d9ddd5;
  --line-strong: #c5cbc2;
  --primary: #ff5a38;
  --primary-strong: #dc3b20;
  --primary-soft: #fff0ea;
  --green: #25745a;
  --green-soft: #e6f2ec;
  --shadow: 0 24px 70px rgba(35, 45, 40, 0.12);
  --radius-lg: 26px;
  --radius-md: 18px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: Georgia, "Songti SC", "STSong", serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111614;
  --surface: #171d1a;
  --surface-strong: #1d2420;
  --ink: #f4f1e9;
  --muted: #a8b2ab;
  --line: #344039;
  --line-strong: #46534c;
  --primary: #ff7254;
  --primary-strong: #ff8a70;
  --primary-soft: #38211b;
  --green: #76c6a7;
  --green-soft: #1d342a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 10% 18%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  transition: background-color 220ms ease, color 220ms ease;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 65%, transparent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
}

.skip-link:focus { transform: translateY(0); }

.topbar {
  width: min(1380px, calc(100% - 40px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.translation-topbar { display: grid; grid-template-columns: 1fr auto 1fr; }
.translation-topbar .topbar-actions { justify-self: end; }

.mode-switch {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
}
.mode-switch a { min-width: 78px; min-height: 38px; display: grid; place-items: center; padding: 0 16px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 720; text-decoration: none; }
.mode-switch a:hover { color: var(--ink); }
.mode-switch a.active { background: var(--ink); color: var(--surface); box-shadow: 0 5px 15px rgba(20,31,27,.12); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--ink);
  color: var(--surface);
}

.brand-mark svg { width: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2.3; }
.brand strong { display: block; font-size: 17px; letter-spacing: .08em; }
.brand small { display: block; margin-top: -3px; color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.icon-button:hover { border-color: var(--line-strong); background: var(--surface-strong); }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.status-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #c29535; box-shadow: 0 0 0 4px color-mix(in srgb, #c29535 14%, transparent); }
.status-pill.ready .status-dot { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 14%, transparent); }
.status-pill.setup .status-dot { background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); }

.page-shell { width: min(1380px, calc(100% - 40px)); margin: 0 auto; padding: 66px 0 56px; }

.intro {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 80px;
  align-items: end;
  margin-bottom: 48px;
}

.eyebrow, .pane-kicker {
  margin: 0 0 11px;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .18em;
}

h1 { margin: 0; font-family: var(--serif); font-size: clamp(42px, 6.3vw, 78px); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
h1 em { color: var(--primary); font-weight: 500; }
.intro-copy { max-width: 420px; margin: 0 0 5px; color: var(--muted); font-size: 16px; line-height: 1.8; }

.translator {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.language-bar {
  display: grid;
  grid-template-columns: 1fr 110px 1fr;
  min-height: 70px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
}

.language-label { display: flex; align-items: center; gap: 11px; font-size: 14px; font-weight: 650; }
.language-label-right { justify-content: flex-end; }
.language-code { min-width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-strong); border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 800; }
.direction { display: flex; align-items: center; color: var(--muted); }
.direction span { height: 1px; flex: 1; background: var(--line); }
.direction svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.panes { display: grid; grid-template-columns: 1fr 1fr; }
.pane { min-width: 0; }
.source-pane { border-right: 1px solid var(--line); }
.pane-heading { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 28px 16px; }
.pane-kicker { display: block; margin-bottom: 2px; color: var(--muted); font-size: 9px; }
.pane h2 { margin: 0; font-size: 17px; font-weight: 680; letter-spacing: -.01em; }

.listening-badge {
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 700;
}

.listening-badge:not([hidden]) { display: inline-flex; }
.listening-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: pulse 1.4s infinite; }

.copy-button, .text-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: color 180ms ease, opacity 180ms ease;
}

.copy-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.copy-button:hover:not(:disabled), .text-button:hover:not(:disabled) { color: var(--ink); }
button:disabled { cursor: not-allowed; opacity: .42; }

.transcript {
  min-height: 330px;
  max-height: 470px;
  overflow-y: auto;
  padding: 8px 28px 36px;
  scrollbar-color: var(--line-strong) transparent;
}

.empty-state { min-height: 255px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty-state svg { width: 42px; margin-bottom: 18px; fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty-state p { margin: 0 0 5px; color: var(--muted); font-size: 15px; }
.empty-state small { color: color-mix(in srgb, var(--muted) 73%, transparent); font-size: 12px; }

.segments { display: flex; flex-direction: column; gap: 19px; }
.segment { position: relative; margin: 0; color: var(--ink); font-size: 18px; line-height: 1.7; letter-spacing: -.01em; animation: segment-in 240ms ease-out both; }
.segment small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.target-pane .segment { font-size: 19px; }
.segment.pending { color: var(--muted); }
.segment.pending::after { content: ""; display: inline-block; width: 13px; height: 13px; margin-left: 8px; border: 2px solid var(--line-strong); border-top-color: var(--primary); border-radius: 50%; vertical-align: -1px; animation: spin .8s linear infinite; }
.segment.error { padding: 11px 13px; border-left: 3px solid var(--primary); border-radius: 7px; background: var(--primary-soft); color: var(--primary-strong); font-size: 14px; }
.interim-text { margin: 19px 0 0; color: var(--muted); font-size: 18px; font-style: italic; line-height: 1.7; }

.control-dock {
  min-height: 118px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 20px 28px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 68%, transparent);
}

.session-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.timer { min-width: 42px; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 700; }
.meta-divider { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }

.record-button {
  position: relative;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.record-rings { position: absolute; inset: 0; border: 1px solid color-mix(in srgb, var(--primary) 32%, transparent); border-radius: 50%; transition: transform 200ms ease, opacity 200ms ease; }
.record-core { position: relative; z-index: 1; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: white; box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 30%, transparent); transition: transform 180ms ease, background 180ms ease; }
.record-button:hover .record-core { transform: scale(1.04); }
.record-button:active .record-core { transform: scale(.97); }
.record-button svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.stop-icon { display: none; }
.record-button.recording .record-rings { animation: record-ring 1.7s ease-out infinite; }
.record-button.recording .mic-icon { display: none; }
.record-button.recording .stop-icon { display: block; }
.record-button.recording .record-core { background: var(--ink); box-shadow: 0 8px 22px color-mix(in srgb, var(--ink) 25%, transparent); }
.record-button:disabled .record-core { background: var(--muted); box-shadow: none; }

.dock-actions { display: flex; justify-content: flex-end; gap: 14px; }
.danger-text { color: var(--primary-strong); }

.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; margin-top: 34px; padding: 0 22px; }
.trust-row > div { display: flex; align-items: flex-start; gap: 12px; }
.trust-row svg { flex: 0 0 auto; width: 21px; margin-top: 2px; fill: none; stroke: var(--green); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.trust-row span { display: flex; flex-direction: column; }
.trust-row strong { color: var(--ink); font-size: 13px; }
.trust-row small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 26px;
  max-width: min(420px, calc(100% - 32px));
  transform: translate(-50%, 24px);
  padding: 12px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.nav-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.nav-button:hover { background: var(--surface-strong); border-color: var(--line-strong); }
.nav-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: stretch;
  transition: grid-template-columns 240ms ease;
}

.workspace-layout.assistant-collapsed { grid-template-columns: minmax(0, 1fr) 68px; }

.session-bar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 55%, transparent);
}

.session-title-field { min-width: 0; display: grid; grid-template-columns: auto minmax(100px, 260px); align-items: center; gap: 0 10px; }
.session-title-field > span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.session-title-field input {
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 650 14px/1 var(--sans);
}
.session-title-field input:hover, .session-title-field input:focus { border-color: var(--line-strong); background: var(--surface); outline: 0; }
.session-title-field small { grid-column: 2; color: var(--muted); font-size: 10px; }

.coverage-switch { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.coverage-switch input { position: absolute; opacity: 0; pointer-events: none; }
.coverage-switch > span:last-child { display: flex; flex-direction: column; }
.coverage-switch strong { font-size: 12px; }
.coverage-switch small { color: var(--muted); font-size: 10px; }
.switch-track { width: 38px; height: 22px; padding: 3px; border-radius: 999px; background: var(--line-strong); transition: background 180ms ease; }
.switch-track span { display: block; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.22); transition: transform 180ms ease; }
.coverage-switch input:checked + .switch-track { background: var(--green); }
.coverage-switch input:checked + .switch-track span { transform: translateX(16px); }
.coverage-switch input:focus-visible + .switch-track { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 3px; }
.coverage-switch input:disabled + .switch-track { opacity: .42; }

.capture-badges { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.coverage-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 750;
}
.coverage-badge svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.coverage-badge[data-state="busy"] svg { animation: pulse 1s infinite; }
.coverage-badge[data-state="error"] { color: var(--primary-strong); background: var(--primary-soft); }

.save-state { margin-left: 4px; padding: 4px 7px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 700; }
.recovered-tag { display: inline-block; margin-left: 7px; padding: 2px 5px; border-radius: 4px; background: var(--green-soft); color: var(--green); font-size: 8px; letter-spacing: .02em; vertical-align: 1px; }
.live-tag, .streamed-tag { display: inline-block; margin-left: 7px; padding: 2px 5px; border-radius: 4px; font-size: 8px; letter-spacing: .02em; vertical-align: 1px; }
.live-tag { background: var(--primary-soft); color: var(--primary-strong); }
.streamed-tag { background: var(--green-soft); color: var(--green); }
.segment.live { padding-left: 11px; border-left: 2px solid var(--primary); color: var(--ink); }
.segment.live small { color: var(--primary-strong); }
.segment.live:not(.pending)::after { content: ""; display: inline-block; width: 5px; height: 1em; margin-left: 4px; background: var(--primary); vertical-align: -2px; animation: pulse 1s infinite; }

.assistant-panel {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-radius 200ms ease;
}

.assistant-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.assistant-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.assistant-title h2 { margin: 0; font-size: 16px; white-space: nowrap; }
.assistant-title .pane-kicker { margin-bottom: 0; font-size: 8px; }
.assistant-mark { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary-strong); }
.assistant-mark svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.assistant-toggle { flex: 0 0 auto; }
.assistant-content { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 17px; }
.assistant-intro { padding: 13px 14px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 12px; line-height: 1.65; }
.assistant-intro p { margin: 0; }
.quick-actions { display: flex; gap: 7px; padding: 14px 0; overflow-x: auto; scrollbar-width: none; }
.quick-actions::-webkit-scrollbar { display: none; }
.quick-actions button { min-height: 36px; flex: 0 0 auto; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-strong); color: var(--ink); font-size: 11px; font-weight: 650; cursor: pointer; }
.quick-actions button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-strong); }
.assistant-messages { min-height: 160px; max-height: 470px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 16px; }
.assistant-message { max-width: 92%; padding: 10px 12px; border-radius: 13px 13px 13px 4px; background: var(--surface-strong); color: var(--ink); font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.assistant-message.user { align-self: flex-end; border-radius: 13px 13px 4px 13px; background: var(--ink); color: var(--surface); }
.assistant-message.pending { color: var(--muted); }
.assistant-message.error { border-left: 3px solid var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.assistant-form { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.assistant-form > label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.assistant-form > div { position: relative; }
.assistant-form textarea {
  display: block;
  width: 100%;
  min-height: 76px;
  max-height: 150px;
  resize: none;
  overflow-y: auto;
  padding: 12px 64px 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-strong);
  color: var(--ink);
  font: 13px/1.6 var(--sans);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.assistant-form textarea::placeholder { color: color-mix(in srgb, var(--muted) 88%, transparent); opacity: 1; }
.assistant-form textarea:hover { border-color: color-mix(in srgb, var(--line-strong) 72%, var(--ink)); }
.assistant-form textarea:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.assistant-form button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 24%, transparent);
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}
.assistant-form button:hover:not(:disabled) { background: var(--primary-strong); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 30%, transparent); transform: translateY(-1px); }
.assistant-form button:active:not(:disabled) { box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 22%, transparent); transform: translateY(0); }
.assistant-form button:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 58%, transparent); outline-offset: 3px; }
.assistant-form button:disabled { background: color-mix(in srgb, var(--muted) 42%, var(--surface-strong)); box-shadow: none; color: color-mix(in srgb, var(--surface-strong) 78%, transparent); cursor: not-allowed; opacity: .78; transform: none; }
.assistant-form button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.assistant-form > small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.assistant-panel.collapsed .assistant-title > div, .assistant-panel.collapsed .assistant-content { display: none; }
.assistant-panel.collapsed .assistant-header { min-height: 100%; flex-direction: column; justify-content: flex-start; padding: 15px 10px; border-bottom: 0; }
.assistant-panel.collapsed .assistant-title { flex-direction: column; }
.assistant-panel.collapsed .assistant-toggle svg { transform: rotate(180deg); }

.drawer-backdrop { position: fixed; z-index: 60; inset: 0; background: rgba(5, 10, 8, .5); backdrop-filter: blur(3px); }
.history-drawer { position: fixed; z-index: 70; top: 0; right: 0; width: min(440px, 100%); height: 100dvh; display: flex; flex-direction: column; padding: 24px; border-left: 1px solid var(--line-strong); background: var(--surface); box-shadow: -20px 0 70px rgba(0,0,0,.18); transform: translateX(105%); visibility: hidden; transition: transform 240ms ease, visibility 240ms; }
.history-drawer.open { transform: translateX(0); visibility: visible; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; }
.drawer-header h2 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 500; }
.history-summary { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 13px; border-bottom: 1px solid var(--line); }
.history-summary strong { font-size: 13px; }
.history-summary span { color: var(--muted); font-size: 11px; }
.history-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 0; }
.history-item { width: 100%; min-height: 112px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-strong); color: var(--ink); text-align: left; cursor: pointer; }
.history-item:hover { border-color: var(--primary); }
.history-item-top { display: flex; justify-content: space-between; gap: 12px; }
.history-item-top strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item time { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.history-preview { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { margin-top: auto; color: var(--green); font-size: 10px; }
.history-tags { display: flex; gap: 6px; }
.history-tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-strong); font-size: 9px; font-weight: 800; }
.history-tag.language { background: var(--green-soft); color: var(--green); }
.history-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.history-empty svg { width: 45px; margin-bottom: 14px; fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.history-empty p { margin: 0 0 4px; color: var(--ink); font-weight: 650; }
.history-empty small { max-width: 260px; font-size: 11px; }
.drawer-new-button { min-height: 48px; border: 0; border-radius: 12px; background: var(--primary); color: white; font-weight: 700; cursor: pointer; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; transform: scale(.72); } }
@keyframes record-ring { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes segment-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .workspace-layout, .workspace-layout.assistant-collapsed { grid-template-columns: 1fr; }
  .assistant-panel { min-height: 500px; }
  .assistant-panel.collapsed { min-height: 68px; }
  .assistant-panel.collapsed .assistant-header { min-height: 66px; flex-direction: row; justify-content: space-between; padding: 10px 14px; }
  .assistant-panel.collapsed .assistant-title { flex-direction: row; }
  .assistant-panel.collapsed .assistant-title > div { display: block; }
  .assistant-panel.collapsed .assistant-content { display: none; }
  .assistant-messages { max-height: 360px; }
}

@media (max-width: 780px) {
  .topbar, .page-shell { width: min(100% - 28px, 680px); }
  .translation-topbar { grid-template-columns: auto 1fr; padding: 12px 0; }
  .translation-topbar .mode-switch { grid-column: 1 / -1; grid-row: 2; width: 100%; margin-top: 10px; }
  .translation-topbar .mode-switch a { flex: 1; }
  .translation-topbar .topbar-actions { justify-self: end; }
  .page-shell { padding-top: 42px; }
  .intro { grid-template-columns: 1fr; gap: 24px; margin-bottom: 34px; }
  .intro-copy { max-width: 560px; }
  .session-bar { align-items: flex-start; flex-direction: column; gap: 12px; padding: 14px 18px; }
  .session-title-field { width: 100%; grid-template-columns: auto 1fr; }
  .coverage-switch { align-self: flex-end; }
  .language-bar { grid-template-columns: 1fr 74px 1fr; padding: 0 20px; }
  .panes { grid-template-columns: 1fr; }
  .source-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .transcript { min-height: 230px; max-height: 360px; padding-inline: 22px; }
  .pane-heading { min-height: 78px; padding-inline: 22px; }
  .control-dock { grid-template-columns: 1fr auto 1fr; padding-inline: 20px; }
  .dock-actions { flex-direction: column; gap: 0; }
  .trust-row { grid-template-columns: 1fr; gap: 19px; }
  .assistant-panel { min-height: 440px; border-radius: 20px; }
}

@media (max-width: 520px) {
  .topbar { min-height: 74px; }
  .brand-mark { width: 38px; height: 38px; }
  .nav-button { width: 38px; min-height: 38px; padding: 0; justify-content: center; }
  .nav-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .status-pill { width: 38px; min-height: 38px; padding: 0; justify-content: center; }
  .status-pill span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .page-shell { padding-top: 34px; padding-bottom: 34px; }
  h1 { font-size: clamp(40px, 13vw, 58px); }
  .translator { border-radius: 20px; }
  .language-bar { min-height: 62px; padding-inline: 16px; }
  .language-label { gap: 7px; font-size: 12px; }
  .language-code { min-width: 26px; height: 26px; }
  .control-dock { grid-template-columns: 1fr auto 1fr; min-height: 108px; gap: 8px; padding: 16px 14px; }
  .session-meta { align-items: flex-start; flex-direction: column; gap: 0; }
  .save-state { display: none; }
  .meta-divider { display: none; }
  .record-button { width: 70px; height: 70px; }
  .text-button { padding-inline: 4px; font-size: 12px; }
  .trust-row { padding-inline: 8px; }
  .capture-badges { max-width: 155px; }
  .coverage-badge, .listening-badge { font-size: 9px; }
  .assistant-content { padding: 15px; }
  .assistant-form textarea { min-height: 84px; padding-right: 66px; }
  .history-drawer { padding: 18px; }
}

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