/* Layout: a fixed tool rail on the left (like a mixer's channel list) and a wide workspace on the right.
   On phones the rail becomes a slide-in drawer under a compact top bar. */
:root {
  --bg: #f1f2f4;
  --surface: #ffffff;
  --surface-2: #eceef1;
  --line: #d9dde3;
  --fg: #14171c;
  --muted: #586170;
  --faint: #8a929e;
  --accent: #a96500;
  --accent-bright: #e59a1c;
  --accent-soft: rgba(229, 154, 28, 0.14);
  --on-accent: #1d1303;
  --signal: #0d8577;
  --wave: #262d38;
  --wave-dim: #bcc3cd;
  --danger: #c23d3a;
  --ok: #18865a;
  --shadow: 0 1px 2px rgba(18, 22, 28, 0.05), 0 10px 30px rgba(18, 22, 28, 0.06);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 12px;
  --rail: 252px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d10; --surface: #13161b; --surface-2: #1a1e24; --line: #262b33; --fg: #e8eaee; --muted: #9ca4b0; --faint: #687180;
    --accent: #f3b44a; --accent-bright: #f3b44a; --accent-soft: rgba(243, 180, 74, 0.12); --on-accent: #1d1303;
    --signal: #4fcfbf; --wave: #e8eaee; --wave-dim: #363d48; --danger: #f06f6a; --ok: #4cc38a;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 12px 32px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d10; --surface: #13161b; --surface-2: #1a1e24; --line: #262b33; --fg: #e8eaee; --muted: #9ca4b0; --faint: #687180;
  --accent: #f3b44a; --accent-bright: #f3b44a; --accent-soft: rgba(243, 180, 74, 0.12); --on-accent: #1d1303;
  --signal: #4fcfbf; --wave: #e8eaee; --wave-dim: #363d48; --danger: #f06f6a; --ok: #4cc38a;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ico { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100%; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 14px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; text-decoration: none; color: var(--fg); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--fg); color: var(--bg); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.nav { display: flex; flex-direction: column; gap: 16px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); padding: 0 12px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--muted); text-decoration: none; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--fg); }
.nav-item.active { background: var(--surface-2); color: var(--fg); }
.nav-item.active .ico { color: var(--accent); }
.rail-file {
  margin-top: auto; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px;
}
.rail-file .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-file .meta { color: var(--muted); font-size: 12px; }
.rail-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; font-size: 12px; color: var(--faint); }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }

.topbar { display: none; }
.main {
  min-width: 0;
  padding-block: 36px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.view { display: flex; flex-direction: column; gap: 20px; }
[data-view]:empty { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
    padding-block: 10px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
  .rail {
    position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(300px, 86vw); height: 100%;
    transform: translateX(-102%); transition: transform 0.22s ease; box-shadow: var(--shadow);
    padding-top: calc(22px + env(safe-area-inset-top, 0px));
  }
  .app.nav-open .rail { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.4); }
  .main { padding-block: 22px 48px; }
}

/* ---------- tool header ---------- */
.tool-head { display: flex; flex-direction: column; gap: 6px; padding-bottom: 4px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); font-weight: 600; }
.tool-head h1 { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.15; font-weight: 700; }
.tool-head p { color: var(--muted); max-width: 64ch; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.card-title { font-family: var(--f-display); font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent-bright); border-color: var(--accent-bright); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn .ico { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.input, .select, .textarea {
  height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); width: 100%; min-width: 0;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 96px; }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-bright); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 10px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 7px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent-bright); width: 16px; height: 16px; }

input[type="range"] { width: 100%; accent-color: var(--accent-bright); cursor: pointer; }
.slider-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.readout { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.readout small { font-size: 13px; color: var(--muted); margin-left: 3px; }

/* ---------- dropzone ---------- */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  padding: 44px 20px; border: 1.5px dashed var(--line); border-radius: var(--r); background: var(--surface);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: var(--accent-bright); background: var(--accent-soft); }
.drop .ico { width: 34px; height: 34px; color: var(--accent); }
.drop strong { font-family: var(--f-display); font-size: 19px; font-weight: 600; }
.drop .hint { color: var(--muted); font-size: 13px; }
.drop-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.privacy { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.privacy .ico { width: 15px; height: 15px; color: var(--ok); }

.file-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
}
.file-badge {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); font-family: var(--f-mono); font-size: 11px; font-weight: 600; color: var(--accent);
}
.file-row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.loading-row { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent-bright); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-size: 14px; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.note .ico { width: 17px; height: 17px; margin-top: 2px; color: var(--accent); }
.note.warn { background: var(--accent-soft); color: var(--fg); }

/* ---------- waveform & transport ---------- */
.wave-card { padding: 0; overflow: hidden; }
.wave { display: block; width: 100%; height: 168px; cursor: pointer; touch-action: none; background: var(--surface); }
.wave.tall { height: 200px; }
.transport {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.play-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--fg); color: var(--bg);
}
.play-btn .ico { width: 18px; height: 18px; }
.time { font-size: 13px; color: var(--muted); }
.time b { color: var(--fg); font-weight: 500; }
.transport .spacer { flex: 1; }
.ab { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.ab button { border: 0; background: transparent; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; letter-spacing: 0.04em; }
.ab button.on { background: var(--fg); color: var(--bg); }
.pstatus { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }

/* ---------- export bar ---------- */
.export {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 14px; align-items: end;
  padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.export .est { font-size: 13px; color: var(--muted); grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.export .est b { color: var(--fg); font-weight: 600; }
@media (max-width: 640px) { .export { grid-template-columns: minmax(0, 1fr); } }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; grid-column: 1 / -1; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent-bright); transition: width 0.2s; }
.result { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; font-size: 14px; }
.result .ok { color: var(--ok); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.pill.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.pill.warn { color: var(--accent); background: var(--accent-soft); }
.pill.run { color: var(--signal); background: color-mix(in srgb, var(--signal) 13%, transparent); }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 18px 0 10px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lede { font-size: 17px; color: var(--muted); margin-top: 16px; max-width: 46ch; }
.hero .row { margin-top: 22px; }
.hero-scope { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); aspect-ratio: 16 / 11; max-width: 100%; }
.hero-scope canvas { width: 100%; height: 100%; display: block; }
.hero-scope .scope-label { position: absolute; left: 14px; top: 12px; font-family: var(--f-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
@media (max-width: 860px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.section-title { font-family: var(--f-display); font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); font-weight: 600; margin: 14px 0 -6px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tool-card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
}
.tool-card:hover { border-color: var(--accent-bright); transform: translateY(-2px); }
.tool-card .ico { width: 24px; height: 24px; color: var(--accent); }
.tool-card h3 { font-size: 16px; font-weight: 600; margin-top: 6px; }
.tool-card p { font-size: 13.5px; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fact { padding: 16px 18px; border-left: 2px solid var(--line); }
.fact b { display: block; font-family: var(--f-display); font-size: 15px; margin-bottom: 3px; }
.fact span { color: var(--muted); font-size: 13.5px; }
@media (max-width: 760px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* ---------- converter list ---------- */
.queue { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.q-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.q-item:first-child { border-top: 0; }
.q-item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .meta { color: var(--muted); font-size: 12.5px; }
.q-item .bar { height: 3px; border-radius: 99px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.q-item .bar i { display: block; height: 100%; width: 0; background: var(--signal); transition: width 0.2s; }
@media (max-width: 560px) { .q-item { grid-template-columns: minmax(0, 1fr) auto; } .q-item .file-badge { display: none; } }

/* ---------- analyzer ---------- */
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
.verdict .badge { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; }
.verdict .badge .ico { width: 32px; height: 32px; }
.verdict.good .badge { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.verdict.warn .badge { background: var(--accent-soft); color: var(--accent); }
.verdict.bad .badge { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.verdict h2 { font-size: 22px; }
.verdict p { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.metric { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.metric .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }
.metric .v { font-family: var(--f-mono); font-size: 18px; font-variant-numeric: tabular-nums; }
.metric .s { font-size: 12px; color: var(--faint); }
.spec-wrap { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.spec { display: block; width: 100%; height: 380px; }
.chart { display: block; width: 100%; height: 220px; }
@media (max-width: 600px) { .spec { height: 300px; } }

/* ---------- tag editor ---------- */
.tag-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .tag-layout { grid-template-columns: minmax(0, 1fr); } }
.cover {
  aspect-ratio: 1; width: 100%; max-width: 100%; border-radius: 10px; background: var(--surface-2);
  display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); cursor: pointer; position: relative;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .empty { color: var(--faint); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; text-align: center; padding: 12px; }
.cover.over { outline: 2px dashed var(--accent-bright); outline-offset: -6px; }
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.form-grid .c2 { grid-column: span 2; } .form-grid .c3 { grid-column: span 3; } .form-grid .c6 { grid-column: span 6; }
@media (max-width: 560px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .c3, .form-grid .c6 { grid-column: span 2; } .form-grid .c2 { grid-column: span 1; } }

/* ---------- equalizer ---------- */
.eq { display: grid; grid-template-columns: auto 1px repeat(10, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.eq-band { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.eq-band input[type="range"] { writing-mode: vertical-lr; direction: rtl; width: 28px; height: 170px; }
.eq-band .val { font-family: var(--f-mono); font-size: 11.5px; color: var(--fg); font-variant-numeric: tabular-nums; }
.eq-band .hz { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.eq-sep { background: var(--line); }
.eq-curve { display: block; width: 100%; height: 140px; border-radius: 10px; background: var(--surface-2); }
@media (max-width: 560px) { .eq-band input[type="range"] { height: 140px; width: 22px; } .eq { gap: 2px; } }

/* ---------- speaker test ---------- */
.stereo { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.spk {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 12px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; transition: border-color 0.15s, background 0.15s;
}
.spk:hover { border-color: var(--accent-bright); }
.spk.live { border-color: var(--accent-bright); background: var(--accent-soft); }
.spk .cone { width: 54px; height: 54px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; color: var(--muted); }
.spk .cone i { width: 18px; height: 18px; border-radius: 50%; background: currentColor; }
.spk.live .cone { color: var(--accent); animation: pulse 0.6s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.sweep-scale { position: relative; height: 34px; }
.sweep-scale .track { position: absolute; left: 0; right: 0; top: 10px; height: 6px; border-radius: 99px; background: var(--surface-2); }
.sweep-scale .fill { position: absolute; left: 0; top: 10px; height: 6px; border-radius: 99px; background: var(--accent-bright); width: 0; }
.sweep-scale .tick { position: absolute; top: 20px; transform: translateX(-50%); font-family: var(--f-mono); font-size: 10.5px; color: var(--faint); }
.big-hz { font-family: var(--f-mono); font-size: 40px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* ---------- calculators ---------- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 96px; gap: 12px; align-items: center; font-size: 13.5px; }
.bar-row .track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 99px; background: var(--wave-dim); }
.bar-row.sel .track i { background: var(--accent-bright); }
.bar-row.sel { font-weight: 600; }
.bar-row .num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .bar-row { grid-template-columns: minmax(0, 1fr) 84px; } .bar-row .track { grid-column: 1 / -1; grid-row: 2; } }
.big-result { display: flex; flex-wrap: wrap; gap: 6px 28px; align-items: baseline; }
.big-result .readout { font-size: 32px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
table.data td.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- page frame: pre-rendered head, live tool, pre-rendered article ---------- */
.page { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-direction: column; gap: 20px; }
.page-head:empty, [data-seo]:empty { display: none; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--faint); margin-bottom: -10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.crumbs > * + *::before { content: "/"; margin-right: 6px; color: var(--line); }

.seo { display: flex; flex-direction: column; gap: 30px; margin-top: 28px; padding-top: 30px; border-top: 1px solid var(--line); }
.seo section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.seo h2 { font-size: 22px; font-weight: 600; }
.seo h3 { font-family: var(--f-body); font-size: 16px; font-weight: 600; letter-spacing: 0; }
.seo p, .seo li { color: var(--muted); max-width: 72ch; }
.seo ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.steps li { counter-increment: step; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); font-size: 14.5px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 26px; height: 26px; margin-bottom: 10px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--f-mono); font-size: 13px; font-weight: 600; }
.faq { gap: 0 !important; }
.faq h2 { margin-bottom: 8px; }
.qa { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.seo .table-wrap { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.seo table.data td { white-space: normal; }

.site-foot { max-width: 1080px; margin: 48px auto 0; padding-top: 24px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px; display: flex; flex-direction: column; gap: 22px; }
.foot-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.foot-links div { display: flex; flex-direction: column; gap: 6px; }
.foot-links b { color: var(--fg); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
.foot-links a { color: var(--muted); text-decoration: none; font-size: 13.5px; }
.foot-links a:hover { color: var(--fg); }
.foot-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
