:root {
  color-scheme: light;
  --bg: #fffdfa;
  --bg-quiet: #f6f3ed;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --panel-soft: #f7faf8;
  --ink: #151d1d;
  --ink-soft: #2f3938;
  --muted: #66716d;
  --muted-strong: #4f5b58;
  --line: rgba(26, 38, 37, 0.12);
  --line-strong: rgba(26, 38, 37, 0.2);
  --teal: #0d7467;
  --teal-dark: #075c52;
  --blue: #2f6fb1;
  --clay: #b45f49;
  --coral: #d95740;
  --amber: #a36d21;
  --wash-teal: #e9f5f2;
  --wash-blue: #edf5fb;
  --wash-clay: #fbf0eb;
  --shadow: 0 26px 70px rgba(28, 39, 38, 0.1);
  --shadow-soft: 0 12px 34px rgba(28, 39, 38, 0.07);
  --radius: 8px;
  --review-panel-height: max(620px, calc(100vh - 188px));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

*::selection {
  background: rgba(13, 116, 103, 0.18);
}

[hidden] {
  display: none !important;
}

html {
  overflow-y: scroll;
}

html.transcript-scroll-locked,
html.transcript-scroll-locked body {
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.96) 0%, rgba(248, 249, 245, 0.96) 43%, rgba(242, 247, 247, 0.98) 100%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 6%, rgba(13, 116, 103, 0.035) 6.2% 6.35%, transparent 6.55% 100%),
    repeating-linear-gradient(90deg, rgba(21, 29, 29, 0.025) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(180deg, rgba(21, 29, 29, 0.018) 0 1px, transparent 1px 48px);
  content: "";
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 111, 177, 0.24);
  outline-offset: 2px;
}

.clinical-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.88)),
    var(--panel);
  box-shadow: var(--shadow-soft);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(24px, 5vw, 72px);
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(360px, 520px);
  gap: 22px;
  width: min(1040px, 100%);
  align-items: stretch;
}

.login-panel {
  padding: clamp(24px, 4vw, 42px);
}

.login-brand {
  align-items: flex-start;
  margin-bottom: 28px;
}

.login-form {
  display: grid;
}

.login-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--coral);
  font-size: 0.9rem;
}

.login-visual {
  position: relative;
  display: grid;
  min-height: 440px;
  align-content: space-between;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(13, 116, 103, 0.08), rgba(47, 111, 177, 0.08) 48%, rgba(180, 95, 73, 0.07)),
    #ffffff;
}

.login-visual::before {
  position: absolute;
  inset: 88px -12% auto -12%;
  height: 150px;
  background:
    linear-gradient(90deg, transparent, rgba(13, 116, 103, 0.18), transparent),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(13, 116, 103, 0.12) 18px 20px, transparent 20px 38px);
  clip-path: polygon(0 48%, 7% 48%, 10% 32%, 13% 64%, 18% 64%, 22% 44%, 27% 44%, 30% 28%, 34% 72%, 40% 72%, 44% 45%, 50% 45%, 54% 62%, 59% 62%, 63% 36%, 68% 36%, 72% 58%, 77% 58%, 81% 42%, 87% 42%, 91% 55%, 100% 55%, 100% 100%, 0 100%);
  content: "";
  opacity: 0.72;
}

.visual-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.84rem;
}

.visual-header strong {
  border: 1px solid rgba(13, 116, 103, 0.22);
  border-radius: 999px;
  background: rgba(233, 245, 242, 0.86);
  color: var(--teal-dark);
  padding: 7px 10px;
  font-size: 0.78rem;
}

.signal-preview {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 176px;
  padding: 20px;
}

.signal-preview span {
  width: 9px;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), var(--teal));
  opacity: 0.58;
}

.signal-preview span:nth-child(1),
.signal-preview span:nth-child(12) {
  height: 30px;
  opacity: 0.36;
}

.signal-preview span:nth-child(2),
.signal-preview span:nth-child(11) {
  height: 58px;
  opacity: 0.48;
}

.signal-preview span:nth-child(3),
.signal-preview span:nth-child(10) {
  height: 82px;
  opacity: 0.64;
}

.signal-preview span:nth-child(4),
.signal-preview span:nth-child(9) {
  height: 48px;
  opacity: 0.52;
}

.signal-preview span:nth-child(5),
.signal-preview span:nth-child(8) {
  height: 104px;
  opacity: 0.76;
}

.signal-preview span:nth-child(6),
.signal-preview span:nth-child(7) {
  height: 70px;
  opacity: 0.68;
}

.transcript-preview {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(26, 38, 37, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(28, 39, 38, 0.06);
  padding: 14px;
}

.transcript-preview + .transcript-preview {
  margin-top: 10px;
}

.transcript-preview span {
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.transcript-preview p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.muted-preview {
  opacity: 0.72;
}

.app-shell {
  position: relative;
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 2.4vw, 34px);
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 4px 0 20px;
}

.topbar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background:
    linear-gradient(90deg, transparent, rgba(13, 116, 103, 0.28), rgba(47, 111, 177, 0.2), transparent);
  content: "";
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #101817, #0b5f56 58%, #2f6fb1);
  box-shadow: 0 14px 28px rgba(13, 116, 103, 0.16);
  color: #ffffff;
  font-weight: 820;
  letter-spacing: 0;
}

.brand h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.72rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand p {
  max-width: 620px;
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted-strong);
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 650;
  white-space: nowrap;
}

.status-pill.ready {
  border-color: rgba(13, 116, 103, 0.24);
  color: var(--teal-dark);
  background: var(--wash-teal);
}

.status-pill.warning {
  border-color: rgba(163, 109, 33, 0.28);
  color: var(--amber);
  background: #fff8e9;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workspace.capture-panel-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
  gap: 0;
}

.capture-column,
.review-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.workspace.capture-panel-collapsed .capture-column {
  visibility: hidden;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.panel {
  padding: 18px;
}

.review-column {
  grid-template-rows: auto minmax(0, var(--review-panel-height));
  min-height: calc(100vh - 126px);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 250, 0.9)),
    var(--panel-solid);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  letter-spacing: 0;
}

.heading-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.section-heading > span,
.section-heading > .heading-actions > span {
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

.transcript-heading {
  align-items: flex-start;
}

.heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.mini-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.mini-button.active {
  border-color: rgba(13, 116, 103, 0.32);
  background: var(--wash-teal);
  color: var(--teal-dark);
}

.shortcut-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 250, 248, 0.72);
  margin-bottom: 12px;
  padding: 12px;
}

.shortcut-panel[hidden] {
  display: none;
}

.shortcut-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shortcut-header strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.shortcut-step-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.shortcut-step-control input {
  width: 68px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.9rem;
}

.shortcut-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.shortcut-action {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 5px;
  min-width: 0;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 8px;
  text-align: center;
}

.shortcut-action:hover {
  border-color: rgba(13, 116, 103, 0.34);
  background: var(--wash-teal);
}

.shortcut-command,
.shortcut-binding-button {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  padding: 0;
}

.shortcut-command {
  display: grid;
  align-content: center;
  min-height: 28px;
}

.shortcut-command:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.shortcut-command span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  font-weight: 760;
  line-height: 1.2;
}

.shortcut-binding-button {
  display: inline-grid;
  justify-self: center;
  padding: 2px;
}

.shortcut-binding-button:hover,
.shortcut-binding-button.recording {
  background: rgba(47, 111, 177, 0.1);
}

.shortcut-binding-button.recording kbd {
  border-color: rgba(47, 111, 177, 0.5);
  color: var(--blue);
}

.shortcut-action kbd {
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 5px;
}

.dropzone {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 144px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(13, 116, 103, 0.35);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(233, 245, 242, 0.82), rgba(237, 245, 251, 0.66)),
    #ffffff;
  padding: 18px;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.dropzone::before {
  position: absolute;
  inset: auto 18px 18px 18px;
  height: 32px;
  background:
    repeating-linear-gradient(90deg, rgba(13, 116, 103, 0.12) 0 2px, transparent 2px 12px);
  clip-path: polygon(0 55%, 9% 55%, 12% 25%, 15% 72%, 21% 72%, 25% 42%, 32% 42%, 36% 65%, 42% 65%, 47% 38%, 53% 38%, 58% 62%, 66% 62%, 70% 46%, 77% 46%, 82% 68%, 88% 68%, 92% 52%, 100% 52%, 100% 100%, 0 100%);
  content: "";
  opacity: 0.7;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--teal);
  background: var(--wash-teal);
  box-shadow: 0 16px 32px rgba(13, 116, 103, 0.1);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone-title,
.dropzone-subtitle {
  position: relative;
  z-index: 1;
}

.dropzone-title {
  color: var(--ink);
  font-weight: 780;
}

.dropzone-subtitle {
  max-width: 280px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.divider::before,
.divider::after {
  height: 1px;
  background: var(--line);
  content: "";
}

.record-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 250, 248, 0.76);
}

.record-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.record-meta span {
  color: var(--muted);
  font-size: 0.86rem;
}

.record-meta strong {
  font-variant-numeric: tabular-nums;
}

.field-label {
  display: block;
  margin: 12px 0 7px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 720;
}

.label-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 7px;
}

.label-row .field-label {
  margin: 0;
}

.info-host {
  position: relative;
}

.info-button {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(47, 111, 177, 0.24);
  border-radius: 999px;
  background: var(--wash-blue);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 820;
  line-height: 1;
}

.info-button:hover,
.info-button:focus-visible,
.info-button.active {
  border-color: rgba(47, 111, 177, 0.46);
  background: #dfeefa;
  outline: none;
}

.help-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(340px, calc(100vw - 64px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.45;
  padding: 10px 12px;
  text-align: left;
}

.section-heading .help-tooltip {
  right: 0;
  left: auto;
  text-align: left;
}

.heading-title .help-tooltip {
  right: auto;
  left: 0;
}

.info-button:hover + .help-tooltip,
.info-button:focus-visible + .help-tooltip,
.info-button.active + .help-tooltip {
  display: block;
}

textarea,
input[type="text"],
input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  border-color: rgba(47, 111, 177, 0.64);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(47, 111, 177, 0.12);
}

.vocabulary-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.vocabulary-heading {
  margin-bottom: 4px;
}

.vocabulary-search {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.vocabulary-search .field-label {
  margin: 0;
}

.vocabulary-search-status {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.term-category + .term-category {
  margin-top: 12px;
}

.term-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0 7px;
}

.term-category-header .field-label {
  margin: 0;
}

.vocabulary-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  text-decoration: none;
  white-space: nowrap;
}

.term-box {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 250, 248, 0.72);
  padding: 8px;
}

.term-list {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 38px;
  max-height: 122px;
  overflow: auto;
  padding-right: 2px;
}

.term-list.locked {
  max-height: 180px;
}

.term-empty {
  align-self: center;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 8px 2px;
}

.term-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid rgba(13, 116, 103, 0.2);
  border-radius: 7px;
  background: var(--wash-teal);
  color: var(--ink);
  overflow: hidden;
}

.term-chip.locked {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(28, 39, 38, 0.14);
}

.term-chip.exact {
  border-color: rgba(13, 116, 103, 0.62);
  box-shadow: 0 0 0 2px rgba(13, 116, 103, 0.12);
}

.term-chip-text {
  max-width: min(28ch, calc(100vw - 104px));
  overflow: hidden;
  padding: 5px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-chip-editor {
  flex: 1 1 auto;
  width: min(26ch, calc(100vw - 104px));
  min-width: 7ch;
  max-width: 100%;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 5px 7px !important;
}

.term-chip-editor:focus {
  background: #ffffff !important;
  box-shadow: inset 0 0 0 2px rgba(47, 111, 177, 0.26) !important;
}

.term-remove {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-weight: 800;
  line-height: 1;
}

.term-remove:hover,
.term-remove:focus-visible {
  background: #ffffff;
  color: var(--coral);
  outline: none;
}

.primary-button,
.secondary-button,
.tab-button {
  border: 0;
  border-radius: var(--radius);
  min-height: 42px;
  padding: 10px 14px;
  font-weight: 760;
  letter-spacing: 0;
}

.primary-button {
  background: linear-gradient(135deg, var(--teal), #0b625a);
  box-shadow: 0 12px 24px rgba(13, 116, 103, 0.17);
  color: #ffffff;
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--teal-dark), #064d46);
}

.primary-button.recording {
  background: linear-gradient(135deg, var(--coral), #b93f2d);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.wide {
  width: 100%;
  margin-top: 16px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #ffffff;
}

.compact-button {
  min-height: 38px;
  padding: 8px 12px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 248, 0.8);
  padding: 10px;
}

.tab-button {
  width: 100%;
  min-width: 0;
  height: 42px;
  background: transparent;
  color: var(--muted);
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-button.active {
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(28, 39, 38, 0.08);
  color: var(--ink);
}

.tab-panel {
  height: var(--review-panel-height);
  min-height: var(--review-panel-height);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - 184px);
  min-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.chat-message {
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(28, 39, 38, 0.04);
  padding: 12px 14px;
}

.chat-message.user {
  align-self: flex-end;
  border-color: rgba(47, 111, 177, 0.2);
  background: var(--wash-blue);
}

.chat-message.assistant {
  align-self: flex-start;
}

.chat-message.system {
  align-self: center;
  max-width: 900px;
  border-color: rgba(180, 95, 73, 0.2);
  background: var(--wash-clay);
}

.chat-message strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.chat-message p {
  margin: 0;
  line-height: 1.55;
}

.audio-console {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

audio {
  width: 100%;
}

.timeline-readout {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.timeline-readout strong {
  color: var(--ink);
}

.position-line {
  margin-left: auto;
  color: var(--teal-dark);
  font-weight: 650;
}

#waveformCanvas {
  width: 100%;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.sync-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 13.5%);
  gap: 16px;
}

.transcript-surface,
.segment-surface {
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(28, 39, 38, 0.04);
  padding: 16px;
}

.transcript-text {
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink-soft);
  line-height: 1.82;
  font-size: 1.02rem;
}

.transcript-readable-text {
  margin: 0;
  white-space: pre-wrap;
}

.transcript-editor {
  display: block;
  width: 100%;
  height: min(520px, calc(var(--review-panel-height) - 240px));
  min-height: 430px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  line-height: 1.72;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  resize: vertical;
  white-space: pre-wrap;
}

.transcript-editor:focus {
  border-color: rgba(47, 111, 177, 0.5);
  box-shadow: 0 0 0 3px rgba(47, 111, 177, 0.12);
  outline: none;
}

.transcript-fragment {
  border-radius: 6px;
  padding: 2px 4px;
  white-space: pre-wrap;
  transition: background 120ms ease, color 120ms ease;
}

.transcript-fragment:hover {
  background: var(--wash-blue);
}

.transcript-fragment.active {
  background: var(--wash-teal);
  box-shadow: inset 0 -2px 0 var(--teal);
  color: var(--ink);
}

.segment-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
}

.segment-surface {
  padding: 12px;
}

.segment-surface .section-heading {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.segment-row {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 250, 248, 0.72);
  padding: 8px;
  color: var(--ink);
  text-align: left;
}

.segment-row:hover,
.segment-row.active {
  border-color: rgba(13, 116, 103, 0.32);
  background: var(--wash-teal);
}

.segment-time {
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.segment-text {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 39, 38, 0.04);
  padding: 14px;
}

.detail-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.history-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 236px);
  overflow: auto;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 39, 38, 0.04);
  padding: 12px;
  text-align: left;
}

.history-row:hover {
  border-color: rgba(13, 116, 103, 0.32);
  background: var(--wash-teal);
}

.history-title {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta,
.history-preview {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.history-preview {
  margin-top: 6px;
}

.history-expiry {
  align-self: start;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .login-grid {
    grid-template-columns: minmax(300px, 440px);
    justify-content: center;
  }

  .login-visual {
    min-height: 340px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .workspace,
  .sync-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .workspace.capture-panel-collapsed .capture-column {
    display: none;
  }

  .review-column {
    min-height: auto;
  }

  .chat-log {
    height: 460px;
    min-height: 360px;
  }

  .position-line {
    flex-basis: 100%;
    margin-left: 0;
  }

  .timeline-readout {
    flex-wrap: wrap;
  }

  .shortcut-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .login-shell {
    padding: 16px;
  }

  .login-grid {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }
}

@media (max-width: 560px) {
  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .brand h1 {
    font-size: 1.28rem;
  }

  .brand p {
    display: none;
  }

  .tabs {
    grid-auto-columns: minmax(132px, 1fr);
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
  }

  .record-box,
  .export-row,
  .history-row {
    align-items: stretch;
    flex-direction: column;
  }

  .history-row {
    display: flex;
  }

  .segment-row {
    grid-template-columns: 1fr;
  }

  .shortcut-header {
    align-items: stretch;
    flex-direction: column;
  }

  .shortcut-step-control {
    justify-content: space-between;
  }

  .shortcut-actions {
    grid-template-columns: 1fr;
  }

  .term-chip,
  .term-chip-editor {
    width: 100%;
  }
}
