/* Public text and audio workspaces share the TM다움 Management layout. */
@font-face {
  font-family: Pretendard;
  src: url("/assets/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: optional;
}

:root {
  --font: Pretendard, "Noto Sans KR", "Malgun Gothic", "Segoe UI", sans-serif;
  --ink: var(--gray-100);
  --text: var(--gray-70);
  --muted: var(--gray-70);
  --line: var(--gray-18);
  --brand-blue: var(--primary-blue);
  --blue: var(--primary-blue);
  --blue-dark: var(--primary-blue);
  --blue-soft: var(--blue-tint);
  --radius: 16px;
}

body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 100dvh;
  align-items: start;
  letter-spacing: -.012em;
}

.app-header {
  position: sticky;
  top: 0;
  display: flex;
  flex-flow: column nowrap;
  align-items: stretch;
  justify-content: flex-start;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow-y: auto;
  padding: 32px 16px 20px;
  gap: 0;
  border: 0;
  border-right: 1px solid var(--line);
}

.brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 0 12px;
}

.brand img { width: 80px; height: auto; }
.app-header .module-name { display: inline; font-weight: 500; color: var(--muted); }

.mode-nav {
  display: grid;
  gap: 6px;
  margin: 32px 0 24px;
  border: 0;
}

.mode-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.mode-nav a:hover { background: var(--canvas); }
.mode-nav a[aria-current="page"] { background: var(--blue-soft); color: var(--blue); }
.mode-nav .icon { width: 19px; height: 19px; }
.mode-nav .subtle { margin-left: auto; font-size: 11px; font-weight: 500; }

.header-actions {
  flex: none;
  flex-flow: column nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  margin-top: auto;
  padding: 18px 10px 0;
  border-top: 1px solid var(--line);
}

/* Keep the session response from changing the header geometry. */
.session-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 18px 18px minmax(26px, auto);
  align-items: center;
  justify-items: start;
  gap: 4px;
  width: 100%;
}
.session-summary .connection-status { grid-row: 1; }
.session-summary .logged-user { grid-row: 2; max-width: 100%; }
.session-summary .quota-remaining { grid-row: 3; }
.session-links {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  grid-template-rows: minmax(48px, auto) minmax(36px, auto);
  align-items: center;
  justify-items: start;
  column-gap: 8px;
  width: 100%;
}
.session-links .guide-trigger { grid-area: 1 / 1; }
.session-links .session-login { grid-area: 2 / 1; }
.session-links #admin-link { grid-area: 1 / 2; white-space: normal; }
.session-links #logout-button { grid-area: 2 / 2; }
.header-actions .text-button { min-height: 32px; text-decoration: none; }
.header-actions .quota-remaining { white-space: normal; }
.page { width: 100%; max-width: 1536px; min-width: 0; padding: 36px clamp(20px, 2.6vw, 48px) 0; }
.page-heading { gap: 14px; }
.page-heading h1 { font: 600 23px/1.4 var(--font); letter-spacing: -.025em; }
.page-description { max-width: none; margin-top: 5px; color: var(--muted); font: 500 15px/1.5 var(--font); }
.scope-label { margin: 0; white-space: nowrap; border-radius: 8px; }
.retention-description { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.workflow {
  margin: 22px 0;
  background: white;
  border-radius: 12px;
}
.workflow li { padding: 13px 16px; gap: 9px; }
.workflow li:not(:last-child)::after { width: 1px; height: 20px; border: 0; background: var(--line); transform: translateY(-50%); }
.workflow .step-number { background: var(--canvas); color: var(--muted); border: 0; font-weight: 600; }
.workflow li.active .step-number, .workflow li[aria-current="step"] .step-number { background: var(--blue); color: white; }

.workbench { grid-template-columns: minmax(248px, 29%) minmax(0, 1fr); gap: 20px; }
.workbench > * { min-width: 0; }
.panel { border-color: var(--line); }
.panel-heading h2, .result-heading h2 { font: 600 18px/1.4 var(--font); }
.result-heading { flex-wrap: wrap; gap: 12px; }
.result-heading p { color: var(--muted); }
.drop-zone {
  min-height: 148px;
  padding: 16px 8px;
  background: var(--sky-blue);
  border: 1px dashed var(--gray-18);
  border-radius: 12px;
}
.drop-zone:hover:not(:disabled), .drop-zone.drag-over { border-color: var(--brand-blue); background: var(--blue-soft); }
.upload-icon { width: 35px; height: 35px; color: var(--blue); background: var(--blue-soft); }
.drop-zone strong { font-size: 15px; }
.drop-zone small { color: var(--muted); }
select, .primary-button, .secondary-button, .sample-button { border-radius: 8px; }
.field label, .sample-button, .speech-language { font-size: 14px; }
.primary-button, .secondary-button { min-height: 40px; }
.result-actions { flex-wrap: wrap; }
.empty-state { min-height: clamp(300px, 48vh, 560px); padding: 32px 20px; }
.empty-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--blue-soft); color: var(--blue); }
.empty-state h3 { margin-top: 14px; font: 600 18px/1.4 var(--font); }
.empty-state p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.speech-actions { grid-column: 1 / -1; }
.speech-actions a { white-space: normal; }

@media (max-width: 1320px) {
  .step-caption { display: none; }
}

@media (max-width: 1100px) {
  body { display: block; }
  .app-header {
    position: static;
    display: grid;
    grid-template-columns: auto minmax(220px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    height: auto;
    min-height: 64px;
    overflow: visible;
    padding: 8px 20px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0; }
  .app-header .module-name { display: none; }
  .mode-nav { display: flex; gap: 4px; margin: 0; }
  .mode-nav a { min-height: 42px; }
  .header-actions { align-items: flex-end; gap: 0; margin: 0; padding: 0; border: 0; }
  .session-summary {
    width: min(100%, 330px);
    grid-template-columns: minmax(0, 1fr) minmax(0, .65fr) minmax(0, 1.5fr);
    grid-template-rows: minmax(28px, auto);
    column-gap: 4px;
  }
  .session-summary .connection-status { grid-area: 1 / 1; max-width: 100%; }
  .session-summary .logged-user { grid-area: 1 / 2; }
  .session-summary .quota-remaining { grid-area: 1 / 3; justify-self: end; }
  .session-links { display: flex; flex-flow: row wrap; justify-content: flex-end; align-items: center; gap: 0 12px; }
  .session-links #admin-link, .session-links #logout-button { order: -1; }
  .page { padding-top: 26px; }
}

@media (max-width: 900px) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .file-panel:not(:has(.processing-note)) { display: block; }
}

@media (max-width: 800px) {
  .app-header { grid-template-columns: auto minmax(0, 1fr); padding: 10px 16px 8px; gap: 6px 12px; }
  .header-actions { display: contents; }
  .session-links { grid-area: 1 / 2; }
  .session-summary { grid-area: 2 / 1 / 3 / -1; width: 100%; }
  .header-actions .text-button { min-height: 36px; }
  .mode-nav { grid-column: 1 / -1; grid-row: 3; }
  .mode-nav a { flex: 1; justify-content: center; min-height: 42px; padding: 8px; font-size: 14px; }
  .mode-nav .subtle { margin-left: 0; }
}

@media (max-width: 700px) {
  .page { padding: 22px 14px 0; }
  .page-description { font-size: 14px; }
  .page-heading { align-items: flex-start; }
  .workflow { margin: 16px 0; }
  .workflow li { justify-content: center; padding: 10px 4px; gap: 5px; }
  .workflow strong { font-size: 12px; }
  .workbench { gap: 14px; }
  .empty-state { min-height: 240px; }
  .result-heading { align-items: flex-start; }
}

@media (max-width: 420px) {
  .session-summary {
    grid-area: 1 / 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 18px minmax(25px, auto);
  }
  .session-summary .logged-user { justify-self: end; }
  .session-summary .quota-remaining { grid-area: 2 / 1 / 3 / -1; }
  .session-links { grid-area: 2 / 1 / 3 / -1; }
}

@media (max-width: 380px) {
  .mode-nav a { gap: 5px; }
  .scope-label { padding: 5px; }
}

.trial-link { display: inline-block; padding: 5px 12px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-weight: 650; }

/* ───────────────────────────────────────────────────────────────
   TM다움 alignment (#954 design pass)
   Colors and type follow the TM다움 Management tokens:
   primary #2d80ff, ink #031832 with alpha grays, mint #24cea7 for done,
   red #ef4444 for failure; captions 13–14px, body 14–16px.
   ─────────────────────────────────────────────────────────────── */
/* Page-level aliases. Every value is a TM다움 token defined at the top of style.css. */
:root {
  --primary-ink: var(--primary-blue);
  --primary-tint: var(--blue-tint);
  --primary-wash: var(--sky-blue);
  --mint-ink: var(--mint);
  --red: var(--primary-red);
  --red-ink: var(--primary-red);
  --green: var(--mint);
  --green-soft: var(--mint-tint);
}

/* Buttons */
.primary-button { background: var(--primary); border-color: var(--primary); font-size: 14px; font-weight: 600; }
.primary-button:hover:not(:disabled) { opacity: .88; filter: none; }
.primary-button:disabled { opacity: 1; background: var(--gray-18); border-color: var(--gray-18); color: var(--white); }
.process-button { min-height: 48px; margin-top: 16px; border-radius: 10px; font-size: 15px; }
.secondary-button { border-radius: 8px; font-size: 14px; font-weight: 600; }
.text-button { color: var(--primary-ink); }

/* Stepper */
.workflow li.active strong, .workflow li[aria-current="step"] strong { color: var(--ink); }
.workflow li.active .step-number, .workflow li[aria-current="step"] .step-number { background: var(--primary); }
.workflow li.done .step-number { background: var(--mint-tint); color: var(--mint-ink); }
.workflow strong { font-size: 14px; font-weight: 600; }
.step-caption { font-size: 13px; color: var(--gray-46); }

/* Left panel: language and encoding on one line each, sample as the first-time path */
.file-controls { display: grid; gap: 14px; padding: 20px; }
.file-controls > * { margin: 0; }
.inline-field { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 10px; }
.field label { font-size: 13px; color: var(--gray-70); }
select { min-height: 40px; border-color: var(--gray-18); border-radius: 8px; font-size: 14px; color: var(--ink); }
select:disabled { background: var(--gray-5); color: var(--gray-46); }
.drop-zone { min-height: 136px; background: var(--primary-wash); border-color: var(--gray-18); }
.drop-zone strong { font-size: 15px; color: var(--ink); }
.drop-zone small, .drop-zone > span { font-size: 12px; color: var(--gray-46); }
.upload-icon { color: var(--primary); background: var(--primary-tint); }
.sample-actions { gap: 6px; margin: 0; }
.sample-cta {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px; align-items: center; gap: 10px;
  padding: 12px; border: 1px solid var(--gray-18); border-radius: 10px; background: var(--white);
  color: var(--ink); text-align: left;
}
.sample-cta:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-wash); filter: none; }
.sample-cta-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--mint-tint); color: var(--mint-ink); }
.sample-cta-icon .icon { width: 18px; height: 18px; }
.sample-cta-copy { display: grid; gap: 2px; min-width: 0; }
.sample-cta-copy > span { font-size: 14px; font-weight: 600; }
.sample-cta-copy small { font-size: 12px; font-weight: 500; color: var(--gray-46); }
.sample-cta > .icon { color: var(--primary); }
.sample-link {
  justify-content: flex-start; width: auto; padding: 4px 2px; border: 0; background: none;
  color: var(--primary-ink); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.sample-link:hover:not(:disabled) { background: none; }
.sample-tip { font-size: 12px; line-height: 1.55; color: var(--gray-46); }
.file-details { padding: 10px 12px; margin: 0; border: 1px solid var(--gray-18); border-radius: 10px; background: var(--gray-5); }
.file-type { background: var(--white); color: var(--primary-ink); border-color: var(--gray-18); font-size: 10px; }
.file-meta strong { font-size: 14px; color: var(--ink); }
.file-meta span { font-size: 12px; color: var(--gray-46); }

/* Why the start button is disabled for a guest who has not registered */
.start-hint {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 4px 8px; align-items: start;
  margin: -4px 0 0; padding: 12px; border-radius: 10px; background: var(--primary-wash);
  color: var(--gray-70); font-size: 13px; line-height: 1.5;
}
.start-hint[hidden] { display: none; }
.start-hint > .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--primary); }
.start-hint a { grid-column: 2; justify-self: start; color: var(--primary-ink); font-weight: 650; text-underline-offset: 3px; }

/* Notes under the controls: readable size, quieter frame */
.processing-note { gap: 10px; padding: 16px 20px; background: var(--gray-5); border-color: var(--line); }
.processing-note > .icon { width: 16px; height: 16px; color: var(--gray-46); }
.processing-note strong { font-size: 13px; color: var(--gray-70); }
.processing-note p { font-size: 12px; line-height: 1.6; color: var(--gray-46); }
.tag-explainer { padding: 20px; }
.micro-label { font-size: 12px; color: var(--gray-46); }
.tag-explainer h3 { font-size: 15px; font-weight: 600; }
.tag-example { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: var(--gray-5); font-size: 12px; color: var(--gray-70); }
.tag-explainer p { font-size: 12px; line-height: 1.65; color: var(--gray-46); }
.tag-explainer .text-button { margin-top: 10px; font-size: 13px; }
code { color: var(--primary-ink); }

/* Result header and status badges */
.result-heading p { font-size: 13px; }
.result-badge { padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.result-badge.working { color: var(--primary-ink); background: var(--primary-tint); }
.result-badge.success { color: var(--mint-ink); background: var(--mint-tint); }
.result-badge.failure { color: var(--red-ink); background: var(--red-tint); }

/* Empty state: one clear action and what will happen */
.empty-state { gap: 0; }
.empty-icon { background: var(--primary-tint); color: var(--primary); }
.empty-sample { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; padding: 0 16px; border: 1px solid var(--primary); background: var(--white); color: var(--primary-ink); }
.empty-sample:hover:not(:disabled) { background: var(--primary-wash); }
.empty-sample .icon { width: 16px; height: 16px; }
.empty-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(100%, 640px); margin: 28px 0 0; padding: 0; list-style: none; text-align: left; }
.empty-points li { display: grid; gap: 4px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.empty-points strong { font-size: 13px; color: var(--primary-ink); }
.empty-points span { font-size: 13px; line-height: 1.55; color: var(--gray-70); word-break: keep-all; }
.empty-points code { font-size: 12px; }
.file-prepared .empty-sample, .file-prepared .empty-points { display: none; }

/* Processing: show where the job is, not just a spinner */
.job-status-section { padding: 20px 24px; background: var(--white); }
.job-status-heading strong { font-size: 15px; }
.job-status-heading p { font-size: 13px; }
.spinner { border-color: var(--primary-tint); border-top-color: var(--primary); }
.spinner.complete { border-color: var(--mint); background: var(--mint-tint); }
.spinner.failed { border-color: var(--red); background: var(--red-tint); }
.job-details { font-size: 12px; }
.job-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: stage; }
.job-stages[hidden] { display: none; }
.job-stages li { position: relative; display: grid; gap: 8px; padding-top: 12px; border-top: 3px solid var(--gray-18); color: var(--gray-46); font-size: 13px; font-weight: 500; }
.job-stages li.done { border-top-color: var(--mint); color: var(--gray-70); }
.job-stages li.current { border-top-color: var(--primary); color: var(--ink); font-weight: 650; }

/* Summary metrics */
.result-summary { display: flex; flex-wrap: wrap; gap: 16px 0; padding: 20px 24px; }
.result-summary > div { flex: 0 0 auto; min-width: 104px; padding-right: 22px; }
.result-summary > div[hidden] { display: none; }
.result-summary > .summary-explanation { flex: 1 1 260px; }
.metric-label { font-size: 13px; color: var(--gray-46); }
.result-summary p > strong { font-size: 26px; font-weight: 700; }
.result-summary p > span { font-size: 13px; color: var(--gray-46); }
.summary-explanation p > strong { font-size: 13px; line-height: 1.5; }
.summary-explanation p > span { font-size: 12px; color: var(--gray-46); }
.mini-check { background: var(--mint-tint); color: var(--mint-ink); }

/* Tabs and filters */
.workspace-toolbar { background: var(--white); }
.tabs button { font-size: 14px; color: var(--gray-46); }
.tabs button[aria-selected=true] { color: var(--ink); }
.tabs button[aria-selected=true]::after { background: var(--primary); }
.tabs button span { font-size: 11px; background: var(--gray-5); color: var(--gray-70); }
.sample-label { font-size: 12px; border-radius: 6px; color: var(--gray-70); background: var(--gray-5); border-color: var(--line); }
.filter-row { gap: 6px; min-height: 0; padding: 12px 24px; }
.filter-chip { min-height: 32px; padding: 6px 12px; border-color: var(--gray-18); border-radius: 999px; color: var(--gray-70); font-size: 13px; }
.filter-chip span { font-size: 12px; color: var(--gray-46); }
.filter-chip.active { color: var(--white); background: var(--ink); border-color: var(--ink); }
.filter-chip.active span { color: var(--white); }

/* Transcripts */
.transcript-title { font-size: 13px; color: var(--gray-70); }
.transcript-title .subtle { font-size: 12px; }
.original-dot { background: var(--primary-red); }
.masked-dot { background: var(--primary); }
.speaker { font-size: 12px; color: var(--gray-46); }
.utterance.customer .speaker { color: var(--primary-ink); }
.utterance { font-size: 14px; color: var(--ink); }
.pii { background: var(--red-tint); color: var(--primary-red); }
.redacted-tag { padding: 2px 6px; border-radius: 6px; background: var(--primary-tint); color: var(--primary-ink); font: 600 12.5px/1.9 var(--font); }
.result-footer, .page-footer { font-size: 12px; color: var(--gray-46); }
th { font-size: 12px; color: var(--gray-46); }
td { font-size: 13px; color: var(--gray-70); }

/* Sidebar session block */
.quota-remaining { font-size: 12px; }
.connection-status, .logged-user { font-size: 12px; }

@media (max-width: 900px) {
  .empty-points { grid-template-columns: minmax(0, 1fr); }
  .job-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
}
@media (max-width: 700px) {
  .result-summary > div { min-width: 0; flex: 1 1 30%; padding-right: 12px; }
  .result-summary > .summary-explanation { flex-basis: 100%; }
  .filter-row, .result-heading, .job-status-section { padding-left: 16px; padding-right: 16px; }
}
.start-hint:not(:has(> .icon)) { grid-template-columns: minmax(0, 1fr); }
.start-hint:not(:has(> .icon)) a { grid-column: 1; }
.speech-process + .start-hint { margin-top: 10px; }
.workflow strong { word-break: keep-all; }
@media (max-width: 700px) {
  .workflow strong { font-size: 12px; line-height: 1.35; }
  .inline-field { grid-template-columns: 64px minmax(0, 1fr); }
}

/* Free-trial card at the bottom of the sidebar (same shape as a sidebar promo card):
   white card, round grey icon, bold title, grey copy; the whole card opens the trial form. */
.header-actions { border-top: 0; padding-top: 0; }
.trial-card {
  position: relative; display: grid; gap: 12px; width: calc(100% + 12px); margin: 0 -6px 16px; padding: 16px;
  border: 1px solid var(--gray-18); border-radius: 16px; background: var(--white);
  box-shadow: 0 1px 2px rgb(3 24 50 / .04);
  transition: background-color .15s;
}
.trial-card:has(.trial-link:not([hidden])):hover { background: var(--canvas); }
.trial-card-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--gray-5); color: var(--gray-70); }
.trial-card-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.trial-card-body { display: grid; gap: 4px; min-width: 0; }
.trial-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.trial-card-head strong { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.trial-card .quota-remaining { padding: 0; border-radius: 0; background: none; color: var(--primary-ink); font-size: 12px; font-weight: 650; white-space: nowrap; }
.trial-card .quota-remaining[hidden], .trial-card .trial-link[hidden] { display: none; }
.trial-card-rules { margin: 0; color: var(--gray-46); font-size: 13px; line-height: 1.5; word-break: keep-all; }
.trial-card-rules span { display: block; margin-top: 4px; font-size: 12px; }
.trial-card .trial-link {
  display: inline-flex; align-items: center; gap: 4px; width: fit-content; margin-top: 6px; padding: 0;
  border-radius: 0; background: none; color: var(--primary-ink); font-size: 13px; font-weight: 650; text-decoration: none;
}
.trial-card .trial-link::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.trial-card .trial-link:focus-visible { outline: none; }
.trial-card:has(.trial-link:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.trial-card .trial-link {
  padding-right: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232d80ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14m-5-5 5 5-5 5'/%3E%3C/svg%3E") right center / 14px no-repeat;
  transition: background-position .15s;
}
.trial-card:hover .trial-link { background-position: right -2px center; }
.session-summary { grid-template-rows: 18px 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Tablet: the sidebar turns into a top bar, so the card becomes one compact row */
@media (max-width: 1100px) {
  .trial-card { display: flex; align-items: center; gap: 10px; width: auto; margin: 0 0 6px; padding: 6px 12px 6px 6px; border-radius: 999px; }
  .trial-card-icon { width: 30px; height: 30px; }
  .trial-card-icon svg { width: 16px; height: 16px; }
  .trial-card-body { display: flex; align-items: center; gap: 10px; }
  .trial-card-head strong { font-size: 14px; }
  .trial-card-rules { display: none; }
  .trial-card .trial-link { margin: 0; }
  .trial-card .trial-link::after { border-radius: 999px; }
  .session-summary { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(24px, auto); padding-top: 0; border-top: 0; }
}
/* Phone: the card takes its own full row under the menu, icon on the left */
@media (max-width: 800px) {
  .trial-card { grid-column: 1 / -1; grid-row: 4; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 12px; margin: 4px 0 0; padding: 14px; border-radius: 16px; }
  .trial-card-icon { width: 44px; height: 44px; }
  .trial-card-icon svg { width: 20px; height: 20px; }
  .trial-card-body { display: grid; gap: 4px; }
  .trial-card-rules { display: block; }
  .trial-card .trial-link { margin-top: 4px; }
  .trial-card .trial-link::after { border-radius: 16px; }
}
@media (max-width: 420px) {
  .session-summary { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(24px, auto); }
}

/* ───────────────────────────────────────────────────────────────
   Color restraint: grey by default, blue only for the point.
   Blue stays on: primary buttons, the current menu item, the current step,
   action links, the tab underline and the masked-tag highlight in results.
   Icons follow the FluentT design system: filled mono glyphs in #8b95a1.
   ─────────────────────────────────────────────────────────────── */
:root { --icon: var(--gray-46); --icon-bg: var(--gray-5); }
.icon { color: inherit; }

/* Upload area and sample card: neutral surfaces, grey glyphs */
.drop-zone { background: var(--white); border-color: var(--gray-18); }
.drop-zone:hover:not(:disabled), .drop-zone.drag-over { background: var(--gray-5); border-color: var(--primary); }
.upload-icon { background: var(--icon-bg); color: var(--icon); }
.sample-cta-icon { background: var(--icon-bg); color: var(--icon); }
.sample-cta > .icon { color: var(--icon); }
.sample-cta:hover:not(:disabled) { background: var(--gray-5); border-color: var(--gray-28); }
.sample-link { color: var(--gray-70); }
.sample-link:hover:not(:disabled) { color: var(--ink); }
.file-type { color: var(--gray-70); }
.process-button .icon, .primary-button .icon { color: var(--white); }

/* Guidance boxes: grey, the link inside is the only blue */
.start-hint { background: var(--gray-5); }
.start-hint > .icon { color: var(--icon); }
.processing-note > .icon { color: var(--icon); }
.tag-explainer .text-button { display: inline-flex; align-items: center; gap: 4px; color: var(--gray-70); }
.tag-explainer .text-button .icon { width: 14px; height: 14px; color: var(--icon); }
code { color: var(--gray-70); }
.tag-example code { color: var(--ink); font-weight: 600; }

/* Empty state */
.empty-icon { background: var(--icon-bg); color: var(--icon); }
.empty-sample { border-color: var(--gray-18); color: var(--ink); }
.empty-sample:hover:not(:disabled) { background: var(--gray-5); }
.empty-sample .icon { color: var(--icon); }
.empty-points strong { color: var(--ink); }
.empty-points code { color: var(--gray-70); }

/* Steps: only the current one is blue */
.workflow li.done .step-number { background: var(--icon-bg); color: var(--gray-70); }
.job-stages li.done { border-top-color: var(--gray-46); }

/* Result summary */
.mini-check { background: var(--icon-bg); color: var(--icon); }

/* Sidebar: grey text links, the trial card keeps one blue action */
.header-actions .text-button { color: var(--gray-70); }
.header-actions .text-button:hover { color: var(--ink); }
.header-actions .text-button .icon { color: var(--icon); }
.mode-nav a:not([aria-current="page"]) .icon { color: var(--icon); }
.trial-card-icon { background: var(--icon-bg); color: var(--icon); }
.trial-card-icon .icon { width: 22px; height: 22px; }
.trial-card .quota-remaining { color: var(--ink); }
.icon-button { color: var(--icon); }
.icon-button:hover:not(:disabled) { color: var(--gray-70); }
.utterance.customer .speaker { color: var(--gray-70); font-weight: 600; }

/* Remaining runs at the right of the page title: a thin ring plus "n / 5 남음" */
.page-heading { align-items: center; }
.quota-meter {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  color: var(--gray-70); font-size: 14px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.quota-meter[hidden] { display: none; }
.quota-meter.has-ring::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  background: conic-gradient(var(--ink) calc(var(--left, 1) * 360deg), var(--gray-18) 0);
  -webkit-mask: radial-gradient(circle, transparent 6px, var(--gray-100) 6.5px);
  mask: radial-gradient(circle, transparent 6px, var(--gray-100) 6.5px);
}

/* Start hint: one quiet line under the button instead of a box */
.start-hint {
  display: block; margin: 0; padding: 0; background: none; border-radius: 0;
  color: var(--gray-46); font-size: 13px; line-height: 1.5; text-align: center;
}
.start-hint[hidden] { display: none; }
.start-hint a { color: var(--primary-ink); font-weight: 650; }
.speech-process + .start-hint { margin-top: 10px; }
.page-description { word-break: keep-all; }
@media (max-width: 700px) {
  .page-heading { align-items: flex-start; }
  .quota-meter { margin-top: 6px; font-size: 13px; }
}
.trial-card:has(.trial-link:not([hidden])):hover .trial-card-icon { background: var(--white); }

/* Sidebar links: the tag guide moved into the text page, so stack what is left without an empty first row */
@media (min-width: 1101px) {
  .session-links { display: flex; flex-flow: column nowrap; align-items: flex-start; gap: 2px; margin-top: 6px; }
}
@media (min-width: 1101px) {
  .session-summary { grid-template-rows: none; grid-auto-rows: minmax(18px, auto); }
  .session-summary .logged-user { grid-row: auto; }
}
/* Mint is too light for text: done badges keep the mint tint and a mint dot, with ink text */
.result-badge.success { gap: 5px; color: var(--gray-100); background: var(--mint-tint); }
.result-badge.success::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }

/* ───────────────────────────────────────────────────────────────
   Upload screen: one core action.
   A large dashed stage with a single prompt and an action bar (파일 선택 | 가상 샘플로 체험),
   the start button under it, and every secondary setting folded into "세부 설정 · 안내".
   ─────────────────────────────────────────────────────────────── */
.workbench { align-items: start; }
.file-panel { display: flex; flex-direction: column; }
.file-panel .panel-heading { gap: 12px; }
.heading-field { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.heading-field label { font-size: 13px; font-weight: 500; color: var(--gray-46); white-space: nowrap; }
.heading-field select { width: auto; min-height: 34px; padding: 6px 30px 6px 10px; font-size: 13px; }
.file-panel .file-controls { display: flex; flex-direction: column; gap: 14px; }

.upload-stage {
  display: flex; flex-direction: column; min-height: 420px; padding: 10px;
  border: 1.5px dashed var(--gray-18); border-radius: 16px; background: var(--background);
  transition: border-color .15s, background-color .15s;
}
.upload-stage:has(.drop-zone:hover:not(:disabled)), .upload-stage:has(.drop-zone.drag-over) { border-color: var(--primary-blue); background: var(--sky-blue); }
.upload-stage .drop-zone {
  flex: 1; min-height: 0; gap: 6px; padding: 24px 12px; border: 0; border-radius: 12px; background: none;
}
.upload-stage .drop-zone:hover:not(:disabled), .upload-stage .drop-zone.drag-over { background: none; }
.upload-stage .drop-zone strong { margin: 0; font-size: 16px; font-weight: 600; color: var(--gray-100); }
.upload-stage .drop-zone small { font-size: 13px; color: var(--gray-46); }

.upload-actions { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid var(--gray-5); border-radius: 12px; background: var(--white); }
.upload-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 12px;
  border: 0; background: none; color: var(--gray-100); font-size: 15px; font-weight: 600;
}
.upload-action + .upload-action { border-left: 1px solid var(--gray-18); border-radius: 0; }
.upload-action:hover:not(:disabled) { background: var(--gray-5); filter: none; }
.upload-action .icon { width: 18px; height: 18px; color: var(--gray-70); }

/* File chosen: the prompt gives way to the file card, centred in the stage */
.upload-stage:has(#file-section:not([hidden])) .drop-zone { display: none; }
.upload-stage .file-details {
  align-self: center; width: min(100%, 360px); margin: auto 0; padding: 12px 14px;
  border: 1px solid var(--gray-18); border-radius: 12px; background: var(--white);
}
.upload-stage .file-details[hidden] { display: none; }

.file-panel .process-button { margin: 0; }
.file-panel .start-hint { margin-top: -6px; }

/* Everything secondary, folded */
.more-settings { border-top: 1px solid var(--gray-5); padding-top: 12px; }
.more-settings > summary {
  display: flex; align-items: center; gap: 6px; width: fit-content; cursor: pointer; list-style: none;
  color: var(--gray-70); font-size: 13px; font-weight: 600;
}
.more-settings > summary::-webkit-details-marker { display: none; }
.more-settings > summary::after {
  content: ""; width: 7px; height: 7px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
  transition: transform .15s;
}
.more-settings[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.more-settings[open] { display: grid; gap: 14px; }
.more-settings .sample-download-row { display: grid; gap: 4px; }
.more-settings .processing-note, .more-settings .tag-explainer { margin: 0; padding: 14px; border: 0; border-radius: 12px; background: var(--gray-5); }
.more-settings .tag-explainer h3 { font-size: 14px; }

/* Empty result: one quiet line, same height as the upload stage */
.result-panel .empty-state { min-height: 560px; }
.result-panel .empty-state h3 { font-size: 16px; font-weight: 600; }

@media (max-width: 900px) {
  .upload-stage { min-height: 280px; }
  .result-panel .empty-state { min-height: 240px; }
}
@media (max-width: 420px) {
  .upload-action { font-size: 14px; gap: 6px; }
}
/* The work-file card keeps one width in every state (before upload, file chosen, processing, result);
   the result panel takes the rest of the row */
@media (min-width: 901px) {
  .workbench { grid-template-columns: clamp(340px, 30vw, 420px) minmax(0, 1fr); }
}
.upload-action { white-space: nowrap; }
a.upload-action { text-decoration: none; color: var(--gray-100); overflow: hidden; }
a.upload-action > span, a.upload-action { text-overflow: ellipsis; }
/* The sample link's text is rewritten per language, so its icon lives in CSS (download glyph, tinted by token) */
#speech-sample-download::before {
  content: ""; flex: none; width: 18px; height: 18px; background: var(--gray-70);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='translate(1.51 1.89)'%3E%3Cpath d='M9.71 13.72C9.92 13.93 10.21 14.04 10.49 14.04C10.77 14.04 11.05 13.93 11.27 13.72L16.5 8.48C16.93 8.05 16.93 7.35 16.5 6.92C16.07 6.49 15.37 6.49 14.94 6.92L11.59 10.27V1.1C11.59 .49 11.1 0 10.49 0C9.88 0 9.39 .49 9.39 1.1V10.28L6.03 6.93C5.6 6.5 4.9 6.5 4.47 6.93C4.04 7.36 4.04 8.06 4.47 8.49Z'/%3E%3Cpath d='M19.88 11.41C19.27 11.41 18.78 11.9 18.78 12.51V16.72C18.78 17.44 18.2 18.02 17.48 18.02H3.5C2.78 18.02 2.2 17.44 2.2 16.72V12.51C2.2 11.9 1.71 11.41 1.1 11.41C.49 11.41 0 11.9 0 12.51V16.72C0 18.65 1.57 20.22 3.5 20.22H17.48C19.41 20.22 20.98 18.65 20.98 16.72V12.51C20.98 11.9 20.49 11.41 19.88 11.41Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='translate(1.51 1.89)'%3E%3Cpath d='M9.71 13.72C9.92 13.93 10.21 14.04 10.49 14.04C10.77 14.04 11.05 13.93 11.27 13.72L16.5 8.48C16.93 8.05 16.93 7.35 16.5 6.92C16.07 6.49 15.37 6.49 14.94 6.92L11.59 10.27V1.1C11.59 .49 11.1 0 10.49 0C9.88 0 9.39 .49 9.39 1.1V10.28L6.03 6.93C5.6 6.5 4.9 6.5 4.47 6.93C4.04 7.36 4.04 8.06 4.47 8.49Z'/%3E%3Cpath d='M19.88 11.41C19.27 11.41 18.78 11.9 18.78 12.51V16.72C18.78 17.44 18.2 18.02 17.48 18.02H3.5C2.78 18.02 2.2 17.44 2.2 16.72V12.51C2.2 11.9 1.71 11.41 1.1 11.41C.49 11.41 0 11.9 0 12.51V16.72C0 18.65 1.57 20.22 3.5 20.22H17.48C19.41 20.22 20.98 18.65 20.98 16.72V12.51C20.98 11.9 20.49 11.41 19.88 11.41Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
#speech-sample-download > svg { display: none; }
.speech-heading .quota-meter { align-self: center; }
.more-settings .speech-setting { margin: 0; }
.more-settings .speech-limit-note { margin: 0; }

/* ── Panel headers line up across both columns ── */
.file-panel .panel-heading, .result-panel .result-heading {
  min-height: 88px; padding-top: 16px; padding-bottom: 16px; align-items: center;
}
.file-panel .panel-heading { padding-left: 24px; padding-right: 24px; }

/* ── Selects: one drawn chevron with even spacing instead of the native arrow ── */
.select-wrap { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.field .select-wrap { width: 100%; }
.heading-field .select-wrap { width: auto; }
.select-wrap select { -webkit-appearance: none; appearance: none; padding-right: 34px; background-image: none; }
.heading-field .select-wrap select { min-width: 104px; padding: 6px 34px 6px 12px; }
.select-wrap::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 12px; height: 12px; margin-top: -6px; pointer-events: none;
  background: var(--gray-46);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.select-wrap:has(select:disabled)::after { background: var(--gray-28); }

/* ── Start appears only once a file is in ── */
.file-panel:has(#file-section[hidden]) .start-row,
.file-panel:has(#speech-file-details[hidden]) .start-row { display: none; }
.start-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; }
.start-row .start-hint { margin: 0 auto 0 0; text-align: left; }
.start-row .speech-setting { margin: 0 auto 0 0; }
.start-row .process-button, .start-row .speech-process {
  width: auto; min-height: 44px; margin: 0; padding: 0 22px; border-radius: 10px; font-size: 15px; font-weight: 600;
}
.start-row .process-button .icon { display: none; }
.start-row .process-button > span { margin: 0; }

/* ── File row: icon tile, name and size, delete ── */
.upload-stage .file-details { display: flex; align-items: center; gap: 12px; width: min(100%, 440px); padding: 12px; border-color: var(--gray-5); border-radius: 14px; }
.file-details .file-type {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: var(--gray-5); color: var(--gray-70);
}
.file-details .file-type .icon { width: 22px; height: 22px; }
.file-details .file-meta { gap: 2px; }
.file-details .file-meta strong { font-size: 15px; font-weight: 600; color: var(--gray-100); }
.file-details .file-meta span { font-size: 13px; color: var(--gray-46); }
.file-details .icon-button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--gray-70); }
.file-details .icon-button:hover:not(:disabled) { background: var(--gray-5); }
.file-details .icon-button .icon { width: 20px; height: 20px; }
/* ...and one height: the card is a fixed 760px tall; the dashed stage absorbs whatever appears or disappears
   inside it (start button, file row). The result panel starts at the same height and grows only with a result. */
@media (min-width: 901px) {
  .workbench { align-items: start; }
  .workbench .file-panel { display: flex; flex-direction: column; min-height: 760px; }
  .workbench .result-panel { display: flex; flex-direction: column; min-height: 760px; }
  .workbench .result-panel > .empty-state { flex: 1; min-height: 0; }
  .file-panel .file-controls { flex: 1; }
  .file-panel .upload-stage { flex: 1; min-height: 300px; }
}
.upload-stage:has(#speech-file-details:not([hidden])) .drop-zone { display: none; }

/* Button labels never spill: when the stage is too narrow for both actions side by side, they stack.
   The voice sample label is the long one (and changes per language), so it decides the break. */
.upload-stage { container-type: inline-size; }
@container (max-width: 340px) {
  .upload-action { gap: 6px; padding: 0 8px; font-size: 14px; }
  .upload-action .icon, #speech-sample-download::before { width: 16px; height: 16px; }
}
@container (max-width: 230px) {
  .upload-actions { grid-template-columns: 1fr; }
  .upload-action + .upload-action { border-left: 0; border-top: 1px solid var(--gray-18); }
}
.more-settings > summary { padding-right: 2px; }

/* Notices: only the "fictional files only" line stays visible; each other notice opens on its own row */
.upload-note { display: flex; align-items: flex-start; gap: 6px; margin: -4px 0 0; color: var(--gray-70); font-size: 13px; line-height: 1.5; }
.upload-note .icon { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--gray-46); }
.info-list { border-top: 1px solid var(--gray-5); }
.info-item + .info-item { border-top: 1px solid var(--gray-5); }
.info-item > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px;
  cursor: pointer; list-style: none; color: var(--gray-70); font-size: 14px; font-weight: 600;
}
.info-item > summary::-webkit-details-marker { display: none; }
.info-item > summary:hover { color: var(--gray-100); }
.info-item > summary::after {
  content: ""; flex: none; width: 7px; height: 7px; margin: -3px 4px 0 0;
  border-right: 1.5px solid var(--gray-46); border-bottom: 1.5px solid var(--gray-46); transform: rotate(45deg); transition: transform .15s;
}
.info-item[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.info-item[open] { display: grid; gap: 10px; padding-bottom: 14px; }
.info-item > p, .info-item .sample-tip { margin: 0; color: var(--gray-70); font-size: 13px; line-height: 1.6; }
.info-item .field { margin: 0; }
.info-item .sample-download-row { display: grid; gap: 4px; }
.info-item .tag-example {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 12px;
  border: 0; border-radius: 10px; background: var(--gray-5); color: var(--gray-70); font-size: 13px;
}
.info-item .tag-example code { padding: 0; background: none; color: var(--gray-100); font: 600 13px/1.4 inherit; font-family: inherit; }
.info-item .guide-trigger { justify-self: start; }

/* Sample audio credits: a quiet footer link, not a browser-default blue one */
.page-footer a { color: var(--gray-46); text-decoration: none; }
.page-footer a:hover { color: var(--gray-70); text-decoration: underline; text-underline-offset: 2px; }
.info-item .sample-download-row > * { margin: 0; }

/* Voice file row: preview and remove, like the text file row's remove button */
.file-details .file-actions { display: flex; flex: none; gap: 2px; margin-left: auto; }
.file-details .file-meta { min-width: 0; }
#speech-play .icon { width: 18px; height: 18px; }
#speech-play .pause-icon, #speech-play[aria-pressed="true"] .play-icon { display: none; }
#speech-play[aria-pressed="true"] .pause-icon { display: block; }
#speech-play[aria-pressed="true"] { background: var(--gray-5); color: var(--gray-100); }
.info-link { color: var(--gray-100); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* One voice language only: the value reads as text, and becomes a dropdown when a second language arrives */
.select-wrap[hidden] { display: none; }
.locale-static { display: inline-flex; align-items: center; min-height: 34px; color: var(--gray-100); font-size: 13px; font-weight: 600; }

/* File chosen, not started: a short "ready" note; the full script waits behind its own preview toggle */
.empty-state.file-prepared { justify-content: center; align-items: center; text-align: center; padding: 32px 20px; }
.file-prepared .empty-icon { display: grid; }
.file-prepared h3 { margin-top: 14px; font-size: 16px; }
.file-prepared p { margin-top: 6px; }
.preview-drawer { width: min(100%, 680px); margin-top: 18px; }
.preview-drawer:has(#input-preview[hidden]) { display: none; }
.preview-drawer > summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--gray-18); border-radius: 999px; background: var(--white);
  color: var(--gray-70); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none;
}
.preview-drawer > summary::-webkit-details-marker { display: none; }
.preview-drawer > summary:hover { background: var(--gray-5); color: var(--gray-100); }
.preview-drawer > summary::after {
  content: ""; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s;
}
.preview-drawer[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.preview-drawer .selected-preview { margin: 14px 0 0; max-height: 360px; padding: 18px 20px; border-color: var(--gray-5); background: var(--background); text-align: left; line-height: 1.9; }
.upload-stage .drop-zone small { text-wrap: pretty; }

/* The screen itself shows what comes next (upload → start → result), so the 1·2·3 step bar is hidden.
   The markup stays because app code still updates its state. */
.workflow { display: none; }
.page-heading { margin-bottom: 24px; }
@media (max-width: 900px) { .page-heading { margin-bottom: 16px; } }

/* ---------- Button scale ----------
   L 44px  main action that moves the job forward (마스킹 시작)
   M 40px  result actions (결과 다운로드, 다시 시도, 새 작업, WAV/TXT 다운로드) — text and icon buttons share it
   S 36px  small controls inside a panel (언어 선택, 파일 행 재생·삭제)
   Chips 32px. Every button corner is 10px (S icon buttons 8px). Disabled = one quiet grey, filled or not. */
.primary-button, .secondary-button, #retry-button {
  box-sizing: border-box; min-height: 40px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
}
.start-row .process-button, .start-row .speech-process { min-height: 44px; padding: 0 22px; font-size: 15px; }
.result-actions { align-items: center; gap: 8px; }
.result-actions .icon-button {
  box-sizing: border-box; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 10px;
  border: 1px solid var(--gray-18); background: var(--white); color: var(--gray-70);
}
.result-actions .icon-button .icon { width: 18px; height: 18px; }
.result-actions .icon-button:hover:not(:disabled) { background: var(--gray-5); color: var(--gray-100); }
.primary-button:disabled, .secondary-button:disabled, .result-actions .icon-button:disabled,
a.primary-button:not([href]), a.secondary-button:not([href]) {
  border-color: var(--gray-5); background: var(--gray-5); color: var(--gray-28); opacity: 1; box-shadow: none; cursor: not-allowed;
}
.heading-field select, .heading-field .locale-static { min-height: 36px; }
.heading-field select { padding-top: 0; padding-bottom: 0; border-radius: 8px; }
.inline-field select { min-height: 36px; border-radius: 8px; }
.file-details .icon-button { width: 36px; height: 36px; border-radius: 8px; }

/* ---------- In progress ----------
   One centred block in the result panel: spinner, what is happening, time so far, then the four stages
   as a vertical checklist (done ✓ / now ◌ / next ○). The header's duplicate sentence is dropped. */
.result-panel:has(> .job-status-section:not([hidden])) .result-heading p { display: none; }
.result-panel:has(> .job-status-section:not([hidden])) > .empty-state { display: none; }
.result-panel > .job-status-section:not([hidden]) {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  margin: 0; padding: 48px 24px; border: 0; background: none; text-align: center;
}
.job-status-section .job-status-heading {
  display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0; padding: 0; border: 0;
}
.job-status-section .job-status-heading .spinner {
  width: 44px; height: 44px; margin: 0 0 4px; border: 3px solid var(--gray-5); border-top-color: var(--primary-blue); border-radius: 50%;
}
.job-status-section .job-status-heading .spinner[hidden] { display: none; }
.job-status-section .job-status-heading strong { display: block; color: var(--gray-100); font-size: 18px; font-weight: 600; }
.job-status-section .job-status-heading p { margin: 6px 0 0; color: var(--gray-70); font-size: 14px; }
.job-status-section .elapsed-time {
  padding: 4px 12px; border-radius: 999px; background: var(--gray-5);
  color: var(--gray-70); font: 600 12px/1.5 var(--font); font-variant-numeric: tabular-nums;
}
.job-status-section .job-details { display: flex; flex-direction: column; gap: 2px; margin: -10px 0 0; padding: 0; border: 0; background: none; color: var(--gray-46); font-size: 12px; }
.job-status-section .job-details span:empty { display: none; }
.job-status-section .job-stages {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; width: min(100%, 300px); margin: 6px 0 0; padding: 14px 16px;
  border-radius: 14px; background: var(--background); list-style: none; text-align: left;
}
.job-status-section .job-stages li {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 36px; margin: 0; padding: 0;
  border: 0; color: var(--gray-46); font-size: 14px; font-weight: 400;
}
.job-status-section .job-stages li::before {
  content: ""; flex: none; box-sizing: border-box; width: 20px; height: 20px; border: 1.5px solid var(--gray-18); border-radius: 50%; background: var(--white);
}
.job-status-section .job-stages li.done { color: var(--gray-70); }
.job-status-section .job-stages li.done::before { border-color: var(--gray-70); background: var(--gray-70); }
.job-status-section .job-stages li.done::after {
  content: ""; position: absolute; left: 5px; top: 50%; width: 10px; height: 10px; margin-top: -5px; background: var(--white);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.5 17.3c-.3 0-.6-.1-.8-.4L4.1 12.3c-.5-.5-.5-1.2 0-1.7s1.2-.5 1.7 0l3.7 3.7 8.6-8.6c.5-.5 1.2-.5 1.7 0s.5 1.2 0 1.7L10.4 16.9c-.3.3-.6.4-.9.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.5 17.3c-.3 0-.6-.1-.8-.4L4.1 12.3c-.5-.5-.5-1.2 0-1.7s1.2-.5 1.7 0l3.7 3.7 8.6-8.6c.5-.5 1.2-.5 1.7 0s.5 1.2 0 1.7L10.4 16.9c-.3.3-.6.4-.9.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.job-status-section .job-stages li.current { color: var(--gray-100); font-weight: 600; }
.job-status-section .job-stages li.current::before {
  border: 2px solid var(--sky-blue); border-top-color: var(--primary-blue); animation: stage-spin .9s linear infinite;
}
@keyframes stage-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .job-status-section .job-stages li.current::before { animation: none; border-color: var(--primary-blue); } }

/* Failed / expired: the spinner becomes a still alert mark, the timer and server note step aside,
   and the error plus "다시 준비" sit right under the title instead of at the bottom of the panel */
.job-status-section .job-status-heading .spinner.failed {
  position: relative; border: 0; background: var(--red-tint); animation: none;
}
.job-status-section .job-status-heading .spinner.failed::after {
  content: ""; position: absolute; inset: 11px; background: var(--primary-red);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 14.2c-.7 0-1.2-.5-1.2-1.2V6.5c0-.7.5-1.2 1.2-1.2s1.2.5 1.2 1.2V13c0 .7-.5 1.2-1.2 1.2zM12 18.7a1.4 1.4 0 1 1 0-2.8 1.4 1.4 0 0 1 0 2.8z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 14.2c-.7 0-1.2-.5-1.2-1.2V6.5c0-.7.5-1.2 1.2-1.2s1.2.5 1.2 1.2V13c0 .7-.5 1.2-1.2 1.2zM12 18.7a1.4 1.4 0 1 1 0-2.8 1.4 1.4 0 0 1 0 2.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.job-status-section:has(.spinner.failed) .elapsed-time,
.job-status-section:has(.spinner.failed) .job-details { display: none; }
.result-panel:has(.spinner.failed) > .job-status-section { flex: 0 0 auto; margin-top: auto; padding-bottom: 18px; }
.result-panel:has(.spinner.failed) > #job-error:not([hidden]) {
  align-self: center; width: min(calc(100% - 48px), 460px); margin: 0; padding: 12px 14px; border: 0; border-radius: 10px; text-align: center;
}
.result-panel:has(.spinner.failed) > .failed-actions:not([hidden]) { display: flex; justify-content: center; margin: 16px 0 auto; padding: 0 24px 48px; border: 0; }

/* Disabled controls: icon and label share exactly one grey, so no part of a disabled button looks "more off" than another */
.primary-button:disabled .icon, .secondary-button:disabled .icon, .process-button:disabled .icon,
.result-actions .icon-button:disabled .icon, .upload-action:disabled .icon, .icon-button:disabled .icon { color: currentColor; }
.result-actions .icon-button .icon, .result-actions .primary-button .icon { width: 18px; height: 18px; }
/* One disabled look everywhere (no half-transparent buttons next to grey ones) */
button:disabled:not(.drop-zone), select:disabled, a.upload-action[aria-disabled="true"] { opacity: 1; color: var(--gray-28); cursor: not-allowed; }
select:disabled { border-color: var(--gray-5); background-color: var(--gray-5); }
.upload-action:disabled { background: none; }
.text-button:disabled { background: none; }

/* "시범" next to 음성 마스킹: a small grey chip instead of loose grey text */
.mode-nav .subtle {
  display: inline-flex; align-items: center; height: 20px; margin-left: auto; padding: 0 7px; border-radius: 999px;
  background: var(--gray-5); color: var(--gray-70); font-size: 11px; font-weight: 600; line-height: 1;
}
.mode-nav a[aria-current="page"] .subtle { background: var(--white); }
@media (max-width: 900px) { .mode-nav .subtle { margin-left: 2px; } }
.mode-nav .subtle { border-radius: 6px; padding: 0 6px; }

/* ───────────── Mobile pass ─────────────
   Header in one line (logo · status · login), a one-line trial card, tighter panel padding.
   Upload area follows the reference: one dashed box with the prompt and the two actions,
   then the chosen file as a plain full-width row, the option checkbox, a divider and the start row. */
@media (max-width: 800px) {
  .app-header { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
  .session-summary { grid-area: 1 / 2 / 2 / 3; width: auto; min-width: 0; }
  .session-links { grid-area: 1 / 3 / 2 / 4; }
  .mode-nav { grid-row: 2; }
  .trial-card {
    grid-row: 3; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 10px;
    margin: 2px 0 0; padding: 10px 12px; border-radius: 12px;
  }
  .trial-card-icon { width: 32px; height: 32px; }
  .trial-card-icon svg { width: 16px; height: 16px; }
  .trial-card-body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0 8px; }
  .trial-card-head strong { font-size: 14px; }
  .trial-card-rules { margin: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .trial-card .trial-link { margin: 0; white-space: nowrap; }
}
@media (max-width: 700px) {
  .file-panel .panel-heading, .result-panel .result-heading { min-height: 0; padding: 14px 16px; }
  .file-panel .file-controls { padding: 16px; gap: 14px; }

  .upload-stage { display: contents; }
  .file-controls > .upload-stage .drop-zone { order: 1; }
  .file-controls > .upload-stage .upload-actions { order: 2; }
  .file-controls > .upload-note { order: 3; margin: 0; }
  .file-controls > .upload-stage .file-details { order: 4; }
  .file-controls > #file-error { order: 5; }
  .file-controls > .start-row { order: 6; }
  .file-controls > .info-list { order: 7; }

  .upload-stage .drop-zone,
  .upload-stage:has(#file-section:not([hidden])) .drop-zone,
  .upload-stage:has(#speech-file-details:not([hidden])) .drop-zone {
    display: flex; flex: none; min-height: 0; padding: 28px 16px 16px;
    border: 1.5px dashed var(--gray-18); border-bottom: 0; border-radius: 16px 16px 0 0; background: var(--background);
  }
  .upload-stage .upload-actions {
    margin-top: -14px; padding: 0 12px 12px; overflow: visible;
    border: 1.5px dashed var(--gray-18); border-top: 0; border-radius: 0 0 16px 16px; background: var(--background);
  }
  .upload-stage .upload-action, .upload-stage .upload-action:disabled { background: var(--white); border-radius: 12px 0 0 12px; }
  .upload-stage .upload-action + .upload-action { border-left: 1px solid var(--gray-5); border-radius: 0 12px 12px 0; }
  .upload-stage .upload-action:hover:not(:disabled) { background: var(--gray-5); }

  .upload-stage .file-details {
    align-self: stretch; width: 100%; margin: 0; padding: 2px 0; border: 0; background: none;
  }
  .file-details .file-meta strong, .file-details .file-meta span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

  .file-controls .start-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 12px; }
  .file-controls .start-row .speech-setting { grid-column: 1 / -1; margin: 0; padding-bottom: 14px; border-bottom: 1px solid var(--gray-5); }
  .file-controls .start-row .start-hint { grid-column: 1; margin: 0; }
  .file-controls .start-row .start-hint[hidden] { display: none; }
  .file-controls .start-row .primary-button { grid-column: 2; }
  .file-controls .start-row:has(.start-hint[hidden]) .primary-button { grid-column: 1 / -1; width: 100%; }

  .result-panel .empty-state, .result-panel .empty-state.file-prepared { min-height: 0; padding: 32px 16px; }
  .result-panel .empty-icon { width: 44px; height: 44px; border-radius: 12px; }
}
@media (max-width: 340px) {
  .upload-stage .upload-actions { grid-template-columns: 1fr; }
  .upload-stage .upload-action, .upload-stage .upload-action:disabled { border-radius: 12px 12px 0 0; }
  .upload-stage .upload-action + .upload-action { border-left: 0; border-top: 1px solid var(--gray-5); border-radius: 0 0 12px 12px; }
}
@media (max-width: 700px) {
  .file-controls > .upload-note { order: 7; }
  .file-controls > .info-list { order: 8; }
  .file-controls .start-row:has(.start-hint:not([hidden])) .start-hint { grid-column: 1 / -1; word-break: keep-all; }
  .file-controls .start-row:has(.start-hint:not([hidden])) .primary-button { grid-column: 1 / -1; width: 100%; }
}
@media (max-width: 700px) {
  .result-actions { justify-content: flex-start; }
  .result-actions .primary-button { flex: 0 0 auto; width: auto; }
  .empty-state p, .page-description, .job-status-section p { word-break: keep-all; }
}
@media (max-width: 700px) {
  .upload-stage .drop-zone:disabled, .upload-stage .drop-zone.disabled { background: var(--background); opacity: 1; }
  .upload-stage .drop-zone:disabled strong, .upload-stage .drop-zone.disabled strong,
  .upload-stage .drop-zone:disabled small, .upload-stage .drop-zone.disabled small { color: var(--gray-28); }
  /* Once a job runs or a result exists, the result panel comes first on a phone, so progress is in view */
  .workbench:has(#job-status-section:not([hidden])) .result-panel,
  .workbench:has(#output-section:not([hidden])) .result-panel,
  .workbench:has(#speech-progress:not([hidden])) .result-panel,
  .workbench:has(#speech-output:not([hidden])) .result-panel { order: -1; }
}

/* Voice progress: a title, "진행 단계 4/9", time so far, a thin bar and a reassurance line.
   Failed: an alert mark replaces the spinner and the failure sentence becomes the title. */
.speech-progress .progress-step { margin: 6px 0 0; color: var(--gray-70); font-size: 14px; }
.speech-progress .progress-step strong { display: inline; color: var(--gray-100); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.speech-progress .progress-bar { width: min(100%, 300px); height: 6px; overflow: hidden; border-radius: 999px; background: var(--gray-5); }
.speech-progress .progress-bar span { display: block; width: calc(var(--progress, 0) * 100%); height: 100%; border-radius: inherit; background: var(--primary-blue); transition: width .4s ease; }
.speech-progress .progress-note { max-width: 300px; margin: 0; color: var(--gray-46); font-size: 12px; word-break: keep-all; }
.speech-progress #speech-queue:empty { display: none; }
.speech-progress[data-state="failed"] .progress-title,
.speech-progress[data-state="failed"] .progress-step > span,
.speech-progress[data-state="failed"] .progress-bar,
.speech-progress[data-state="failed"] .progress-note,
.speech-progress[data-state="failed"] .elapsed-time { display: none; }
.speech-progress[data-state="failed"] .progress-step strong { font-size: 18px; }
.speech-progress[data-state="failed"] .spinner {
  position: relative; border: 0; background: var(--red-tint); animation: none;
}
.speech-progress[data-state="failed"] .spinner::after {
  content: ""; position: absolute; inset: 11px; background: var(--primary-red);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 14.2c-.7 0-1.2-.5-1.2-1.2V6.5c0-.7.5-1.2 1.2-1.2s1.2.5 1.2 1.2V13c0 .7-.5 1.2-1.2 1.2zM12 18.7a1.4 1.4 0 1 1 0-2.8 1.4 1.4 0 0 1 0 2.8z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 14.2c-.7 0-1.2-.5-1.2-1.2V6.5c0-.7.5-1.2 1.2-1.2s1.2.5 1.2 1.2V13c0 .7-.5 1.2-1.2 1.2zM12 18.7a1.4 1.4 0 1 1 0-2.8 1.4 1.4 0 0 1 0 2.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Voice failure: the error sentence sits under the alert instead of at the panel bottom */
.result-panel:has(.speech-progress[data-state="failed"]) > .speech-progress { flex: 0 0 auto; margin-top: auto; padding-bottom: 16px; }
.result-panel:has(.speech-progress[data-state="failed"]) > #speech-error:not([hidden]) {
  align-self: center; width: min(calc(100% - 48px), 460px); margin: 0 0 auto; padding: 12px 14px; border: 0; border-radius: 10px; text-align: center;
}

/* ───────────── Phone (≤700px) ─────────────
   1. The sidebar becomes a drawer behind the menu button (menu, free-trial card, status, sign-in).
   2. A small sticky top bar carries the page title and the quota ring; the long description is dropped.
   3. The upload box comes first, with no card around it; the result panel follows;
      the notice rows (처리 방식, 결과 보관 …) move to the very bottom of the page. */
.mobile-menu-button, .menu-close, .menu-backdrop { display: none; }
@media (max-width: 700px) {
  /* 1 · drawer */
  body > .app-header {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    display: flex; flex-direction: column; align-items: stretch; gap: 18px;
    width: min(300px, 86vw); height: 100dvh; min-height: 0; margin: 0; padding: 18px 16px 24px; overflow-y: auto;
    border: 0; background: var(--white); box-shadow: none;
    transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility .22s;
  }
  html.menu-open .app-header { transform: none; visibility: visible; box-shadow: 0 0 48px rgb(3 24 50 / .2); }
  .menu-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgb(3 24 50 / .32); opacity: 0; pointer-events: none; transition: opacity .22s; }
  html.menu-open .menu-backdrop { opacity: 1; pointer-events: auto; }
  html.menu-open body { overflow: hidden; }
  .menu-close {
    display: grid; place-items: center; position: absolute; top: 14px; right: 12px; width: 36px; height: 36px;
    border: 0; border-radius: 8px; background: none; color: var(--gray-70); cursor: pointer;
  }
  .menu-close::before, .menu-close::after { content: ""; grid-area: 1 / 1; width: 16px; height: 2px; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
  .menu-close::after { transform: rotate(-45deg); }
  .menu-close:hover { background: var(--gray-5); }
  .app-header .brand { padding: 4px 8px 0; }
  .app-header .mode-nav { display: flex; flex-direction: column; gap: 4px; margin: 0; grid-area: auto; }
  .app-header .mode-nav a { flex: none; justify-content: flex-start; min-height: 44px; padding: 10px 12px; font-size: 15px; }
  .app-header .mode-nav .subtle { margin-left: auto; }
  .app-header .header-actions { display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin-top: auto; padding: 0; border: 0; }
  .app-header .trial-card {
    grid-area: auto; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 12px;
    width: auto; margin: 0; padding: 14px; border-radius: 14px;
  }
  .app-header .trial-card-icon { width: 36px; height: 36px; }
  .app-header .trial-card-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .app-header .trial-card-rules { display: block; margin: 0; white-space: normal; }
  .app-header .trial-card .trial-link { justify-self: start; margin-top: 4px; }
  .app-header .session-summary { grid-area: auto; display: flex; flex-wrap: wrap; gap: 6px 12px; width: auto; padding: 14px 8px 0; border-top: 1px solid var(--gray-5); }
  .app-header .session-links { grid-area: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0 8px; }

  /* 2 · top bar */
  .page { padding-top: 0; }
  .page-heading, .page-heading.speech-heading {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px;
    min-height: 52px; margin: 0 -14px 16px; padding: 8px 14px 8px 8px;
    border-bottom: 1px solid var(--gray-5); background: var(--white);
  }
  .page-heading > div { flex: 1; min-width: 0; }
  .page-heading h1 { margin: 0; overflow: hidden; font-size: 16px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
  .page-heading .page-description { display: none; }
  .page-heading .quota-meter { flex: none; align-self: center; font-size: 13px; }
  .mobile-menu-button {
    display: grid; place-items: center; flex: none; width: 40px; height: 40px;
    border: 0; border-radius: 10px; background: none; color: var(--gray-100); cursor: pointer;
  }
  .mobile-menu-button svg { width: 22px; height: 22px; }
  .mobile-menu-button:hover { background: var(--gray-5); }

  /* 3 · content order */
  .workbench { display: flex; flex-direction: column; gap: 14px; }
  .workbench .file-panel, .workbench .file-panel:not(:has(.processing-note)), .file-panel .file-controls { display: contents; }
  .file-panel .panel-heading {
    order: 1; display: flex; justify-content: flex-end; min-height: 0; padding: 0; border: 0; background: none;
  }
  .file-panel .panel-heading h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .file-panel .panel-heading .heading-field { display: flex; align-items: center; gap: 8px; margin: 0; }
  .file-panel .panel-heading .heading-field label { display: inline; }
  .file-controls > .upload-stage .drop-zone { order: 2; }
  .file-controls > .upload-stage .upload-actions { order: 3; }
  .file-controls > .upload-stage .file-details { order: 4; }
  .file-controls > #file-error { order: 5; }
  .file-controls > .start-row { order: 6; }
  .file-controls > .upload-note { order: 7; }
  .workbench > .result-panel { order: 8; margin-top: 6px; }
  .file-controls > .info-list { order: 9; margin-top: 4px; }
  .workbench:has(#job-status-section:not([hidden])) > .result-panel,
  .workbench:has(#output-section:not([hidden])) > .result-panel,
  .workbench:has(#speech-progress:not([hidden])) > .result-panel,
  .workbench:has(#speech-output:not([hidden])) > .result-panel { order: 0; margin: 0 0 6px; }
}
@media (max-width: 700px) {
  .workbench, .workbench:has(#output-section:not([hidden])), .workbench:has(#speech-output:not([hidden])) { align-items: stretch; }
  .workbench .file-controls > *, .workbench .upload-stage > * { align-self: stretch; }
  .upload-stage .file-details { width: auto; }
}
@media (max-width: 700px) {
  .file-panel .panel-heading { position: relative; }
  .file-panel .panel-heading h2 { top: 0; left: 0; margin: 0; }
}

/* Phone, while a job runs or its result is shown: the upload box, language row, start row and the
   privacy line step aside — only the file being processed stays, under the result panel.
   Completed speech results keep the next upload available below the result; failed jobs allow retrying. */
@media (max-width: 700px) {
  .workbench:has(#job-status-section:not([hidden]) .spinner:not(.failed)) :is(.upload-stage .drop-zone, .upload-stage .upload-actions, .file-controls > .start-row, .file-controls > .upload-note, .file-panel > .panel-heading),
  .workbench:has(#output-section:not([hidden])) :is(.upload-stage .drop-zone, .upload-stage .upload-actions, .file-controls > .start-row, .file-controls > .upload-note, .file-panel > .panel-heading),
  .workbench:has(#speech-progress:not([hidden]):not([data-state="failed"])) :is(.upload-stage .drop-zone, .upload-stage .upload-actions, .file-controls > .start-row, .file-controls > .upload-note, .file-panel > .panel-heading) {
    display: none;
  }
}

/* Desktop/tablet: option and start button share one compact line. The option's explanation moves to
   the label's tooltip (and stays readable for screen readers); the row wraps only if the card is too narrow. */
@media (min-width: 701px) {
  .start-row:has(.speech-setting) { flex-wrap: nowrap; gap: 12px; }
  .start-row .speech-setting { flex: 1 1 auto; min-width: 0; align-items: center; gap: 8px; line-height: 1.4; }
  .start-row .speech-setting input { flex: none; width: 16px; height: 16px; margin: 0; }
  .start-row .speech-setting > span { min-width: 0; overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
  .start-row .speech-setting small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .start-row .speech-process { flex: none; padding: 0 18px; }
  .start-row:has(.speech-setting):has(.start-hint:not([hidden])) { flex-wrap: wrap; }
}
@media (min-width: 701px) {
  .start-row .speech-setting > span { overflow: visible; white-space: normal; word-break: keep-all; text-overflow: clip; }
}

/* ───────────── Voice result: three groups, one type scale ─────────────
   Group title   15/600 ink        (음성 비교 · 전사 텍스트 · 검수·내보내기)
   Group helper  13/400 grey-46
   Sub label     13/600 grey-70    (원음 · 삐처리 음성 · 삐처리 위치 · 전사 원문 · 마스킹된 텍스트)
   Body          14/1.8 ink        (transcripts)
   Meta          12/400 grey-46    (보관 시각, 내보내기 안내)
   Section actions are the S size (36px). */
#speech-output .summary-explanation { flex: 1 1 100%; }
#speech-output .summary-explanation p { margin: 0; color: var(--gray-70); font-size: 13px; line-height: 1.5; }
#speech-output .summary-explanation p:empty { display: none; }
.speech-group { padding: 22px 24px; border-top: 1px solid var(--gray-5); }
.speech-group-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin: 0 0 16px; }
.speech-group-head h3, .speech-export h3 { margin: 0; color: var(--gray-100); font-size: 15px; font-weight: 600; line-height: 1.4; }
.speech-group-head p { margin: 4px 0 0; color: var(--gray-46); font-size: 13px; line-height: 1.5; }
.speech-group-head .primary-button, .speech-group-head .secondary-button {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13px; text-decoration: none;
}
.speech-players h4, .speech-compare h4, .speech-sub { margin: 0; color: var(--gray-70); font-size: 13px; font-weight: 600; line-height: 1.4; }
.speech-group .speech-players { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 0; border: 0; }
.speech-group .speech-players section { display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--background); }
.speech-group .speech-players audio { width: 100%; height: 40px; }
.speech-intervals-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.speech-intervals-row .speech-intervals { gap: 6px; max-height: none; }
.interval-chip {
  min-height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--gray-5); color: var(--gray-70);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
}
.interval-chip:hover { background: var(--blue-tint); color: var(--primary-blue); }
.speech-group .speech-compare { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden; border: 1px solid var(--gray-5); border-radius: 12px; }
.speech-group .speech-compare section { padding: 14px 16px; }
.speech-group .speech-compare section + section { border-left: 1px solid var(--gray-5); }
.speech-group .speech-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.speech-group .speech-title-row .text-button { min-height: 28px; font-size: 13px; }
.speech-group .speech-compare pre { height: 280px; margin: 10px 0 0; color: var(--gray-100); font: 14px/1.8 var(--font); }
.speech-export { display: grid; gap: 12px; }
.speech-export #speech-export-status { margin: 0; color: var(--gray-70); font-size: 13px; }
.speech-export label { display: flex; align-items: flex-start; gap: 8px; color: var(--gray-100); font-size: 14px; line-height: 1.5; }
.speech-export label input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; }
.speech-export .speech-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.speech-export .speech-actions > * { min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13px; }
.speech-export .subtle { margin: 0; color: var(--gray-46); font-size: 12px; line-height: 1.6; }
.speech-expiry { margin: 0; padding: 0 24px 20px; color: var(--gray-46); font-size: 12px; }
.speech-expiry:empty { display: none; }
@media (max-width: 760px) {
  .speech-group { padding: 18px 16px; }
  .speech-group .speech-players, .speech-group .speech-compare { grid-template-columns: minmax(0, 1fr); }
  .speech-group .speech-compare section + section { border-left: 0; border-top: 1px solid var(--gray-5); }
  .speech-group .speech-compare pre { height: 220px; }
  .speech-expiry { padding: 0 16px 18px; }
}
#speech-output .result-summary > .summary-explanation { display: block; min-width: 0; padding: 12px 0 0; border-top: 1px dashed var(--gray-5); }
#speech-output .result-summary > .summary-explanation { border-left: 0; margin-left: 0; padding-left: 0; }

/* Voice result header: 작업 삭제 · TXT · WAV, same M size as the text page header */
.result-panel .result-heading:has(#speech-delete) { align-items: center; }
.result-heading .result-actions:has(#speech-delete) { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.result-actions #speech-delete { min-height: 40px; padding: 0 10px; }
.result-actions .primary-button, .result-actions .secondary-button { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.result-actions a.secondary-button:not([href]) { border-color: var(--gray-5); }

/* ---------- Status chips (both pages) ----------
   Same shape as the "시범" chip: 20px tall, 6px corners, 11px/600, grey.
   Colour only as a small dot: blue running, mint done, red failed; no dot before a job. */
.result-badge, .result-badge.working, .result-badge.success, .result-badge.failure {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 6px; border: 0; border-radius: 6px;
  background: var(--gray-5); color: var(--gray-70); font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.result-badge::before { content: none; }
.result-badge.working::before, .result-badge.success::before, .result-badge.failure::before,
.result-panel:has(#speech-progress[data-state="queued"]) #speech-badge::before,
.result-panel:has(#speech-progress[data-state="uploading"]) #speech-badge::before,
.result-panel:has(#speech-progress[data-state="processing"]) #speech-badge::before,
.result-panel:has(#speech-progress[data-state="completed"]) #speech-badge::before,
.result-panel:has(#speech-progress[data-state="failed"]) #speech-badge::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--primary-blue);
}
.result-badge.success::before, .result-panel:has(#speech-progress[data-state="completed"]) #speech-badge::before { background: var(--mint); }
.result-badge.failure::before, .result-panel:has(#speech-progress[data-state="failed"]) #speech-badge::before { background: var(--primary-red); }
.result-actions #speech-delete { width: 40px; height: 40px; padding: 0; }

/* Voice audio: two players side by side, each with its label above, no box behind them */
.speech-group .speech-players { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.speech-group .speech-players section { display: grid; gap: 8px; padding: 0; border-radius: 0; background: none; }
@media (max-width: 760px) { .speech-group .speech-players { grid-template-columns: minmax(0, 1fr); } }

/* Voice transcripts: the text page's compare columns (dot title, speaker rows, highlights) */
.speech-transcripts { overflow: hidden; border: 1px solid var(--gray-5); border-radius: 12px; }
.speech-transcripts .transcript { height: 320px; overflow: auto; }
.speech-transcripts .transcript-title .text-button { min-height: 24px; padding: 0; font-size: 12px; }

/* Summary numbers (both pages): readable, not shouting — label 12, value 18/600, unit 12 */
.result-summary { padding: 16px 24px; gap: 12px 0; }
.result-summary > div { min-width: 96px; padding-right: 20px; }
.result-summary .metric-label { font-size: 12px; color: var(--gray-46); }
.result-summary p { margin-top: 4px; }
.result-summary p > strong { font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.result-summary p > span { margin-left: 2px; font-size: 12px; }

/* Summary metrics as equal boxes filling the row (both pages); notes run full width underneath */
.result-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; padding: 16px 24px; }
.result-summary > div, .result-summary > div + div {
  min-width: 0; margin: 0; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--background);
}
.result-summary > div[hidden] { display: none; }
.result-summary > .summary-explanation, #speech-output .result-summary > .summary-explanation {
  grid-column: 1 / -1; padding: 2px 2px 0; border: 0; border-radius: 0; background: none;
}
@media (max-width: 700px) { .result-summary { padding: 14px 16px; } .result-summary > div { padding: 10px 12px; } }
.result-summary { display: flex; flex-wrap: wrap; }
.result-summary > div, .result-summary > div + div { flex: 1 1 0; min-width: 0; }
.result-summary > .summary-explanation, #speech-output .result-summary > .summary-explanation { flex: 0 0 100%; }
.result-summary > div:not(:first-child) { padding-left: 14px; border-left: 0; }
@media (max-width: 700px) { .result-summary > div:not(:first-child) { padding-left: 12px; } }
.result-summary > .summary-explanation:not(:first-child) { padding-left: 2px; }

/* ---------- Chips, one system ----------
   Shape (all): 20px tall, 6px corners, 11px/600 — the "시범" chip.
   Colour by meaning, always a light tint with readable text, no dots:
   neutral grey (처리 전 · 시범 · 가상 데이터 · tab counts), blue (처리 중/대기), mint (완료), red (실패). */
.result-badge, .result-badge.working, .result-badge.success, .result-badge.failure,
.sample-label, .tabs #tab-count, .mode-nav .subtle {
  display: inline-flex; align-items: center; height: 20px; min-width: 20px; padding: 0 6px; border: 0; border-radius: 6px;
  background: var(--gray-5); color: var(--gray-70); font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; justify-content: center;
}
.result-badge::before, .result-badge.working::before, .result-badge.success::before, .result-badge.failure::before,
.result-panel #speech-badge::before { content: none !important; }
.result-badge.working,
.result-panel:has(#speech-progress[data-state="queued"]) #speech-badge,
.result-panel:has(#speech-progress[data-state="uploading"]) #speech-badge,
.result-panel:has(#speech-progress[data-state="processing"]) #speech-badge { background: var(--blue-tint); color: var(--primary-blue); }
.result-badge.success,
.result-panel:has(#speech-progress[data-state="completed"]) #speech-badge { background: var(--mint-tint); color: color-mix(in srgb, var(--mint) 45%, var(--gray-100)); }
.result-badge.failure,
.result-panel:has(#speech-progress[data-state="failed"]) #speech-badge { background: var(--red-tint); color: var(--primary-red); }
.tabs button[aria-selected="true"] #tab-count { background: var(--blue-tint); color: var(--primary-blue); }
.mode-nav a[aria-current="page"] .subtle { background: var(--white); }

/* Header actions appear only when they can be used (no greyed-out buttons before a result) */
.result-actions > button:disabled,
.result-actions > a.primary-button:not([href]),
.result-actions > a.secondary-button:not([href]) { display: none; }
.result-actions:not(:has(> :is(button:not(:disabled), a[href]))) { display: none; }
/* Same tint strength for every coloured chip (the red token tint is lighter than blue/mint) */
.result-badge.failure,
.result-panel:has(#speech-progress[data-state="failed"]) #speech-badge { background: color-mix(in srgb, var(--primary-red) 10%, transparent); }

/* Summary note sits in the same row as the metric boxes, as a wider box on the right (both pages).
   On narrow panels it drops to its own full-width box below. */
.result-summary > .summary-explanation, #speech-output .result-summary > .summary-explanation,
.result-summary > .summary-explanation:not(:first-child) {
  display: flex; flex: 2 1 0; align-items: center; gap: 10px; min-width: 0;
  padding: 12px 14px; border: 0; border-radius: 12px; background: var(--background);
}
.result-summary .summary-explanation .mini-check { flex: none; width: 24px; height: 24px; }
.result-summary .summary-explanation .mini-check .icon { width: 13px; height: 13px; }
.result-summary .summary-explanation p { display: grid; gap: 2px; margin: 0; min-width: 0; }
.result-summary .summary-explanation p > strong { color: var(--gray-100); font-size: 13px; font-weight: 600; line-height: 1.45; }
.result-summary .summary-explanation p > span { color: var(--gray-46); font-size: 12px; line-height: 1.45; }
#speech-output .result-summary .summary-explanation p { color: var(--gray-70); font-size: 13px; font-weight: 500; line-height: 1.45; }
@media (max-width: 1180px) { .result-summary .summary-explanation { display: flex; } }
.result-panel { container-type: inline-size; container-name: result; }
@container result (max-width: 480px) {
  .result-summary > .summary-explanation, #speech-output .result-summary > .summary-explanation,
  .result-summary > .summary-explanation:not(:first-child) { flex: 0 0 100%; }
}

/* Voice result tabs (원문 비교 · 마스킹 대본 · 치환 내역), styled like the text page */
.speech-results { padding-top: 0; }
.speech-results .workspace-toolbar { margin: 0 -24px 16px; padding: 0 24px; border-bottom: 1px solid var(--gray-5); }
.speech-tabpanel[hidden] { display: none; }
.speech-results .speech-single { overflow: hidden; border: 1px solid var(--gray-5); border-radius: 12px; }
.speech-results .speech-single .transcript-title { display: flex; align-items: center; justify-content: space-between; }
.speech-results .speech-single .transcript { height: 360px; overflow: auto; }
.speech-results .speech-single .text-button { min-height: 24px; padding: 0; font-size: 12px; }
.tabs .tab-count { display: inline-flex; align-items: center; justify-content: center; height: 20px; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: var(--gray-5); color: var(--gray-70); font-size: 11px; font-weight: 600; line-height: 1; }
.tabs button[aria-selected="true"] .tab-count { background: var(--blue-tint); color: var(--primary-blue); }
/* 치환 내역: age line, then the beep sections as a list of rows (click = both players jump there) */
.speech-age-summary { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--background); color: var(--gray-70); font-size: 13px; }
.speech-age-summary:empty { display: none; }
.speech-intervals-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.speech-intervals-head .subtle { color: var(--gray-46); font-size: 12px; }
.speech-interval-list { display: grid; gap: 0; max-height: none; overflow: hidden; border: 1px solid var(--gray-5); border-radius: 12px; }
.speech-interval-list .interval-chip {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 14px;
  border: 0; border-radius: 0; background: var(--white); color: var(--gray-100); font-size: 14px; font-weight: 500; text-align: left;
}
.speech-interval-list .interval-chip + .interval-chip { border-top: 1px solid var(--gray-5); }
.speech-interval-list .interval-chip::before {
  content: ""; flex: none; width: 12px; height: 12px; background: var(--gray-46);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.7 13.1 8 22c-.9.6-1.5.1-1.5-.8V3.3c0-.9.6-1.4 1.5-.8l13.7 8.9c.6.4.6 1.3 0 1.7z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.7 13.1 8 22c-.9.6-1.5.1-1.5-.8V3.3c0-.9.6-1.4 1.5-.8l13.7 8.9c.6.4.6 1.3 0 1.7z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.speech-interval-list .interval-chip:hover { background: var(--gray-5); color: var(--gray-100); }
.speech-interval-list .interval-chip:hover::before { background: var(--primary-blue); }
@media (max-width: 760px) { .speech-results .workspace-toolbar { margin: 0 -16px 14px; padding: 0 16px; } }
.tabs button > span[data-i18n] { display: inline; height: auto; min-width: 0; margin: 0; padding: 0; border-radius: 0; background: none; color: inherit; font: inherit; }
.result-panel .tabs [role="tab"] { box-sizing: border-box; display: inline-flex; align-items: center; height: 50px; padding-top: 0; padding-bottom: 0; }

/* ───────────── Greys & strokes, one system (both pages) ─────────────
   Lines are all 1px.
     --line-outline  gray-18   edges: cards/panels, sidebar, form controls, secondary & icon buttons, filter chips
     --line-soft     ~10%      dividers inside a card: headings, sections, tab bar, list rows, columns, inner boxes
     dashed upload box: 1px gray-28 (dashes need a touch more contrast to read as a line)
   Fills inside a card are gray-5 (boxes, tiles, chips, previews, upload stage); the page canvas stays --background.
   Text: gray-100 primary · gray-70 secondary · gray-46 helper/meta · gray-28 disabled. */
:root { --line-outline: var(--gray-18); --line-soft: color-mix(in srgb, var(--gray-18) 55%, transparent); }

/* dividers inside cards */
.file-panel .panel-heading, .result-panel .result-heading, .workspace-toolbar, .speech-results .workspace-toolbar,
.transcript-title, .filter-row, #filters { border-bottom-color: var(--line-soft); }
.speech-group, .info-list, .info-item + .info-item, .result-footer, .session-summary,
.speech-interval-list .interval-chip + .interval-chip { border-top-color: var(--line-soft); }
.transcript-column + .transcript-column, .speech-group .speech-compare section + section,
.upload-action + .upload-action, .upload-stage .upload-action + .upload-action { border-left-color: var(--line-soft); }
.speech-transcripts, .speech-results .speech-single, .speech-interval-list, .upload-actions,
.upload-stage .file-details, .table-wrap { border-color: var(--line-soft); }
.table-wrap th, .table-wrap td { border-color: var(--line-soft); }
@media (max-width: 700px) {
  .file-controls .start-row .speech-setting { border-bottom-color: var(--line-soft); }
  .upload-stage .upload-action + .upload-action { border-left-color: var(--line-soft); }
}

/* edges */
.panel, .app-header { border-color: var(--line-outline); }
.secondary-button, .result-actions .icon-button, select, .filter-chip:not(.active) { border-color: var(--line-outline); }

/* one dashed stroke */
.upload-stage { border: 1px dashed var(--gray-28); }
@media (max-width: 700px) {
  .upload-stage .drop-zone, .upload-stage:has(#file-section:not([hidden])) .drop-zone, .upload-stage:has(#speech-file-details:not([hidden])) .drop-zone { border: 1px dashed var(--gray-28); border-bottom: 0; }
  .upload-stage .upload-actions { border: 1px dashed var(--gray-28); border-top: 0; }
}

/* one inner fill */
.upload-stage, .result-summary > div, .result-summary > div + div, .result-summary > .summary-explanation,
#speech-output .result-summary > .summary-explanation, .result-summary > .summary-explanation:not(:first-child),
.speech-age-summary, .preview-drawer .selected-preview, .job-status-section .job-stages, .info-item .tag-example { background: var(--gray-5); }
@media (max-width: 700px) {
  .upload-stage .drop-zone, .upload-stage:has(#file-section:not([hidden])) .drop-zone, .upload-stage:has(#speech-file-details:not([hidden])) .drop-zone,
  .upload-stage .drop-zone:disabled, .upload-stage .drop-zone.disabled, .upload-stage .upload-actions { background: var(--gray-5); }
}

/* helper / meta text */
.transcript-title .subtle, .speech-intervals-head .subtle, .result-summary .metric-label, .speaker,
.file-details .file-meta span, .speech-group-head p, .upload-stage .drop-zone small, .job-status-section .job-details { color: var(--gray-46); }
.transcript-title, .transcript-title > span:first-child { color: var(--gray-70); }
.speech-expiry, .workspace-toolbar { border-top-color: var(--line-soft); }
.preview-drawer .selected-preview { border-color: var(--line-soft); }
/* Voice tab area laid out like the text page: tab bar and compare columns run edge to edge in the panel */
.speech-group.speech-results { padding: 0; }
.speech-results .workspace-toolbar { margin: 0; padding: 0 24px; }
.speech-results .speech-transcripts { border: 0; border-radius: 0; }
.speech-results #speech-view-masked, .speech-results #speech-view-intervals { padding: 16px 24px 22px; }
@media (max-width: 760px) {
  .speech-results .workspace-toolbar { margin: 0; padding: 0 16px; }
  .speech-results #speech-view-masked, .speech-results #speech-view-intervals { padding: 14px 16px 18px; }
}
/* Each compare column starts with its own audio: 원문 ← 원음, 마스킹 결과 ← 삐처리 음성 */
.speech-transcripts .column-audio { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.speech-transcripts .column-audio audio { display: block; width: 100%; height: 40px; }

/* Text 치환 내역: the comparison basis / tag rule as one note above the table */
.detections-note { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 24px; border-bottom: 1px solid var(--line-soft); color: var(--gray-70); font-size: 13px; }
.detections-note .icon { flex: none; width: 16px; height: 16px; color: var(--gray-46); }
.detections-note span:empty { display: none; }
@media (max-width: 700px) { .detections-note { padding: 12px 16px; } }

/* Voice header sub-line: file name · retention time */
.result-heading #speech-job-name, .result-heading #speech-expiry { display: inline; margin: 0; }
.result-heading #speech-expiry { padding: 0; border: 0; color: var(--gray-46); font-size: 13px; }
.result-heading #speech-expiry:not(:empty)::before { content: "·"; margin: 0 6px; color: var(--gray-28); }

/* 검수 후 내보내기 */
.speech-export { display: block; }
.speech-export .speech-group-head { margin-bottom: 14px; }
.export-status:empty { display: none; }
.export-status { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--gray-5); color: var(--gray-70); font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; }
.export-status[data-state="approved"] { background: var(--mint-tint); color: color-mix(in srgb, var(--mint) 45%, var(--gray-100)); }
.export-status[data-state="pending"] { background: var(--blue-tint); color: var(--primary-blue); }
.export-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 12px 14px; border-radius: 12px; background: var(--gray-5); }
.export-confirm { display: flex; flex: 1 1 260px; align-items: center; gap: 10px; min-width: 0; color: var(--gray-100); font-size: 14px; line-height: 1.45; cursor: pointer; word-break: keep-all; }
.export-confirm input { flex: none; width: 16px; height: 16px; margin: 0; }
.export-confirm:has(input:disabled) { color: var(--gray-46); cursor: default; }
.export-actions { display: flex; flex: none; gap: 8px; }
.export-actions > * { min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13px; text-decoration: none; }
.export-actions .secondary-button { background: var(--white); }
.export-actions .secondary-button:disabled { background: var(--white); }
.export-actions .primary-button { display: inline-flex; align-items: center; gap: 6px; }
.export-actions .primary-button .icon { width: 16px; height: 16px; }
/* once approved, only the download stays in the row */
.speech-export:has(.export-status[data-state="approved"]) .export-confirm,
.speech-export:has(.export-status[data-state="approved"]) #speech-review-approve { display: none; }
.export-more { margin-top: 10px; border-top: 0; }
.export-more > summary { min-height: 36px; font-size: 13px; }
.export-more > p { margin: 0 0 4px; color: var(--gray-46); font-size: 12px; line-height: 1.6; }
.speech-export:has(.export-status[data-state="approved"]) .export-row { justify-content: flex-start; padding: 0; background: none; }

/* Transcript rows (both pages, all transcript views): tighter turns — 8px between rows, 1.65 line height,
   speaker label sits on the first text line */
.transcript .utterance { margin: 0 0 8px; }
.transcript .utterance:last-child { margin-bottom: 0; }
.transcript .utterance p { line-height: 1.65; }
.transcript .utterance .speaker { line-height: calc(14px * 1.65); }

/* Summary numbers live at the top of 치환 내역 as one quiet line (label · value), not boxes */
.result-summary.stats-inline {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin: 0; padding: 14px 24px 0; border: 0; background: none;
}
.result-summary.stats-inline > div, .result-summary.stats-inline > div + div, .result-summary.stats-inline > div:not(:first-child) {
  display: flex; flex: none; align-items: baseline; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none;
}
.result-summary.stats-inline > div[hidden] { display: none; }
.result-summary.stats-inline .metric-label { color: var(--gray-46); font-size: 13px; }
.result-summary.stats-inline p { display: inline; margin: 0; }
.result-summary.stats-inline p > strong { color: var(--gray-100); font-size: 14px; font-weight: 600; }
.result-summary.stats-inline p > span { margin-left: 1px; color: var(--gray-70); font-size: 13px; }
#view-detections .detections-note { padding-top: 6px; }
.speech-tabpanel .result-summary.stats-inline { padding: 0 0 10px; }
@media (max-width: 700px) {
  .result-summary.stats-inline { padding: 12px 16px 0; }
  .result-summary.stats-inline > div { padding: 0; }
  .speech-tabpanel .result-summary.stats-inline { padding: 0 0 10px; }
}
/* Tabs now follow the result title directly: keep only the title's bottom line, no stacked top lines */
.result-panel .workspace-toolbar, .speech-group.speech-results { border-top: 0; }
/* Desktop: the start button uses the same M size as the result actions (40px, 14px); phones keep a 44px full-width tap target */
@media (min-width: 701px) {
  .start-row .process-button, .start-row .speech-process { min-height: 40px; height: 40px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 600; }
}
.speech-export #speech-export-status.export-status { margin: 0; font-size: 11px; color: var(--gray-70); }
.speech-export #speech-export-status.export-status[data-state="approved"] { color: color-mix(in srgb, var(--mint) 45%, var(--gray-100)); }
.speech-export #speech-export-status.export-status[data-state="pending"] { color: var(--primary-blue); }
/* A start row whose button can't be pressed (job running, result shown) and has no trial hint explaining why is hidden,
   same rule as the result header actions. Before trial signup the hint + disabled button stay, so the reason is visible. */
.file-controls .start-row:has(.start-hint[hidden]):has(.primary-button:disabled) { display: none; }
/* Phone result header: actions share one full-width row (icon button + downloads splitting the rest) */
@media (max-width: 700px) {
  .result-panel .result-heading .result-actions, .result-heading .result-actions:has(#speech-delete) {
    display: flex; flex-wrap: nowrap; justify-content: stretch; gap: 8px; width: 100%;
  }
  .result-heading .result-actions .primary-button, .result-heading .result-actions .secondary-button { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 10px; }
  /* transcripts size to their content on a phone (stacked columns), capped so long ones scroll */
  .transcript, .speech-transcripts .transcript, .speech-results .speech-single .transcript { height: auto; max-height: 320px; }
}
@media (max-width: 700px) {
  .result-heading .result-actions > * { height: 40px; min-height: 40px; }
}
@media (max-width: 360px) {
  .result-heading .result-actions .primary-button .icon, .result-heading .result-actions .secondary-button .icon { display: none; }
}

/* Blank transcript lines: keep the row for offsets, drop the "대본" label and most of the height */
.transcript .utterance.blank p, .transcript .utterance.blank .speaker { line-height: 0.6; }
/* Narrow screens: the "가상 데이터" chip moves above the tabs instead of colliding with the last tab */
@media (max-width: 760px) {
  .result-panel .workspace-toolbar:has(> .sample-label:not([hidden])) { flex-wrap: wrap; }
  .result-panel .workspace-toolbar > .sample-label { order: -1; margin: 12px 0 0; }
}
