:root {
  color-scheme: dark;
  --black: #050607;
  --shell: #0b0c0e;
  --panel: #111315;
  --panel-2: #17191c;
  --panel-3: #202328;
  --line: #30343a;
  --line-soft: #23262b;
  --text: #e8e9e7;
  --muted: #8b9096;
  --dim: #585d63;
  --orange: #4da3ff;
  --orange-soft: #2d79c7;
  --gold: #f0b43f;
  --green: #58d68d;
}

/* V9 — engineered desktop instrument */
body {
  padding: 22px;
  background:
    radial-gradient(circle at 50% -20%, #ffffff 0, #eeeeee 42%, #d9d9d9 100%);
}

.discovery-machine {
  width: calc(100vw - 44px);
  height: calc(100vh - 44px);
  padding: 12px;
  gap: 5px;
  border: 1px solid #35383c;
  border-radius: 24px;
  background:
    radial-gradient(circle at 28% 0%, rgba(255, 255, 255, 0.055), transparent 31%),
    linear-gradient(145deg, #292c30 0%, #141619 48%, #1d2023 100%);
  box-shadow:
    0 28px 55px rgba(0, 0, 0, 0.38),
    0 6px 14px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 0 rgba(0, 0, 0, 0.7);
}

.machine-header,
.song-deck,
.board-panel,
.command-row > button,
.quick-folders,
.scan-console {
  border-color: #42464b;
  background:
    radial-gradient(circle at 40% 0%, rgba(255, 255, 255, 0.035), transparent 50%),
    linear-gradient(155deg, #202327, #111315 72%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -2px 2px rgba(0, 0, 0, 0.55),
    0 1px 2px rgba(0, 0, 0, 0.75);
}

.machine-header {
  border-radius: 12px 12px 5px 5px;
}

.control-board,
.discovery-mode.active,
.playback-strip,
.discovery-controls,
.command-row {
  gap: 5px;
}

.song-deck,
.board-panel,
.quick-folders,
.scan-console,
.command-row > button {
  border-radius: 7px;
}

.song-deck {
  padding: 8px;
}

.preview-frame {
  border-color: #050607;
  box-shadow:
    0 0 0 2px #34373b,
    inset 0 0 18px rgba(0, 0, 0, 0.55);
}

.player-column {
  border-inline: 1px solid #303338;
  padding-inline: 14px;
}

.player-scrubber {
  height: 6px;
  background: #363a3e;
  box-shadow: inset 0 1px 2px #050607, 0 1px rgba(255, 255, 255, 0.04);
}

.scan-display {
  border-color: #30343a;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #07090a;
  background-size: 100% 13px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.75);
}

.board-panel {
  padding: 11px;
}

.setting-module {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 42%),
    #171a1d;
}

.setting-module::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.45px, transparent 0.55px);
  background-size: 4px 4px;
}

.setting-header,
.setting-options,
.switch-control,
.mode-toggle {
  position: relative;
  z-index: 1;
}

.setting-options {
  justify-items: center;
  gap: 14px;
  padding: 9px 8px 13px;
}

.setting-button {
  position: relative;
  width: min(68px, 100%);
  height: auto;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #4f545a;
  border-radius: 50%;
  color: #d7d9db;
  background:
    radial-gradient(circle at 46% 39%, #50545a 0 16%, #35393e 17% 39%, #17191c 40% 67%, #0a0b0d 68% 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.13),
    inset 0 -6px 9px rgba(0, 0, 0, 0.7),
    0 4px 7px rgba(0, 0, 0, 0.88),
    0 0 0 5px #121416,
    0 0 0 6px #34383d;
  text-shadow: 0 1px 2px #000;
}

.setting-button::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #090a0b;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12);
  transform: translateX(-50%);
}

.setting-button:hover {
  border-color: #686d73;
  transform: translateY(-1px);
}

.setting-button.active {
  color: #ffffff;
  border-color: #62676d;
  background:
    radial-gradient(circle at 46% 39%, #61666c 0 16%, #3d4247 17% 39%, #1c1f22 40% 67%, #0a0b0d 68% 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.18),
    inset 0 -6px 9px rgba(0, 0, 0, 0.72),
    0 4px 7px rgba(0, 0, 0, 0.88),
    0 0 0 5px #121416,
    0 0 0 6px #5b6066;
}

.setting-button.active::before {
  background: var(--orange);
  box-shadow: 0 0 8px rgba(255, 126, 25, 0.95);
}

.setting-button small,
.setting-button.active small {
  color: var(--muted);
}

.mode-toggle {
  border-color: #4d5258;
  background:
    radial-gradient(circle at 44% 38%, #4d5257 0 16%, #30343a 17% 39%, #131518 40% 68%, #08090a 69% 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.12),
    inset 0 -7px 10px rgba(0, 0, 0, 0.75),
    0 5px 8px rgba(0, 0, 0, 0.8),
    0 0 0 5px #101214,
    0 0 0 6px #393d42;
}

.mode-toggle::after {
  width: 6px;
  height: 6px;
  border: 0;
  background: #070809;
  box-shadow: none;
}

.mode-toggle.active {
  border-color: #60656b;
  background:
    radial-gradient(circle at 44% 38%, #5c6167 0 16%, #393e43 17% 39%, #17191c 40% 68%, #08090a 69% 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.16),
    inset 0 -7px 10px rgba(0, 0, 0, 0.75),
    0 5px 8px rgba(0, 0, 0, 0.8),
    0 0 0 5px #101214,
    0 0 0 6px #565b61;
}

.mode-toggle.active::after {
  background: var(--orange);
  box-shadow: 0 0 9px rgba(255, 126, 25, 0.95);
}

.switch-control,
.switch-control.active {
  border: 1px solid #555a60;
  background: linear-gradient(#2d3034, #17191c);
  box-shadow: inset 0 2px 4px #08090a, 0 1px rgba(255, 255, 255, 0.08);
}

.switch-knob {
  background: linear-gradient(#f1f1ef, #a9acae);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.switch-copy {
  color: var(--orange);
}

.command-row > button {
  position: relative;
  overflow: hidden;
  color: #d5d7d9;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.command-row > button::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #090a0b;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.command-row > button:hover {
  border-color: #60656b;
  background: linear-gradient(155deg, #282c30, #151719 72%);
  transform: translateY(-1px);
}

.command-row .start-scan {
  color: #e6e7e8;
  border-color: #555a60;
  background:
    radial-gradient(circle at 12% 50%, rgba(255, 126, 25, 0.09), transparent 18%),
    linear-gradient(155deg, #282b2f, #131517 72%);
}

.command-row .start-scan > span,
.command-row .start-scan > strong {
  color: var(--orange);
}

.command-row .start-scan > small {
  color: var(--muted);
}

.command-row .start-scan::after,
.command-row > button.active::after {
  background: var(--orange);
  box-shadow: 0 0 9px rgba(255, 126, 25, 0.92);
}

.quick-folders {
  padding: 9px 11px 11px;
}

.quick-folder-buttons {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(48px, 1fr));
  align-content: stretch;
  gap: 6px;
}

.quick-folder,
.quick-folder-slot {
  position: relative;
  min-height: 0;
  padding: 9px 12px;
  border: 1px solid #44494f;
  border-radius: 7px;
  color: #c9cccf;
  font: inherit;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
  background:
    radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.055), transparent 42%),
    linear-gradient(#24272b, #151719);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.07),
    inset 0 -3px 3px rgba(0, 0, 0, 0.42),
    0 2px 3px rgba(0, 0, 0, 0.65);
}

.quick-folder::after,
.quick-folder-slot::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #65696d;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14);
}

.quick-folder:hover,
.quick-folder-slot:hover {
  border-color: #646a70;
  background: linear-gradient(#2c3034, #181a1d);
}

.quick-folder.saved {
  color: #d9eee2;
  border-color: #2e7d55;
  background: linear-gradient(#183426, #10251b);
}

.quick-folder.saved::after {
  background: var(--green);
  box-shadow: 0 0 8px rgba(56, 230, 137, 0.9);
}

.quick-folder-slot {
  color: #676c71;
}

.quick-folder-slot span {
  margin-right: 7px;
  color: var(--orange);
  font-size: 14px;
  vertical-align: -1px;
}

.quick-folder-slot::after {
  background: #25282b;
}

.scan-console {
  padding: 5px 7px 7px;
}

.scan-track {
  gap: 3px;
}

.scan-step {
  border-color: #3e4247;
  background:
    radial-gradient(circle at 50% 42%, #383c41 0 23%, #202327 24% 56%, #111315 57% 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), 0 2px 3px rgba(0, 0, 0, 0.65);
}

.scan-step.heard {
  color: #ffe36c;
  border-color: #7c6b21;
  background: radial-gradient(circle at 50% 42%, #8c7723 0 23%, #3d3619 24% 56%, #16150f 57% 100%);
}

.scan-step.saved {
  color: #84f3b4;
  border-color: #278053;
  background: radial-gradient(circle at 50% 42%, #267b51 0 23%, #173d2c 24% 56%, #0e1712 57% 100%);
}

@media (max-width: 1200px), (max-height: 760px) {
  body {
    padding: 10px;
  }

  .discovery-machine {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    padding: 8px;
    border-radius: 18px;
  }

  .setting-options {
    gap: 10px;
  }

  .setting-button {
    width: min(58px, 100%);
  }
}

/* V12 — website panels, not a hardware gadget */
body {
  padding: 0;
  background: #0b0d0f;
}

.discovery-machine {
  width: 100vw;
  height: 100vh;
  padding: 0;
  gap: 0;
  border: 0;
  border-radius: 0;
  background: #0b0d0f;
  box-shadow: none;
}

.machine-header,
.song-deck,
.board-panel,
.command-row > button,
.quick-folders,
.scan-console {
  border-color: #2b3035;
  border-radius: 0;
  background: #121519;
  box-shadow: none;
}

.machine-header {
  border-width: 0 0 1px;
}

.machine-body {
  grid-template-columns: minmax(210px, 22vw) minmax(0, 1fr);
  gap: 0;
}

.song-deck {
  padding: 8px 7px;
  border-width: 0 1px 0 0;
}

.control-board {
  grid-template-rows: 132px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  background: #0b0d0f;
}

.playback-strip,
.discovery-mode.active,
.discovery-controls,
.command-row {
  gap: 8px;
}

.board-panel,
.command-row > button {
  border-radius: 6px;
}

.playback-strip {
  grid-template-columns: minmax(150px, 190px) minmax(280px, 1fr) minmax(180px, 23%);
  padding: 9px;
}

.mini-screen,
.scan-readout {
  border-radius: 4px;
}

.transport-controls button,
.transport-controls .main-play {
  width: 58px;
  height: 38px;
  border-radius: 5px;
  background: #1b1f23;
  box-shadow: none;
}

.transport-controls .main-play {
  width: 76px;
}

.song-progress::-webkit-slider-thumb {
  width: 14px;
  height: 20px;
  margin-top: -7px;
  border-radius: 3px;
  box-shadow: none;
}

.discovery-mode.active {
  grid-template-rows: 144px 76px minmax(96px, 1fr);
}

.discovery-controls {
  grid-template-columns: minmax(118px, .55fr) minmax(330px, 1.45fr) minmax(260px, 1.12fr) minmax(135px, .62fr);
}

.control-module {
  padding: 10px;
}

.control-module header span {
  width: auto;
  height: auto;
  padding: 0;
  color: var(--orange);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 8px;
}

.setting-options {
  justify-items: stretch;
  gap: 7px;
  padding: 8px 0 5px;
}

.setting-button,
.setting-button.active {
  width: 100%;
  height: 64px;
  aspect-ratio: auto;
  padding: 0;
  border-radius: 5px;
  background: #1b1f23;
  box-shadow: none;
  text-shadow: none;
}

.setting-button::before,
.setting-button.active::before {
  content: none;
}

.setting-button.active {
  color: #111;
  border-color: #ffad54;
  background: var(--orange);
}

.setting-button:hover {
  transform: none;
}

.mode-toggle,
.mode-toggle.active {
  display: grid;
  grid-template-columns: auto 1fr;
  place-items: center;
  gap: 8px;
  width: 100%;
  height: 54px;
  margin: auto 0;
  border-radius: 5px;
  background: #1b1f23;
  box-shadow: none;
}

.mode-toggle.active {
  color: #111;
  border-color: #ffad54;
  background: var(--orange);
}

.mode-toggle::after,
.mode-toggle.active::after {
  content: none;
}

.mode-toggle span,
.mode-toggle.active span {
  color: inherit;
  font-size: 16px;
}

.switch-control,
.switch-control.active {
  display: grid;
  place-items: center;
  width: 100%;
  height: 54px;
  margin: auto 0;
  padding: 0;
  border-radius: 5px;
  background: #1b1f23;
  box-shadow: none;
}

.switch-control span {
  display: none;
}

.switch-control.active {
  color: #111;
  border-color: #ffad54;
  background: var(--orange);
}

.switch-control.active strong {
  transform: none;
}

.command-row {
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, .72fr) minmax(180px, .92fr);
}

.command-row > button {
  grid-template-columns: 34px 1fr;
  padding: 8px 12px;
  background: #171b1f;
}

.command-row > button::after {
  content: none;
}

.command-row > button:hover {
  transform: none;
  background: #20252a;
}

.command-row .start-scan {
  color: #111;
  border-color: #ffad54;
  background: var(--orange);
}

.quick-folders {
  padding: 9px 10px 10px;
}

.quick-folder-buttons {
  grid-template-rows: repeat(2, minmax(40px, 1fr));
  gap: 6px;
}

.quick-folder,
.quick-folder-slot {
  border-radius: 5px;
  background: #181c20;
  box-shadow: none;
}

.scan-console {
  border-width: 1px 0 0;
}

.scan-step,
.scan-step.heard,
.scan-step.saved {
  border-radius: 3px;
  background: #1b1f23;
  box-shadow: none;
}

.scan-step.heard { background: #4a3c12; }
.scan-step.saved { background: #143824; }

.workspace-switch button,
#manageQuickFolders,
#addSkipRange,
.remove-skip,
.rule-toggle,
.repeat-option,
.quick-folder,
.quick-folder-slot,
.folder-choice,
.close-dialog {
  border-radius: 5px;
  box-shadow: none;
}

.rule-toggle span {
  display: none;
}

.rule-toggle,
.rule-toggle.active {
  justify-content: center;
  padding: 0 12px;
}

.rule-toggle.active strong {
  transform: none;
}

@media (max-width: 1200px), (max-height: 760px) {
  body { padding: 0; }
  .discovery-machine { width: 100vw; height: 100vh; padding: 0; border-radius: 0; }
  .control-board { padding: 6px; }
  .setting-button { width: 100%; height: 58px; }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  min-width: 980px;
  height: 100vh;
  overflow: hidden;
  color: var(--text);
  background: #030405;
  font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.discovery-machine {
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr) 82px;
  gap: 8px;
  width: 100vw;
  height: 100vh;
  padding: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 74% 0%, rgba(255, 138, 29, 0.04), transparent 30%),
    linear-gradient(135deg, #0a0b0d, #050607 70%);
  border: 1px solid #1f2226;
}

.machine-header,
.song-deck,
.board-panel,
.command-row > button,
.scan-console {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #141619, #0d0f11);
  box-shadow: inset 0 1px rgba(255,255,255,.035), 0 5px 16px rgba(0,0,0,.24);
}

.machine-header {
  display: grid;
  grid-template-columns: minmax(205px, 22%) minmax(0, 1fr) 138px;
  align-items: stretch;
  overflow: hidden;
  border-radius: 7px;
}

.machine-brand,
.heard-display {
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.machine-brand {
  gap: 11px;
  border-right: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #111;
  background: var(--orange);
  border-radius: 50%;
  font-size: 21px;
  font-weight: 900;
  box-shadow: 0 0 0 4px rgba(255,138,29,.1);
}

.machine-brand div,
.heard-display,
.deck-header div {
  display: grid;
  gap: 3px;
}

.machine-brand strong {
  font-size: 19px;
  letter-spacing: 0;
}

.machine-brand small,
.heard-display span,
.deck-header span,
.scan-label span {
  color: var(--muted);
  font: 700 8px/1.2 "Courier New", monospace;
  letter-spacing: .13em;
}

.now-display {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 78px;
  align-items: center;
  min-width: 0;
  padding: 0 14px;
  background: #08090a;
}

.now-display > span,
.now-display > strong {
  color: var(--orange);
  font: 700 9px/1 "Courier New", monospace;
  letter-spacing: .08em;
}

.now-display > strong {
  padding: 7px 6px;
  color: var(--gold);
  border: 1px solid #473118;
  border-radius: 4px;
  text-align: center;
}

.now-copy { min-width: 0; text-align: center; }
.now-copy h1, .now-copy p { margin: 0; }

.now-copy h1 {
  overflow: hidden;
  font: 700 clamp(15px, 1.45vw, 24px)/1.1 "Courier New", monospace;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-copy p {
  margin-top: 4px;
  color: var(--muted);
  font: 700 8px/1 "Courier New", monospace;
  letter-spacing: .08em;
}

.now-copy i {
  margin: 0 8px;
  color: var(--orange);
  font-style: normal;
}

#currentViews { color: var(--gold); }

.heard-display {
  justify-content: center;
  border-left: 1px solid var(--line);
  text-align: center;
}

.heard-display strong {
  color: var(--orange);
  font: 800 21px/1 "Courier New", monospace;
}

.machine-body {
  display: grid;
  grid-template-columns: minmax(205px, 22%) minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.song-deck {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  border-radius: 7px;
}

.deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 4px 10px;
  border-bottom: 1px solid var(--line);
}

.deck-header strong {
  font: 700 15px/1 "Courier New", monospace;
  letter-spacing: .08em;
}

.deck-header > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 28px;
  color: var(--orange);
  background: #08090a;
  border: 1px solid #3a3d42;
  border-radius: 4px;
}

.song-cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 12px 5px 80px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--orange-soft) #090a0b;
}

.song-card {
  position: relative;
  flex: 0 0 auto;
  width: min(86%, 245px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  color: #fff;
  background-color: #111;
  background-position: center;
  background-size: cover;
  border: 1px solid #4a4d51;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(0,0,0,.34);
  text-align: left;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}

.song-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.08) 42%, rgba(0,0,0,.9)),
    linear-gradient(90deg, rgba(0,0,0,.24), transparent 55%);
}

.song-card:hover { transform: translateY(-2px); border-color: #777c82; }

.song-card.active {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255,138,29,.14), 0 14px 30px rgba(0,0,0,.45);
}

.song-card.saved { border-color: var(--green); }

.card-number,
.card-status,
.card-copy { position: absolute; z-index: 2; }

.card-number {
  top: 13px;
  left: 14px;
  font: 700 13px/1 "Courier New", monospace;
}

.card-status {
  top: 12px;
  right: 13px;
  width: 9px;
  height: 9px;
  background: #5a5e63;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(0,0,0,.25);
}

.song-card.heard .card-status { background: var(--gold); }
.song-card.saved .card-status { background: var(--green); }

.card-copy {
  right: 14px;
  bottom: 15px;
  left: 14px;
  display: grid;
  gap: 5px;
}

.card-copy strong,
.card-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-copy strong { font-size: 14px; letter-spacing: .04em; }
.card-copy span { color: #c5c7c8; font: 700 9px/1 "Courier New", monospace; }

.deck-loading {
  color: var(--muted);
  font: 700 9px/1.6 "Courier New", monospace;
  text-align: center;
}

.control-board {
  display: grid;
  grid-template-rows: 136px 160px 96px minmax(105px, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.board-panel { border-radius: 7px; }

.playback-strip {
  display: grid;
  grid-template-columns: 205px minmax(300px, 1fr) minmax(180px, 25%);
  gap: 12px;
  min-width: 0;
  padding: 10px;
}

.mini-screen {
  position: relative;
  overflow: hidden;
  background: #050607;
  border: 1px solid #3d4146;
  border-radius: 5px;
}

.mini-screen img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8) contrast(1.08); }

.mini-screen span {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 4px 6px;
  color: var(--orange);
  background: rgba(0,0,0,.72);
  border: 1px solid rgba(255,138,29,.35);
  font: 700 7px/1 "Courier New", monospace;
  letter-spacing: .1em;
}

.transport-bank {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: center;
  min-width: 0;
  padding: 4px 8px;
}

.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 700 8px/1 "Courier New", monospace;
  letter-spacing: .08em;
}

.time-row strong { color: #cdd0d1; }

.song-progress {
  width: 100%;
  height: 25px;
  appearance: none;
  background: transparent;
}

.song-progress::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, var(--orange) 0 var(--progress, 0%), #35383d var(--progress, 0%) 100%);
  border-radius: 10px;
}

.song-progress::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6px;
  appearance: none;
  background: #1b1d20;
  border: 2px solid var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 0 3px #0b0c0e;
}

.transport-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.transport-controls button {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  color: #c7c9ca;
  background: #191b1e;
  border: 1px solid #45494e;
  border-radius: 50%;
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 3px 5px #050607;
  font-size: 12px;
}

.transport-controls .main-play {
  width: 54px;
  height: 54px;
  color: var(--orange);
  border-color: var(--orange-soft);
  font-size: 18px;
}

.scan-readout {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  background: #090a0b;
  border: 1px solid #292c30;
  border-radius: 5px;
}

.scan-readout span,
.scan-readout small {
  color: var(--muted);
  font: 700 7px/1.3 "Courier New", monospace;
  letter-spacing: .08em;
}

.scan-readout strong {
  overflow: hidden;
  color: var(--orange);
  font: 700 11px/1.2 "Courier New", monospace;
  text-overflow: ellipsis;
}

.discovery-controls {
  display: grid;
  grid-template-columns: minmax(145px, .7fr) minmax(300px, 1.45fr) minmax(245px, 1.15fr) minmax(160px, .8fr);
  gap: 8px;
  min-width: 0;
}

.control-module {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  padding: 12px;
}

.control-module header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d2d4d4;
  font: 700 9px/1 "Courier New", monospace;
  letter-spacing: .06em;
}

.control-module header span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--orange);
  background: #090a0b;
  border: 1px solid #34373b;
  border-radius: 50%;
  font-size: 7px;
}

.control-module > small {
  color: var(--muted);
  font: 700 7px/1 "Courier New", monospace;
  text-align: center;
}

.mode-toggle,
.switch-control {
  align-self: center;
  color: #c8cbcc;
  background: #191b1e;
  border: 1px solid #45494e;
}

.mode-toggle {
  display: grid;
  place-items: center;
  gap: 4px;
  width: 74px;
  height: 74px;
  margin: 0 auto;
  border-radius: 50%;
}

.mode-toggle span { color: var(--muted); font-size: 20px; }
.mode-toggle strong { font: 700 8px/1 "Courier New", monospace; }

.mode-toggle.active {
  color: var(--orange);
  border-color: var(--orange-soft);
  box-shadow: inset 0 0 0 3px #0c0d0f, 0 0 14px rgba(255,138,29,.11);
}

.mode-toggle.active span { color: var(--orange); }

.setting-options {
  display: grid;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.setting-options.five-options { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.setting-options.four-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.setting-button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  height: 78px;
  color: #c5c7c8;
  background: #1b1d20;
  border: 1px solid #45494e;
  border-radius: 10px;
  box-shadow: inset 0 1px rgba(255,255,255,.045), 0 3px 5px #060708;
  font: 500 19px/1 "Courier New", monospace;
}

.setting-button small {
  color: var(--muted);
  font: 700 7px/1 "Courier New", monospace;
}

.setting-button:hover { border-color: #686d73; }

.setting-button.active {
  color: #111;
  background: var(--orange);
  border-color: #ffad54;
  box-shadow: inset 0 1px rgba(255,255,255,.24), 0 0 14px rgba(255,138,29,.16);
}

.setting-button.active small { color: #3f2209; }

.switch-control {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  align-self: center;
  width: 105px;
  height: 46px;
  margin: 0 auto;
  padding: 5px 12px 5px 6px;
  border-radius: 24px;
  font: 700 9px/1 "Courier New", monospace;
}

.switch-control span {
  width: 32px;
  height: 32px;
  background: #5c6065;
  border-radius: 50%;
  transition: transform .16s, background .16s;
}

.switch-control.active { color: #111; background: var(--orange); border-color: #ffad54; }
.switch-control.active span { transform: translateX(54px); background: #f3f3ef; }
.switch-control.active strong { transform: translateX(-35px); }

.command-row {
  display: grid;
  grid-template-columns: 1.5fr .7fr 1fr .8fr;
  gap: 8px;
}

.command-row > button {
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  min-width: 0;
  padding: 10px 13px;
  color: #d5d7d7;
  border-radius: 7px;
  text-align: left;
}

.command-row button > span {
  grid-row: 1 / span 2;
  color: var(--orange);
  font-size: 24px;
}

.command-row button > strong {
  overflow: hidden;
  font: 700 12px/1 "Courier New", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-row button > small {
  color: var(--muted);
  font: 700 7px/1 "Courier New", monospace;
}

.command-row .start-scan {
  color: #111;
  background: linear-gradient(180deg, #ff9d39, #e87413);
  border-color: #ffb05f;
}

.start-scan > span { color: #111 !important; }
.start-scan > small { color: #5e2d08 !important; }

.command-button:hover,
.command-button.saved,
.command-button.active {
  border-color: var(--orange-soft);
  background: #1d1712;
}

.command-button.saved > span,
.command-button.active > span { color: var(--orange); }

.quick-folders {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 12px;
}

.quick-folders header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.quick-folders header div { display: grid; gap: 4px; }
.quick-folders header span { font: 700 11px/1 "Courier New", monospace; letter-spacing: .08em; }
.quick-folders header strong { color: var(--muted); font: 700 7px/1 "Courier New", monospace; }

#manageQuickFolders {
  display: grid;
  place-items: center;
  width: 36px;
  height: 30px;
  color: var(--orange);
  background: #191b1e;
  border: 1px solid #4a4d51;
  border-radius: 5px;
  font-size: 20px;
}

.quick-folder-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: center;
  gap: 7px;
  min-height: 0;
  padding-top: 9px;
}

.quick-folder {
  position: relative;
  min-width: 0;
  min-height: 45px;
  padding: 7px 24px 7px 9px;
  overflow: hidden;
  color: #b8bbbd;
  background: #181a1d;
  border: 1px solid #3d4146;
  border-radius: 6px;
  font: 700 8px/1.2 "Courier New", monospace;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-folder::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  background: #5a5e63;
  border-radius: 50%;
}

.quick-folder.saved {
  color: #dffbea;
  background: #10231a;
  border-color: #327a53;
}

.quick-folder.saved::after { background: var(--green); box-shadow: 0 0 7px rgba(88,214,141,.6); }

.quick-folder-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font: 700 8px/1.4 "Courier New", monospace;
  text-align: center;
}

.scan-console {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr) 245px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px 14px;
  border-radius: 7px;
}

.scan-label { display: grid; gap: 5px; }
.scan-label strong { color: var(--orange); font: 700 10px/1 "Courier New", monospace; }

.scan-steps {
  display: grid;
  grid-template-columns: repeat(30, minmax(19px, 1fr));
  gap: 3px;
  min-width: 0;
}

.scan-step {
  position: relative;
  display: grid;
  place-items: start center;
  min-width: 0;
  height: 47px;
  padding-top: 5px;
  color: #71767b;
  background: #111315;
  border: 1px solid #30343a;
  border-radius: 5px;
  font: 700 7px/1 "Courier New", monospace;
}

.scan-step::after {
  content: "";
  position: absolute;
  bottom: 7px;
  width: 8px;
  height: 8px;
  background: #4d5156;
  border: 2px solid #090a0b;
  border-radius: 50%;
}

.scan-step.heard::after { background: var(--gold); box-shadow: 0 0 6px rgba(240,180,63,.55); }
.scan-step.saved::after { background: var(--green); box-shadow: 0 0 6px rgba(88,214,141,.55); }

.scan-step.active {
  color: var(--orange);
  border-color: var(--orange);
  box-shadow: inset 0 0 0 1px rgba(255,138,29,.2);
}

.scan-step:disabled { opacity: .23; cursor: default; }

.step-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  color: var(--muted);
  font: 700 7px/1 "Courier New", monospace;
}

.step-legend span { display: flex; align-items: center; gap: 5px; }
.step-legend i { width: 8px; height: 8px; background: #4d5156; border-radius: 50%; }
.step-legend i.heard { background: var(--gold); }
.step-legend i.saved { background: var(--green); }

.folder-dialog {
  width: min(650px, calc(100vw - 40px));
  padding: 0;
  color: var(--text);
  background: #101214;
  border: 1px solid #45494e;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,.7);
}

.folder-dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(5px); }
.folder-sheet { padding: 22px; }

.folder-sheet header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.folder-sheet header p,
.folder-sheet header h2,
.folder-status { margin: 0; }

.folder-sheet header p { color: var(--orange); font: 700 8px/1 "Courier New", monospace; letter-spacing: .1em; }
.folder-sheet header h2 { margin-top: 6px; font: 700 20px/1.1 "Courier New", monospace; }

.close-dialog {
  width: 36px;
  height: 36px;
  color: #ddd;
  background: #1a1c1f;
  border: 1px solid #45494e;
  border-radius: 50%;
  font-size: 20px;
}

.folder-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 16px 0;
}

.folder-choice {
  min-height: 54px;
  padding: 0 14px;
  color: #b9bcbe;
  background: #181a1d;
  border: 1px solid #3e4247;
  border-radius: 7px;
  font: 700 9px/1 "Courier New", monospace;
  text-align: left;
}

.folder-choice.saved {
  color: #111;
  background: var(--orange);
  border-color: #ffad54;
}

.folder-choice.quick-selected {
  color: #dffbea;
  background: #123220;
  border-color: #409568;
}

.folder-status {
  padding: 11px 12px;
  color: var(--orange);
  background: #090a0b;
  border-left: 3px solid var(--orange);
  font: 700 8px/1.3 "Courier New", monospace;
}

.audio-host {
  position: fixed;
  top: -2000px;
  left: -2000px;
  width: 320px;
  height: 180px;
  opacity: .01;
  pointer-events: none;
}

[hidden] { display: none !important; }

.machine-header {
  grid-template-columns: minmax(205px, 22%) minmax(0, 1fr) 292px;
}

.header-controls {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: stretch;
  border-left: 1px solid var(--line);
}

.header-controls .heard-display {
  padding: 0 7px;
  border: 0;
  border-right: 1px solid var(--line);
}

.header-controls .heard-display strong { font-size: 13px; }

.workspace-switch {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 5px;
  align-items: center;
  padding: 8px;
}

.workspace-switch button {
  height: 38px;
  padding: 0 8px;
  color: var(--muted);
  background: #131518;
  border: 1px solid #383c41;
  border-radius: 5px;
  font: 700 8px/1 "Courier New", monospace;
  letter-spacing: .04em;
}

.workspace-switch button.active {
  color: #111;
  background: var(--orange);
  border-color: #ffad54;
}

.song-list-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 8px;
  padding: 8px 8px 6px 50px;
  color: var(--dim);
  border-bottom: 1px solid var(--line-soft);
  font: 700 7px/1 "Courier New", monospace;
  letter-spacing: .08em;
}

.song-list-heading span:last-child { text-align: right; }

.song-list {
  min-height: 0;
  overflow-y: auto;
  padding: 4px 2px 60px;
  scrollbar-width: thin;
  scrollbar-color: var(--orange-soft) #090a0b;
}

.song-row {
  display: grid;
  grid-template-columns: 10px 30px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 31px;
  padding: 0 7px;
  color: #aeb1b3;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #1e2125;
  text-align: left;
}

.song-row:hover { background: #17191c; }

.song-row.active {
  color: #fff;
  background: #20170f;
  box-shadow: inset 2px 0 var(--orange);
}

.song-row .song-led {
  width: 7px;
  height: 7px;
  background: #50545a;
  border-radius: 50%;
}

.song-row.seen .song-led { background: #f4f4f1; box-shadow: 0 0 5px rgba(255,255,255,.45); }
.song-row.heard .song-led { background: var(--gold); box-shadow: 0 0 5px rgba(240,180,63,.5); }
.song-row.saved .song-led { background: var(--green); box-shadow: 0 0 5px rgba(88,214,141,.5); }
.song-row.liked .song-led { background: #ff5f7d; box-shadow: 0 0 6px rgba(255,95,125,.62); }

.song-row .song-number,
.song-row .song-views {
  color: var(--dim);
  font: 700 7px/1 "Courier New", monospace;
}

.song-row .song-title,
.song-row .song-views {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-row .song-title { font: 700 8px/1 "Courier New", monospace; }
.song-row .song-views { color: #a66b27; text-align: right; }
.song-row.active .song-number, .song-row.active .song-views { color: var(--orange); }

.control-board { grid-template-rows: 136px minmax(0, 1fr); }

.mode-view { min-width: 0; min-height: 0; }

.discovery-mode.active {
  display: grid;
  grid-template-rows: 160px 96px minmax(105px, 1fr);
  gap: 8px;
}

.command-row { grid-template-columns: 1.5fr .75fr 1fr; }

.player-mode {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(300px, .9fr);
  grid-template-rows: minmax(145px, 1fr) minmax(145px, 1fr) 76px;
  gap: 8px;
}

.rule-panel {
  min-width: 0;
  min-height: 0;
  padding: 14px;
}

.rule-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.rule-panel header div { display: grid; gap: 4px; }
.rule-panel header span, .rule-summary > span { color: var(--orange); font: 700 10px/1 "Courier New", monospace; }
.rule-panel header strong, .rule-summary > small { color: var(--muted); font: 700 7px/1.2 "Courier New", monospace; }

.skip-rules { grid-row: 1 / span 3; }

#addSkipRange {
  min-width: 100px;
  height: 34px;
  color: #111;
  background: var(--orange);
  border: 1px solid #ffad54;
  border-radius: 5px;
  font: 700 8px/1 "Courier New", monospace;
}

.rule-columns,
.skip-range-row {
  display: grid;
  grid-template-columns: 1fr 1fr 34px;
  gap: 8px;
}

.rule-columns {
  padding: 12px 3px 6px;
  color: var(--dim);
  font: 700 7px/1 "Courier New", monospace;
}

.skip-ranges {
  display: grid;
  align-content: start;
  gap: 7px;
  max-height: calc(100% - 76px);
  overflow-y: auto;
}

.skip-range-row input,
.time-rule-inputs input {
  width: 100%;
  height: 42px;
  color: var(--text);
  background: #090a0b;
  border: 1px solid #3d4146;
  border-radius: 5px;
  outline: 0;
  font: 700 12px/1 "Courier New", monospace;
  text-align: center;
}

.skip-range-row input:focus,
.time-rule-inputs input:focus { border-color: var(--orange); }

.remove-skip {
  width: 34px;
  height: 42px;
  color: #c4c6c7;
  background: #1a1c1f;
  border: 1px solid #3d4146;
  border-radius: 5px;
  font-size: 16px;
}

.empty-rules {
  margin: 20px 0 0;
  color: var(--muted);
  font: 700 8px/1.5 "Courier New", monospace;
  text-align: center;
}

.loop-rules,
.repeat-rules { display: grid; grid-template-rows: auto 1fr; }

.rule-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 128px;
  height: 38px;
  margin: 13px auto 8px;
  padding: 5px 10px 5px 5px;
  color: var(--muted);
  background: #191b1e;
  border: 1px solid #45494e;
  border-radius: 22px;
  font: 700 8px/1 "Courier New", monospace;
}

.rule-toggle span { width: 27px; height: 27px; background: #555a60; border-radius: 50%; }
.rule-toggle.active { color: #111; background: var(--orange); border-color: #ffad54; }
.rule-toggle.active span { transform: translateX(84px); background: #f4f4ef; }
.rule-toggle.active strong { transform: translateX(-35px); }

.time-rule-inputs {
  display: grid;
  grid-template-columns: 1fr 20px 1fr;
  align-items: end;
  gap: 8px;
}

.time-rule-inputs label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font: 700 7px/1 "Courier New", monospace;
}

.time-rule-inputs > span { padding-bottom: 14px; color: var(--orange); text-align: center; }

.repeat-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  align-items: center;
  padding-top: 12px;
}

.repeat-option {
  display: grid;
  place-items: center;
  gap: 7px;
  min-width: 0;
  height: 76px;
  color: var(--muted);
  background: #191b1e;
  border: 1px solid #3d4146;
  border-radius: 7px;
}

.repeat-option span { font: 700 21px/1 "Courier New", monospace; }
.repeat-option strong { font: 700 7px/1.2 "Courier New", monospace; }
.repeat-option.active { color: #111; background: var(--orange); border-color: #ffad54; }

.rule-summary {
  display: grid;
  align-content: center;
  gap: 7px;
  background: #090a0b;
}

.rule-summary > strong {
  overflow: hidden;
  color: #d6d8d8;
  font: 700 10px/1 "Courier New", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .discovery-machine { grid-template-rows: 62px minmax(0, 1fr) 76px; }
  .machine-header { grid-template-columns: 205px minmax(0, 1fr) 255px; }
  .machine-body { grid-template-columns: 205px minmax(0, 1fr); }
  .control-board { grid-template-rows: 125px minmax(0, 1fr); }
  .playback-strip { grid-template-columns: 175px minmax(260px, 1fr) 170px; }
  .discovery-controls { grid-template-columns: 135px minmax(270px, 1.4fr) minmax(215px, 1.1fr) 150px; }
  .setting-button { height: 70px; }
  .command-row button > strong { font-size: 10px; }
  .scan-console { grid-template-columns: 135px minmax(0, 1fr) 190px; padding-inline: 10px; }
  .step-legend { gap: 8px; }
}

@media (max-height: 760px) {
  .discovery-machine { grid-template-rows: 58px minmax(0, 1fr) 70px; gap: 6px; padding: 6px; }
  .control-board { grid-template-rows: 115px minmax(0, 1fr); gap: 6px; }
  .discovery-mode.active { grid-template-rows: 136px 82px minmax(88px, 1fr); gap: 6px; }
  .playback-strip { padding: 7px; }
  .setting-button { height: 62px; }
  .command-row > button { padding: 7px 10px; }
  .quick-folders { padding: 9px; }
  .quick-folder { min-height: 38px; }
  .song-card { width: min(80%, 210px); }
  .scan-step { height: 41px; }
}

/* V9 final cascade — Midlife Engineering-inspired control surface */
body {
  padding: 22px;
  background: radial-gradient(circle at 50% -20%, #fff 0, #eee 42%, #d9d9d9 100%);
}

.discovery-machine {
  width: calc(100vw - 44px);
  height: calc(100vh - 44px);
  padding: 12px;
  gap: 5px;
  border: 1px solid #35383c;
  border-radius: 24px;
  background:
    radial-gradient(circle at 28% 0%, rgba(255,255,255,.055), transparent 31%),
    linear-gradient(145deg, #292c30, #141619 48%, #1d2023);
  box-shadow: 0 28px 55px rgba(0,0,0,.38), 0 6px 14px rgba(0,0,0,.24),
    inset 0 1px rgba(255,255,255,.08), inset 0 -2px rgba(0,0,0,.7);
}

.machine-header,
.song-deck,
.board-panel,
.command-row > button,
.quick-folders,
.scan-console {
  border-color: #42464b;
  border-radius: 7px;
  background:
    radial-gradient(circle at 40% 0%, rgba(255,255,255,.035), transparent 50%),
    linear-gradient(155deg, #202327, #111315 72%);
  box-shadow: inset 0 1px rgba(255,255,255,.06), inset 0 -2px 2px rgba(0,0,0,.55),
    0 1px 2px rgba(0,0,0,.75);
}

.machine-header { border-radius: 12px 12px 5px 5px; }
.control-board, .discovery-mode.active, .playback-strip, .discovery-controls, .command-row { gap: 5px; }
.song-deck { padding: 8px; }
.player-column { padding-inline: 14px; border-inline: 1px solid #303338; }
.player-scrubber { height: 6px; background: #363a3e; box-shadow: inset 0 1px 2px #050607; }
.preview-frame { border-color: #050607; box-shadow: 0 0 0 2px #34373b, inset 0 0 18px rgba(0,0,0,.55); }
.scan-display { border-color: #30343a; background: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), #07090a; background-size: 100% 13px; box-shadow: inset 0 0 20px rgba(0,0,0,.75); }

.board-panel { padding: 11px; }
.setting-module { position: relative; background: linear-gradient(155deg, rgba(255,255,255,.035), transparent 42%), #171a1d; }
.setting-module::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .2; background-image: radial-gradient(rgba(255,255,255,.16) .45px, transparent .55px); background-size: 4px 4px; }
.setting-header, .setting-options, .switch-control, .mode-toggle { position: relative; z-index: 1; }
.setting-options { justify-items: center; gap: 14px; padding: 9px 8px 13px; }

.setting-button {
  position: relative;
  width: min(68px, 100%);
  height: auto;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #4f545a;
  border-radius: 50%;
  color: #d7d9db;
  background: radial-gradient(circle at 46% 39%, #50545a 0 16%, #35393e 17% 39%, #17191c 40% 67%, #0a0b0d 68%);
  box-shadow: inset 0 2px 3px rgba(255,255,255,.13), inset 0 -6px 9px rgba(0,0,0,.7),
    0 4px 7px rgba(0,0,0,.88), 0 0 0 5px #121416, 0 0 0 6px #34383d;
  text-shadow: 0 1px 2px #000;
}

.setting-button::before { content: ""; position: absolute; top: 8px; left: 50%; width: 5px; height: 5px; border-radius: 50%; background: #090a0b; transform: translateX(-50%); }
.setting-button:hover { border-color: #686d73; transform: translateY(-1px); }
.setting-button.active { color: #fff; border-color: #62676d; background: radial-gradient(circle at 46% 39%, #61666c 0 16%, #3d4247 17% 39%, #1c1f22 40% 67%, #0a0b0d 68%); box-shadow: inset 0 2px 3px rgba(255,255,255,.18), inset 0 -6px 9px rgba(0,0,0,.72), 0 4px 7px rgba(0,0,0,.88), 0 0 0 5px #121416, 0 0 0 6px #5b6066; }
.setting-button.active::before { background: var(--orange); box-shadow: 0 0 8px rgba(255,126,25,.95); }
.setting-button small, .setting-button.active small { color: var(--muted); }

.mode-toggle { border-color: #4d5258; background: radial-gradient(circle at 44% 38%, #4d5257 0 16%, #30343a 17% 39%, #131518 40% 68%, #08090a 69%); box-shadow: inset 0 2px 3px rgba(255,255,255,.12), inset 0 -7px 10px rgba(0,0,0,.75), 0 5px 8px rgba(0,0,0,.8), 0 0 0 5px #101214, 0 0 0 6px #393d42; }
.mode-toggle::after { width: 6px; height: 6px; border: 0; background: #070809; box-shadow: none; }
.mode-toggle.active { border-color: #60656b; background: radial-gradient(circle at 44% 38%, #5c6167 0 16%, #393e43 17% 39%, #17191c 40% 68%, #08090a 69%); box-shadow: inset 0 2px 3px rgba(255,255,255,.16), inset 0 -7px 10px rgba(0,0,0,.75), 0 5px 8px rgba(0,0,0,.8), 0 0 0 5px #101214, 0 0 0 6px #565b61; }
.mode-toggle.active::after { background: var(--orange); box-shadow: 0 0 9px rgba(255,126,25,.95); }

.switch-control, .switch-control.active { border: 1px solid #555a60; background: linear-gradient(#2d3034, #17191c); box-shadow: inset 0 2px 4px #08090a, 0 1px rgba(255,255,255,.08); }
.switch-knob { background: linear-gradient(#f1f1ef, #a9acae); box-shadow: 0 2px 5px rgba(0,0,0,.8); }
.switch-copy { color: var(--orange); }

.command-row > button { position: relative; overflow: hidden; color: #d5d7d9; transition: 140ms ease; }
.command-row > button::after { content: ""; position: absolute; top: 12px; right: 13px; width: 6px; height: 6px; border-radius: 50%; background: #090a0b; }
.command-row > button:hover { border-color: #60656b; background: linear-gradient(155deg, #282c30, #151719 72%); transform: translateY(-1px); }
.command-row .start-scan { color: #e6e7e8; border-color: #555a60; background: radial-gradient(circle at 12% 50%, rgba(255,126,25,.09), transparent 18%), linear-gradient(155deg, #282b2f, #131517 72%); }
.command-row .start-scan > span, .command-row .start-scan > strong { color: var(--orange); }
.command-row .start-scan > small { color: var(--muted); }
.command-row .start-scan::after, .command-row > button.active::after { background: var(--orange); box-shadow: 0 0 9px rgba(255,126,25,.92); }
.command-row { grid-template-columns: 1.5fr .75fr 1fr; }

.quick-folders { padding: 9px 11px 11px; }
.quick-folder-buttons { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(48px, 1fr)); align-content: stretch; gap: 6px; }
.quick-folder, .quick-folder-slot { position: relative; min-height: 0; padding: 9px 12px; border: 1px solid #44494f; border-radius: 7px; color: #c9cccf; font: 700 8px/1 "Courier New", monospace; letter-spacing: .04em; text-align: left; cursor: pointer; background: radial-gradient(circle at 30% 0%, rgba(255,255,255,.055), transparent 42%), linear-gradient(#24272b, #151719); box-shadow: inset 0 1px rgba(255,255,255,.07), inset 0 -3px 3px rgba(0,0,0,.42), 0 2px 3px rgba(0,0,0,.65); }
.quick-folder::after, .quick-folder-slot::after { content: ""; position: absolute; top: 10px; right: 11px; width: 6px; height: 6px; border-radius: 50%; background: #65696d; }
.quick-folder:hover, .quick-folder-slot:hover { border-color: #646a70; background: linear-gradient(#2c3034, #181a1d); }
.quick-folder.saved { color: #d9eee2; border-color: #2e7d55; background: linear-gradient(#183426, #10251b); }
.quick-folder.saved::after { background: var(--green); box-shadow: 0 0 8px rgba(56,230,137,.9); }
.quick-folder-slot { color: #676c71; }
.quick-folder-slot span { margin-right: 7px; color: var(--orange); font-size: 14px; vertical-align: -1px; }
.quick-folder-slot::after { background: #25282b; }

.scan-console { padding: 5px 7px 7px; }
.scan-track { gap: 3px; }
.scan-step { border-color: #3e4247; background: radial-gradient(circle at 50% 42%, #383c41 0 23%, #202327 24% 56%, #111315 57%); box-shadow: inset 0 1px rgba(255,255,255,.07), 0 2px 3px rgba(0,0,0,.65); }
.scan-step.heard { color: #ffe36c; border-color: #7c6b21; background: radial-gradient(circle at 50% 42%, #8c7723 0 23%, #3d3619 24% 56%, #16150f 57%); }
.scan-step.saved { color: #84f3b4; border-color: #278053; background: radial-gradient(circle at 50% 42%, #267b51 0 23%, #173d2c 24% 56%, #0e1712 57%); }

@media (max-width: 1200px), (max-height: 760px) {
  body { padding: 10px; }
  .discovery-machine { width: calc(100vw - 20px); height: calc(100vh - 20px); padding: 8px; border-radius: 18px; }
  .setting-options { gap: 10px; }
  .setting-button { width: min(58px, 100%); height: auto; }
  .quick-folder, .quick-folder-slot { min-height: 0; }
}
