/* Field-notebook palette: warm paper, graphite ink, moss accent. */
:root {
  --bg: #efede6; --panel: #f9f8f4; --ink: #1e211d; --muted: #6a6e64; --line: #d5d2c6;
  --accent: #3e6a43; --accent-ink: #f6f8f2; --field: #fdfcf9; --wave: #1e211d; --wave-dim: #c7c4b6;
  --h: 34px; --r: 5px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #131512; --panel: #1a1d19; --ink: #e5e8df; --muted: #8e9488; --line: #2e332d;
    --accent: #84b07d; --accent-ink: #131512; --field: #151714; --wave: #e5e8df; --wave-dim: #3c4239; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 "Public Sans", system-ui, sans-serif; }
main { max-width: 740px; margin: 0 auto; padding: 20px 16px 28px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
h1 { font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h1 small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
.links { display: flex; gap: 12px; font-size: 13px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }

button, select, input[type=number] {
  height: var(--h); border: 1px solid var(--line); background: var(--field); color: var(--ink);
  border-radius: var(--r); font: inherit; padding: 0 10px; cursor: pointer;
}
input[type=number] { cursor: text; }
button:hover:not(:disabled), select:hover { border-color: var(--muted); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; padding: 0 18px; }
button.icon { width: var(--h); padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none; }
button.icon.sm { width: 30px; height: 30px; }
button.icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
button.icon svg .fill, button.icon svg circle { fill: currentColor; stroke: none; }
textarea:focus, select:focus, input:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }

textarea { display: block; width: 100%; min-height: 96px; resize: vertical; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--field); color: var(--ink); font: inherit; font-size: 15px; padding: 9px 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.chips button { height: 26px; font-size: 12px; padding: 0 9px; color: var(--muted); }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.voice { display: flex; gap: 4px; align-items: center; min-width: 0; }
.voice select { width: 200px; min-width: 0; }
.speed { display: flex; align-items: center; gap: 8px; height: var(--h); padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--field); color: var(--muted); font-size: 13px; }
.speed input { width: 96px; accent-color: var(--accent); margin: 0; }
.speed b { color: var(--ink); font-weight: 500; min-width: 40px; text-align: right; }

details { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 500; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+ "; font-family: "JetBrains Mono", monospace; }
details[open] summary::before { content: "− "; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 14px; margin-top: 10px; }
.grid label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.grid label > span { display: flex; justify-content: space-between; }
.grid label b { color: var(--ink); font-weight: 500; }
.grid input[type=range] { width: 100%; accent-color: var(--accent); height: 18px; margin: 0; }
.grid select, .grid input[type=number] { width: 100%; height: 30px; }
.inline { display: flex; gap: 6px; }
.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.status { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); min-height: 20px; }
.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 6px 0 10px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.files { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; color: var(--muted); }
.files .done { color: var(--ink); }
.loader.compact .bar, .loader.compact .files { display: none; }
.loader.compact { padding: 8px 12px; }

.player { display: flex; gap: 8px; align-items: center; }
canvas { display: block; flex: 1 1 auto; min-width: 0; height: var(--h); cursor: pointer; }
.time { white-space: nowrap; min-width: 86px; text-align: right; color: var(--muted); }
footer { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.err { color: #b4432a; }
[hidden] { display: none !important; }

@media (max-width: 560px) {
  .voice { flex: 1 1 100%; } .voice select { flex: 1 1 auto; width: auto; }
  .speed { flex: 1 1 0; min-width: 0; } .speed input { flex: 1 1 auto; width: auto; min-width: 0; }
  .toolbar > .grow { display: none; }
  .time { min-width: 0; }
}
