
:root {
  --bg: #fbfbfa;
  --panel: #ffffff;
  --panel-2: #f4f4f2;
  --line: #e4e3df;
  --line-strong: #d3d2cc;
  --ink: #1c1c1a;
  --ink-dim: #6b6b64;
  --ink-faint: #9d9c95;
  --accent: #2f5eff;
  --accent-soft: #eaeeff;
  --teal: #0ea88e;
  --teal-soft: #e3f7f2;
  --amber: #b8860b;
  --amber-soft: #fbf3de;
  --red: #d64545;
  --red-soft: #fbeaea;
  --radius: 12px;
  --disp: 'Space Grotesk', sans-serif;
  --body: 'IBM Plex Sans', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); }
::selection { background: var(--accent-soft); color: var(--accent); }

.wrap { max-width: 980px; margin: 0 auto; }

/* top actions */
.top-actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }

/* card */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.card h2 {
  font-family: var(--disp);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
}

/* meta grid */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 600px) { .meta-grid { grid-template-columns: repeat(2, 1fr); } }
.meta-item .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.meta-item .value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* settings row */
.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 720px) { .settings-row { grid-template-columns: 1fr; } }

/* waveform */
.wave-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  margin-bottom: 12px;
}
.wave-canvas { display: block; width: 100%; min-width: 280px; }

/* curve section */
.curve-title { margin-top: 20px !important; }
.curve-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.curve-canvas {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f111a;
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 180px;
}

/* gain reduction meter */
.gr-meter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.gr-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.gr-track {
  width: 14px;
  height: 140px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.gr-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, #d64545 0%, #f59e0b 60%, #0ea88e 100%);
  border-radius: 3px;
  transition: height .08s ease;
}
.gr-val {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}

/* preview row */
.preview-row {
  display: flex;
  gap: 8px;
}
.half-btn { flex: 1; }

/* controls */
.ctrl { margin-bottom: 16px; }
.ctrl label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.ctrl .val {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0;
  text-transform: none;
}
.ctrl input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--line-strong);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.ctrl input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(47,94,255,.2);
  cursor: pointer;
  transition: transform .1s;
}
.ctrl input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.ctrl input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  cursor: pointer;
}

/* preset buttons */
.preset-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-btn {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--ink-dim);
  cursor: pointer;
  transition: all .1s;
}
.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.preset-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* select */
.out-select {
  font-family: var(--mono);
  font-size: 12.5px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: border-color .1s;
}
.out-select:focus { border-color: var(--accent); }
.out-format { margin-bottom: 18px; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  width: 100%;
  margin-bottom: 12px;
  transition: filter .12s, opacity .12s;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  margin-bottom: 0;
}
.btn.ghost:hover:not(:disabled) { filter: none; border-color: var(--accent); color: var(--accent); }
.btn.download-result { background: var(--teal); width: auto; padding: 10px 18px; margin-bottom: 0; }

/* progress */
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  border-radius: 2px;
  transition: width .15s ease;
}
.status-line {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  min-height: 16px;
}

/* result */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.result-heading h2 { margin-bottom: 4px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--teal);
}
.pip { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); display: inline-block; }
.result-body { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 700px) { .result-body { grid-template-columns: 1fr; } }
.result-side { display: flex; flex-direction: column; gap: 16px; }

.file-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px;
  background: var(--panel-2);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.file-pair .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.file-pair .fname { font-family: var(--mono); font-size: 12px; color: var(--ink); word-break: break-all; }

.result-stats { display: flex; flex-direction: column; gap: 0; }
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.stat-label { color: var(--ink-faint); }
.stat-value { color: var(--ink); font-weight: 600; }
.stat-value.accent { color: var(--accent); }

.result-info-box {
  font-family: var(--body);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-dim);
  background: var(--teal-soft);
  border-radius: 8px;
  padding: 10px 14px;
}
