:root {
  color-scheme: dark;
  --bg: #090b0e;
  --panel: #101419;
  --panel-raised: #151a20;
  --panel-soft: #1a2027;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f7ef;
  --muted: #929aa3;
  --quiet: #68717b;
  --accent: #dcff63;
  --accent-dim: rgba(220, 255, 99, 0.12);
  --blue: #79b8ff;
  --violet: #b69cff;
  --orange: #ff9e67;
  --pink: #ff7eb6;
  --danger: #ff7b76;
  --success: #89e19c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  --speaker-0: #79b8ff;
  --speaker-1: #dcff63;
  --speaker-2: #b69cff;
  --speaker-3: #ff9e67;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 76% 18%, rgba(120, 184, 255, 0.055), transparent 32%),
    radial-gradient(circle at 12% 86%, rgba(220, 255, 99, 0.035), transparent 30%),
    var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.noise {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 78px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 60px);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 14, 0.86);
  backdrop-filter: blur(22px);
}

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

.brand-mark {
  display: flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 11px;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(220, 255, 99, 0.12);
}

.brand-mark i {
  display: block;
  width: 3px;
  border-radius: 8px;
  background: #0a0d0f;
}

.brand-mark i:nth-child(1) { height: 10px; }
.brand-mark i:nth-child(2) { height: 21px; }
.brand-mark i:nth-child(3) { height: 15px; }

.brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 820;
  letter-spacing: 0.18em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

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

.quiet-link {
  padding: 9px 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 160ms ease;
}

.quiet-link:hover { color: var(--text); }

.health-pill,
.icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.health-pill:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.065);
}

.health-pill {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0bf6a;
  box-shadow: 0 0 0 4px rgba(240, 191, 106, 0.1);
}

.health-pill.ready .health-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(137, 225, 156, 0.1);
}

.health-pill.error .health-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 123, 118, 0.1);
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
}

.icon-button svg { width: 17px; }

.app-shell {
  display: grid;
  min-height: calc(100vh - 78px);
  grid-template-columns: 370px minmax(0, 1fr);
}

.control-column {
  position: relative;
  padding: 54px 38px 44px clamp(24px, 4vw, 60px);
  border-right: 1px solid var(--line);
}

.eyebrow,
.overline,
.section-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}

.eyebrow span,
.result-kicker span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 13px rgba(220, 255, 99, 0.55);
}

.control-column h1 {
  margin: 18px 0 18px;
  font-size: clamp(38px, 3.2vw, 52px);
  font-weight: 560;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.control-column h1 em {
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.intro {
  max-width: 310px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.mode-button {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  color: var(--quiet);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: color 180ms ease, background 180ms ease;
}

.mode-button svg { width: 16px; }

.mode-button.active {
  color: var(--text);
  background: var(--panel-soft);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.mode-panel { margin-top: 15px; }

.dropzone {
  display: flex;
  width: 100%;
  min-height: 205px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.17);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: rgba(220, 255, 99, 0.5);
  background: var(--accent-dim);
  transform: translateY(-1px);
}

.drop-icon {
  display: grid;
  width: 45px;
  height: 45px;
  margin-bottom: 15px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--accent);
  background: var(--panel-raised);
}

.drop-icon svg { width: 21px; }

.drop-title {
  font-size: 13px;
  font-weight: 750;
}

.drop-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.drop-formats {
  margin-top: 19px;
  color: var(--quiet);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.selected-files {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.selected-files-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.selected-files-head > div { display: grid; min-width: 0; gap: 4px; }
.selected-files-head strong { font-size: 12px; }
.selected-files-head span { color: var(--muted); font-size: 9px; }

.selected-files-list {
  display: grid;
  max-height: 220px;
  overflow: auto;
}

.selected-file-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 12px;
}

.selected-file-row + .selected-file-row { border-top: 1px solid rgba(255,255,255,.055); }
.selected-file-row .file-type { width: 34px; height: 34px; border-radius: 8px; font-size: 8px; }

.file-type {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #0b0e11;
  background: var(--accent);
  font-size: 9px;
  font-weight: 900;
}

.file-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 4px;
}

.file-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy span {
  color: var(--muted);
  font-size: 10px;
}

.remove-file {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}

.remove-file:hover { color: var(--text); background: rgba(255,255,255,.05); }

.primary-button,
.secondary-button,
.record-button {
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.primary-button {
  display: flex;
  width: 100%;
  height: 50px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 18px;
  color: #0a0d0f;
  background: var(--accent);
  font-size: 12px;
}

.primary-button svg { width: 18px; }

.primary-button:hover:not(:disabled),
.record-button:hover,
.new-session-button:hover { transform: translateY(-1px); filter: brightness(1.04); }

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.primary-button.compact {
  width: auto;
  min-width: 130px;
  justify-content: center;
  margin: 0;
}

.secondary-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  font-size: 11px;
}

.privacy-note {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  color: var(--quiet);
  font-size: 10px;
  line-height: 1.5;
}

.privacy-note svg {
  width: 17px;
  flex: 0 0 auto;
  color: var(--success);
}

.privacy-note strong { color: var(--muted); }

.recent-section {
  margin-top: 40px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.recent-list {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}

.recent-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 29px;
  align-items: center;
  gap: 3px;
  border-radius: 9px;
}

.recent-entry:hover { background: rgba(255,255,255,.035); }

.recent-item {
  display: grid;
  width: 100%;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.recent-item:hover { background: transparent; }
.recent-item > i { width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.recent-item strong { display: block; overflow: hidden; color: var(--text); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.recent-item small { display: block; margin-top: 3px; color: var(--quiet); font-size: 8px; }
.recent-item time { font-size: 8px; }
.recent-delete {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--quiet);
  background: transparent;
  cursor: pointer;
  opacity: .55;
  transition: color 160ms ease, background 160ms ease, opacity 160ms ease;
}
.recent-delete:hover { color: var(--danger); background: rgba(255,123,118,.09); opacity: 1; }
.recent-delete:disabled { cursor: wait; opacity: .3; }
.recent-delete svg { width: 13px; }
.recent-empty { color: var(--quiet); font-size: 10px; line-height: 1.5; }

.recorder-card {
  display: flex;
  min-height: 205px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.02);
}

.recorder-visual {
  display: flex;
  height: 46px;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
}

.recorder-visual span {
  width: 4px;
  height: 12px;
  border-radius: 4px;
  background: var(--accent);
}

.recorder-card.recording .recorder-visual span {
  animation: voice 850ms ease-in-out infinite alternate;
}

.recorder-card.recording .recorder-visual span:nth-child(2) { animation-delay: -500ms; }
.recorder-card.recording .recorder-visual span:nth-child(3) { animation-delay: -200ms; }
.recorder-card.recording .recorder-visual span:nth-child(4) { animation-delay: -700ms; }
.recorder-card.recording .recorder-visual span:nth-child(5) { animation-delay: -350ms; }
.recorder-card.recording .recorder-visual span:nth-child(6) { animation-delay: -650ms; }
.recorder-card.recording .recorder-visual span:nth-child(7) { animation-delay: -100ms; }

@keyframes voice { to { height: 42px; } }

.recorder-card strong { font-size: 13px; }
.recorder-card > span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.recorder-card time { margin-top: 13px; color: var(--accent); font: 600 23px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }

.audio-source-picker {
  min-width: 0;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
}

.audio-source-picker legend { padding: 0 5px; color: var(--quiet); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.audio-source-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.audio-source-options label { min-width: 0; }
.audio-source-options input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.audio-source-options span { display: grid; min-height: 33px; place-items: center; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.025); cursor: pointer; font-size: 9px; font-weight: 800; transition: border-color 160ms ease, color 160ms ease, background 160ms ease; }
.audio-source-options span:hover { color: var(--text); background: rgba(255,255,255,.045); }
.audio-source-options input:checked + span { border-color: rgba(220,255,99,.42); color: var(--accent); background: rgba(220,255,99,.07); }
.audio-source-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.audio-source-options input:disabled + span { cursor: default; opacity: .45; }
.audio-source-picker p { min-height: 23px; margin: 8px 2px 0; color: var(--quiet); font-size: 8px; line-height: 1.4; }
.task-type-picker { margin: 18px 0 16px; }
.task-type-picker .audio-source-options { grid-template-columns: repeat(2, 1fr); }

.record-button {
  display: flex;
  width: 100%;
  height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 10px;
  color: #0a0d0f;
  background: var(--accent);
  font-size: 12px;
}

.record-button.stopping { background: var(--orange); }
.record-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.record-button.stopping .record-dot { border-radius: 2px; }
#cancelRecordingButton { width: 100%; margin-top: 8px; }

.workspace {
  position: relative;
  min-width: 0;
  padding: clamp(28px, 5vw, 72px);
}

.empty-state {
  display: grid;
  min-height: calc(100vh - 222px);
  place-items: center;
  align-content: center;
  text-align: center;
}

.signal-art {
  position: relative;
  width: 230px;
  height: 230px;
  margin-bottom: 25px;
}

.signal-ring {
  position: absolute;
  inset: 0;
  margin: auto;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 50%;
}

.ring-one { width: 100%; height: 100%; animation: drift 10s linear infinite; border-style: dashed; }
.ring-two { width: 73%; height: 73%; border-color: rgba(220,255,99,.12); }
.ring-three { width: 47%; height: 47%; background: rgba(220,255,99,.025); }

@keyframes drift { to { transform: rotate(360deg); } }

.signal-core {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.signal-core i {
  width: 5px;
  border-radius: 5px;
  background: var(--accent);
  box-shadow: 0 0 17px rgba(220,255,99,.15);
}

.signal-core i:nth-child(1), .signal-core i:nth-child(5) { height: 18px; }
.signal-core i:nth-child(2), .signal-core i:nth-child(4) { height: 39px; }
.signal-core i:nth-child(3) { height: 64px; }

.empty-copy h2 {
  margin: 11px 0 13px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 520;
  letter-spacing: -0.055em;
  line-height: 1;
}

.empty-copy p {
  max-width: 470px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 34px;
  color: var(--quiet);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
}

.feature-row b { margin-right: 7px; color: var(--accent); font-weight: 800; }

.processing-view,
.batch-view,
.result-view {
  width: min(100%, 1120px);
  margin: 0 auto;
  animation: reveal 340ms ease both;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(8px); }
}

.processing-view {
  display: flex;
  min-height: calc(100vh - 222px);
  flex-direction: column;
  justify-content: center;
}

.batch-view { padding: 28px 0 60px; }
.batch-head { align-items: center; }
.batch-counter {
  min-width: 78px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--accent);
  background: var(--panel);
  font: 750 12px/1 ui-monospace, monospace;
  text-align: center;
}
.batch-overall-progress {
  height: 5px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255,255,255,.07);
}
.batch-overall-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 280ms ease;
}
.batch-hint { max-width: 760px; margin: 16px 0 26px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.batch-job-list { display: grid; gap: 9px; }
.batch-job {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(150px, 230px) 84px;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.batch-job.failed { border-color: rgba(255,123,118,.25); }
.batch-job.completed { border-color: rgba(137,225,156,.23); }
.batch-job-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-dim);
  font: 750 10px/1 ui-monospace, monospace;
}
.batch-job-copy { min-width: 0; }
.batch-job-copy strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.batch-job-copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.batch-job-progress { min-width: 0; }
.batch-job-progress span { display: flex; justify-content: space-between; gap: 8px; color: var(--quiet); font-size: 8px; }
.batch-job-progress div { height: 4px; margin-top: 8px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.07); }
.batch-job-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 280ms ease; }
.batch-job.failed .batch-job-progress i { background: var(--danger); }
.batch-job.completed .batch-job-progress i { background: var(--success); }
.batch-open {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--panel-soft);
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}
.batch-open:disabled { cursor: default; opacity: .4; }

.processing-head,
.result-header,
.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.processing-head h2,
.result-header h2 {
  max-width: 700px;
  overflow: hidden;
  margin: 10px 0 0;
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 560;
  letter-spacing: -.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.processing-badge {
  display: grid;
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  background: var(--panel);
  font: 700 13px/1 ui-monospace, monospace;
}

.wave-loader {
  display: flex;
  height: 116px;
  align-items: center;
  gap: 3px;
  margin: 46px 0;
  overflow: hidden;
}

.wave-loader i {
  min-width: 3px;
  flex: 1;
  border-radius: 4px;
  background: linear-gradient(to top, rgba(220,255,99,.18), var(--accent));
  opacity: .76;
  animation: pulsebar 1.5s ease-in-out infinite alternate;
}

@keyframes pulsebar { to { transform: scaleY(.46); opacity: .25; } }

.pipeline {
  display: grid;
  grid-template-columns: max-content 1fr max-content 1fr max-content 1fr max-content;
  align-items: center;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 11px;
  opacity: .32;
  transition: opacity 240ms ease;
}

.pipeline-step i {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
}

.pipeline-step span { display: grid; gap: 3px; }
.pipeline-step b { font-size: 10px; }
.pipeline-step small { color: var(--muted); font-size: 8px; }
.pipeline-step.active, .pipeline-step.done { opacity: 1; }
.pipeline-step.active i { border-color: var(--accent); color: #0b0e11; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-dim); }
.pipeline-step.done i { border-color: rgba(137,225,156,.5); color: var(--success); }
.pipeline-line { height: 1px; margin: 0 16px; background: var(--line); }

.processing-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.processing-footer code { margin-left: auto; color: var(--quiet); font-size: 8px; }
.spinner { width: 11px; height: 11px; border: 1px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.live-transcript { margin-top: 28px; padding: 22px; border-left: 2px solid var(--accent); background: rgba(255,255,255,.025); }
.live-transcript p { margin: 10px 0 0; white-space: pre-wrap; font: 400 22px/1.5 Georgia, serif; }
.live-transcript .partial { color: var(--muted); font-style: italic; }

.result-view { padding-bottom: 60px; }
.result-kicker { display: flex; align-items: center; gap: 9px; color: var(--success); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.result-kicker span { background: var(--success); }
.result-meta { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.result-meta span + span::before { content: "·"; margin-right: 15px; color: var(--quiet); }

.new-session-button {
  display: flex;
  height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.new-session-button svg { width: 15px; }
.result-actions { display: flex; align-items: center; gap: 8px; }

.media-preview {
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.media-preview audio { display: block; width: 100%; height: 45px; }
.media-preview video { display: block; width: 100%; max-height: 360px; background: #000; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat {
  display: grid;
  min-height: 92px;
  align-content: center;
  gap: 8px;
  padding: 0 24px;
  border-right: 1px solid var(--line);
}

.stat:last-child { border-right: 0; }
.stat small { color: var(--quiet); font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.stat strong { font-size: 22px; font-weight: 540; letter-spacing: -.03em; }

.timeline-card,
.transcript-card,
.export-card,
.warnings-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.timeline-card { margin-top: 18px; padding: 25px; }
.card-heading h3, .export-card h3 { margin: 7px 0 0; font-size: 18px; font-weight: 600; letter-spacing: -.025em; }
.speaker-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.legend-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--speaker-color); }

.timeline { display: grid; gap: 10px; margin-top: 25px; }
.timeline-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 13px; }
.timeline-label { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-track { position: relative; height: 21px; border-radius: 5px; background: rgba(255,255,255,.035); }
.timeline-block { position: absolute; top: 3px; bottom: 3px; min-width: 3px; border-radius: 3px; background: var(--speaker-color); opacity: .82; cursor: pointer; transition: opacity 160ms ease, transform 160ms ease; }
.timeline-block:hover { z-index: 2; opacity: 1; transform: scaleY(1.25); }
.timeline-axis { position: relative; height: 15px; margin-left: 75px; color: var(--quiet); font: 8px/1 ui-monospace, monospace; }
.timeline-axis span { position: absolute; transform: translateX(-50%); }

.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; margin-top: 18px; align-items: start; }
.transcript-card { min-width: 0; overflow: hidden; }
.transcript-heading { padding: 25px 25px 20px; border-bottom: 1px solid var(--line); }
.text-button { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; font-weight: 750; }
.text-button:hover { color: var(--text); background: rgba(255,255,255,.04); }
.text-button svg { width: 14px; }

.transcript-list { max-height: 630px; overflow-y: auto; scrollbar-color: var(--line-strong) transparent; }
.transcript-segment { position: relative; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 16px; padding: 21px 25px; border-bottom: 1px solid var(--line); transition: background 160ms ease; }
.transcript-segment:last-child { border-bottom: 0; }
.transcript-segment:hover { background: rgba(255,255,255,.018); }
.segment-aside { display: grid; align-content: start; gap: 7px; }
.segment-time { border: 0; padding: 0; color: var(--quiet); background: transparent; cursor: pointer; font: 9px/1 ui-monospace, monospace; text-align: left; }
.segment-time:hover { color: var(--text); }
.speaker-tag { display: flex; align-items: center; gap: 6px; color: var(--speaker-color); font-size: 9px; font-weight: 800; }
.speaker-tag:is(button) { width: fit-content; padding: 2px 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.speaker-tag:is(button):hover { text-decoration: underline; text-underline-offset: 3px; }
.speaker-tag i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.segment-text { margin: 0; color: #e8eae3; font: 400 17px/1.65 Georgia, "Times New Roman", serif; }
.segment-flags { display: flex; gap: 6px; margin-top: 8px; }
.segment-flag { padding: 3px 6px; border-radius: 4px; color: var(--orange); background: rgba(255,158,103,.08); font-size: 7px; font-weight: 800; letter-spacing: .08em; }
.empty-transcript { padding: 45px 25px; color: var(--muted); text-align: center; font-size: 12px; }

.export-card { position: sticky; top: 98px; padding: 24px; }
.export-card > p { margin: 9px 0 19px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.export-list { display: grid; gap: 6px; }
.export-list button { display: grid; min-height: 48px; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(255,255,255,.018); cursor: pointer; text-align: left; transition: border-color 160ms ease, background 160ms ease; }
.export-list button:hover { border-color: rgba(220,255,99,.3); background: var(--accent-dim); }
.export-list b { color: var(--accent); font: 800 9px/1 ui-monospace, monospace; }
.export-list span { color: var(--muted); font-size: 9px; }
.export-list i { color: var(--quiet); font-style: normal; }
.model-note { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.model-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #0b0e11; background: var(--accent); font-size: 11px; font-weight: 900; }
.model-note > span:last-child { display: grid; gap: 3px; }
.model-note b { font-size: 8px; }
.model-note small { color: var(--quiet); font-size: 7px; }

.warnings-card { margin-top: 18px; padding: 20px 24px; border-color: rgba(255,158,103,.25); }
.warnings-card strong { color: var(--orange); font-size: 11px; }
.warnings-card ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 10px; line-height: 1.6; }

.settings-dialog {
  width: min(92vw, 480px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 19px;
  color: var(--text);
  background: var(--panel-raised);
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
}

.settings-dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(5px); }
.settings-dialog form { max-height: min(86vh, 760px); overflow-y: auto; padding: 27px; }
.settings-dialog header { display: flex; align-items: flex-start; justify-content: space-between; }
.settings-dialog h2 { margin: 7px 0 0; font-size: 23px; font-weight: 560; letter-spacing: -.035em; }
.settings-dialog p { margin: 20px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.settings-dialog label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.dialog-close { width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.04); cursor: pointer; font-size: 20px; }
.secret-field { display: flex; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); }
.secret-field:focus-within { border-color: rgba(220,255,99,.4); }
.secret-field input { min-width: 0; height: 45px; flex: 1; padding: 0 13px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11px; }
.secret-field button { border: 0; padding: 0 12px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.memory-choice { display: flex !important; align-items: flex-start; gap: 10px; margin-top: 17px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.018); cursor: pointer; letter-spacing: 0 !important; text-transform: none !important; }
.memory-choice input { margin-top: 2px; accent-color: var(--accent); }
.memory-choice span { display: grid; gap: 4px; }
.memory-choice b { color: var(--text); font-size: 10px; }
.memory-choice small { color: var(--quiet); font-size: 8px; font-weight: 500; line-height: 1.45; }

.voice-memory-panel { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.voice-memory-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.voice-memory-heading h3 { margin: 7px 0 0; font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.memory-refresh { padding: 6px 8px; border: 0; border-radius: 7px; color: var(--quiet); background: transparent; cursor: pointer; font-size: 8px; font-weight: 750; }
.memory-refresh:hover { color: var(--text); background: rgba(255,255,255,.04); }
.voice-profile-list { display: grid; gap: 7px; margin-top: 13px; }
.voice-profile-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); }
.voice-profile-copy { min-width: 0; }
.voice-profile-copy strong { display: block; overflow: hidden; color: var(--text); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.voice-profile-copy small { display: block; margin-top: 4px; color: var(--quiet); font-size: 8px; line-height: 1.35; }
.voice-profile-delete { padding: 7px 9px; border: 1px solid rgba(255,123,118,.16); border-radius: 8px; color: var(--danger); background: rgba(255,123,118,.045); cursor: pointer; font-size: 8px; font-weight: 800; }
.voice-profile-delete:hover { border-color: rgba(255,123,118,.35); background: rgba(255,123,118,.1); }
.voice-profile-delete:disabled { cursor: wait; opacity: .45; }
.voice-profile-empty { margin: 0 !important; padding: 16px 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--quiet) !important; text-align: center; }

.confirm-dialog { width: min(92vw, 420px); }
.confirm-dialog p { margin-bottom: 0; }
.danger-button { min-height: 40px; padding: 0 16px; border: 1px solid rgba(255,123,118,.32); border-radius: 10px; color: #160c0b; background: var(--danger); cursor: pointer; font-size: 9px; font-weight: 850; }
.danger-button:hover { filter: brightness(1.08); }

.toast {
  position: fixed;
  z-index: 50;
  right: 25px;
  bottom: 25px;
  display: flex;
  min-width: 250px;
  max-width: 420px;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #1a2027;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 11px;
}

.toast.visible { opacity: 1; transform: translateY(0); }
.toast > span:first-child { color: var(--accent); font-weight: 900; }
.toast.error > span:first-child { color: var(--danger); }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 320px minmax(0, 1fr); }
  .control-column { padding-right: 26px; padding-left: 28px; }
  .workspace { padding: 42px 30px; }
  .pipeline-step small { display: none; }
  .batch-job { grid-template-columns: 40px minmax(0, 1fr) 180px 76px; }
  .result-grid { grid-template-columns: 1fr; }
  .export-card { position: static; }
  .export-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .topbar { height: 68px; padding: 0 18px; }
  .brand-copy small, .quiet-link { display: none; }
  .app-shell { display: block; }
  .control-column { padding: 32px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .control-column h1 { font-size: 40px; }
  .intro { max-width: 520px; }
  .dropzone { min-height: 170px; }
  .recent-section { margin-top: 28px; }
  .workspace { padding: 42px 20px; }
  .empty-state, .processing-view, .batch-view { min-height: 550px; }
  .signal-art { width: 180px; height: 180px; }
  .pipeline { grid-template-columns: 1fr; gap: 12px; }
  .pipeline-line { display: none; }
  .pipeline-step { padding: 9px; border-bottom: 1px solid var(--line); }
  .batch-job { grid-template-columns: 36px minmax(0, 1fr) 72px; }
  .batch-job-progress { grid-column: 2 / -1; }
  .processing-footer { align-items: flex-start; flex-wrap: wrap; }
  .processing-footer code { width: 100%; margin-left: 21px; overflow: hidden; text-overflow: ellipsis; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .result-header { align-items: flex-start; }
  .new-session-button { width: 40px; padding: 0; justify-content: center; }
  .new-session-button { font-size: 0; }
  .speaker-legend { justify-content: flex-start; }
  .card-heading { flex-direction: column; }
  .transcript-heading { flex-direction: row; }
}

@media (max-width: 480px) {
  .health-pill { width: 36px; padding: 0; justify-content: center; }
  .health-pill span:last-child { display: none; }
  .workspace { padding-right: 13px; padding-left: 13px; }
  .processing-head h2, .result-header h2 { max-width: 240px; font-size: 27px; }
  .processing-badge { width: 58px; height: 58px; }
  .batch-head { align-items: flex-start; }
  .batch-counter { min-width: 64px; padding: 10px; }
  .batch-job { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .batch-job-progress { grid-column: 1 / -1; }
  .batch-open { grid-column: 1 / -1; }
  .timeline-card, .transcript-heading { padding: 19px; }
  .transcript-segment { grid-template-columns: 1fr; gap: 10px; padding: 19px; }
  .segment-aside { display: flex; align-items: center; justify-content: space-between; }
  .export-list { grid-template-columns: 1fr; }
  .toast { right: 13px; bottom: 13px; left: 13px; min-width: 0; }
}

.speaker-count {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 13px;
}
.speaker-count input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
}
.speaker-count.hidden { display: none; }

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