:root {
  color-scheme: light;
  --ink: #172236;
  --muted: #5b6575;
  --line: #d8dee8;
  --surface: #ffffff;
  --soft: #f5f7fb;
  --accent: #174ea6;
  --focus: #ffbf47;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--soft); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.site-header { display: flex; align-items: center; gap: 1rem; padding: .85rem max(1rem, calc((100vw - 1200px) / 2)); background: #102a43; color: white; }
.site-header a { color: white; }
.site-header nav { display: flex; gap: .9rem; }
.brand { font-size: 1.25rem; }
.signed-in { margin-left: auto; font-size: .9rem; }
.site-header button { padding: .45rem .7rem; }
.page-shell { width: min(1200px, calc(100% - 2rem)); margin: 2rem auto; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.page-heading h1 { margin: 0; }
.page-heading p { margin: .25rem 0; }
.eyebrow { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .8rem; }
.status-badge { display: inline-block; border: 2px solid #8a4b08; border-radius: 999px; padding: .25rem .65rem; background: #fff4d6; font-weight: 800; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0; }
.filter-panel, .card, .empty-state { background: var(--surface); border: 1px solid var(--line); border-radius: .6rem; padding: 1rem; margin: 1rem 0; }
.filter-grid, .detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .85rem; }
.field label, dt { display: block; font-weight: 700; margin-bottom: .2rem; }
.field input, .field select, .field textarea { width: 100%; padding: .55rem; border: 1px solid #8792a2; border-radius: .3rem; background: white; color: var(--ink); font: inherit; }
.field-error, .error-box { color: #8d1d14; font-weight: 700; }
.actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
button { border: 0; border-radius: .3rem; padding: .6rem .9rem; color: white; background: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: .6rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eaf0f8; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); font-size: .9em; }
.pagination { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; }
.pagination div { display: flex; gap: 1rem; }
.detail-grid > div { border-left: 3px solid var(--line); padding-left: .7rem; }
dd { margin: 0; }
.recording-record { border-top: 1px solid var(--line); margin-top: 1rem; }
.recording-player { margin: 1rem 0; padding: .85rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--soft); }
.recording-player audio { display: block; width: min(100%, 560px); margin-top: .75rem; }
.recording-player audio[hidden] { display: none; }
.playback-status { min-height: 1.5em; margin: .5rem 0; }
.record-list, .timeline { padding-left: 1.3rem; }
.notice { border-left: 4px solid var(--accent); padding: .6rem .8rem; background: #eef5ff; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.transcript-record { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.transcript-text { white-space: normal; overflow-wrap: anywhere; padding: .75rem; background: var(--soft); border-radius: .3rem; }
.transcript-form, .inline-form, .history-entry, .search-result { margin-top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 700px) {
  .site-header { align-items: flex-start; flex-wrap: wrap; }
  .signed-in { width: 100%; margin-left: 0; }
  .page-shell { width: min(100% - 1rem, 1200px); margin: 1rem auto; }
  .page-heading { align-items: flex-start; }
  .filter-grid, .detail-grid { grid-template-columns: 1fr; }
  .pagination { flex-direction: column; }
  th, td { padding: .55rem; }
}
