:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #f1ede6;
  --text: #1f1c18;
  --muted: #6b645a;
  --line: #e2dcd2;
  --accent: #7a3e1d;
  --accent-ink: #ffffff;
  --ok: #2f6b3a;
  --warn: #a4471c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(30, 20, 10, 0.06), 0 4px 16px rgba(30, 20, 10, 0.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161412;
    --surface: #1f1c19;
    --surface-2: #29251f;
    --text: #efe9e0;
    --muted: #a59d91;
    --line: #38322b;
    --accent: #d9935f;
    --accent-ink: #1a120c;
    --ok: #7fbf8a;
    --warn: #f0905e;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #161412; --surface: #1f1c19; --surface-2: #29251f; --text: #efe9e0; --muted: #a59d91;
  --line: #38322b; --accent: #d9935f; --accent-ink: #1a120c; --ok: #7fbf8a; --warn: #f0905e; --shadow: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, system-ui, -apple-system, Segoe UI, sans-serif;
}
.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 650; line-height: 1.2; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 21px; margin-bottom: 12px; }
h3 { font-size: 16px; font-family: Inter, sans-serif; font-weight: 600; }
.muted { color: var(--muted); }
.tiny { font-size: 13px; }
.eyebrow { margin: 0 0 2px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }

.top { border-bottom: 1px solid var(--line); background: var(--surface); margin-bottom: 24px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; gap: 12px; }

.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }

label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 14px; }
.label-text { font-weight: 500; font-size: 14px; }
input, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 400;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input { margin-top: 0; flex: 1 1 200px; }

button, .file-btn, .btn {
  appearance: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: progress; }
button.ghost, .file-btn, .btn.ghost { background: transparent; color: var(--accent); }
button.small, .file-btn, .btn.small { padding: 6px 12px; font-size: 13px; }
.file-btn, .btn { display: inline-block; margin: 0; text-decoration: none; }
.file-btn input { display: none; }

.transcript-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
details { margin: 8px 0 14px; }
summary { cursor: pointer; font-weight: 500; font-size: 14px; }
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.output-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin: 4px 0 14px; scrollbar-width: thin; }
.tabs button { background: var(--surface); color: var(--text); border-color: var(--line); padding: 7px 14px; font-size: 14px; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.panel { display: none; }
.panel.active { display: block; }
.group-title { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-family: Inter, sans-serif; font-weight: 600; }
.group-title:first-child { margin-top: 0; }

.field { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.field-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.field-head .meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.count { font-size: 12px; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.count.ok { color: var(--ok); }
.count.over { color: var(--warn); font-weight: 600; }
.value { white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; margin: 0; }
.value.rich { white-space: normal; }
.value.rich h4 { font-size: 15px; margin: 14px 0 4px; }
.value.rich p { margin: 0 0 8px; }
.value.rich ul { margin: 0 0 8px; padding-left: 20px; }
.copy.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.badge { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin-left: 6px; }
.note { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--surface-2); border-radius: 0 8px 8px 0; margin-bottom: 8px; }
.error { color: var(--warn); font-weight: 500; }

footer { padding-top: 10px; padding-bottom: 40px; }
