:root {
  --bg: #10131a;
  --bg-grid: #151a22;
  --panel: #191d26;
  --panel-2: #1f2430;
  --border: #262c3a;
  --border-soft: #1e2330;
  --text: #e9ecf2;
  --muted: #8b93a5;
  --muted-2: #5c6478;
  --accent: #4bd8c9;
  --accent-dim: rgba(75, 216, 201, 0.14);
  --accent-line: rgba(75, 216, 201, 0.35);
  --warn: #f0a857;
  --warn-dim: rgba(240, 168, 87, 0.14);
  --danger: #ef5d6f;
  --danger-dim: rgba(239, 93, 111, 0.14);

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(75,216,201,0.07), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(240,168,87,0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(16, 19, 26, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: conic-gradient(from 220deg, var(--accent), #2a8f84 60%, var(--accent));
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px var(--border), 0 6px 16px -6px rgba(75,216,201,0.55);
}
.brand-mark svg { width: 15px; height: 15px; }

.nav-links {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.nav-links a {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active {
  color: #0d1410;
  background: var(--accent);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex: none; }
.nav-status.live .status-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); animation: pulse 1.8s ease-in-out infinite; }
.nav-status.live { color: var(--accent); border-color: var(--accent-line); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 2px var(--accent-dim);} 50% { box-shadow: 0 0 0 5px transparent; } }

.shell { width: 100%; max-width: none; margin: 0 auto; padding: 32px 24px 80px; }
.view { display: none; }
.view.active { display: block; animation: fade-up 0.35s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: translateY(0);} }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 16px; height: 1px; background: var(--accent); }

h1.page-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.page-sub { color: var(--muted); font-size: 15.5px; max-width: 620px; margin: 0 0 36px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(8, 10, 14, 0.22);
}
.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}
.panel-head .muted-tag { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.panel-body { padding: 20px; }

/* ---------------------------------------------------------------- onboarding (home, pre-pairing) */

.onboarding { padding-bottom: 8px; }

.steps-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 10px;
  align-items: stretch;
}
@media (max-width: 860px) { .steps-row { grid-template-columns: 1fr; } }

.step-card {
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.step-card-head { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
}
.step-card-head h2 { font-family: var(--font-display); font-size: 18px; margin: 0 0 4px; }
.step-card-head p { color: var(--muted); font-size: 13px; margin: 0; }

.download-block { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.step-fine { font-size: 11.5px; color: var(--muted-2); margin: 8px 0 0; }
.step-fine a { color: var(--accent); text-decoration: none; }
.step-fine a:hover { text-decoration: underline; }

.download-confirm {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
}
.download-confirm svg { flex: none; margin-top: 2px; }
.download-confirm strong { color: var(--text); }
.download-confirm .step-fine { color: var(--muted); }

.spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pairing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 2px 0 4px;
}
.pair-node {
  width: 68px; height: 68px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.pair-node svg { width: 26px; height: 26px; }
.pair-node.pulsing { animation: node-pulse 1.6s ease-in-out infinite; }
@keyframes node-pulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-dim);} 50% { box-shadow: 0 0 0 10px transparent;} }
.pair-node.linked { border-color: var(--accent-line); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }

.pair-link { width: 56px; height: 2px; position: relative; background: var(--border); border-radius: 2px; overflow: hidden; flex: none; }
.pair-link::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 16px);
  transform: translateX(-100%);
  opacity: 0.55;
}
.pair-link.connecting::after { animation: link-scan 0.9s linear infinite; opacity: 1; }
.pair-link.linked { background: var(--accent); }
.pair-link.linked::after { display: none; }
@keyframes link-scan { to { transform: translateX(0%); } }

.connect-form { display: flex; gap: 10px; width: 100%; }
.connect-form input {
  flex: 1;
  min-width: 0;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
}
.connect-form input::placeholder { color: var(--muted-2); }

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: #0a1512; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--muted-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

.gate-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; font-family: var(--font-mono); min-height: 16px; }
.gate-hint { margin-top: 4px; font-size: 12.5px; color: var(--muted-2); }
.gate-hint a { color: var(--accent); text-decoration: none; }
.gate-hint a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- walkthrough (post-download) */

.walkthrough { margin-top: 22px; }
.walkthrough-body { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
@media (max-width: 720px) { .walkthrough-body { grid-template-columns: 1fr; } }
.walkthrough-art svg { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
.walkthrough-steps { margin: 0; }

/* ---------------------------------------------------------------- app grid / tool */

.app-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
  min-height: calc(100vh - 230px);
}
.left-stack,
.right-stack { display: flex; flex-direction: column; gap: 16px; }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
}
@media (max-width: 980px) {
  .app-grid { grid-template-columns: 1fr; min-height: auto; }
  .left-stack { order: 2; }
  .right-stack { order: 3; }
}

.video-queue-panel { position: relative; }
.video-queue-panel .panel-head { align-items: center; }
.video-queue-panel .panel-body { padding: 14px; }
.queue-tabs .btn { padding: 8px 10px; }

/* preview expanded / theater modes */
body.preview-mode-active { overflow: hidden; }
.preview-panel.preview-expanded {
  position: fixed !important;
  inset: 24px !important;
  z-index: 80 !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(8,10,14,0.95), rgba(8,10,14,0.98));
  padding: 22px !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.preview-panel.preview-fullscreen {
  inset: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  padding: 0 !important;
}
.preview-panel.preview-expanded .preview-surface {
  height: 100%;
}
.preview-panel.preview-fullscreen .preview-surface {
  border-radius: 0;
  border: none;
}
.preview-panel.preview-fullscreen .preview-toolbar {
  top: 18px;
  right: 18px;
}

@media (max-width: 980px) {
  .app-grid { grid-template-columns: 1fr; }
  .video-queue-panel { order: 3; }
}

.dropzone {
  display: block;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(75,216,201,0.08), rgba(75,216,201,0.02));
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-dim); transform: translateY(-1px); }
.dropzone svg { width: 24px; height: 24px; color: var(--accent); margin-bottom: 8px; }
.dropzone .dz-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.dropzone .dz-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.pre-blur-chip { margin-top: 14px; }

.field-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

.opt-row { display: flex; gap: 16px; flex-wrap: wrap; }
.chip {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text);
  cursor: pointer; user-select: none;
}
.chip input { accent-color: var(--accent); width: 15px; height: 15px; }

/* censor-style swatches */
.swatch-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); gap: 10px; }
.swatch {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 74px;
  padding: 8px 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.swatch:hover { background: var(--panel-2); transform: translateY(-1px); }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.swatch.is-selected { border-color: var(--accent-line); background: var(--accent-dim); }
.swatch-label { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.25; }
.swatch.is-selected .swatch-label { color: var(--text); }
.swatch-preview {
  width: 38px; height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  position: relative;
  overflow: hidden;
}
.swatch-blur { background: linear-gradient(135deg, #6fb8ef, #f0a857 55%, #ef5d6f); filter: blur(3.5px); }
.swatch-soft-blur { background: linear-gradient(135deg, rgba(111,184,239,0.7), rgba(240,168,87,0.7)); backdrop-filter: blur(6px); }
.swatch-pixelate { background: repeating-conic-gradient(#4bd8c9 0% 25%, #2a8f84 0% 50%) 0 0 / 13px 13px; }
.swatch-frosted { background: linear-gradient(135deg, #6fb8ef, #f0a857); position: relative; }
.swatch-frosted::after { content: ""; position: absolute; inset: 0; background: rgba(233, 236, 242, 0.4); }
.swatch-smudge { background: linear-gradient(135deg, rgba(111,184,239,0.4), rgba(14,19,29,0.8)); position: relative; }
.swatch-smudge::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.16), transparent 70%); }
.swatch-cover { background: linear-gradient(135deg, rgba(15,18,25,0.95), rgba(75,216,201,0.2)); position: relative; }
.swatch-cover::after { content: ""; position: absolute; inset: 0; border: 2px solid rgba(255,255,255,0.18); border-radius: 6px; }
.swatch-box { background: #0a0a0a; }
.swatch-outline { background: linear-gradient(135deg, rgba(75,216,201,0.2), rgba(239,93,111,0.15)); }
.swatch-outline::before { content: ""; position: absolute; inset: 6px; border: 2px solid rgba(75,216,201,0.9); border-radius: 6px; }
.swatch-solid { background: #0a0a0a; }
.swatch-glitch { background: linear-gradient(135deg, #b37cec 0%, #2abe9d 45%, #f7e166 100%); }
.swatch-glitch::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(255,255,255,0.18) 2px 4px);
}
.swatch-rainbow { background: linear-gradient(135deg, #ff4d6d, #f7d03f, #4ad9ff, #7c6bff); }
.swatch-dots { background: radial-gradient(circle at 20% 20%, rgba(75,216,201,0.72) 9%, transparent 10%), radial-gradient(circle at 80% 20%, rgba(239,93,111,0.72) 9%, transparent 10%), radial-gradient(circle at 50% 70%, rgba(240,168,87,0.72) 9%, transparent 10%); background-color: #10131a; background-size: 40px 40px; }
.swatch-scanline { background: linear-gradient(180deg, rgba(75,216,201,0.17) 0%, rgba(75,216,201,0.06) 8%, rgba(75,216,201,0.17) 16%, rgba(75,216,201,0.06) 24%, rgba(75,216,201,0.12) 100%); }
.swatch-negative { background: linear-gradient(135deg, #121212, #f6f7fb); filter: invert(0.9); }
.swatch-emboss { background: linear-gradient(145deg, #2e2f35, #11151a); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.15); }

#solidColorWrap input[type="color"] {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 2px;
  cursor: pointer;
}

.status-line { font-size: 12px; min-height: 16px; margin-top: 10px; }
.status-line.ok { color: var(--accent); }
.status-line.error { color: var(--danger); }
.status-line.info { color: var(--muted); }

.preview-panel {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 18px;
  overflow: hidden;
}
.preview-toolbar { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 20; }
.preview-surface {
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top left, rgba(75,216,201,0.1), transparent 40%),
    linear-gradient(135deg, rgba(31,36,48,0.95), rgba(16,19,26,0.94));
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.preview-panel.drag .preview-surface {
  border-color: var(--accent-line);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.preview-empty {
  color: var(--muted-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13.5px;
  text-align: center;
  padding: 24px;
  max-width: 360px;
}
.preview-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--accent-dim);
  color: var(--accent);
}
.preview-empty-icon svg { width: 34px; height: 34px; }
.preview-empty-title { font-size: 16px; font-weight: 700; color: var(--text); }
.preview-empty-copy { font-size: 13px; line-height: 1.55; color: var(--muted); }
.preview-browse-btn { margin-top: 6px; }
.preview-canvas-wrap, .preview-video-wrap {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 10px;
}
.preview-video-wrap { flex-direction: column; gap: 10px; align-items: stretch; }
.preview-video-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
}
.preview-video-wrap video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  background: #000;
}
canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #06070b;
}

.log-row {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  margin-bottom: 10px;
  font-size: 12.5px;
}
.log-row .lr-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.log-row .lr-class { font-weight: 600; color: var(--accent); text-transform: capitalize; }
.log-row .lr-score { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.log-coords {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
}
.log-coords .coord-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.025);
}
.log-coords .coord-pill span:last-child { color: var(--text); }
.tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.tag.censored { background: var(--danger-dim); color: var(--danger); }
.tag.ignored { background: var(--panel); color: var(--muted); border: 1px solid var(--border); }

.queue-card {
  background: linear-gradient(135deg, rgba(31,36,48,0.95), rgba(16,19,26,0.86));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.queue-card.done { border-color: var(--accent-line); box-shadow: inset 0 0 0 1px var(--accent-line); }
.queue-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-bar { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #7cebd8); transition: width 0.2s ease; }

.docs-grid { display: grid; grid-template-columns: 220px 1fr; gap: 34px; }
@media (max-width: 900px) { .docs-grid { grid-template-columns: 1fr; } }
.docs-nav { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 4px; align-self: start; }
.docs-nav a { text-decoration: none; font-size: 13px; color: var(--muted); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.docs-nav a:hover { color: var(--text); background: var(--panel-2); }
.docs-nav a.active { color: var(--accent); background: var(--accent-dim); }

.doc-section { margin-bottom: 46px; }
.doc-section h3 { font-family: var(--font-display); font-size: 19px; margin: 0 0 12px; }
.doc-section p { color: var(--muted); font-size: 14px; max-width: 700px; }
.doc-section ul { color: var(--muted); font-size: 14px; max-width: 700px; padding-left: 20px; }
.doc-section ul li { margin-bottom: 8px; }
.doc-section ul strong { color: var(--text); }
pre.code-block {
  background: #0d1017;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #cdd6e3;
  line-height: 1.6;
}
.code-block .c-accent { color: var(--accent); }
.code-block .c-muted { color: var(--muted-2); }

.step-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step-list li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--muted);
}
.step-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  display: grid; place-items: center;
  font-weight: 700;
}
.step-list strong { color: var(--text); }

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--panel-2);
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted);
}
.callout.warn { border-left-color: var(--warn); }
.callout strong { color: var(--text); }

@media (max-width: 720px) {
  .navbar {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 10px;
  }
  .brand { font-size: 15.5px; }
  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
  }
  .nav-links a { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
  .nav-status { font-size: 10.5px; padding: 6px 10px; margin-left: auto; }

  .shell { padding: 24px 16px 70px; }
  .page-sub { margin-bottom: 26px; }

  .step-card { padding: 20px 18px; }
  .pairing { gap: 12px; }
  .pair-node { width: 56px; height: 56px; border-radius: 14px; }
  .pair-node svg { width: 22px; height: 22px; }
  .pair-link { width: 32px; }

  .connect-form { flex-direction: column; }
  .connect-form input { width: 100%; }
  .connect-form .btn { width: 100%; }

  .app-grid { gap: 16px; }
  .preview-panel { min-height: 320px; padding: 14px; }
  canvas { max-height: 60vh; }

  #videoQueueList { grid-template-columns: 1fr !important; }

  .docs-grid { gap: 22px; }
  .docs-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 6px;
  }
  .docs-nav a { padding: 7px 10px; }

  .opt-row { gap: 12px; }
  .log-coords { grid-template-columns: 1fr 1fr; }
  .swatch { width: 64px; }
  .preview-toolbar { top: 10px; right: 10px; gap: 6px; }

  .btn { padding: 12px 16px; font-size: 13px; }
}

@media (max-width: 380px) {
  .nav-status span:not(.status-dot) { display: none; }
  .nav-status { padding: 7px; border-radius: 50%; }
}

/* ------------------------------------------------------------------ */
/* Custom modal (replaces window.prompt / window.alert)                */
/* ------------------------------------------------------------------ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 10, 14, 0.62);
  backdrop-filter: blur(6px);
  animation: modalFade 0.16s ease-out;
}

@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: modalPop 0.18s cubic-bezier(.2,.9,.3,1.2);
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
  margin-bottom: 14px;
}

.modal-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 6px;
}

.modal-sub {
  margin: 0 0 4px;
  font-size: 13.5px;
  color: var(--text);
  word-break: break-word;
}

.modal-hint {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.modal-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.modal-field input[type="number"] {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 20px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 8px;
  -moz-appearance: textfield;
}
.modal-field input[type="number"]::-webkit-outer-spin-button,
.modal-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-btn {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.stepper-btn:hover { border-color: var(--accent-line); color: var(--accent); }

.modal-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.preset-chip {
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  font-size: 11.5px;
  font-family: var(--font-body);
  text-align: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.preset-chip:hover { color: var(--text); border-color: var(--muted-2); }
.preset-chip.active {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions .btn { flex: 1; }

@media (max-width: 480px) {
  .modal-card { padding: 22px 18px 18px; }
  .modal-presets { gap: 5px; }
  .preset-chip { font-size: 10.5px; padding: 8px 4px; }
}
