:root {
  --bg: #f4f6fc;
  --surface: #ffffff;
  --surface-2: #eef1fa;
  --border: #dfe4f2;
  --border-strong: #c7cee3;
  --text: #0f1530;
  --muted: #5b6485;
  --accent: #2f6bff;
  --accent-2: #ff2e88;
  --accent-hover: #1f55e0;
  --accent-ink: #ffffff;
  --accent-soft: #e3ebff;
  --accent-text: #1d4fd8;
  --grad: linear-gradient(120deg, #2f6bff 0%, #7a4dff 50%, #ff2e88 100%);
  --ok: #129a63;
  --ok-soft: #d8f5e8;
  --warn: #b7791f;
  --warn-soft: #fbefd5;
  --danger: #d6204e;
  --danger-soft: #fde0e8;
  --wave-on: #2f6bff;
  --wave-off: #c9d1e8;
  --wave-cut: #e3e7f3;
  --region: rgba(47, 107, 255, 0.08);
  --shadow: 0 1px 2px rgba(15, 21, 48, .05), 0 8px 24px rgba(15, 21, 48, .06);
  --radius: 16px;
  --font: 'Plus Jakarta Sans', 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: #0b1020; --surface: #121936; --surface-2: #1a2246; --border: #252f5a; --border-strong: #34407a;
    --text: #eef1ff; --muted: #9aa4cc; --accent: #5b8cff; --accent-2: #ff4f9d; --accent-hover: #7ba3ff; --accent-ink: #ffffff;
    --accent-soft: #1a2a5e; --accent-text: #9db8ff; --grad: linear-gradient(120deg, #5b8cff 0%, #9a6bff 50%, #ff4f9d 100%);
    --ok: #3ddc97; --ok-soft: #133a2e; --warn: #e2a64a; --warn-soft: #3a2d15;
    --danger: #ff5c86; --danger-soft: #3d1626; --wave-on: #5b8cff; --wave-off: #333e6e; --wave-cut: #222a52;
    --region: rgba(91, 140, 255, 0.12); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020; --surface: #121936; --surface-2: #1a2246; --border: #252f5a; --border-strong: #34407a;
  --text: #eef1ff; --muted: #9aa4cc; --accent: #5b8cff; --accent-2: #ff4f9d; --accent-hover: #7ba3ff; --accent-ink: #ffffff;
  --accent-soft: #1a2a5e; --accent-text: #9db8ff; --grad: linear-gradient(120deg, #5b8cff 0%, #9a6bff 50%, #ff4f9d 100%);
  --ok: #3ddc97; --ok-soft: #133a2e; --warn: #e2a64a; --warn-soft: #3a2d15;
  --danger: #ff5c86; --danger-soft: #3d1626; --wave-on: #5b8cff; --wave-off: #333e6e; --wave-cut: #222a52;
  --region: rgba(91, 140, 255, 0.12); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
  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: 13px; gap: .28em; }
.sidebar-top .wordmark b { padding: 2px 5px 1px; }
.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: #e6141e; 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; overflow-x: clip; }
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(--grad); 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(--grad); background-size: 160% 100%; background-position: 0 0; border-color: transparent; color: var(--accent-ink); transition: background-position .4s ease, box-shadow .2s, transform .05s; }
.btn.primary:hover { background: var(--grad); background-size: 160% 100%; background-position: 100% 0; border-color: transparent; box-shadow: 0 6px 20px -6px var(--accent-2); }
.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(--accent-2) 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(--grad); border-color: transparent; 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-radius: 12px; padding: 44px 20px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}

.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; }

.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(--grad); border-color: transparent; color: #fff; position: relative; }
.play-btn:hover { filter: brightness(1.1); }
.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 — Full Audio Tools
   Radiating sound waves, gradient borders, blur-in reveals, ripple bursts.
   ========================================================= */
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes spinAng { to { --ang: 360deg; } }
@keyframes radiate { 0% { transform: scale(.25); opacity: 0; } 12% { opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes signal { 0%, 100% { opacity: .25; } 30%, 60% { opacity: 1; } }
@keyframes hueFlow { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
@keyframes blurIn { from { opacity: 0; filter: blur(10px); scale: .96; } to { opacity: 1; filter: blur(0); scale: 1; } }
@keyframes bobUp { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-7px); } 60% { transform: translateY(-4px); } }
@keyframes marching { to { background-position: 28px 0, -28px 100%, 0 -28px, 100% 28px; } }
@keyframes growY { from { transform: scaleY(0); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }
@keyframes dotWave { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-6px); opacity: 1; } }
@keyframes ringOut { from { transform: scale(.5); opacity: .8; } to { transform: scale(3.2); opacity: 0; } }
@keyframes sparkle { 0% { transform: translate(0, 0) scale(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--x), var(--y)) scale(1); opacity: 0; } }
@keyframes stamp { 0% { transform: scale(1.6) rotate(-12deg); opacity: 0; } 70% { transform: scale(.94) rotate(2deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes floatLogo { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(1.5deg); } }

/* Hero: the logo broadcasting sound — rainbow rings radiate out behind it */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 24px; align-items: center; }
.hero > :not(.hero-viz) { grid-column: 1; }
.hero .eyebrow { justify-self: start; }
.hero-viz { grid-column: 2; grid-row: 1 / span 5; position: relative; width: 300px; height: 300px; pointer-events: none; }
.hero-viz .ring {
  position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent;
  border-top-color: var(--c); border-right-color: var(--c);
  transform-origin: center; rotate: -45deg; animation: radiate 3.6s cubic-bezier(.2, .6, .3, 1) infinite; animation-delay: var(--d);
}
.hero-viz .hero-logo { position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px; animation: floatLogo 6s ease-in-out infinite; filter: drop-shadow(0 18px 30px rgba(47, 107, 255, .25)); }
.hero-viz .hero-logo .arcs path { animation: signal 2.4s ease-in-out infinite; }
.hero-viz .hero-logo .arcs path:nth-child(4) { animation-delay: 0s; }
.hero-viz .hero-logo .arcs path:nth-child(3) { animation-delay: .25s; }
.hero-viz .hero-logo .arcs path:nth-child(2) { animation-delay: .5s; }
.hero-viz .hero-logo .arcs path:nth-child(1) { animation-delay: .75s; }
.shine {
  background: linear-gradient(90deg, #2f6bff, #7a4dff, #ff2e88, #ff8a00, #2f6bff);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: hueFlow 8s ease-in-out infinite alternate;
}
.hero .eyebrow, .hero h1, .hero .lede, .hero-points { animation: blurIn .8s cubic-bezier(.2, .7, .2, 1) both; }
.hero h1 { animation-delay: .08s; }
.hero .lede { animation-delay: .16s; }
.hero-points { animation-delay: .24s; }

/* Logo: speaker waves pulse like a live signal; arcs light up in sequence on hover */
.brand-mark .waves path { animation: signal 2s ease-in-out infinite; }
.brand-mark .waves path:nth-child(2) { animation-delay: .3s; }
.brand:hover .brand-mark .arcs path { animation: signal .9s ease-in-out infinite; }
.brand:hover .brand-mark .arcs path:nth-child(3) { animation-delay: .12s; }
.brand:hover .brand-mark .arcs path:nth-child(2) { animation-delay: .24s; }
.brand:hover .brand-mark .arcs path:nth-child(1) { animation-delay: .36s; }

/* Scroll reveal: blur + scale in (class added by JS, below-the-fold only) */
.rv { opacity: 0; filter: blur(8px); scale: .96; transition: opacity .7s ease, filter .7s ease, scale .7s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 70ms); }
.rv.in { opacity: 1; filter: blur(0); scale: 1; }

/* Tool cards: rotating gradient border + lift */
.tool-card { position: relative; isolation: isolate; transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s, border-color .25s, opacity .7s ease, filter .7s ease, scale .7s ease; }
.tool-card::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 2px; z-index: -1; opacity: 0; transition: opacity .25s;
  background: conic-gradient(from var(--ang), #2f6bff, #7a4dff, #ff2e88, #ff8a00, #15b8a6, #2f6bff);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spinAng 3s linear infinite paused;
}
.tool-card:hover { transform: translateY(-5px); border-color: transparent; box-shadow: 0 16px 34px -14px rgba(47, 107, 255, .45); }
.tool-card:hover::before { opacity: 1; animation-play-state: running; }
.tool-card:hover .tc-ico { background: var(--grad); color: #fff; }
.tool-card:hover .tc-ico .ico { animation: bobUp .7s ease; }
.tc-ico { transition: background .25s, color .25s; }

.tool-ico { box-shadow: 0 10px 26px -10px var(--accent-2); }

/* Dropzone: marching gradient border + bouncing upload arrow */
.dropzone {
  border: 0; position: relative;
  background:
    linear-gradient(90deg, var(--accent) 50%, transparent 0) repeat-x 0 0 / 14px 2px,
    linear-gradient(90deg, var(--accent-2) 50%, transparent 0) repeat-x 0 100% / 14px 2px,
    linear-gradient(0deg, var(--accent) 50%, transparent 0) repeat-y 0 0 / 2px 14px,
    linear-gradient(0deg, var(--accent-2) 50%, transparent 0) repeat-y 100% 0 / 2px 14px;
  transition: background-color .2s, transform .2s;
}
.dropzone:hover, .dropzone.over { background-color: var(--accent-soft); animation: marching .8s linear infinite; }
.dropzone.over { transform: scale(1.01); }
.dz-ico { background: var(--grad); color: #fff; }
.dropzone:hover .dz-ico .ico, .dropzone.over .dz-ico .ico { animation: bobUp 1s ease-in-out infinite; }

/* Waveform grows out from the centre line */
.wave-canvas { transform-origin: center; animation: growY .7s cubic-bezier(.2, .8, .2, 1) both; }
.play-btn.playing::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%; padding: 2px;
  background: conic-gradient(from var(--ang), transparent 0 60%, var(--accent-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spinAng 1s linear infinite;
}

/* Progress: bouncing dots + flowing gradient bar */
.pbar-label { display: inline-flex; align-items: center; gap: 8px; }
.eq { display: inline-flex; align-items: center; gap: 3px; height: 14px; }
.eq i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: dotWave 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .12s; background: #7a4dff; }
.eq i:nth-child(3) { animation-delay: .24s; background: var(--accent-2); }
.eq i:nth-child(4) { animation-delay: .36s; background: #ff8a00; }
.pbar-fill { background: linear-gradient(90deg, #2f6bff, #7a4dff, #ff2e88, #7a4dff, #2f6bff); background-size: 300% 100%; animation: hueFlow 2s linear infinite alternate; }

/* Result: stamp-in badge, ripple rings and sparkles, items slide up */
.result.pop { animation: slideUp .45s ease-out both; }
.done-badge { position: relative; overflow: visible; background: var(--grad); color: #fff; animation: stamp .55s cubic-bezier(.2, .7, .2, 1.3) both; }
.done-badge svg path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: draw .4s .35s ease-out forwards; }
.burst-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent-2); pointer-events: none; animation: ringOut .9s ease-out both; }
.burst-dot { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; pointer-events: none; animation: sparkle .9s cubic-bezier(.15, .7, .3, 1) both; }
.result-item { animation: slideUp .5s ease-out both; }
.result-item:nth-child(2) { animation-delay: .07s; }
.result-item:nth-child(3) { animation-delay: .14s; }
.result-item:nth-child(4) { animation-delay: .21s; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-viz { grid-column: 1; grid-row: auto; width: 200px; height: 200px; margin: 0 auto 8px; order: -1; }
  .hero-viz .hero-logo { width: 110px; height: 110px; margin: -55px 0 0 -55px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; filter: none; scale: 1; }
  .done-badge svg path { stroke-dashoffset: 0; }
  .hero-viz .ring { opacity: .3; transform: scale(.9); }
}
/* ---------- 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); }
/* =========================================================
   Learn: guides, glossary, fact boxes
   ========================================================= */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.guide-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .2s, transform .2s, box-shadow .2s; }
.guide-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.guide-card h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; }
.guide-card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; line-height: 1.5; }
.gc-cat { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.gc-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.gc-meta .ico { width: 14px; height: 14px; }
.home-learn { margin-top: 40px; }
.home-learn .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.home-learn h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; }
.home-learn .section-head a { font-size: 14px; font-weight: 700; color: var(--accent-text); text-decoration: none; }

.article-head { margin-bottom: 22px; }
.article-head .kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 8px; }
.article-head h1 { margin-bottom: 12px; }
.article-head .lede { font-size: 18px; color: var(--muted); margin: 0 0 14px; line-height: 1.6; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); font-weight: 600; }
.byline span + span::before { content: '•'; margin-right: 18px; opacity: .5; }
.byline a { color: inherit; font-weight: 700; }

.takeaways { border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--surface); border-radius: 12px; padding: 16px 20px; margin: 0 0 22px; }
.tk-title, .toc-title { margin: 0 0 8px; font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.takeaways ul { margin: 0; padding-left: 20px; }
.takeaways li { margin-bottom: 4px; }
.toc { background: var(--surface-2); border-radius: 12px; padding: 14px 20px; margin: 0 0 28px; font-size: 15px; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.toc li { margin-bottom: 4px; break-inside: avoid; }
.toc a { color: var(--text); font-weight: 600; text-decoration: none; }
.toc a:hover { color: var(--accent-text); text-decoration: underline; }
.content h2[id] { scroll-margin-top: 80px; }
.content .callout { border-radius: 12px; padding: 14px 18px; background: var(--accent-soft); margin: 0 0 16px; }
.content .callout p:last-child { margin-bottom: 0; }

.facts { margin: 0 0 8px; }
.facts h2 { margin-top: 0 !important; }
.facts dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0; }
.facts dl > div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.facts dt { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-weight: 600; font-size: 15px; line-height: 1.45; }

.related-guides { margin-top: 40px; }
.related-guides h2 { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.related-guides ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.related-guides li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.related-guides a { font-weight: 700; color: var(--accent-text); text-decoration: none; }
.related-guides a:hover { text-decoration: underline; }
.related-guides span { font-size: 14px; color: var(--muted); }
.try-tools { margin-top: 36px; }

dl.glossary { margin: 0; display: grid; gap: 10px; }
dl.glossary dt { font-weight: 800; font-size: 17px; margin-top: 10px; scroll-margin-top: 80px; }
dl.glossary dd { margin: 0; padding: 0 0 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.az a { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); font-weight: 800; text-decoration: none; color: var(--text); }
.az a:hover { background: var(--accent); color: #fff; }

@media (max-width: 860px) {
  .toc ol { columns: 1; }
  .article-head .lede { font-size: 17px; }
}