:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #efebe4;
  --text: #1c1a17;
  --muted: #6b655c;
  --line: #e2ddd4;
  --accent: #e0561f;
  --accent-ink: #ffffff;
  --accent-soft: #fbe3d6;
  --good: #2f7d4f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 26, 23, .06), 0 6px 24px rgba(28, 26, 23, .06);
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110; --surface: #1b1a18; --surface-2: #24221f; --text: #f1ede6; --muted: #a39c91;
    --line: #2f2c28; --accent: #ff7a3d; --accent-ink: #1a0d06; --accent-soft: #3a2316; --good: #5cc287;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #121110; --surface: #1b1a18; --surface-2: #24221f; --text: #f1ede6; --muted: #a39c91;
  --line: #2f2c28; --accent: #ff7a3d; --accent-ink: #1a0d06; --accent-soft: #3a2316; --good: #5cc287;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: 920px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 58px; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: 8px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--mono); font-size: .85rem; }
.site-header nav { margin-left: auto; display: flex; gap: 4px; overflow-x: auto; }
.site-header nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: .92rem; white-space: nowrap; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--text); background: var(--surface-2); text-decoration: none; }

main { padding: 28px 0 48px; }
.hero { padding: 24px 0 8px; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 560px; }

.search { display: flex; gap: 8px; margin-top: 18px; }
.search input { flex: 1; min-width: 0; font: inherit; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.small { padding: 8px 12px; font-size: .9rem; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.results { margin-top: 10px; display: grid; gap: 6px; }
.result { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); }
.result:hover { border-color: var(--accent); text-decoration: none; }
.result .t { font-weight: 600; }
.result .a { color: var(--muted); font-size: .9rem; }
.result .meta { font-family: var(--mono); font-size: .85rem; color: var(--muted); white-space: nowrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 20px 0; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; text-align: center; padding: 20px; background: var(--surface-2); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-title { font-weight: 700; font-size: 1.1rem; }
.dz-sub { color: var(--muted); font-size: .9rem; }

.progress { margin-top: 16px; }
.progress .bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.progress-text { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.stat .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .value { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.stat .sub { font-size: .8rem; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { min-width: 64px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; transition: background .1s, border-color .1s; }
.chip .n { font-family: var(--mono); font-weight: 700; font-size: 1.1rem; }
.chip .r { font-size: .75rem; color: var(--muted); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.on .r { color: var(--accent-ink); opacity: .8; }

.timeline { display: flex; gap: 3px; overflow-x: auto; padding: 4px 0 10px; scroll-behavior: smooth; }
.tl { flex: none; padding: 8px 6px; border-radius: 8px; background: var(--surface-2); font-family: var(--mono); font-size: .85rem; text-align: center; cursor: pointer; border: 1px solid transparent; color: var(--text); }
.tl.rest { color: var(--muted); }
.tl.on { border-color: var(--accent); background: var(--accent-soft); }
audio { width: 100%; margin: 10px 0; }

.ad-slot { margin: 20px 0; min-height: 90px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; color: var(--muted); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--text); }
.feature:hover { border-color: var(--accent); text-decoration: none; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
select, .field input { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }

.notice { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: .92rem; }
.tag { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ok { color: var(--good); }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
td.mono { font-family: var(--mono); }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: .88rem; }
.site-footer p { margin: 0 0 6px; }
[hidden] { display: none !important; }
@media (max-width: 520px) {
  .search { flex-direction: column; }
  .site-header nav a { padding: 6px 8px; }
  .brand-name { display: none; }
}
