:root {
  --bg: #070a10;
  --panel: rgba(16, 22, 33, 0.88);
  --panel-2: #111827;
  --text: #eef6ff;
  --muted: #8794a9;
  --line: rgba(143, 168, 199, 0.16);
  --dark: #0b111d;
  --green: #30d9a2;
  --cyan: #25c8f5;
  --red: #ff5d6c;
  --purple: #9d79ff;
  --orange: #ffb44c;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  --inset: inset 0 1px 0 rgba(255,255,255,.05), inset 0 -1px 0 rgba(0,0,0,.2);
}

body.light-mode {
  --bg: #eef3f9;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-2: #e7edf5;
  --text: #111827;
  --muted: #667085;
  --line: rgba(25, 42, 70, 0.14);
  --dark: #253047;
  --shadow: 0 18px 50px rgba(36, 48, 77, 0.10);
  --inset: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -1px 0 rgba(0,0,0,.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-width: 1280px;
}

button, input, select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 30px 36px 90px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 6px 0 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 290px;
}

.brand-mark {
  width: 140px;
  height: 88px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 55% 45%, #1f7ec7, transparent 42%),
    radial-gradient(circle at 35% 42%, #3cf3ff, transparent 25%),
    linear-gradient(135deg, #080b18, #243b91 45%, #14c5f6);
  color: white;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -2px;
  box-shadow: var(--shadow);
  position: relative;
}

.brand-mark:before,
.brand-mark:after {
  content: "";
  position: absolute;
  height: 8px;
  width: 75px;
  background: linear-gradient(90deg, transparent, #0fb4e6, transparent);
  top: 42px;
}

.brand-mark:before { left: -58px; }
.brand-mark:after { right: -58px; }

.brand h1 {
  margin: 0;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .7px;
}

.brand p {
  margin: 2px 0 0;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .9px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  border: 0;
  border-radius: 7px;
  padding: 12px 17px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 2px 0 rgba(0,0,0,.05), inset 0 1px 0 rgba(255,255,255,.65);
  transition: .18s transform ease, .18s opacity ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn.dark {
  background: var(--dark);
  color: #fff;
}

.btn.green {
  background: var(--green);
  color: #fff;
}

.btn.cyan {
  background: var(--cyan);
  color: #fff;
}

.btn.red {
  background: var(--red);
  color: #fff;
}

.btn.light {
  background: #fff;
  color: #23283a;
  border: 1px solid var(--line);
  border-radius: 28px;
}

.btn.small {
  padding: 9px 12px;
  font-size: 12px;
}

.btn.full {
  width: 100%;
}

.select,
.field input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 7px;
  outline: none;
}

.select.wide { width: 210px; }

.dark-select {
  background: #302d38;
  color: #dfe6ff;
  border-color: transparent;
}

.layout {
  display: grid;
  grid-template-columns: 246px minmax(700px, 1fr) 384px;
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.left-rail,
.right-rack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.left-rail .card {
  padding: 18px 16px;
}

.card-title,
.module-row-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card-title {
  margin-bottom: 10px;
}

.mini-text {
  color: var(--text);
  line-height: 1.45;
  margin: 8px 0 12px;
}

.tiny {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.knob,
.mini-knob {
  display: grid;
  place-items: center;
  gap: 8px;
  user-select: none;
}

.knob-dial,
.mini-knob > div {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  position: relative;
  cursor: ns-resize;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,.18), transparent 24%),
    radial-gradient(circle, #1b1d24, #05060a);
  box-shadow:
    8px 12px 20px rgba(0,0,0,.18),
    inset 7px 8px 13px rgba(255,255,255,.08),
    inset -7px -8px 14px rgba(0,0,0,.35);
}

.knob.big .knob-dial { width: 92px; height: 92px; }

.knob-dial span,
.mini-knob > div span {
  position: absolute;
  width: 2px;
  height: 16px;
  background: var(--orange);
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255,178,62,.55);
}

.knob strong,
.mini-knob b {
  font-size: 10px;
  letter-spacing: .5px;
  color: var(--muted);
}

.knob em,
.mini-knob em {
  font-style: normal;
  font-size: 13px;
}

.input-card,
.output-card { text-align: center; }

.output-card .field { text-align: left; }

.field {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  font-size: 12px;
}

.field span,
.slider-field span {
  color: var(--text);
  font-size: 12px;
}

.field.compact {
  margin-top: 24px;
}

.meter-card {
  min-height: 224px;
}

.meters {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
}

.meters > div {
  display: grid;
  gap: 6px;
  place-items: center;
  font-size: 12px;
}

.meter {
  width: 31px;
  height: 112px;
  background: repeating-linear-gradient(to top, #9199a4 0 3px, transparent 3px 7px);
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
}

.meter i {
  display: block;
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, #3ddbb4, #e5cf55, #ff5b6b);
  border-radius: 15px;
  transition: height .07s linear;
}

.meters b {
  font-size: 12px;
  color: #05aee6;
  font-weight: 600;
}

.meter-readout {
  margin-top: 13px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.center-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-gradient {
  min-height: 450px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 24%, rgba(255,255,255,.8), transparent 11%),
    linear-gradient(120deg, #ffe8bc 0%, #edd4ef 42%, #bdd9ff 100%);
  border: 0;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.edition {
  width: max-content;
  margin: 0 auto 18px;
  padding: 12px 25px;
  border: 1px solid rgba(255,171,50,.75);
  color: #ffc400;
  border-radius: 22px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 4px;
}

.module-head {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  color: rgba(255,255,255,.92);
}

.module-head h2 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
}

.module-head p {
  margin: 3px 0 0;
  font-size: 10px;
  text-transform: uppercase;
  color: rgba(255, 112, 230, .75);
  letter-spacing: 1.3px;
}

.module-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.35);
  color: #b254ff;
  box-shadow: 0 10px 22px rgba(151,73,255,.22);
}

.switch input { display: none; }

.switch span {
  display: block;
  width: 56px;
  height: 28px;
  border-radius: 40px;
  background: #41434c;
  position: relative;
  cursor: pointer;
  transition: .2s ease;
}

.switch.small-switch span {
  width: 48px;
  height: 26px;
}

.switch span:after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  right: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  transition: .2s ease;
  box-shadow: 0 2px 9px rgba(0,0,0,.18);
}

.switch input:not(:checked) + span:after {
  right: 31px;
}

.switch input:checked + span {
  background: linear-gradient(90deg, #8d26ff, #3d62ff);
}

.inline-module {
  background: rgba(35, 32, 45, .78);
  color: #161d30;
  padding: 16px 17px;
  border-radius: 9px;
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inline-module strong {
  display: block;
  color: rgba(255,255,255,.48);
  text-transform: uppercase;
  font-size: 12px;
}

.inline-module small {
  color: rgba(57, 108, 176, .8);
  font-size: 10px;
}

.slider-field {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 20px;
  background: linear-gradient(90deg, #ce89ed var(--range, 50%), rgba(255,255,255,.35) var(--range, 50%));
  border: 1px solid rgba(0,0,0,.08);
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #c68cf1;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(198,140,241,.15);
}

.mastering-badge {
  text-align: center;
  margin-top: 34px;
}

.mastering-badge b {
  display: block;
  color: #ffc400;
  letter-spacing: 8px;
  font-size: 12px;
}

.mastering-badge span {
  display: block;
  color: #37d5b7;
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 3px;
  font-weight: 800;
}

.module-card {
  padding: 16px;
}

.big-control {
  min-height: 168px;
  margin-top: 12px;
  border: 1px solid rgba(47, 55, 68, .3);
  border-radius: 6px;
  background: rgba(0,0,0,.25);
  display: grid;
  place-items: center;
  color: #152036;
}

.big-control p {
  margin: 0;
  font-size: 11px;
  color: rgba(26, 40, 63, .65);
  text-align: center;
  max-width: 250px;
}

.upload-area {
  min-height: 318px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.25);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.upload-area:not(.has-audio) {
  cursor: pointer;
}

.upload-area:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.upload-area.drag {
  border-color: var(--purple);
  background: rgba(141, 44, 255, .08);
}

.empty-upload {
  display: grid;
  place-items: center;
  gap: 7px;
  color: var(--muted);
}

.empty-upload b {
  font-weight: 500;
  color: #566174;
}

.upload-icon {
  font-size: 42px;
  color: #3d4656;
}

.wave-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr 120px;
  opacity: 0;
  transition: .2s;
}

.upload-area.has-audio .wave-wrap {
  opacity: 1;
}

.upload-area.has-audio .empty-upload {
  display: none;
}

#waveCanvas,
#spectrumCanvas {
  width: 100%;
  height: 100%;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 14px;
}

.detail-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255,255,255,.2);
}

.checkline {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
}

.right-rack .card {
  padding: 16px;
}

.ai-card {
  background: linear-gradient(135deg, #4e5058, #42434b);
  color: white;
  min-height: 205px;
}

.ai-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.ai-top h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.ai-top p {
  margin: 0;
  color: #c99dff;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

.brain {
  opacity: .14;
  font-size: 58px;
}

.ai-result {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  font-size: 12px;
  display: none;
  line-height: 1.45;
}

.pill {
  color: #ffaf33;
  background: rgba(255, 182, 65, .16);
  border: 1px solid rgba(255, 182, 65, .33);
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 900;
}

.module-toggle {
  border: 0;
  background: #878e9a;
  color: #555d6b;
  font-weight: 900;
  border-radius: 5px;
  padding: 6px 12px;
  cursor: pointer;
}

.module-toggle.on {
  color: #fff;
  background: #07a0c8;
}

.rack-knobs {
  display: grid;
  gap: 14px;
  margin-top: 17px;
  align-items: start;
}

.rack-knobs.four { grid-template-columns: repeat(4, 1fr); }
.rack-knobs.three { grid-template-columns: repeat(3, 1fr); }
.rack-knobs.one { grid-template-columns: 1fr; }

.mini-knob > div {
  width: 62px;
  height: 62px;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,.45), transparent 21%),
    radial-gradient(circle, #aeb2b8, #82868e);
}

.mini-knob.large > div {
  width: 88px;
  height: 88px;
}

.mini-knob b {
  text-align: center;
  font-size: 10px;
}

.mini-knob em {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.gr-line {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.gr-line b {
  color: var(--orange);
}

.reduction-bar {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}

.reduction-bar i {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 10px;
  background: linear-gradient(90deg, #94a0ad 0%, #d2d8df 0%);
  border: 1px solid var(--line);
}

.transport {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  min-width: 720px;
  height: 66px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 18px 50px rgba(29, 38, 55, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px;
  z-index: 20;
  backdrop-filter: blur(10px);
}

body.dark-mode .transport {
  background: rgba(30,35,48,.92);
}

.timebox {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.timebox input {
  width: 78px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
}

.round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.big-round {
  width: 52px;
  height: 52px;
  font-size: 26px;
}

.clock {
  width: 86px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--panel-2);
}

.clock b {
  color: #02afd8;
  font-family: Consolas, monospace;
  font-size: 14px;
}

.clock span {
  font-size: 8px;
  color: var(--muted);
  font-weight: 800;
}

#toast {
  position: fixed;
  right: 24px;
  bottom: 104px;
  background: #121620;
  color: white;
  padding: 12px 16px;
  border-radius: 9px;
  opacity: 0;
  transform: translateY(10px);
  transition: .2s ease;
  z-index: 50;
  max-width: 360px;
  box-shadow: 0 14px 34px rgba(0,0,0,.25);
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1500px) {
  .layout {
    grid-template-columns: 246px minmax(620px, 1fr) 360px;
  }
  .app-shell {
    padding-left: 24px;
    padding-right: 24px;
  }
}



/* ===== Export Modal v2 ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 32, .62);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 100;
}

.modal-backdrop.show {
  display: flex;
}

.export-modal {
  width: 420px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 28px);
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
}

.modal-head {
  min-height: 58px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.modal-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #00b9df;
  background: rgba(0,185,223,.14);
  font-weight: 900;
}

.modal-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .2px;
}

.modal-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.icon-close {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.modal-body {
  overflow: auto;
  padding: 14px 16px;
}

.modal-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.25);
  margin-bottom: 14px;
}

.modal-section h3 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.modal-section p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 9px;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.platform-card,
.format-card,
.quality-card {
  border: 1px solid transparent;
  border-radius: 5px;
  background: rgba(120, 128, 139, .48);
  color: rgba(255,255,255,.78);
  text-align: left;
  cursor: pointer;
  transition: .16s ease;
}

.platform-card {
  min-height: 44px;
  padding: 7px;
}

.platform-card b {
  display: block;
  font-size: 10px;
}

.platform-card span,
.platform-card small {
  display: block;
  font-size: 8px;
  opacity: .72;
}

.platform-card.dark {
  background: #575b67;
}

.platform-card.active,
.format-card.active,
.quality-card.active {
  background: rgba(198, 242, 251, .9);
  color: #00a8d4;
  border-color: #35c6e4;
  box-shadow: inset 0 0 0 1px rgba(53,198,228,.35);
}

.modal-label {
  display: block;
  margin: 10px 0 7px;
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.format-card {
  padding: 10px;
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  position: relative;
}

.format-card i,
.quality-card i {
  font-style: normal;
  color: #ffb23e;
  font-size: 8px;
  position: absolute;
  right: 4px;
  top: 3px;
}

.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.quality-card {
  position: relative;
  padding: 10px 9px;
  font-size: 10px;
  color: var(--text);
  background: rgba(88,93,103,.55);
}

.modal-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 5px;
  margin-top: 12px;
  font-size: 10px;
}

.modal-check input {
  margin-top: 3px;
}

.modal-check b,
.modal-check small {
  display: block;
}

.modal-check small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.strong-check {
  background: rgba(79,84,93,.6);
  color: #fff;
}

.strong-check small {
  color: rgba(255,255,255,.62);
}

.soft-check {
  background: rgba(0, 155, 205, .18);
  border: 1px solid rgba(0, 155, 205, .22);
}

.modal-note {
  padding: 10px;
  border: 1px solid rgba(60,65,75,.5);
  background: rgba(80,85,96,.55);
  border-radius: 5px;
  color: rgba(255,255,255,.72);
  font-size: 8.5px;
  line-height: 1.35;
}

.modal-footer {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.18);
}

.export-summary {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

body.dark-mode .platform-card,
body.dark-mode .format-card,
body.dark-mode .quality-card {
  background: rgba(110,116,128,.35);
}

body.dark-mode .platform-card.active,
body.dark-mode .format-card.active,
body.dark-mode .quality-card.active {
  background: rgba(20, 120, 150, .38);
  color: #62d9ff;
}

/* Ernoz Audio Lab v4 — modern studio surface */
html { color-scheme: dark; }
body.light-mode { color-scheme: light; }

body {
  min-width: 0;
  background:
    radial-gradient(circle at 8% -5%, rgba(37, 200, 245, .13), transparent 28rem),
    radial-gradient(circle at 92% 3%, rgba(157, 121, 255, .11), transparent 30rem),
    linear-gradient(180deg, #080c14 0, var(--bg) 36rem);
  background-attachment: fixed;
}

body.light-mode {
  background:
    radial-gradient(circle at 8% -5%, rgba(37, 200, 245, .14), transparent 28rem),
    radial-gradient(circle at 92% 3%, rgba(157, 121, 255, .11), transparent 30rem),
    var(--bg);
}

.app-shell { padding: 20px 24px 110px; }

.topbar {
  position: sticky;
  top: 12px;
  z-index: 40;
  max-width: 1840px;
  margin: 0 auto 22px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(145%);
}

.brand { min-width: 230px; gap: 12px; }
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  font-size: 15px;
  letter-spacing: -.5px;
  background: linear-gradient(135deg, #23d8ed, #1687e8 50%, #9d79ff);
  box-shadow: 0 10px 30px rgba(37, 200, 245, .22), inset 0 1px 0 rgba(255,255,255,.4);
}
.brand-mark:before,
.brand-mark:after { display: none; }
.brand h1 { font-size: 15px; letter-spacing: .03em; }
.brand p { margin-top: 4px; font-size: 9px; letter-spacing: .14em; }

.top-actions { gap: 7px; }
.btn {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 14px;
  background: rgba(255,255,255,.045);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 200, 245, .42);
  background: rgba(37, 200, 245, .08);
}
.btn.dark { background: #0a101b; border-color: rgba(143,168,199,.18); }
.btn.green {
  color: #02120d;
  background: linear-gradient(135deg, #48edb8, #24c994);
  border-color: transparent;
  box-shadow: 0 9px 24px rgba(48, 217, 162, .2);
}
.btn.light { border-radius: 11px; background: rgba(255,255,255,.08); color: var(--text); }
.select,
.field input,
.batch-preset {
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  border-color: var(--line);
}
.select.wide { width: 226px; }

.layout {
  max-width: 1840px;
  margin: 0 auto;
  grid-template-columns: 226px minmax(580px, 1fr) 348px;
  gap: 18px;
}
.left-rail,
.right-rack { gap: 12px; }
.card {
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.035), transparent 70%), var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(18px);
}
.card-title,
.module-row-title { letter-spacing: .11em; font-weight: 760; }
.hero-card {
  border: 1px solid rgba(37,200,245,.2);
  background:
    linear-gradient(120deg, rgba(37,200,245,.11), transparent 42%),
    linear-gradient(300deg, rgba(157,121,255,.12), transparent 48%),
    #0d1421;
}
.edition,
.eyebrow { color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.module-card,
.detail-grid { background: var(--panel); }
.detail-panel { border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }

.upload-area {
  min-height: 260px;
  border-radius: 18px;
  border: 1px dashed rgba(37,200,245,.34);
  background:
    linear-gradient(rgba(37,200,245,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,200,245,.035) 1px, transparent 1px),
    rgba(9, 15, 25, .78);
  background-size: 32px 32px;
  box-shadow: inset 0 0 80px rgba(37,200,245,.025);
}
.upload-area.drag { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(37,200,245,.12), inset 0 0 80px rgba(37,200,245,.08); }
.empty-upload b { font-size: 16px; }
.upload-icon {
  color: var(--cyan);
  background: rgba(37,200,245,.1);
  border: 1px solid rgba(37,200,245,.25);
  box-shadow: 0 12px 32px rgba(37,200,245,.12);
}

.batch-card { padding: 20px; margin-top: 16px; }
.batch-head,
.batch-footer,
.batch-toolbar,
.batch-actions {
  display: flex;
  align-items: center;
}
.batch-head,
.batch-footer { justify-content: space-between; gap: 16px; }
.batch-head h2 { margin: 4px 0 2px; font-size: 21px; }
.batch-head p { margin: 0; color: var(--muted); font-size: 12px; }
.batch-actions { gap: 8px; flex-wrap: wrap; }
.batch-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, auto) 1fr auto;
  gap: 14px;
  margin: 17px 0 10px;
  color: var(--muted);
  font-size: 11px;
}
.batch-format { color: var(--cyan); font-weight: 750; }
.batch-progress { height: 5px; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.07); }
.batch-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .25s ease; }
.batch-list { display: grid; gap: 7px; max-height: 380px; overflow: auto; padding-right: 3px; }
.batch-empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.batch-item {
  display: grid;
  grid-template-columns: 42px minmax(150px, 1fr) minmax(180px, 250px) auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}
.batch-item.is-processing { border-color: rgba(37,200,245,.45); background: rgba(37,200,245,.055); }
.batch-item.is-done { border-color: rgba(48,217,162,.3); }
.batch-item.is-error { border-color: rgba(255,93,108,.35); }
.batch-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--cyan); background: rgba(37,200,245,.08); font-size: 11px; font-weight: 800; }
.batch-info { min-width: 0; display: grid; gap: 4px; }
.batch-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.batch-info span { color: var(--muted); font-size: 10px; }
.batch-preset { min-width: 0; width: 100%; color: var(--text); padding: 9px 10px; font-size: 10px; outline: none; }
.batch-preset:disabled { opacity: .55; }
.batch-item-actions { display: flex; gap: 6px; align-items: center; }
.icon-action { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 20px; }
.icon-action:hover { color: var(--red); border-color: rgba(255,93,108,.4); }
.batch-footer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.batch-check { margin: 0; }

.meter i { background: linear-gradient(180deg, var(--red), var(--orange) 38%, var(--green) 75%, var(--cyan)); }
.ai-card { background: linear-gradient(145deg, rgba(157,121,255,.1), transparent 60%), var(--panel); }
.pill { border-radius: 999px; color: var(--cyan); background: rgba(37,200,245,.08); border: 1px solid rgba(37,200,245,.14); }
.transport {
  width: auto;
  left: 24px;
  right: 24px;
  bottom: 14px;
  transform: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7,10,16,.88);
  backdrop-filter: blur(24px);
  box-shadow: 0 18px 60px rgba(0,0,0,.48);
}
body.light-mode .transport { background: rgba(250,252,255,.9); }
.round { border-color: var(--line); background: rgba(255,255,255,.045); color: var(--text); }

.modal-backdrop { backdrop-filter: blur(12px); background: rgba(2,5,10,.72); }
.export-modal { border-radius: 18px; border: 1px solid var(--line); background: #101723; box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.modal-head,
.modal-footer { background: rgba(255,255,255,.025); }
.platform-card,
.format-card,
.quality-card { border-radius: 10px; background: rgba(255,255,255,.04); border-color: var(--line); color: var(--text); }
.platform-card.active,
.format-card.active,
.quality-card.active { color: var(--cyan); background: rgba(37,200,245,.1); border-color: rgba(37,200,245,.42); }

button:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

@media (max-width: 1500px) {
  .layout { grid-template-columns: 210px minmax(520px, 1fr) 320px; gap: 14px; }
  .app-shell { padding-inline: 14px; }
  .topbar { top: 8px; }
  .select.wide { width: 190px; }
}

@media (max-width: 1120px) {
  .topbar { position: relative; top: 0; align-items: flex-start; }
  .top-actions { justify-content: flex-start; }
  .layout { grid-template-columns: 210px 1fr; }
  .right-rack { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { padding: 10px 10px 128px; }
  .topbar { display: block; border-radius: 14px; }
  .brand { margin-bottom: 12px; }
  .top-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-actions .select.wide { grid-column: 1 / -1; width: 100%; }
  .layout { display: flex; flex-direction: column; }
  .left-rail,
  .center-stage,
  .right-rack { display: flex; width: 100%; flex-direction: column; }
  .right-rack { grid-column: auto; }
  .detail-grid { grid-template-columns: 1fr; }
  .batch-head,
  .batch-footer { align-items: flex-start; flex-direction: column; }
  .batch-toolbar { grid-template-columns: 1fr auto; }
  .batch-toolbar .batch-progress { grid-row: 2; grid-column: 1 / -1; }
  .batch-item { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .batch-preset { grid-column: 2 / -1; }
  .batch-footer .batch-actions { width: 100%; }
  .batch-footer .btn { flex: 1; }
  .transport { left: 8px; right: 8px; overflow-x: auto; justify-content: flex-start; padding: 8px; }
  .transport .timebox { display: none; }
  .export-modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
}

/* v4.0.1 — export modal readability and contrast */
.export-modal {
  width: 620px;
  color: #f4f8ff;
  color-scheme: dark;
  background: #0c1420;
  border: 1px solid #2a3a50;
  box-shadow: 0 32px 110px rgba(0, 0, 0, .72), 0 0 0 1px rgba(255,255,255,.025) inset;
}

.modal-head {
  min-height: 76px;
  padding: 15px 18px;
  background: #101a28;
  border-bottom-color: #24344a;
}

.modal-icon {
  width: 34px;
  height: 34px;
  color: #5ce6ff;
  background: #073246;
  border: 1px solid #15536a;
}

.modal-head h2 {
  color: #ffffff;
  font-size: 17px;
  line-height: 1.2;
}

.modal-head p {
  color: #a9b8cb;
  font-size: 11px;
  line-height: 1.4;
}

.icon-close {
  color: #cbd7e6;
  border-radius: 8px;
}

.icon-close:hover {
  color: #ffffff;
  background: rgba(255,255,255,.08);
}

.modal-body {
  padding: 18px;
  background: #0c1420;
  scrollbar-color: #34465e #0c1420;
}

.modal-section {
  padding: 15px;
  margin-bottom: 14px;
  color: #edf5ff;
  background: #121d2b;
  border: 1px solid #27384e;
  border-radius: 12px;
}

.modal-section h3 {
  color: #f7fbff;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: .06em;
}

.modal-section p {
  color: #9fafc3;
  font-size: 10.5px;
  line-height: 1.5;
}

.platform-grid { gap: 9px; }

.platform-card,
.platform-card.dark,
.format-card,
.quality-card,
body.dark-mode .platform-card,
body.dark-mode .format-card,
body.dark-mode .quality-card {
  color: #eaf3ff;
  background: #1a2738;
  border: 1px solid #2c4059;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.platform-card {
  min-height: 62px;
  padding: 10px;
}

.platform-card b {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.25;
}

.platform-card span,
.platform-card small {
  color: #afbdd0;
  font-size: 9.5px;
  line-height: 1.35;
  opacity: 1;
}

.platform-card:hover,
.format-card:hover,
.quality-card:hover {
  color: #ffffff;
  background: #213249;
  border-color: #3e5b78;
}

.platform-card.active,
.format-card.active,
.quality-card.active,
body.dark-mode .platform-card.active,
body.dark-mode .format-card.active,
body.dark-mode .quality-card.active {
  color: #7cecff;
  background: #0c3b4e;
  border-color: #2bd5f5;
  box-shadow: 0 0 0 1px rgba(43,213,245,.16) inset, 0 8px 24px rgba(0,176,215,.09);
}

.platform-card.active b,
.format-card.active,
.quality-card.active {
  color: #83eeff;
}

.platform-card.active span,
.platform-card.active small {
  color: #d2f8ff;
}

.modal-label {
  margin-top: 14px;
  color: #c3d0df;
  font-size: 11.5px;
}

.format-grid,
.quality-grid { gap: 9px; }

.format-card,
.quality-card {
  min-height: 46px;
  padding: 12px 10px;
  font-size: 11.5px;
}

.format-card i,
.quality-card i {
  top: 5px;
  right: 7px;
  color: #ffc766;
  font-size: 9px;
}

.modal-check {
  min-height: 58px;
  padding: 12px;
  color: #eef6ff;
  background: #182638;
  border: 1px solid #2c415b;
  border-radius: 10px;
  font-size: 11.5px;
}

.modal-check b { color: #ffffff; }
.modal-check small,
.strong-check small {
  color: #aebdd0;
  font-size: 9.5px;
  line-height: 1.4;
}

.modal-check input {
  width: 16px;
  height: 16px;
  accent-color: #25c8f5;
}

.modal-check.is-disabled {
  opacity: .5;
  background: #111b28;
}

.modal-note {
  padding: 12px;
  color: #c7d5e6;
  background: #151f2e;
  border: 1px solid #2a3c53;
  border-radius: 10px;
  font-size: 10px;
  line-height: 1.5;
}

.modal-footer {
  min-height: 70px;
  padding: 13px 18px;
  color: #f4f8ff;
  background: #101a28;
  border-top-color: #26384e;
}

.export-summary {
  color: #b8c7d9;
  font-size: 11px;
  line-height: 1.45;
}

.modal-footer .btn.green {
  min-width: 150px;
  color: #03130f;
  font-size: 13px;
}

@media (max-width: 680px) {
  .modal-backdrop { padding: 8px; }
  .export-modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 15px; }
  .modal-head { min-height: 68px; padding: 12px 14px; }
  .modal-body { padding: 12px; }
  .modal-section { padding: 12px; }
  .platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-card { min-height: 65px; }
  .modal-footer { grid-template-columns: 1fr; padding: 12px 14px; }
  .modal-footer .btn.green { width: 100%; }
}
