[hidden] { display: none !important; }

:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #6e7974;
  --line: #dce2dc;
  --paper: #f7f8f3;
  --card: #fff;
  --lime: #c8f169;
  --lime-dark: #56751f;
  --radius: 18px;
  --focus: #56751f;
}

html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid #56751f;
  outline-offset: 3px;
}
.app-shell { max-width: 1180px; padding: 22px 34px 24px; }
.brand { text-decoration: none; }
.topbar-note { white-space: nowrap; }
.hero h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: -0.065em; }
.hero-text { max-width: 560px; }
.eyebrow svg, .upload-icon svg, .file-icon svg, .icon-button svg, .replace-button svg,
.primary-button svg, .download-all-button svg, .stem-control svg, .transport-button svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.eyebrow svg { width: 15px; height: 15px; }
.upload-card, .process-card { overflow: hidden; }
.dropzone { cursor: pointer; border-radius: inherit; }
.dropzone:hover { background: #fafbf7; }
.dropzone.is-dragging { background: #f2f8e8; outline: 2px dashed var(--lime-dark); outline-offset: -8px; }
.dropzone:active, .primary-button:active, .transport-button:active, .download-all-button:active { transform: translateY(1px); }
.upload-icon, .file-icon { flex: 0 0 auto; }
.file-message { padding: 0 25px 12px; color: var(--muted); font-size: 12px; }
.file-message[data-kind="error"] { color: #9d3b30; font-weight: 700; }
.file-message[data-kind="success"] { color: var(--lime-dark); }
.source-player { display: block; max-width: 100%; }
.replace-button { margin: 0 25px 16px; min-height: 38px; cursor: pointer; }

.process-description { max-width: 660px; }
.range-panel { margin: 18px 0 18px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcf9; }
.range-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 12px 15px; color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 800; list-style: none; }
.range-panel summary::-webkit-details-marker { display: none; }
.range-panel summary::after { content: "+"; color: var(--lime-dark); font-size: 20px; font-weight: 500; }
.range-panel[open] summary::after { content: "−"; }
.range-summary-hint { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
.range-intro { padding: 0 15px 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.range-list { display: grid; gap: 8px; padding: 0 12px 10px; }
.range-voice { display: grid; grid-template-columns: minmax(100px, 0.7fr) repeat(2, minmax(110px, 1fr)); align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid #e9ede7; }
.range-voice-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; }
.range-voice-label strong { font-size: 12px; }
.range-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--voice-color); }
.range-values { display: none; color: var(--muted); font-size: 10px; }
.range-field { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.range-field span { display: flex; justify-content: space-between; gap: 8px; }
.range-field output { color: var(--ink); font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--lime-dark); min-width: 0; }
.range-field input { width: 100%; margin: 0; }
.reset-ranges { margin: 0 15px 14px; padding: 7px 0; color: var(--lime-dark); background: transparent; border: 0; cursor: pointer; font-size: 11px; font-weight: 800; }
.range-dirty-note { margin: 0 0 14px; padding: 10px 12px; color: #62521d; background: #fff7df; border-radius: 10px; font-size: 12px; line-height: 1.45; }

.progress-wrap { margin: 10px 0 16px; }
.progress-label, .progress-meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.progress-label { color: var(--ink); font-size: 12px; font-weight: 700; }
.progress-label b { font-variant-numeric: tabular-nums; }
.progress-track { height: 8px; margin: 8px 0; overflow: hidden; border-radius: 99px; background: #e8ece5; }
.progress-track > div { height: 100%; width: 0; border-radius: inherit; background: var(--lime-dark); transition: width 180ms linear; }
.progress-meta { color: var(--muted); font-size: 10px; }
.process-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; }
.primary-button { cursor: pointer; }
.primary-button:disabled { cursor: not-allowed; opacity: 0.55; }
.cancel-button { min-height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; font-size: 12px; font-weight: 800; cursor: pointer; }
.cancel-button:disabled { opacity: 0.6; cursor: wait; }
.process-status { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.error-box { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 14px; padding: 11px 12px; border: 1px solid #eed3ce; border-radius: 11px; background: #fff7f5; color: #8b3128; font-size: 12px; line-height: 1.5; }

.output-section { margin-top: 24px; }
.transport-card { margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 10px 24px #23302306; }
.transport-topline, .transport-actions, .seek-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.transport-title { display: grid; gap: 4px; }
.transport-title strong { font-size: 14px; }
.transport-mode { color: var(--muted); font-size: 11px; }
.transport-actions { justify-content: flex-start; margin: 13px 0; flex-wrap: wrap; }
.transport-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.transport-primary { color: var(--lime); border-color: var(--ink); background: var(--ink); }
.transport-primary svg { fill: currentColor; stroke: none; }
.seek-label { color: var(--muted); font-size: 10px; }
.seek-label span:last-child { font-variant-numeric: tabular-nums; }
.seek-bar { width: 100%; margin: 5px 0 0; }
.stems-list { display: grid; gap: 9px; }
.stem-card { grid-template-columns: 28px 38px minmax(70px, 1fr) minmax(230px, 1.1fr) 40px; }
.stem-info span { display: block; }
.stem-controls { display: grid; grid-template-columns: 36px 36px 36px minmax(70px, 1fr); align-items: center; gap: 5px; }
.stem-control { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.stem-control[aria-pressed="true"] { color: #fff; border-color: var(--ink); background: var(--ink); }
.stem-control svg { width: 15px; height: 15px; }
.volume-control { display: grid; gap: 1px; min-width: 0; color: var(--muted); font-size: 9px; }
.volume-control span { display: flex; justify-content: space-between; }
.volume-control output { font-variant-numeric: tabular-nums; }
.volume-control input { width: 100%; margin: 0; }
.download-button { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; }
.download-button svg { width: 18px; height: 18px; }
.download-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 13px 0 4px; }
.download-all-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 16px; color: var(--lime); background: var(--ink); border: 1px solid var(--ink); border-radius: 12px; font-size: 12px; font-weight: 800; cursor: pointer; }
.download-all-button:disabled { opacity: 0.55; cursor: not-allowed; }
.zip-save-link { text-decoration: none; }
.zip-save-link[hidden] { display: none; }
.zip-save-link:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.zip-status { color: var(--muted); font-size: 10px; text-align: right; }
.download-note { display: flex; align-items: center; gap: 7px; margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.side-card a { text-decoration: none; }
.side-card a span { float: right; }
.footer { margin-top: 44px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 850px) {
  .app-shell { padding: 16px 20px 26px; }
  .hero { padding: 48px 0 32px; }
  .layout { grid-template-columns: 1fr; gap: 20px; }
  .side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-card { grid-column: 1 / -1; }
  .stem-card { grid-template-columns: 26px 36px minmax(80px, 1fr) 40px; gap: 9px; }
  .stem-controls { grid-column: 2 / -1; grid-row: 2; grid-template-columns: 40px 40px 40px minmax(100px, 1fr); }
  .stem-card > .download-button { grid-column: 4; grid-row: 1; }
}

@media (max-width: 560px) {
  .app-shell { padding: max(14px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
  .topbar { padding-bottom: 14px; }
  .topbar-note { font-size: 9px; }
  .hero { align-items: flex-start; gap: 10px; padding: 38px 0 25px; }
  .hero h1 { max-width: 8ch; font-size: clamp(2.7rem, 12vw, 4rem); line-height: 0.98; }
  .hero-text { max-width: 35ch; font-size: 13px; }
  .hero-mark { width: 58px; height: 58px; flex: 0 0 auto; }
  .hero-mark span { font-size: 23px; }
  .section-kicker { gap: 8px; }
  .section-kicker em { font-size: 9px; }
  .dropzone { min-height: 126px; gap: 12px; padding: 18px 15px; }
  .dropzone-copy strong { font-size: 13px; }
  .dropzone-copy small { font-size: 10px; }
  .file-message { padding: 0 16px 10px; }
  .source-player { width: calc(100% - 32px); margin: 4px 16px 10px; }
  .replace-button { margin-left: 16px; }
  .process-card { padding: 15px; }
  .process-heading h2 { font-size: 21px; }
  .range-voice { grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 11px 4px; }
  .range-voice-label { grid-column: 1 / -1; }
  .range-values { display: inline; margin-left: auto; }
  .range-summary-hint { display: none; }
  .range-field { font-size: 9px; }
  .progress-meta { flex-wrap: wrap; }
  .process-actions { grid-template-columns: 1fr; }
  .cancel-button { width: 100%; }
  .transport-card { padding: 13px; }
  .transport-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .transport-button { min-width: 0; min-height: 44px; padding: 0 8px; font-size: 10px; }
  .stem-card { grid-template-columns: 22px 34px minmax(0, 1fr) 38px; padding: 10px 9px; }
  .stem-index { font-size: 9px; }
  .stem-avatar { width: 32px; height: 32px; font-size: 12px; }
  .stem-info strong { font-size: 12px; }
  .stem-info span { font-size: 9px; }
  .stem-controls { grid-template-columns: 40px 40px 40px minmax(72px, 1fr); gap: 4px; }
  .stem-control { width: 38px; height: 38px; }
  .download-actions { align-items: stretch; flex-direction: column; }
  .download-all-button { min-height: 50px; width: 100%; }
  .zip-status { text-align: left; }
  .side-column { grid-template-columns: 1fr; }
  .compact-card { grid-column: auto; }
  .footer { margin-top: 30px; font-size: 9px; }
}

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


.range-presets { display: grid; grid-template-columns: auto minmax(150px, 240px); align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.range-presets select, .speed-control select { min-height: 38px; padding: 0 11px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 12px; }
.waveform-canvas { display: block; width: 100%; height: 76px; margin-top: 12px; border: 1px solid #e7ece5; border-radius: 10px; background: linear-gradient(180deg, #fbfcf9, #f5f8f1); touch-action: none; cursor: crosshair; }
.waveform-caption { margin: 4px 0 10px; color: var(--muted); font-size: 10px; }
.loop-controls { display: grid; gap: 8px; margin: 10px 0; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcf9; }
.loop-markers { display: flex; gap: 8px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.loop-markers span { padding: 4px 8px; border-radius: 999px; background: #eef2e9; }
.loop-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.loop-buttons .transport-button { min-height: 36px; padding: 0 10px; font-size: 10px; }
.loop-buttons #toggleLoopButton[aria-pressed="true"] { color: #fff; border-color: var(--lime-dark); background: var(--lime-dark); }
.loop-status { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.speed-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.speed-control select { min-height: 34px; }
.batch-panel { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcf9; }
.batch-panel summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 12px 14px; color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 800; }
.batch-panel summary span { color: var(--muted); font-size: 10px; font-weight: 500; }
.batch-body { display: grid; gap: 10px; padding: 0 14px 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.batch-body > p { margin: 0; }
.batch-file-picker { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 12px; color: var(--ink); border: 1px dashed var(--lime-dark); border-radius: 10px; background: #f5f8ef; font-size: 11px; font-weight: 800; cursor: pointer; }
.batch-file-picker:hover { background: #eef5df; }
.batch-queue { display: grid; gap: 5px; margin: 0; padding-left: 22px; color: var(--ink); font-size: 11px; }
.batch-queue li { padding: 5px 7px; border-radius: 7px; background: #fff; }
.batch-queue li[data-state="done"] { color: var(--lime-dark); }
.batch-queue li[data-state="error"] { color: #9d3b30; }
.batch-status { min-height: 1em; }
.batch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.batch-actions .primary-button, .batch-actions .download-all-button { min-height: 42px; padding: 0 13px; font-size: 11px; }
.batch-actions .download-all-button { width: auto; }

@media (max-width: 560px) {
  .range-presets { grid-template-columns: 1fr; gap: 6px; }
  .range-presets select { width: 100%; }
  .loop-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .loop-buttons .transport-button { min-width: 0; padding: 0 5px; }
  .batch-panel summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .batch-actions { display: grid; grid-template-columns: 1fr; }
  .batch-actions .download-all-button { width: 100%; }
}


.pwa-install-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 20px #23302305; }
.pwa-install-copy { display: grid; gap: 3px; min-width: 0; }
.pwa-install-copy strong { color: var(--ink); font-size: 12px; }
.pwa-install-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.pwa-install-button { flex: 0 0 auto; min-height: 42px; padding: 0 15px; border: 1px solid var(--ink); border-radius: 10px; color: var(--lime); background: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pwa-install-button:active { transform: translateY(1px); }
@media (max-width: 560px) {
  .pwa-install-banner { align-items: flex-start; gap: 10px; }
  .pwa-install-button { min-height: 44px; }
}
