/* ==========================================================
   Music Bingo — Shared Styles
   Aesthetic: midnight pub, neon arcade, cassette/vinyl energy
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* Surfaces */
  --bg-deep: #07090f;
  --bg: #0c1020;
  --bg-elev: #141a30;
  --bg-elev-2: #1c2340;
  --border: #2a3358;
  --border-strong: #3d4878;

  /* Text */
  --text: #f3f4ff;
  --text-muted: #9aa1c4;
  --text-dim: #6770a0;

  /* Accents */
  --magenta: #ff2e88;
  --magenta-glow: #ff2e8844;
  --cyan: #00f0ff;
  --cyan-glow: #00f0ff44;
  --gold: #ffd166;
  --green: #7eff97;
  --red: #ff5b6a;

  /* Effects */
  --shadow-lift: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-deep: 0 14px 48px rgba(0, 0, 0, 0.6);
  --radius: 10px;
  --radius-lg: 16px;

  /* Fonts */
  --font-display: 'Bungee', system-ui, sans-serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(255, 46, 136, 0.12), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(0, 240, 255, 0.10), transparent 60%),
    var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* Subtle grain overlay */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 2px,
      rgba(255, 255, 255, 0.012) 2px,
      rgba(255, 255, 255, 0.012) 3px
    );
}

/* ---------- Layout ---------- */

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--magenta), #b5168f 60%, #6e0e60);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  color: white;
  font-size: 18px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 8px 24px var(--magenta-glow);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1px;
  line-height: 1;
  margin: 0;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.18s;
}

.nav a:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg-elev);
}

.nav a.active {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 16px var(--cyan-glow);
}

/* ---------- Cards / Panels ---------- */

.card {
  background: linear-gradient(180deg, var(--bg-elev), var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lift);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--magenta), var(--cyan), transparent);
  opacity: 0.6;
}

.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 1px;
  margin: 0 0 6px;
}

.card-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 12px;
}

/* ---------- Form controls ---------- */

label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 14px;
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

textarea {
  resize: vertical;
  min-height: 70px;
  font-family: var(--font-body);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa1c4' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

input[type="file"] {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

input[type="file"]::file-selector-button {
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  margin-right: 12px;
  transition: all 0.15s;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.field {
  margin-bottom: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.help {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* ---------- Buttons ---------- */

button, .button {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.5px;
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 12px 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

button:hover, .button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 18px var(--cyan-glow);
  transform: translateY(-1px);
}

button:active, .button:active { transform: translateY(0); }

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

button.primary, .button.primary {
  background: linear-gradient(135deg, var(--magenta), #cc1e6f);
  border-color: var(--magenta);
  color: white;
  box-shadow: 0 6px 22px var(--magenta-glow);
}

button.primary:hover, .button.primary:hover {
  filter: brightness(1.12);
  color: white;
  box-shadow: 0 8px 28px var(--magenta-glow);
}

button.ghost, .button.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

button.danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}

button.danger:hover {
  background: rgba(255, 91, 106, 0.1);
  color: var(--red);
  box-shadow: 0 0 18px rgba(255, 91, 106, 0.3);
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ---------- Range slider ---------- */

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--magenta);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--magenta-glow);
  cursor: pointer;
  border: 2px solid var(--bg-deep);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--magenta);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--magenta-glow);
  cursor: pointer;
  border: 2px solid var(--bg-deep);
}

/* ---------- Rounds list ---------- */

.round-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  position: relative;
}

.round-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.round-number {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
}

.round-controls {
  display: flex;
  gap: 6px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-mono);
}

.icon-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: none;
  transform: none;
}

.icon-btn.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ---------- Host pills ---------- */

.host-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.host-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.host-row.active {
  border-color: var(--magenta);
  box-shadow: 0 0 0 1px var(--magenta) inset, 0 0 24px var(--magenta-glow);
}

.host-thumb {
  width: 48px;
  height: 32px;
  border-radius: 4px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.host-name {
  flex: 1;
  font-weight: 500;
}

/* ---------- Toast / status ---------- */

.toast-wrap {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow-deep);
  animation: toast-in 0.25s ease-out;
  max-width: 340px;
  pointer-events: auto;
}

.toast.error {
  border-color: var(--red);
  box-shadow: 0 0 22px rgba(255, 91, 106, 0.35);
}

.toast.success {
  border-color: var(--green);
}

@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ---------- Misc ---------- */

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-right-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.empty {
  text-align: center;
  padding: 32px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1px;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.35);
  color: var(--gold);
}

/* ---------- Image-model toggle ---------- */

/* Segmented pill shared by the Library header and the round editor's header. The
   highlighted model is what every generate/regenerate uses. */
.model-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.model-toggle button {
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.model-toggle button:hover {
  color: var(--text);
}

.model-toggle button.on {
  background: var(--magenta);
  color: #fff;
  box-shadow: 0 0 14px var(--magenta-glow);
}

/* Inside an editor header pill the toggle drops its own shell to sit flush. */
.reditor .opt .model-toggle {
  border: none;
  background: transparent;
  padding: 0;
}

/* ---------- TV cycle-order reorder ---------- */

.order-tile {
  position: relative;
  width: 76px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  cursor: grab;
  user-select: none;
  overflow: hidden;
}

.order-tile:active {
  cursor: grabbing;
}

.order-tile.drag-over {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 0 12px var(--cyan-glow);
}

.order-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  display: block;
  background: rgba(255, 255, 255, 0.03);
}

.order-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.order-pos {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  background: rgba(7, 9, 15, 0.82);
  border: 1px solid var(--border);
  color: var(--text);
}

.order-arrows {
  display: flex;
}

.order-arrow {
  flex: 1;
  padding: 3px 0;
  font-size: 14px;
  line-height: 1;
  background: rgba(7, 9, 15, 0.6);
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.order-arrow + .order-arrow {
  border-left: 1px solid var(--border);
}

.order-arrow:hover:not(:disabled) {
  background: var(--magenta);
  color: #fff;
}

.order-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 15, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 100;
  animation: fade-in 0.18s ease-out;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Lightbox gallery controls — overlaid on the dimmed backdrop, anchored to the
   viewport edges so they clear the image at any aspect ratio. */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
  border-radius: 50%;
  background: rgba(7, 9, 15, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }

.lightbox-nav:hover {
  background: var(--magenta);
  border-color: var(--magenta);
  color: #fff;
  box-shadow: 0 0 18px var(--magenta-glow);
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--text);
  background: rgba(7, 9, 15, 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-deep);
  position: relative;
}

.modal h2 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: 1px;
}

.modal p {
  color: var(--text-muted);
  margin: 0 0 20px;
  font-size: 14px;
}

/* ==========================================================
   App chrome — rail shell shared by Dashboard / Settings / Library
   ========================================================== */
.app-surface { display: grid; grid-template-columns: 84px 1fr; height: 100vh; width: 100%; }

.app-rail { background: var(--bg-deep); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; }
.app-rail .brand-mark { margin: 0 auto 12px; }

.rail-i { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; border-radius: 10px; color: var(--text-dim); border: 1px solid transparent; background: none; cursor: pointer; text-decoration: none; transition: all .15s; font: inherit; }
.rail-i span { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1px; }
.rail-i:hover { color: var(--cyan); border-color: var(--border); background: var(--bg-elev); transform: none; box-shadow: none; }
.rail-i.active { color: var(--cyan); border-color: var(--cyan); background: var(--bg-elev); box-shadow: 0 0 14px var(--cyan-glow); }

/* Inline SVG icon base (used by the rail on every page) */
.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }

/* Page scaffold for the simple (non-dashboard) screens */
.page-main { padding: 22px 26px; min-width: 0; overflow-y: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; margin: 0; }
.page-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; color: var(--text-dim); margin-top: 6px; }

/* ==========================================================
   Full-screen round editor (per-image prompts) — the .reditor
   overlay. All rules are scoped under .reditor so its bare
   element styling (header/h1/textarea/select/button) can't leak
   onto the rest of the app. Fonts are already loaded globally.
   ========================================================== */
.reditor {
  /* Editor-local palette (kept off :root so it never clobbers app tokens). */
  --navy: #000c30; --azure: #00a8dc; --purple: #a830cc; --gold: #fccc18; --cream: #fcf0d8;
  --panel: #0a1030; --panel-2: #0c1440;
  --line: rgba(0, 240, 255, 0.14); --line-soft: rgba(255, 255, 255, 0.08);
  --ink: #e7ecff; --ink-dim: #8a93c4;

  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; overflow: hidden;
  color: var(--ink); font-family: 'Outfit', system-ui, sans-serif;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(168, 48, 204, 0.18), transparent 60%),
    radial-gradient(900px 600px at -5% 110%, rgba(0, 168, 220, 0.16), transparent 55%),
    #04061a;
}
.reditor .eyebrow { font-family: 'JetBrains Mono', monospace; letter-spacing: 0.16em; font-size: 11px; text-transform: uppercase; color: var(--ink-dim); }

/* header + title bar */
.reditor header { flex: 0 0 auto; border-bottom: 1px solid var(--line-soft); background: linear-gradient(180deg, rgba(10, 16, 48, 0.92), rgba(10, 16, 48, 0.5)); backdrop-filter: blur(6px); }
.reditor .titlebar { display: flex; align-items: center; gap: 18px; padding: 14px 22px 12px; }
.reditor .back { display: flex; align-items: center; gap: 7px; color: var(--ink-dim); text-decoration: none; font-size: 13px; font-weight: 600; font-family: 'Outfit', sans-serif; letter-spacing: 0; text-transform: none; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; cursor: pointer; background: transparent; }
.reditor .back:hover { color: var(--cyan); border-color: var(--line); transform: none; box-shadow: none; }
.reditor .mb { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--magenta), var(--purple)); font-family: 'Bungee'; font-size: 13px; color: #fff; box-shadow: 0 0 18px rgba(255, 46, 136, 0.35); }
.reditor h1 { font-family: 'Bungee'; font-size: 20px; margin: 0; letter-spacing: 0.02em; line-height: 1; }
.reditor .title-wrap { display: flex; flex-direction: column; gap: 3px; }
.reditor .title-sub { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-dim); letter-spacing: 0.08em; }
.reditor .spacer { flex: 1; }
.reditor .status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em; }
.reditor .dot { width: 9px; height: 9px; border-radius: 50%; }
.reditor .status.saved { color: #57e08a; }
.reditor .status.saved .dot { background: #57e08a; box-shadow: 0 0 10px #57e08a; }
.reditor .status.dirty { color: var(--gold); }
.reditor .status.dirty .dot { background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: reditor-pulse 1.1s infinite; }
@keyframes reditor-pulse { 50% { opacity: 0.35; } }

/* options row */
.reditor .options { display: flex; align-items: center; gap: 14px; padding: 0 22px 14px; flex-wrap: wrap; }
.reditor .opt { display: flex; align-items: center; gap: 9px; background: rgba(3, 6, 26, 0.55); border: 1px solid var(--line-soft); border-radius: 11px; padding: 8px 12px; }
.reditor .opt .k { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.reditor .opt input[type=text] { background: transparent; border: none; color: var(--ink); font-family: 'Outfit'; font-size: 14px; padding: 0; width: 210px; border-radius: 0; }
.reditor .opt input:focus { outline: none; box-shadow: none; }
.reditor .opt select { background: transparent; border: none; color: var(--ink); font-family: 'Outfit'; font-size: 14px; padding: 0 18px 0 0; cursor: pointer; appearance: none; border-radius: 0;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%), linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%);
  background-position: calc(100% - 8px) center, calc(100% - 3px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.reditor .opt select:focus { outline: none; box-shadow: none; }
.reditor .opt.btn-opt { cursor: pointer; }
.reditor .opt.btn-opt:hover { border-color: var(--line); color: var(--cyan); }

/* header buttons */
.reditor .btn { font-family: 'JetBrains Mono', monospace; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; border-radius: 11px; cursor: pointer; padding: 11px 18px; border: 1px solid transparent; transition: 0.15s; color: #fff; }
.reditor .btn-primary { background: linear-gradient(135deg, var(--magenta), #d81f74); box-shadow: 0 6px 22px rgba(255, 46, 136, 0.32); }
.reditor .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(255, 46, 136, 0.45); color: #fff; border-color: transparent; }
.reditor .btn-ghost { background: transparent; border-color: var(--line); color: var(--cyan); }
.reditor .btn-ghost:hover { background: rgba(0, 240, 255, 0.08); transform: none; box-shadow: none; color: var(--cyan); }
.reditor .btn:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }

/* scroll body */
.reditor .scroll { flex: 1; overflow: auto; padding: 20px 24px 60px; }
.reditor .scroll::-webkit-scrollbar { width: 10px; }
.reditor .scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 8px; }

/* stacked image rows */
.reditor .stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.reditor .row { display: grid; grid-template-columns: 280px 1fr auto; gap: 20px; align-items: stretch; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 16px; padding: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); transition: border-color 0.15s; }
.reditor .row.dirty { border-color: rgba(252, 204, 24, 0.42); }

.reditor .thumb { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16/10; background: #04061a; }
.reditor .thumb .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: 0.4s; cursor: zoom-in; }
.reditor .thumb .art.empty { display: grid; place-items: center; object-fit: initial; cursor: default; background: rgba(255, 255, 255, 0.03); color: var(--ink-dim); font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.08em; }
.reditor .thumb .grain { position: absolute; inset: 0; opacity: 0.22; mix-blend-mode: overlay; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.reditor .thumb .num { position: absolute; top: 9px; left: 9px; width: 28px; height: 28px; border-radius: 8px; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; font-family: 'Bungee'; font-size: 13px; color: var(--cream); }
.reditor .thumb .shimmer { position: absolute; inset: 0; display: none; place-items: center; background: rgba(4, 6, 26, 0.45); }
.reditor .row.busy .thumb .art { filter: blur(6px) saturate(0.4); }
.reditor .row.busy .thumb .shimmer { display: grid; }
.reditor .spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.18); border-top-color: var(--cyan); animation: reditor-sp 0.7s linear infinite; }
@keyframes reditor-sp { to { transform: rotate(360deg); } }
.reditor .row.stale .thumb::after { content: "NEEDS REGEN"; position: absolute; inset: 0; display: grid; place-items: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.12em; color: var(--gold); background: rgba(4, 6, 26, 0.6); text-shadow: 0 0 12px rgba(252, 204, 24, 0.5); pointer-events: none; }
.reditor .row.busy.stale .thumb::after { display: none; }

.reditor .prompt-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.reditor .prompt-col .lbl { display: flex; align-items: center; justify-content: space-between; }
.reditor .prompt-col .mini { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.06em; color: var(--ink-dim); }
.reditor .prompt-col .mini.dirtytxt { color: var(--gold); }
.reditor textarea { width: 100%; flex: 1; background: rgba(3, 6, 26, 0.7); border: 1px solid var(--line-soft); border-radius: 11px; color: var(--ink); font-family: 'Outfit'; font-size: 14px; padding: 12px 13px; resize: none; line-height: 1.55; transition: 0.15s; min-height: 120px; }
.reditor textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.14); }

.reditor .act-col { display: flex; flex-direction: column; justify-content: center; gap: 9px; width: 150px; }
.reditor .act-col button { font-family: 'JetBrains Mono', monospace; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; font-size: 11px; padding: 11px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line-soft); color: var(--cyan); background: transparent; transition: 0.15s; }
.reditor .act-col button:hover { background: rgba(0, 240, 255, 0.08); transform: none; box-shadow: none; color: var(--cyan); border-color: var(--line); }
.reditor .act-col button.go { border: none; color: #fff; background: linear-gradient(135deg, var(--magenta), #d81f74); }
.reditor .act-col button.go:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--magenta), #d81f74); color: #fff; }
.reditor .act-col button:disabled { opacity: 0.45; cursor: default; }

/* reused reorder block (TV cycle order) themed to sit in the editor */
.reditor .order-block { margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line-soft); }

/* narrow-laptop fallback */
@media (max-width: 900px) {
  .reditor .row { grid-template-columns: 1fr; }
  .reditor .act-col { width: auto; flex-direction: row; }
  .reditor .act-col button { flex: 1; }
}
