:root {
  --bg: #f7f6f4;
  --surface: #ffffff;
  --surface-2: #efebe3;
  --border: #e2ddd2;
  --border-strong: #cfc8ba;
  --text: #1e1c18;
  --muted: #6e685c;
  --accent: #e8162e;
  --accent-hover: #c80f24;
  --accent-ink: #ffffff;
  --accent-soft: #fde3e6;
  --accent-text: #b50d22;
  --ok: #23874f;
  --ok-soft: #dcf1e4;
  --warn: #b7791f;
  --warn-soft: #fbefd5;
  --danger: #c93a2e;
  --danger-soft: #fbe0dd;
  --wave-on: #e8162e;
  --wave-off: #cdc6b8;
  --wave-cut: #d9d3c7;
  --region: rgba(232, 22, 46, 0.07);
  --shadow: 0 1px 2px rgba(40, 30, 10, .05), 0 4px 16px rgba(40, 30, 10, .05);
  --radius: 14px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131210; --surface: #1c1a17; --surface-2: #26241f; --border: #312e28; --border-strong: #45413a;
    --text: #f2eee6; --muted: #a39d91; --accent: #ff4757; --accent-hover: #ff6b78; --accent-ink: #1a0d07;
    --accent-soft: #3d171c; --accent-text: #ff8d97; --ok: #4cc27f; --ok-soft: #173424; --warn: #e2a64a; --warn-soft: #3a2d15;
    --danger: #ff6b5e; --danger-soft: #3d1c19; --wave-on: #ff4757; --wave-off: #4a463e; --wave-cut: #3a3731;
    --region: rgba(255, 71, 87, 0.10); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131210; --surface: #1c1a17; --surface-2: #26241f; --border: #312e28; --border-strong: #45413a;
  --text: #f2eee6; --muted: #a39d91; --accent: #ff4757; --accent-hover: #ff6b78; --accent-ink: #1a0d07;
  --accent-soft: #3d171c; --accent-text: #ff8d97; --ok: #4cc27f; --ok-soft: #173424; --warn: #e2a64a; --warn-soft: #3a2d15;
  --danger: #ff6b5e; --danger-soft: #3d1c19; --wave-on: #ff4757; --wave-off: #4a463e; --wave-cut: #3a3731;
  --region: rgba(255, 71, 87, 0.10); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
a { color: inherit; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 12px; display: flex; flex-direction: column;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 0 12px 6px; }
.sidebar-top .brand { gap: 8px; min-width: 0; }
.sidebar-top .wordmark { font-size: 14px; }
.sidebar-top .brand-mark { width: 34px; height: 34px; }
#theme { flex: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; display: block; }
.brand-mark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.wordmark { display: inline-flex; align-items: center; gap: .32em; font-weight: 800; font-size: 16px; letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; }
.wordmark b { background: #e8162e; color: #fff; padding: 2px 6px 1px; border-radius: 3px; font-weight: 800; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px;
  text-decoration: none; font-weight: 600; font-size: 14px; color: var(--text);
}
.nav a .ico { color: var(--muted); }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav a.active .ico { color: var(--accent-text); }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
.sidebar-foot { margin-top: auto; padding: 16px 10px 4px; font-size: 12px; color: var(--muted); }

.main-col { min-width: 0; display: flex; flex-direction: column; }
main.page { flex: 1; width: 100%; max-width: 992px; margin: 0 auto; padding: 36px clamp(16px, 4vw, 56px) 56px; }
.topbar { display: none; }
.scrim { display: none; }

/* ---------- Home ---------- */
.hero { position: relative; padding: 16px 0 36px; isolation: isolate; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700;
  color: var(--accent-text); background: var(--accent-soft); padding: 5px 12px 5px 10px; border-radius: 99px;
}
.eyebrow .ico { width: 14px; height: 14px; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; margin: 18px 0 14px; max-width: 16ch; letter-spacing: -0.035em; }
.lede { font-size: 18px; color: var(--muted); max-width: 56ch; margin: 0; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; font-weight: 600; font-size: 14px; }
.hero-points span { display: inline-flex; align-items: center; gap: 7px; }
.hero-points .ico { color: var(--accent); }
.home-group { margin-top: 28px; }
.home-group h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-card {
  display: flex; flex-direction: column; gap: 4px; padding: 18px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tool-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tc-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; margin-bottom: 10px; }
.tc-ico .ico { width: 21px; height: 21px; }
.tc-name { font-weight: 700; font-size: 16px; margin: 0; letter-spacing: -0.01em; }
.tc-desc { color: var(--muted); font-size: 14px; flex: 1; margin: 0; }
.tc-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--accent-text); margin-top: 10px; }
.tc-go .ico { width: 14px; height: 14px; transition: transform .15s; }
.tool-card:hover .tc-go .ico { transform: translateX(3px); }

/* ---------- Tool page ---------- */
.tool-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.tool-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.tool-ico .ico { width: 26px; height: 26px; }
.tool-head h1 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; }
.tool-head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.opts { display: flex; flex-direction: column; gap: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { font-weight: 700; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wave-hint { margin: 10px 0 0; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.field .inline:first-child, .field > .inline { margin-top: 0; }
.muted { color: var(--muted); }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.lg { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn .ico { width: 17px; height: 17px; }
.icon-btn { width: 38px; padding: 0; }
.icon-btn.ghost { color: var(--muted); }
.icon-btn:disabled { opacity: .3; }

.select {
  height: 40px; padding: 0 36px 0 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  appearance: none; font-weight: 600; min-width: 0; max-width: 100%; cursor: pointer;
}
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 11px; align-self: flex-start; max-width: 100%; }
.seg-btn { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.range { display: flex; align-items: center; gap: 14px; }
.range input { flex: 1; min-width: 0; appearance: none; height: 6px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--p, 50%), var(--surface-2) var(--p, 50%)); cursor: pointer; }
.range input::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.range input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.range-val { font-family: var(--mono); font-size: 14px; min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-strong); display: grid; place-items: center; color: transparent; flex: none; transition: .15s; }
.check-box svg { width: 14px; height: 14px; stroke-width: 3; }
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.check input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 99px; padding: 4px 12px; font-family: var(--mono); font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent-text); }
.pill { display: inline-flex; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--danger-soft); color: var(--danger); }

.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; color: var(--muted); }
.note .ico { color: var(--accent-text); margin-top: 2px; }
.note.warn { background: var(--warn-soft); color: var(--text); }
.note.warn .ico { color: var(--warn); }

.estimate { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.estimate .ico { width: 15px; height: 15px; color: var(--muted); }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: 12px; padding: 44px 20px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-ico { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; margin: 0 auto 14px; }
.dropzone:hover .dz-ico, .dropzone.over .dz-ico { background: var(--accent); color: #fff; }
.dz-ico .ico { width: 24px; height: 24px; }
.dz-title { font-weight: 700; font-size: 17px; }
.dz-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.link { color: var(--accent-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.loading { display: flex; align-items: center; gap: 12px; padding: 36px 8px; color: var(--muted); justify-content: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- File rows ---------- */
.file-bar, .file-row { display: flex; align-items: center; gap: 12px; }
.file-bar { margin-bottom: 16px; }
.fb-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; flex: none; }
.fb-main, .fr-main { flex: 1; min-width: 0; }
.fb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-meta { color: var(--muted); font-size: 13px; }
.file-list { display: flex; flex-direction: column; }
.file-list:not(:empty) { margin-top: 16px; }
.file-row { padding: 10px 0; border-top: 1px solid var(--border); }
.file-row.ok .fr-status { color: var(--ok); font-weight: 600; }
.file-row.err .fr-status { color: var(--danger); font-weight: 600; }
.fr-status { display: inline; }
.fr-actions { display: flex; gap: 2px; }
.idx { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--mono); font-size: 13px; flex: none; }
.total { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- Waveform ---------- */
.wave {
  position: relative; height: 150px; border-radius: 10px; background: var(--surface-2);
  overflow: hidden; cursor: crosshair; touch-action: none; user-select: none;
}
.wave-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.region { position: absolute; top: 0; bottom: 0; background: var(--region); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); cursor: grab; }
.region:active { cursor: grabbing; }
.region.cut { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--region) 6px 12px); border-color: var(--danger); }
.handle { position: absolute; top: 0; bottom: 0; width: 16px; cursor: ew-resize; }
.handle::after { content: ''; position: absolute; top: 50%; width: 10px; height: 34px; margin-top: -17px; border-radius: 4px; background: var(--accent); }
.region.cut .handle::after { background: var(--danger); }
.handle.l { left: -9px; } .handle.l::after { left: 3px; }
.handle.r { right: -9px; } .handle.r::after { right: 3px; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); pointer-events: none; }
.wave-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 12px; }
.play-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.play-btn:hover { background: var(--accent-hover); }
.play-btn .ico { width: 18px; height: 18px; }
.sel-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.sel-fields label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.time-in { width: 92px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font-family: var(--mono); font-size: 14px; }
.sel-len, .wave-pos { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.wave-pos { margin-left: auto; }

/* ---------- Actions & progress ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 20px 0; }
.pbar { flex: 1; min-width: 220px; }
.pbar-text { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.pbar-pct { font-family: var(--mono); color: var(--muted); }
.pbar-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.pbar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .2s; }
.pbar-fill.indet { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ---------- Results ---------- */
.result { border-color: var(--ok); }
.result-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.result-head > div:nth-child(2) { flex: 1; min-width: 180px; }
.result-head h2 { font-size: 18px; }
.result-head p { margin: 2px 0 0; font-size: 14px; }
.done-badge { width: 40px; height: 40px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.done-badge svg { stroke-width: 2.6; }
.result-list { display: grid; gap: 12px; }
.result-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--bg); }
.ri-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ri-text { flex: 1; min-width: 0; }
.ri-label { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-meta { font-size: 13px; color: var(--muted); }
.result-item audio { width: 100%; height: 40px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; left: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 100; pointer-events: none; }
.toast { max-width: 420px; padding: 12px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: tin .2s ease-out; pointer-events: auto; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30;
    padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .topbar .brand { font-size: 17px; }
  .topbar .brand-mark { width: 32px; height: 32px; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 280px; max-width: 85vw; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .sidebar.open + .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35); }
  main.page { padding-top: 20px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 16px; }
  .tool-head { gap: 12px; }
  .tool-ico { width: 44px; height: 44px; }
  .wave { height: 120px; }
  .wave-pos { margin-left: 0; }
  .btn.lg { width: 100%; }
  .file-row { flex-wrap: wrap; }
  .file-row .fr-main { flex-basis: calc(100% - 110px); }
}

/* ---------- Site chrome ---------- */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { left: 8px; }
.sidebar-foot { display: flex; gap: 8px; align-items: flex-start; }
.sidebar-foot .ico { width: 15px; height: 15px; margin-top: 2px; color: var(--accent); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 18px; padding: 0; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: '/'; margin-right: 6px; opacity: .6; }
.crumbs a { text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--accent-text); }

/* ---------- Article content ---------- */
.content { margin-top: 40px; font-size: 16px; line-height: 1.7; }
.content.prose { margin-top: 0; }
.content h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; margin-bottom: 12px; }
.content h2 { font-size: 23px; font-weight: 800; margin: 40px 0 12px; }
.content h3 { font-size: 18px; font-weight: 700; margin: 26px 0 8px; }
.content p, .content ul, .content ol { margin: 0 0 14px; }
.content ul, .content ol { padding-left: 22px; }
.content li { margin-bottom: 6px; }
.content a { color: var(--accent-text); font-weight: 600; text-underline-offset: 3px; }
.content .updated { color: var(--muted); font-size: 14px; }
.content table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 15px; }
.content th, .content td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.content th { font-weight: 700; background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
ol.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 12px; }
ol.steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 58px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin: 0; }
ol.steps li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 15px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq-a { padding-bottom: 14px; color: var(--muted); }
.faq-a p:last-child { margin-bottom: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.feature h3 { margin: 0 0 4px; font-size: 16px; }
.feature p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; }
.related { margin-top: 48px; }
.related h2 { font-size: 20px; font-weight: 800; margin-bottom: 14px; }

/* ---------- Ads (clearly labelled, separated from tool controls) ---------- */
.ad { margin: 32px 0; padding-top: 6px; border-top: 1px solid var(--border); min-height: 120px; }
.ad-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; text-align: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 40px clamp(16px, 4vw, 56px) 28px; font-size: 14px; }
.footer-grid { max-width: 880px; margin: 0 auto; display: grid; grid-template-columns: 1.3fr 1.4fr 1fr; gap: 32px; }
.footer-brand .brand-mark { width: 44px; height: 44px; }
.footer-brand p { color: var(--muted); margin: 12px 0 0; max-width: 32ch; }
.site-footer h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0 0 20px; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--accent-text); }
.footer-grid > div:nth-child(2) ul { columns: 2; column-gap: 20px; }
.footer-bottom { max-width: 880px; margin: 24px auto 0; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .content h2 { font-size: 21px; }
}

/* =========================================================
   Motion
   ========================================================= */
@keyframes eqBar { from { transform: scaleY(.22); } to { transform: scaleY(1); } }
@keyframes shine { to { background-position: 200% center; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes ripple { from { transform: scale(.9); opacity: .55; } to { transform: scale(2.1); opacity: 0; } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes pulseRing { from { box-shadow: 0 0 0 0 var(--accent); } to { box-shadow: 0 0 0 14px transparent; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes popIn { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes riseIn { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes noteFly {
  0% { transform: translate(0, 0) rotate(0) scale(.4); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1.1); opacity: 0; }
}
@keyframes logoBar { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.45); } }

/* Hero: live equalizer behind the headline */
.hero-viz {
  position: absolute; z-index: -1; top: 0; right: -12px; width: 52%; height: 62%;
  display: flex; align-items: center; gap: 3px; pointer-events: none; opacity: .5;
  -webkit-mask-image: linear-gradient(to left, #000 35%, transparent), linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  mask-image: linear-gradient(to left, #000 35%, transparent), linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
}
.hero-viz span {
  flex: 1; height: calc(var(--h) * 100%); border-radius: 99px; transform-origin: center;
  background: linear-gradient(to top, var(--c1), var(--c2));
  animation: eqBar var(--s) ease-in-out var(--d) infinite alternate;
}
.shine {
  background: linear-gradient(90deg, var(--accent), #ff8a00 25%, var(--accent) 50%, #ff8a00 75%, var(--accent));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
}
.hero .eyebrow, .hero h1, .hero .lede, .hero-points { animation: riseIn .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero h1 { animation-delay: .06s; }
.hero .lede { animation-delay: .12s; }
.hero-points { animation-delay: .18s; }

/* Logo: sound arcs draw in on load, then ripple outward on hover */
@keyframes arcDraw { from { stroke-dashoffset: 48; } to { stroke-dashoffset: 0; } }
@keyframes arcWave { 0%, 100% { opacity: 1; } 40% { opacity: .15; } }
.brand-mark svg > g:first-child path { stroke-dasharray: 48; animation: arcDraw .7s cubic-bezier(.3, .7, .2, 1) both; }
.brand-mark svg > g:first-child path:nth-child(4) { animation-delay: .1s; }
.brand-mark svg > g:first-child path:nth-child(3) { animation-delay: .22s; }
.brand-mark svg > g:first-child path:nth-child(2) { animation-delay: .34s; }
.brand-mark svg > g:first-child path:nth-child(1) { animation-delay: .46s; }
.brand:hover .brand-mark svg > g:first-child path { animation: arcWave .9s ease-in-out infinite; }
.brand:hover .brand-mark svg > g:first-child path:nth-child(4) { animation-delay: 0s; }
.brand:hover .brand-mark svg > g:first-child path:nth-child(3) { animation-delay: .12s; }
.brand:hover .brand-mark svg > g:first-child path:nth-child(2) { animation-delay: .24s; }
.brand:hover .brand-mark svg > g:first-child path:nth-child(1) { animation-delay: .36s; }

/* Scroll reveal (class added by JS, only for below-the-fold elements) */
.rv { opacity: 0; translate: 0 18px; transition: opacity .6s ease, translate .6s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 60ms); }
.rv.in { opacity: 1; translate: 0 0; }

/* Tool cards: tilt + cursor spotlight */
.tool-card { position: relative; overflow: hidden; transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: border-color .2s, box-shadow .2s, transform .25s ease-out, opacity .6s ease, translate .6s cubic-bezier(.2, .7, .2, 1); }
.tool-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 70%);
}
.tool-card:hover::before { opacity: 1; }
.tool-card > * { position: relative; }
.tool-card:hover .tc-ico { animation: floatY 1.4s ease-in-out infinite; background: var(--accent); color: #fff; }
.tc-ico { transition: background .2s, color .2s; }

/* Tool page icon floats gently */
.tool-ico { animation: floatY 4s ease-in-out infinite; box-shadow: 0 8px 24px -8px var(--accent); }

/* Dropzone: floating icon with sonar ripples */
.dz-ico { position: relative; animation: floatY 2.6s ease-in-out infinite; }
.dz-ico::before, .dz-ico::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }
.dropzone:hover .dz-ico::before, .dropzone.over .dz-ico::before { animation: ripple 1.6s ease-out infinite; }
.dropzone:hover .dz-ico::after, .dropzone.over .dz-ico::after { animation: ripple 1.6s ease-out .8s infinite; }
.dropzone.over { transform: scale(1.01); }
.dropzone { transition: border-color .15s, background .15s, transform .2s; }

/* Waveform sweeps in when a file loads */
.wave-canvas { animation: wipe .9s cubic-bezier(.3, .7, .2, 1) both; }
.play-btn.playing { animation: pulseRing 1.2s ease-out infinite; }

/* Mini equalizer next to progress text */
.pbar-label { display: inline-flex; align-items: center; gap: 8px; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--accent); transform-origin: bottom; animation: eqBar .5s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.2s; animation-duration: .42s; }
.eq i:nth-child(3) { animation-delay: -.35s; animation-duration: .58s; }
.eq i:nth-child(4) { animation-delay: -.1s; animation-duration: .47s; }
.pbar-fill:not(.indet) { background-image: linear-gradient(90deg, var(--accent), #ff8a00, var(--accent)); background-size: 200% 100%; animation: shine 1.5s linear infinite; }

/* Result: panel rises, check draws itself, notes burst out */
.result.pop { animation: riseIn .5s cubic-bezier(.2, .7, .2, 1) both; }
.done-badge { position: relative; overflow: visible; animation: popIn .5s cubic-bezier(.2, .7, .2, 1.4) both; }
.done-badge svg path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: draw .45s .25s ease-out forwards; }
.note-burst {
  position: absolute; left: 50%; top: 50%; margin: -10px 0 0 -6px; font-size: 18px; font-weight: 700;
  color: var(--accent); pointer-events: none; animation: noteFly 1.3s cubic-bezier(.15, .7, .3, 1) both;
}
.note-burst:nth-child(3n) { color: #ff8a00; }
.note-burst:nth-child(4n) { color: var(--ok); }
.result-item { animation: riseIn .5s cubic-bezier(.2, .7, .2, 1) both; }
.result-item:nth-child(2) { animation-delay: .08s; }
.result-item:nth-child(3) { animation-delay: .16s; }
.result-item:nth-child(4) { animation-delay: .24s; }
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%);
  translate: -100% 0; transition: translate .6s ease;
}
.btn.primary:hover::after { translate: 100% 0; }

@media (max-width: 860px) {
  .hero-viz { width: 100%; right: 0; opacity: .22; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; translate: none; }
  .done-badge svg path { stroke-dashoffset: 0; }
  .hero-viz span { transform: scaleY(.6); }
}
/* ---------- AI / key changer ---------- */
.note-sub { margin-top: 6px; color: var(--warn); font-weight: 600; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; flex: none; }
.key-detect { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 14px; }
.key-detect .ico { color: var(--accent-text); }
.key-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--border-strong); font-size: 18px; font-weight: 800; }
.key-summary .ico { color: var(--muted); }
.key-summary .ks-from { color: var(--muted); }
.key-summary .ks-to { color: var(--accent-text); animation: popIn .35s ease-out; }
.key-summary .pill { margin-left: auto; font-family: var(--mono); }