:root {
  --bg: #faf6ef;
  --card: #fff;
  --text: #1d2327;
  --muted: #4a5358;
  --teal: #0f5257;
  --line: #d8d0c2;
  --focus: #0b57d0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--teal); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .75rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

.site-header, .site-footer, main { max-width: 60rem; margin: 0 auto; padding: 1rem; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; }
.brand { margin: 0; font-weight: 700; }
ul { margin: 0; padding: 0; list-style: none; }
nav ul, .site-footer ul { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
nav a, .site-footer a { display: inline-block; padding: .6rem .25rem; min-height: 44px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; }
h1 { font-size: 1.75rem; line-height: 1.2; margin-top: 0; }
h2 { font-size: 1.2rem; }
h1:focus, h2:focus { outline: none; }
h1:focus-visible, h2:focus-visible { outline: 3px solid var(--focus); }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
button { min-height: 44px; padding: .5rem 1.25rem; border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; border: 2px solid var(--teal); }
.primary { background: var(--teal); color: #fff; }
.secondary { background: #fff; color: var(--teal); }
button[aria-disabled="true"] { opacity: .75; cursor: not-allowed; }

.note, .status { color: var(--muted); }
.status:empty { display: none; }
.status { background: #fff7e0; border: 1px solid #c79a1b; border-radius: 6px; padding: .5rem .75rem; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }

a.button { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1.25rem; border-radius: 6px; font-weight: 600; text-decoration: none; border: 2px solid var(--teal); }
a.primary { background: var(--teal); color: #fff; }
button.small { padding: .25rem .75rem; }
button[aria-pressed="true"] { background: var(--teal); color: #fff; }

.banner { background: #e8f1f2; border: 1px solid var(--teal); border-radius: 6px; padding: .5rem .75rem; font-weight: 600; }
.review-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1.5rem; }
.review-head p { margin: .25rem 0; }
.counter { font-size: 1.4rem; font-weight: 700; }
audio { width: 100%; margin: .5rem 0; }
.wave { display: block; width: 100%; height: 140px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.zoom { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0; }
.zoom input[type="range"] { flex: 1 1 10rem; min-height: 44px; }
.load-box { border: 1px solid var(--line); border-radius: 6px; padding: .75rem; margin: 1rem 0; }
.load-box progress { width: 100%; height: 1.25rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.types { border: 1px solid var(--line); border-radius: 6px; display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: .5rem .75rem; }
.types label { display: inline-flex; align-items: center; gap: .25rem; min-height: 32px; }
.types input { width: 1.2rem; height: 1.2rem; }

.transcript { border: 1px solid var(--line); border-radius: 6px; padding: .5rem .75rem; margin: .75rem 0; }
.transcript h3 { margin: .25rem 0; font-size: 1.05rem; }
.lists summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.field { display: block; margin-top: .5rem; font-weight: 600; }
.field input { display: block; width: 100%; min-height: 44px; margin-top: .25rem; padding: .25rem .5rem; font: inherit; border: 2px solid var(--muted); border-radius: 6px; }
.lists .small { margin-top: .5rem; }
.tmsg .err { font-weight: 700; color: #8a1c1c; }

.rows { display: grid; gap: .5rem; }
.row { border: 1px solid var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; align-items: stretch; }
.row.selected { border: 2px solid var(--focus); }
.row-main { flex: 1 1 18rem; text-align: left; background: transparent; border: 0; font-weight: 400; color: var(--text); }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .5rem; }
.meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .875rem; color: var(--muted); }
.meta .time { font-weight: 700; color: var(--text); }
.state { font-weight: 700; }
.state.cut { color: #8a1c1c; }
.state.keep { color: #1f5f2b; }
.state.shorten { color: #7a4b00; }
.context { display: block; margin-top: .25rem; }
mark { background: #ffe38a; color: var(--text); padding: 0 .2rem; border-radius: 3px; font-weight: 700; }
mark.is-cut, mark.is-short { text-decoration: line-through; background: #f6d6d3; }
.kept { font-weight: 700; color: #7a4b00; }
.empty { padding: 1rem; color: var(--muted); }
.help dt { font-weight: 700; float: left; clear: left; min-width: 5rem; }
.help dd { margin: 0 0 .25rem 5rem; }

.wave { touch-action: pan-y; } /* horizontal drags move handles; vertical swipes still scroll */
.wave.on-handle { cursor: ew-resize; }
.editor .pair { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.editor .pair .field { flex: 1 1 10rem; }
.editor .actions { margin: .5rem 0; }
.warn { display: block; margin-top: .25rem; font-weight: 700; color: #7a4b00; }
.row-note { display: block; margin-top: .25rem; color: var(--muted); font-style: italic; }
.bulk .actions { margin: .5rem 0; }

button:disabled { opacity: .6; cursor: not-allowed; }
.legal h1 { margin-bottom: .25rem; }
.legal h2 { margin-top: 1.5rem; }
.bullets { list-style: disc; padding-left: 1.5rem; }
.bullets li { margin: .25rem 0; }
#saved-list li > button { text-align: left; width: 100%; margin-bottom: .5rem; }

/* Phone width: the list stays fully usable; waveform editing is aimed at desktop. */
@media (max-width: 40rem) {
  main, .site-header, .site-footer { padding: .75rem; }
  .card { padding: .75rem; }
  .wave { height: 110px; }
  .row-actions { width: 100%; }
  .row-actions button { flex: 1 1 6rem; }
  .actions > button, .actions > a.button { flex: 1 1 100%; }
  .help dt { float: none; }
  .help dd { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
