/* =========================================================
   MiniDisc Lab — Hi-Fi '90s studio dark theme
   ========================================================= */
:root {
  --bg: #0b0c0e;
  --bg-2: #111215;
  --panel: #16181c;
  --panel-2: #1c1f24;
  --line: #2a2e35;
  --line-2: #363b44;
  --text: #e6e2d9;
  --muted: #8d8a83;
  --amber: #ffad3b;
  --amber-2: #ff8a1f;
  --amber-glow: rgba(255, 160, 50, .45);
  --cyan: #3ee6d4;
  --cyan-dim: rgba(62, 230, 212, .15);
  --red: #ff4545;
  --lcd-bg: #1a1305;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .04);
  --font-ui: 'Rajdhani', system-ui, sans-serif;
  --font-lcd: 'VT323', ui-monospace, monospace;
  --font-logo: 'Orbitron', var(--font-ui);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 140, 30, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(62, 230, 212, .05), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }

.eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--amber);
  opacity: .85;
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45em;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #262a31, #1a1d22);
  padding: .55em 1.05em;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 2px 0 #08090a;
  transition: transform .12s, border-color .2s, box-shadow .2s, background .2s;
  white-space: nowrap;
}
.btn:hover { border-color: #4a505b; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0,0,0,.5); }
.btn.primary {
  border-color: rgba(255, 173, 59, .55);
  background: linear-gradient(180deg, #3a2a12, #23190b);
  color: #ffd79c;
  box-shadow: inset 0 1px 0 rgba(255,210,150,.15), 0 2px 0 #08090a, 0 0 0 0 var(--amber-glow);
}
.btn.primary:hover { box-shadow: inset 0 1px 0 rgba(255,210,150,.2), 0 2px 0 #08090a, 0 0 22px -4px var(--amber-glow); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.danger { border-color: rgba(255, 69, 69, .4); color: #ff9b9b; }
.btn.danger:hover { border-color: var(--red); color: #fff; background: rgba(255, 69, 69, .18); box-shadow: 0 0 14px rgba(255, 69, 69, .35); }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--line);
  background: transparent; cursor: pointer; color: var(--muted);
  transition: .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,.04); }
.icon-btn.danger { color: #ff8585; border-color: rgba(255,69,69,.3); }
.icon-btn.danger:hover { color: #fff; border-color: rgba(255,69,69,.8); background: rgba(255,69,69,.22); box-shadow: 0 0 10px rgba(255,69,69,.45); }

/* ---------- Deck header ---------- */
.deck {
  position: sticky; top: 0; z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 10px 24px;
  background: rgba(18, 20, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.deck-screws { display: none; }

.brand { display: flex; align-items: center; gap: 14px; }
.brand h1 {
  font-family: var(--font-logo);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .02em;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff, #b9b4aa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand h1 span {
  margin-left: 3px;
  font-weight: 500;
  background: linear-gradient(180deg, #ffd08a, var(--amber-2));
  -webkit-background-clip: text; background-clip: text;
}
.tagline { margin: 2px 0 0; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.disc-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #0b0c0e 0 4px, #c9ccd2 4.5px 7px, transparent 7.5px),
    conic-gradient(from 0deg, #ff7eb3, #ffd36e, #7cf3e1, #8e8cff, #ff7eb3);
  box-shadow: 0 0 0 2px #0b0c0e, 0 0 0 3px #3a3e45, 0 0 20px -2px rgba(255,170,60,.5);
  position: relative;
  animation: spin 6s linear infinite;
  flex: none;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}
.disc-logo:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px #0b0c0e, 0 0 0 3px var(--amber), 0 0 28px rgba(255,170,60,.75);
}
.disc-logo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(0,0,0,.12) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* LCD */
.lcd {
  justify-self: center;
  display: flex; align-items: stretch; gap: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.2) 0 1px, transparent 1px 3px),
    radial-gradient(120% 140% at 50% 0%, #1e1507, rgba(10, 12, 16, 0.7));
  border: 1px solid rgba(255, 173, 59, 0.2);
  border-radius: 7px;
  padding: 3px 8px;
  box-shadow: inset 0 0 10px rgba(0,0,0,.8);
  max-width: 100%;
}
.lcd-cell { padding: 1px 8px; border-right: 1px dashed rgba(255,173,59,.15); min-width: 56px; }
.lcd-cell label { display: block; font-family: var(--font-lcd); font-size: 10px; letter-spacing: .12em; color: rgba(255,173,59,.5); }
.lcd-cell b {
  font-family: var(--font-lcd); font-weight: 400; font-size: 22px; line-height: .92;
  color: var(--amber); text-shadow: 0 0 7px var(--amber-glow), 0 0 1px #ffd9a0;
}
.vu { display: flex; align-items: flex-end; gap: 2px; padding: 2px 2px 2px 8px; height: 32px; }
.vu i {
  width: 3.5px; border-radius: 1px; background: rgba(255,173,59,.12);
  height: calc(10% + var(--i) * 6.5%);
  transition: background .25s, box-shadow .25s;
}
.vu i.on { background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); }
.vu i.on.hot { background: var(--red); box-shadow: 0 0 6px rgba(255,69,69,.6); }
.vu i.on.cool { background: var(--cyan); box-shadow: 0 0 6px rgba(62,230,212,.5); }

/* Download button modernizzato */
.btn-download {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 16px 7px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 173, 59, 0.35);
  background: linear-gradient(180deg, #2a2015, #16110b);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}
.btn-download:hover:not(:disabled) {
  border-color: var(--amber);
  background: linear-gradient(180deg, #3a2b1a, #20170d);
  box-shadow: 0 4px 18px rgba(255, 173, 59, 0.25), 0 0 0 1px var(--amber);
  transform: translateY(-1px);
}
.btn-download:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.6);
}
.btn-download:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  filter: grayscale(1);
}
.dl-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 173, 59, 0.15);
  border: 1px solid rgba(255, 173, 59, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  flex-shrink: 0;
  transition: all 0.2s;
}
.dl-icon svg {
  width: 17px;
  height: 17px;
}
.btn-download:hover:not(:disabled) .dl-icon {
  background: var(--amber);
  color: #121316;
  box-shadow: 0 0 10px var(--amber-glow);
}
.dl-content {
  display: flex;
  flex-direction: column;
}
.dl-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .02em;
  color: #fff;
  line-height: 1.2;
}
.dl-info {
  font-family: var(--font-lcd);
  font-size: 12.5px;
  color: var(--amber-soft);
  letter-spacing: .06em;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 540px);
  gap: 28px;
  padding: 28px;
  max-width: 1680px;
  margin: 0 auto;
  align-items: start;
}
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head.compact { margin: 22px 0 14px; }
.section-head h2 { font-family: var(--font-logo); font-size: 20px; font-weight: 700; letter-spacing: .03em; margin-top: 4px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-lcd); font-size: 17px; letter-spacing: .06em;
  padding: 2px 10px; border-radius: 6px;
  color: var(--cyan); background: var(--cyan-dim); border: 1px solid rgba(62,230,212,.25);
}

/* ---------- Album cards ---------- */
.albums { display: grid; gap: 20px; }
.album {
  position: relative;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 1px, transparent 1px 2px),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
  animation: slideIn .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } }
.album::before {
  content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--amber), var(--amber-2));
  box-shadow: 0 0 12px var(--amber-glow);
}
.album-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.album-index {
  font-family: var(--font-lcd); font-size: 22px; color: var(--amber);
  background: var(--lcd-bg); border: 1px solid #000; border-radius: 7px;
  padding: 0 8px; box-shadow: inset 0 0 8px #000; text-shadow: 0 0 6px var(--amber-glow);
}
.album-name {
  flex: 1; min-width: 160px;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  font-family: var(--font-logo); font-weight: 700; font-size: 18px; letter-spacing: .03em;
  padding: 6px 10px; transition: .2s;
}
.album-name:hover { border-color: var(--line); }
.album-name:focus { outline: none; border-color: rgba(255,173,59,.5); background: rgba(0,0,0,.25); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted);
}
.badge.link { color: var(--cyan); border-color: rgba(62,230,212,.35); background: var(--cyan-dim); }
.stepper {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
  background: rgba(0,0,0,.25);
}
.stepper button { width: 30px; height: 32px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 18px; }
.stepper button:hover { color: var(--amber); background: rgba(255,173,59,.07); }
.stepper output { font-family: var(--font-lcd); font-size: 21px; color: var(--amber); min-width: 46px; text-align: center; }
.stepper small { font-size: 11px; color: var(--muted); letter-spacing: .1em; padding-left: 8px; text-transform: uppercase; }

.slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1440px) and (min-width: 901px) {
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.slot-label { display: flex; align-items: baseline; gap: 6px; font-weight: 700; font-size: 14px; letter-spacing: .03em; }
.slot-num {
  font-family: var(--font-lcd); font-size: 16px; color: #111; background: var(--amber);
  border-radius: 4px; padding: 0 5px; line-height: 1.2;
}
.slot-label em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.drop {
  position: relative;
  border-radius: 10px;
  border: 1.5px dashed var(--line-2);
  background:
    radial-gradient(circle at 50% 40%, rgba(255,173,59,.05), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.015) 0 6px, transparent 6px 12px),
    #0f1013;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.drop.square { aspect-ratio: 1 / 1; }
.drop.back { aspect-ratio: 56 / 37; }
.drop.cd { aspect-ratio: 1 / 1; border-radius: 50%; }
.drop:hover { border-color: rgba(255,173,59,.6); box-shadow: 0 0 0 4px rgba(255,173,59,.06); }
.drop.dragover { border-color: var(--cyan); border-style: solid; box-shadow: 0 0 0 4px var(--cyan-dim), 0 0 30px -6px rgba(62,230,212,.6); transform: scale(1.02); }
.drop.filled { border-style: solid; border-color: var(--line); }
.drop canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.drop-empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px;
  color: var(--muted); font-size: 12px; text-align: center; padding: 8px;
  pointer-events: none;
}
.drop-empty svg { width: 26px; height: 26px; opacity: .7; }
.drop.filled .drop-empty { display: none; }
.drop .edit-hint {
  position: absolute; inset: auto 0 0 0; padding: 18px 6px 6px; text-align: center;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #ffd79c;
  opacity: 0; transition: .2s; pointer-events: none;
}
.drop.cd .edit-hint { inset: 0; display: grid; place-items: center; padding: 0; background: rgba(0,0,0,.45); }
.drop.filled:hover .edit-hint { opacity: 1; }
.cd-hole {
  position: absolute; left: 50%; top: 50%; width: 15%; height: 15%;
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 1.5px dashed var(--line-2); pointer-events: none;
}
.drop.filled .cd-hole { display: none; }
.slot-foot { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.dpi {
  font-family: var(--font-lcd); font-size: 15px; letter-spacing: .05em;
  padding: 0 6px; border-radius: 5px; color: var(--cyan); background: var(--cyan-dim);
}
.dpi.warn { color: #ffcf6b; background: rgba(255,173,59,.12); }
.dpi.bad { color: #ff8f8f; background: rgba(255,69,69,.12); }
.slot-foot .icon-btn { width: 28px; height: 28px; margin-left: auto; font-size: 13px; }
.slot-foot .icon-btn + .icon-btn { margin-left: 0; }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 30px;
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  background: radial-gradient(circle at 50% 0%, rgba(255,173,59,.06), transparent 60%), var(--bg-2);
}
.empty-state[hidden] { display: none; }
.empty-state h3 { font-family: var(--font-logo); font-size: 20px; margin: 22px 0 8px; }
.empty-state p { max-width: 520px; margin: 0 auto 22px; color: var(--muted); line-height: 1.5; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.empty-disc {
  width: 120px; height: 120px; margin: 0 auto; border-radius: 50%;
  background:
    radial-gradient(circle, var(--bg-2) 0 9px, #555 9.5px 13px, transparent 13.5px),
    repeating-radial-gradient(circle, rgba(255,255,255,.04) 0 1px, transparent 1px 3px),
    conic-gradient(from 30deg, #2a2d33, #4a4d55, #23262b, #5a5d66, #2a2d33);
  box-shadow: 0 0 0 1px #000, 0 20px 40px -10px rgba(0,0,0,.8);
  animation: spin 9s linear infinite;
}

/* ---------- Monitor ---------- */
.monitor { position: sticky; top: 104px; max-height: calc(100vh - 124px); overflow: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #3a3e45 transparent; }
.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.settings summary {
  list-style: none; cursor: pointer; padding: 14px 18px;
  display: grid; grid-template-columns: 1fr auto; align-items: center; row-gap: 2px;
}
.settings summary::-webkit-details-marker { display: none; }
.settings-title { grid-column: 1; font-weight: 700; font-size: 16px; }
.chev { grid-row: 1 / span 2; grid-column: 2; color: var(--muted); transition: transform .25s; }
.settings[open] .chev { transform: rotate(180deg); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding: 4px 18px 18px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.field.span2 { grid-column: span 2; }
.field select, .num {
  background: #0d0e10; border: 1px solid var(--line); border-radius: 8px; color: var(--text);
  height: 36px; padding: 0 10px; font-weight: 600; font-size: 15px;
}
.field select:focus, .num:focus-within { outline: none; border-color: rgba(255,173,59,.5); }
.num { display: flex; align-items: center; }
.num input { width: 100%; background: transparent; border: 0; outline: none; font-family: var(--font-lcd); font-size: 22px; color: var(--amber); }
.num em { font-style: normal; color: var(--muted); font-size: 13px; }
.toggle { grid-column: span 2; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; }
.toggle small { color: var(--muted); font-weight: 500; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  flex: none; width: 38px; height: 20px; border-radius: 999px; background: #0d0e10; border: 1px solid var(--line-2);
  position: relative; transition: .2s;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #5a5e66; transition: .2s;
}
.toggle input:checked + .switch { border-color: rgba(255,173,59,.6); background: #2a1d07; }
.toggle input:checked + .switch::after { left: 20px; background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--cyan); outline-offset: 2px; }

.pages { display: grid; gap: 22px; padding-bottom: 20px; }
.page-fig { margin: 0; }
.page-fig figcaption {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
  font-family: var(--font-lcd); font-size: 18px; letter-spacing: .08em; color: var(--amber);
}
.page-fig figcaption span:last-child { color: var(--muted); font-size: 16px; }
.page-canvas { display: block; width: 100%; border-radius: 10px; cursor: crosshair; }
.page-canvas.hovering { cursor: pointer; }
.warn-box {
  border: 1px solid rgba(255,69,69,.4); background: rgba(255,69,69,.08); color: #ffb3b3;
  padding: 10px 14px; border-radius: 10px; font-size: 14px;
}

/* ---------- Editor ---------- */
.editor {
  padding: 0; border: 1px solid var(--line-2); border-radius: 18px;
  background: linear-gradient(180deg, #1e2126, #141619);
  color: var(--text);
  width: min(720px, 94vw);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.9), 0 0 0 1px #000;
}
.editor::backdrop { background: rgba(5, 5, 7, .72); backdrop-filter: blur(6px); }
.editor[open] { animation: pop .25s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(8px); } }
.editor-inner { display: flex; flex-direction: column; }
.ed-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 14px; }
.ed-head h3 { font-family: var(--font-logo); font-size: 20px; margin-top: 3px; }
.lcd-chip {
  font-family: var(--font-lcd); font-size: 22px; color: var(--amber); background: var(--lcd-bg);
  border: 1px solid #000; border-radius: 8px; padding: 2px 12px; box-shadow: inset 0 0 10px #000;
  text-shadow: 0 0 6px var(--amber-glow);
}
.lcd-chip.warn { color: #ffcf6b; }
.lcd-chip.bad { color: #ff7a7a; text-shadow: 0 0 6px rgba(255,69,69,.6); }
.ed-stage { position: relative; height: min(440px, 56vh); margin: 0 22px; border-radius: 12px; overflow: hidden; background: #0a0b0d; border: 1px solid #000; touch-action: none; cursor: grab; }
.ed-stage.dragging { cursor: grabbing; }
.ed-stage canvas { width: 100%; height: 100%; display: block; }
.ed-hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  font-size: 12px; letter-spacing: .08em; color: rgba(255,255,255,.55); background: rgba(0,0,0,.55);
  padding: 4px 10px; border-radius: 999px; pointer-events: none; white-space: nowrap;
}
.ed-controls { display: flex; flex-direction: column; gap: 14px; padding: 16px 22px 6px; }
.fit-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.06); flex-wrap: wrap;
}
.ed-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.seg-ctrl {
  display: inline-flex; border-radius: 9px; border: 1px solid var(--line);
  background: #0c0d10; padding: 3px; gap: 3px; flex-wrap: wrap;
}
.seg-btn {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 7px;
  cursor: pointer; transition: .15s; display: inline-flex; align-items: center; gap: 6px;
}
.seg-btn:hover { color: var(--text); background: rgba(255,255,255,.07); }
.seg-btn.active {
  background: var(--amber);
  color: #0b0c0e;
  border-color: #ffd074;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(255, 173, 59, .75);
}
.dim-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.06); flex-wrap: wrap;
}
.dim-ctrls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dim-group {
  display: inline-flex; align-items: center; gap: 8px; background: #0c0d10;
  padding: 4px 10px; border-radius: 9px; border: 1px solid var(--line);
}
.dim-sublabel { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.dim-val { font-family: var(--font-lcd); font-size: 20px; color: var(--amber); min-width: 58px; text-align: center; }
.dim-reset { color: var(--amber); border-color: rgba(255,173,59,.4); }
.dim-reset:hover { background: rgba(255,173,59,.15); }
.custom-size-em { color: var(--amber) !important; font-weight: 700 !important; }
.ed-controls-bottom { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; width: 100%; }
.zoom-row { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 260px; font-weight: 600; color: var(--muted); }
.zoom-row output { font-family: var(--font-lcd); font-size: 20px; color: var(--amber); min-width: 52px; text-align: center; }
.btn-sm { padding: 4px 10px; font-size: 14px; min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.ed-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }

input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--amber) var(--p, 0%), #2a2e35 var(--p, 0%)); outline: none; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3efe7, #9b968c 70%); border: 2px solid #111;
  box-shadow: 0 2px 6px rgba(0,0,0,.6); cursor: pointer;
}
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #d8d3c9; border: 2px solid #111; cursor: pointer; }

/* ---------- PDF Ready Modal ---------- */
.pdf-modal {
  border: 1px solid var(--line-2); border-radius: 18px; padding: 0; background: transparent;
  box-shadow: 0 20px 60px rgba(0,0,0,.85), 0 0 30px rgba(255,173,59,.2); max-width: 520px; width: 92vw;
}
.pdf-modal::backdrop { background: rgba(5,6,8,.85); backdrop-filter: blur(10px); }
.pdf-modal-card { background: linear-gradient(180deg, #1c1f24, #121417); padding: 24px 28px 28px; border-radius: 18px; color: var(--text); }
.pdf-modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pdf-icon { font-size: 32px; filter: drop-shadow(0 0 10px rgba(255,173,59,.4)); }
.pdf-modal-head h3 { font-family: var(--font-logo); font-size: 19px; color: #fff; margin: 0; }
.pdf-meta { font-family: var(--font-lcd); font-size: 18px; color: var(--amber); margin-top: 4px; }
.btn-close { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 4px; transition: .15s; }
.btn-close:hover { color: #fff; transform: scale(1.1); }
.pdf-advice {
  background: rgba(255, 173, 59, .08); border: 1px solid rgba(255, 173, 59, .25);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 22px; font-size: 13.5px; line-height: 1.5; color: #eeddc4;
}
.pdf-advice strong { color: var(--amber); display: block; margin-bottom: 4px; font-size: 12.5px; letter-spacing: .05em; }
.pdf-advice b { color: #fff; }
.pdf-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-lg { font-size: 15px; padding: 12px 18px; text-decoration: none; text-align: center; border-radius: 9px; font-weight: 700; }

/* ---------- Overlay / toasts ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(5,5,7,.78); backdrop-filter: blur(8px); }
.overlay[hidden] { display: none; }
.overlay-card {
  width: min(380px, 90vw); text-align: center; padding: 30px; border-radius: 18px;
  background: linear-gradient(180deg, #1e2126, #141619); border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.overlay-card h3 { font-family: var(--font-logo); font-size: 18px; margin-top: 18px; }
.overlay-card p { color: var(--muted); font-family: var(--font-lcd); font-size: 19px; margin: 8px 0 16px; }
.spin-disc {
  width: 84px; height: 84px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle, #141619 0 7px, #bbb 7.5px 10px, transparent 10.5px), conic-gradient(#ff7eb3, #ffd36e, #7cf3e1, #8e8cff, #ff7eb3);
  animation: spin 1.1s linear infinite; box-shadow: 0 0 30px -4px rgba(255,170,60,.5);
}
.progress { height: 8px; border-radius: 99px; background: #0d0e10; border: 1px solid #000; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--amber-2), var(--amber)); box-shadow: 0 0 10px var(--amber-glow); transition: width .2s; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: grid; gap: 10px; }
.toast {
  padding: 12px 16px; border-radius: 12px; min-width: 240px; max-width: 380px;
  background: #1c1f24; border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-weight: 600; animation: toastIn .3s cubic-bezier(.2,.9,.3,1.2);
  border-left: 3px solid var(--amber);
}
.toast.error { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--cyan); }
.toast.out { opacity: 0; transform: translateX(20px); transition: .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.site-footer { text-align: center; color: #5d5b56; font-size: 13px; padding: 10px 20px 30px; letter-spacing: .04em; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .monitor { position: static; max-height: none; overflow: visible; }
  .pages { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}
@media (max-width: 900px) {
  .deck { grid-template-columns: 1fr auto; gap: 14px; padding: 14px 18px; position: static; }
  .lcd { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; overflow-x: auto; }
  .slots { grid-template-columns: 1fr 1fr; }
  .layout { padding: 18px; }
}
@media (max-width: 520px) {
  .rec-text small { display: none; }
  .brand h1 { font-size: 20px; }
  .vu { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .field.span2, .toggle { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
