/* =========================================================
   AudioCutter — styles
   Dark professional theme with orange accents
   ========================================================= */

:root {
  --bg: #0b0c0f;
  --bg-2: #101217;
  --panel: #14161c;
  --panel-2: #1a1d24;
  --line: #262a33;
  --line-2: #323743;
  --text: #eceef2;
  --text-2: #a4a9b4;
  --text-3: #6d7380;
  --accent: #ff6a00;
  --accent-2: #ff8a3d;
  --accent-soft: rgba(255, 106, 0, 0.14);
  --accent-glow: rgba(255, 106, 0, 0.35);
  --danger: #ff4d5e;
  --ok: #3ddc84;
  --warn: #ffc247;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }

.bg-glow {
  position: fixed;
  inset: -20vh -10vw auto;
  height: 70vh;
  pointer-events: none;
  background:
    radial-gradient(50% 60% at 50% 0%, rgba(255, 106, 0, 0.16), transparent 70%),
    radial-gradient(30% 40% at 85% 10%, rgba(255, 138, 61, 0.08), transparent 70%);
  z-index: 0;
}

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px max(20px, env(safe-area-inset-left));
  background: rgba(11, 12, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  box-shadow: 0 6px 18px -6px var(--accent-glow);
}
.brand-mark svg { width: 22px; height: 22px; stroke: #fff; stroke-width: 2.6; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand-name span, .hero-title span { color: var(--accent); }

.topbar-actions { display: flex; gap: 6px; }

/* ---------------- Layout ---------------- */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  flex: 1;
}

.footer {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
  padding: 20px;
  color: var(--text-3);
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.visits {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line-2);
  color: var(--text-2); font-size: 13px;
  animation: rise 0.5s var(--ease) both;
}
.visits svg { width: 16px; height: 16px; color: var(--accent); }
.visits b { font: 600 13.5px var(--font-mono); color: var(--accent-2); font-variant-numeric: tabular-nums; }

/* ---------------- Buttons ---------------- */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h);
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 600 14px/1 var(--font);
  color: var(--text);
  background: var(--panel-2);
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible, .tbtn:focus-visible, .nudge:focus-visible, .link-btn:focus-visible, .dropzone:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn-lg { --h: 50px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn-primary {
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 8px 24px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 32px -6px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25); filter: brightness(1.06); }
.btn-secondary { background: var(--panel-2); border-color: var(--line-2); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-2); }
.btn-secondary.is-ready { border-color: var(--accent); color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.6s var(--ease) 2; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.btn-icon { width: var(--h); padding: 0; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); }
  50% { box-shadow: 0 0 0 9px rgba(255, 106, 0, 0.05); }
}

/* ---------------- Hero / upload ---------------- */
.hero { text-align: center; padding: 4vh 0 2vh; animation: rise 0.6s var(--ease) both; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 8vw, 84px);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
  font-weight: 700;
}
.hero-sub { margin: 0 0 36px; color: var(--text-2); font-size: clamp(16px, 2.2vw, 20px); }

.dropzone {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  border-radius: 22px;
  border: 1.5px dashed var(--line-2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    var(--bg-2);
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
  box-shadow: var(--shadow);
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 106, 0, 0.07), rgba(255, 106, 0, 0.02)), var(--bg-2);
  box-shadow: 0 0 0 6px var(--accent-soft), var(--shadow);
}
.dropzone.is-over { transform: scale(1.01); }

.dz-wave { display: flex; align-items: center; justify-content: center; gap: 5px; height: 56px; margin-bottom: 18px; }
.dz-wave span {
  width: 5px; border-radius: 4px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  animation: eq 1.3s ease-in-out infinite;
  opacity: 0.85;
}
.dz-wave span:nth-child(odd) { animation-duration: 1.05s; }
.dz-wave span:nth-child(3n) { animation-duration: 1.6s; }
.dz-wave span:nth-child(1) { animation-delay: -0.2s; } .dz-wave span:nth-child(2) { animation-delay: -0.7s; }
.dz-wave span:nth-child(3) { animation-delay: -0.4s; } .dz-wave span:nth-child(4) { animation-delay: -1.1s; }
.dz-wave span:nth-child(5) { animation-delay: -0.1s; } .dz-wave span:nth-child(6) { animation-delay: -0.9s; }
.dz-wave span:nth-child(7) { animation-delay: -0.5s; } .dz-wave span:nth-child(8) { animation-delay: -1.3s; }
.dz-wave span:nth-child(9) { animation-delay: -0.3s; } .dz-wave span:nth-child(10) { animation-delay: -0.8s; }
.dz-wave span:nth-child(11) { animation-delay: -0.6s; } .dz-wave span:nth-child(12) { animation-delay: -1.2s; }
.dz-wave span:nth-child(13) { animation-delay: -0.25s; } .dz-wave span:nth-child(14) { animation-delay: -1s; }
@keyframes eq { 0%, 100% { height: 14%; } 50% { height: 100%; } }

.dz-title { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.dz-or { margin: 6px 0 14px; color: var(--text-3); font-size: 14px; }
.dz-formats { margin: 18px 0 0; color: var(--text-3); font-size: 12.5px; letter-spacing: 0.08em; }

.features {
  list-style: none; padding: 0; margin: 36px auto 0; max-width: 960px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.features li {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  padding: 16px; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-2); font-size: 14px;
}
.features svg { color: var(--accent); margin-top: 1px; }
.features b { color: var(--text); font-weight: 600; }

/* ---------------- Content (how-to, FAQ, info pages) ---------------- */
.content {
  max-width: 760px; margin: 56px auto 0; text-align: left;
  color: var(--text-2); font-size: 15.5px; line-height: 1.7;
}
.content h1, .content h2 {
  font-family: var(--font-display); color: var(--text);
  letter-spacing: -0.02em; text-wrap: balance;
}
.content h1 { font-size: clamp(30px, 5vw, 42px); margin: 0 0 8px; line-height: 1.1; }
.content h2 { font-size: 22px; margin: 40px 0 14px; }
.content h2:first-child { margin-top: 0; }
.content h3 { color: var(--text); font-size: 16px; margin: 24px 0 6px; }
.content p { margin: 0 0 14px; }
.content b, .content strong { color: var(--text); font-weight: 600; }
.content em { font-style: normal; color: var(--accent-2); }
.content a { color: var(--accent-2); text-underline-offset: 3px; }
.content code { font: 500 13px var(--font-mono); background: var(--panel-2); padding: 2px 6px; border-radius: 6px; color: var(--text); }
.content ul { padding-left: 20px; }
.content li { margin-bottom: 6px; }
.content .lead { font-size: 17px; color: var(--text-2); margin-bottom: 28px; }
.content .updated { font-size: 13px; color: var(--text-3); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li {
  counter-increment: step; position: relative;
  padding: 14px 16px 14px 56px; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.05);
}
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-2);
  font: 600 13px var(--font-mono);
}
.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 44px 14px 16px; position: relative;
  color: var(--text); font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 11px; color: var(--accent); font-size: 20px; transition: transform 0.2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
.faq details p { padding: 0 16px 14px; margin: 0; }
.page { padding-block: 24px 40px; }
.contact-form { display: grid; gap: 2px; margin: 8px 0 28px; padding: 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line-2); }
.contact-form .btn { justify-self: start; margin-top: 4px; }
.text-input.textarea { height: auto; min-height: 140px; padding: 10px 12px; resize: vertical; font: 500 14px/1.5 var(--font); }
.hp { position: absolute; left: -9999px; }
.page .content { margin-top: 0; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; }
.footer-nav a { color: var(--text-2); text-decoration: none; font-size: 13.5px; }
.footer-nav a:hover { color: var(--accent-2); }
.contact-card {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line-2);
  margin: 8px 0 24px;
}
.contact-card .email { font: 600 16px var(--font-mono); color: var(--accent-2); word-break: break-all; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------------- Editor ---------------- */
.editor { display: grid; gap: 16px; animation: rise 0.5s var(--ease) both; }

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-2);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* File info */
.fileinfo { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.fileinfo-main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.file-icon {
  display: grid; place-items: center; flex: none;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.file-text { min-width: 0; }
.file-name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 3px; font-size: 13px; color: var(--text-2); }
.file-meta em { font-style: normal; color: var(--text-3); margin-right: 3px; }
.file-meta b { font-weight: 500; color: var(--text); font-family: var(--font-mono); font-size: 12.5px; }

.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line-2);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  max-width: 100%;
}
.status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.status[data-state="ready"] .status-dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status[data-state="busy"] .status-dot { background: var(--accent); animation: blink 0.9s infinite; }
.status[data-state="done"] .status-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.status[data-state="error"] .status-dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.status[data-state="error"] { color: var(--danger); border-color: rgba(255, 77, 94, 0.4); }
@keyframes blink { 50% { opacity: 0.3; } }

/* Waveform panel */
.wave-panel { padding: 14px 18px 12px; }
.wave-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.clock { font-family: var(--font-mono); display: flex; align-items: baseline; gap: 8px; }
.clock-now { font-size: 26px; font-weight: 600; color: var(--accent-2); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.clock-total { color: var(--text-3); font-size: 14px; }
.zoom { display: flex; align-items: center; gap: 6px; }
.zoom input { width: 140px; }

.wave-wrap {
  position: relative;
  border-radius: 12px;
  background:
    linear-gradient(180deg, transparent calc(50% - 0.5px), rgba(255, 255, 255, 0.05) 50%, transparent calc(50% + 0.5px)),
    #0d0f13;
  border: 1px solid var(--line);
  overflow: hidden;
  min-height: 180px;
}
.waveform { padding: 0 2px; touch-action: pan-y; }

/* wavesurfer shadow-DOM parts */
.waveform div::part(scroll) { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.waveform div::part(cursor) { box-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
.waveform div::part(region) { border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
.waveform div::part(region-handle) {
  width: 14px !important;
  border: none !important;
  background: transparent !important;
  cursor: ew-resize;
}
.waveform div::part(region-handle-left) {
  border-left: 3px solid var(--accent) !important;
  left: -1px !important;
  background: linear-gradient(90deg, rgba(255, 106, 0, 0.35), transparent) !important;
}
.waveform div::part(region-handle-right) {
  border-right: 3px solid var(--accent) !important;
  right: -1px !important;
  background: linear-gradient(270deg, rgba(255, 106, 0, 0.35), transparent) !important;
}
.editor.mode-remove .waveform div::part(region) { border-color: var(--danger); }
.editor.mode-remove .waveform div::part(region-handle-left),
.editor.mode-remove .waveform div::part(region-handle-right) { border-color: var(--danger) !important; }

.wave-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: rgba(13, 15, 19, 0.88);
  color: var(--text-2); font-size: 14px;
  z-index: 5;
}
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--line-2); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.wave-hint { margin: 10px 2px 0; font-size: 12.5px; color: var(--text-3); }

/* Transport */
.transport { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  height: 74px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font: 500 12.5px/1 var(--font);
  cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.tbtn svg { width: 24px; height: 24px; }
.tbtn:hover { border-color: var(--text-3); background: #20242c; }
.tbtn:active { transform: scale(0.95); }
.tbtn.is-active { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.tbtn-accent { color: var(--accent-2); }
.tbtn-accent.is-active { background: linear-gradient(140deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: 0 8px 22px -8px var(--accent-glow); }

.switch { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--line-2); transition: background 0.2s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.25s var(--ease); }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

.shortcuts { margin: 12px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.9; }
kbd {
  font: 500 11px var(--font-mono);
  padding: 2px 6px; border-radius: 5px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-width: 2px;
  color: var(--text-2);
}

/* Selection */
.times { display: grid; grid-template-columns: 1fr 1fr 0.8fr; gap: 12px; }
.time-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.time-field > label { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.time-input {
  display: flex; align-items: stretch;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: #0f1116;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.time-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.time-input input {
  flex: 1; min-width: 0; width: 100%;
  border: 0; background: transparent; color: var(--text);
  font: 600 15px var(--font-mono);
  text-align: center; padding: 10px 2px;
  font-variant-numeric: tabular-nums;
}
.time-input input:focus { outline: none; }
.time-input input.invalid { color: var(--danger); }
.nudge {
  flex: none; width: 32px;
  border: 0; background: rgba(255, 255, 255, 0.03); color: var(--text-2);
  font: 600 17px/1 var(--font); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nudge:hover { background: var(--accent-soft); color: var(--accent-2); }
.duration-value {
  height: 43px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-2);
  font: 600 15px var(--font-mono); font-variant-numeric: tabular-nums;
}
.link-btn {
  align-self: flex-start;
  border: 0; background: none; padding: 2px 0;
  color: var(--text-2); font: 500 12.5px var(--font);
  cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent-2); text-decoration-color: var(--accent); }

.segmented {
  display: grid; grid-template-columns: 1fr 1fr;
  margin-top: 16px; padding: 4px;
  border-radius: 12px; background: #0f1116; border: 1px solid var(--line);
}
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; text-align: center; padding: 9px 8px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}
.segmented input:checked + span { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.segmented input[value="remove"]:checked + span { color: #ff8692; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

/* Sliders */
.slider-row { margin-bottom: 16px; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.slider-head label { font-size: 14px; font-weight: 500; }
.slider-head output { font: 600 13px var(--font-mono); color: var(--accent-2); }

input[type="range"] {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--p), var(--line-2) var(--p));
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 0;
  box-shadow: 0 0 0 4px var(--accent-soft), 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s var(--ease);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0;
  box-shadow: 0 0 0 4px var(--accent-soft), 0 2px 6px rgba(0, 0, 0, 0.5);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--accent-glow); }

.muted { color: var(--text-3); }
.small { font-size: 12.5px; margin: 4px 0 0; }

/* Export */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; flex: 1; }
.field label { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.field-row { display: flex; gap: 12px; }
.text-input, .select {
  height: 42px; width: 100%;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #0f1116; color: var(--text);
  font: 500 14px var(--font);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a4a9b4' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  padding-right: 34px;
}
.text-input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.export-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }

.progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.progress-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: width 0.2s linear;
  background-size: 200% 100%;
}
.progress-text { font: 600 13px var(--font-mono); color: var(--accent-2); min-width: 44px; text-align: right; }

/* Result */
.result { border-color: rgba(255, 106, 0, 0.45); box-shadow: 0 0 0 1px rgba(255, 106, 0, 0.12), 0 20px 50px -20px var(--accent-glow); animation: rise 0.45s var(--ease) both; }
.result-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.result-head .panel-title { margin: 0; color: var(--text); }
.result-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; flex: none; }
.result-badge svg { stroke-width: 3; }
.result audio { width: 100%; height: 44px; border-radius: 10px; }

/* Toasts */
.toasts {
  position: fixed; z-index: 60;
  right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px;
  background: #1c1f27; border: 1px solid var(--line-2);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
  font-size: 14px;
  animation: toastIn 0.35s var(--ease) both;
}
.toast.leaving { animation: toastOut 0.25s ease-in both; }
.toast svg { margin-top: 1px; }
.toast-error { border-color: rgba(255, 77, 94, 0.5); } .toast-error svg { color: var(--danger); }
.toast-success svg { color: var(--ok); }
.toast-info svg { color: var(--accent-2); }
.toast-warn { border-color: rgba(255, 194, 71, 0.45); } .toast-warn svg { color: var(--warn); }
.toast b { display: block; margin-bottom: 2px; }
.toast p { margin: 0; color: var(--text-2); }
.toast-close { margin-left: auto; border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 0 0 0 6px; font-size: 18px; line-height: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

.drop-overlay {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  background: rgba(11, 12, 15, 0.82);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.drop-overlay div {
  padding: 40px 60px; border-radius: 22px;
  border: 2px dashed var(--accent);
  font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--accent-2);
  background: var(--accent-soft);
}
.noscript { position: fixed; inset: auto 0 0; padding: 14px; text-align: center; background: var(--danger); color: #fff; }

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .container { padding: 16px 12px 28px; }
  .topbar { padding: 10px 12px; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { width: 40px; padding: 0; }
  .features { grid-template-columns: 1fr; }
  .dropzone { padding: 36px 16px 30px; }
  .panel { padding: 14px; }
  .wave-panel { padding: 12px; }
  .clock-now { font-size: 21px; }
  .zoom input { width: 100px; }
  .wave-wrap { min-height: 150px; }
  .times { grid-template-columns: 1fr 1fr; }
  .time-duration { grid-column: 1 / -1; }
  .transport { gap: 8px; }
  .tbtn { height: 64px; }
  .field-row { flex-direction: column; gap: 0; }
  .export-actions { grid-template-columns: 1fr; }
  .shortcuts { display: none; }
  .toasts { right: 12px; left: 12px; max-width: none; }
}

@media (hover: none) {
  .waveform div::part(region-handle) { width: 22px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
