/* vrinda Arena — arena.css
   Dark, premium, restrained. Desktop-first (>=1100px solid), stacks at 768px.
   No external assets, no @import, no web fonts. System font stack only. */

:root {
  --bg: #0a0c10;
  --bg-raise: #111520;
  --bg-raise-2: #161b28;
  --panel: #131824;
  --panel-border: #232a3a;
  --panel-border-soft: #1c2331;
  --ink: #e8ecf4;
  --ink-soft: #a7b0c2;
  --ink-dim: #6b7488;
  --ink-faint: #4a5266;
  --accent: #6ea8fe;
  --accent-deep: #3d6fd4;
  --accent-glow: rgba(110, 168, 254, 0.22);
  --good: #46d18a;
  --good-dim: #1f7a52;
  --warn: #e6b256;
  --bad: #f0736b;
  --bad-dim: #7a2f2b;
  --grey-chip: #2a3244;
  --repair: #b79bff;
  --repair-dim: #5a4a99;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "Menlo", "Consolas", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(61, 111, 212, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(120, 90, 200, 0.07), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

.page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 28px 64px;
}

/* ---------- Masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(10, 12, 16, 0.97), rgba(10, 12, 16, 0.90));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--panel-border-soft);
  padding: 18px 0 20px;
  margin-bottom: 26px;
}

.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #cfe0ff, #8fb4ff 60%, #b79bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.masthead-right { display: flex; align-items: center; gap: 16px; }

.quota-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-raise);
  border: 1px solid var(--panel-border);
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.quota-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}
.quota-chip.exhausted .quota-dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.quota-chip.exhausted { color: var(--bad); border-color: var(--bad-dim); }

/* daily $ balance pill — same chip pattern; tabular figures for the amount */
.balance-chip { font-variant-numeric: tabular-nums; }
.balance-chip.exhausted .quota-dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.balance-chip.exhausted { color: var(--bad); border-color: var(--bad-dim); }

.logout {
  color: var(--ink-dim);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s;
}
.logout:hover { color: var(--ink-soft); }

.global-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(240, 115, 107, 0.10);
  border: 1px solid var(--bad-dim);
  color: #f4b4ae;
  font-size: 14px;
}

/* ---------- Prompt block ---------- */
.prompt-block {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.prompt-wrap { flex: 1; display: flex; flex-direction: column; }
.prompt {
  width: 100%;
  resize: vertical;
  min-height: 74px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.prompt:focus {
  outline: none;
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.prompt:disabled { opacity: 0.55; cursor: not-allowed; }
.prompt::placeholder { color: var(--ink-faint); }

.prompt-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  min-height: 18px;
}
.prompt-counter { font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.prompt-counter.near { color: var(--warn); }
.prompt-counter.at { color: var(--bad); }
.prompt-disabled-msg { font-size: 12px; color: var(--bad); }

.build-col { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 168px; }
.build-btn {
  flex: 1;
  min-height: 74px;
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  color: #08111f;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 6px 20px rgba(61, 111, 212, 0.28);
}
.build-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(61, 111, 212, 0.38); }
.build-btn:active:not(:disabled) { transform: translateY(0); }
.build-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.build-btn.building { opacity: 0.7; cursor: progress; }
.build-hint { font-size: 11.5px; color: var(--ink-dim); text-align: center; }

/* ---------- Chips ---------- */
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--bg-raise);
  border: 1px solid var(--panel-border);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.14s;
  user-select: none;
}
.chip:hover { border-color: var(--accent-deep); color: var(--ink); background: var(--bg-raise-2); }
.chip:active { transform: scale(0.97); }

/* ---------- Arm selector ---------- */
.arms-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.arms-label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-dim); font-weight: 600;
}
.arm-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.arm-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-raise);
  border: 1px solid var(--panel-border);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.14s;
  user-select: none;
}
.arm-chip .arm-check {
  width: 14px; height: 14px; border-radius: 4px;
  border: 1.5px solid var(--ink-faint);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.14s;
}
.arm-chip.on {
  border-color: var(--accent-deep);
  color: var(--ink);
  background: linear-gradient(160deg, rgba(110,168,254,0.14), rgba(61,111,212,0.08));
}
.arm-chip.on .arm-check {
  background: var(--accent);
  border-color: var(--accent);
}
.arm-chip.on .arm-check::after {
  content: "";
  width: 4px; height: 8px;
  border: solid #08111f;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}
.arm-chip.disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.arms-note { font-size: 12px; color: var(--ink-dim); }

/* ---------- Prelude ---------- */
.prelude { color: var(--ink-dim); font-size: 14px; max-width: 720px; margin: 4px 0 20px; }
.prelude.hidden { display: none; }

/* ---------- Columns ---------- */
.columns {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
.columns.cols-2 { grid-template-columns: 1fr 1fr; }
.columns.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.col {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  opacity: 0;
  transform: translateY(10px);
  animation: col-enter 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes col-enter { to { opacity: 1; transform: translateY(0); } }

.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-border-soft);
  background: linear-gradient(180deg, var(--bg-raise-2), var(--panel));
}
.col-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.col-letter {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  min-width: 22px;
}
.col-name {
  font-size: 14px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-version {
  font-size: 11px;
  color: var(--ink-dim);
  font-family: var(--mono);
}
.col-timer {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* status/phase ticker */
.col-phase {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--panel-border-soft);
  min-height: 44px;
  font-size: 13px;
  color: var(--ink-soft);
}
.phase-pip {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pip-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pip-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); opacity: 1; }
  50% { box-shadow: 0 0 0 6px rgba(110,168,254,0); opacity: 0.6; }
}
.col-phase.selffix { color: var(--repair); }
.col-phase.selffix .phase-pip { background: var(--repair); animation-duration: 0.9s; }
.col-phase.done .phase-pip { animation: none; background: var(--ink-faint); box-shadow: none; }
.phase-detail { color: var(--ink-dim); font-size: 12px; }

/* body: skeleton / iframe / honest-fail */
.col-body { position: relative; flex: 1; display: flex; min-height: 300px; background: #05070b; }

.skeleton {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #10141f 0%, #1b2130 50%, #10141f 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w90 { width: 90%; }
.skeleton-line.block { flex: 1; height: auto; margin-top: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.artifact-frame {
  border: none;
  width: 100%;
  height: 100%;
  min-height: 300px;
  background: #fff;
  display: block;
}

.honest-fail {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 28px; text-align: center;
}
.honest-fail-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bad-dim);
  color: var(--bad);
  font-size: 22px; font-weight: 700;
}
.honest-fail.timeout .honest-fail-icon,
.honest-fail.capped .honest-fail-icon { border-color: var(--warn); color: var(--warn); }
.honest-fail-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.honest-fail-reason { font-size: 13px; color: var(--ink-dim); max-width: 320px; }

/* verdict + repair chips */
.col-verdict-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 16px;
  border-top: 1px solid var(--panel-border-soft);
  min-height: 46px;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge.verifying { background: var(--grey-chip); color: var(--ink-soft); }
.badge.verifying .badge-dot { background: var(--ink-soft); animation: pip-pulse 1.4s ease-in-out infinite; }
.badge.verified { background: rgba(70,209,138,0.12); color: var(--good); border-color: var(--good-dim); }
.badge.verified .badge-dot { background: var(--good); box-shadow: 0 0 6px var(--good); }
.badge.failed { background: rgba(240,115,107,0.12); color: var(--bad); border-color: var(--bad-dim); }
.badge.failed .badge-dot { background: var(--bad); }
.badge.unverified { background: var(--grey-chip); color: var(--ink-dim); }
.badge.unverified .badge-dot { background: var(--ink-faint); }
.badge.repaired { background: rgba(183,155,255,0.12); color: var(--repair); border-color: var(--repair-dim); }
.badge.repaired .badge-dot { background: var(--repair); box-shadow: 0 0 6px var(--repair); }
.badge.cost {
  background: var(--bg-raise); color: var(--ink); border-color: var(--panel-border);
  font-variant-numeric: tabular-nums; cursor: default;
}
.badge.cost.unavailable { color: var(--ink-dim); }

/* control bar */
.col-controls {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--panel-border-soft);
  min-height: 48px;
}
.ctrl-btn {
  background: var(--bg-raise);
  border: 1px solid var(--panel-border);
  color: var(--ink-soft);
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.14s;
}
.ctrl-btn:hover { border-color: var(--accent-deep); color: var(--ink); }
.ctrl-btn.active { border-color: var(--accent-deep); color: var(--accent); background: rgba(110,168,254,0.08); }
.ctrl-spacer { flex: 1; }
.ctrl-link {
  font-size: 12px; color: var(--ink-dim); text-decoration: none; cursor: pointer;
  border: none; background: none; padding: 0;
}
.ctrl-link:hover { color: var(--ink-soft); text-decoration: underline; }

/* code view */
.code-view {
  position: absolute; inset: 0;
  background: #06080d;
  overflow: auto;
  padding: 0;
  display: none;
}
.code-view.show { display: block; }
.code-view pre {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #c8d0e0;
  white-space: pre;
  tab-size: 2;
}
.code-copy-bar {
  position: sticky; top: 0;
  display: flex; justify-content: flex-end;
  padding: 8px 10px;
  background: rgba(6,8,13,0.92);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--panel-border-soft);
}
/* minimal hand-written highlighter tokens */
.tok-tag { color: #6ea8fe; }
.tok-attr { color: #b79bff; }
.tok-str { color: #46d18a; }
.tok-com { color: #5a6478; font-style: italic; }
.tok-kw { color: #e6b256; }
.tok-num { color: #f0a56b; }
.tok-punct { color: #8a93a6; }

/* refine (disabled shell) */
.col-refine {
  display: flex; gap: 8px; padding: 10px 16px;
  border-top: 1px solid var(--panel-border-soft);
}
.refine-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--panel-border-soft);
  border-radius: var(--radius-sm);
  color: var(--ink-dim);
  padding: 7px 11px;
  font-size: 12.5px;
  font-family: var(--font);
  cursor: not-allowed;
}
.refine-input:disabled { opacity: 0.6; }

/* feedback */
.col-feedback { padding: 10px 16px; border-top: 1px solid var(--panel-border-soft); }
.feedback-link {
  font-size: 12px; color: var(--ink-dim); background: none; border: none;
  cursor: pointer; padding: 0; text-decoration: underline;
}
.feedback-link:hover { color: var(--ink-soft); }
.feedback-box { display: none; flex-direction: column; gap: 8px; }
.feedback-box.show { display: flex; }
.feedback-text {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font);
  resize: vertical;
  min-height: 60px;
}
.feedback-actions { display: flex; gap: 8px; align-items: center; }
.feedback-thanks { font-size: 12px; color: var(--good); }

/* ---------- Vote region ---------- */
.vote-region {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
/* display:flex above (specificity 0,1,0) overrides UA [hidden]{display:none};
   restore hidden-wins so the hidden attribute actually collapses the region. */
.vote-region[hidden] { display: none !important; }
.vote-lock {
  font-size: 13px;
  color: var(--ink-dim);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--bg-raise);
  border: 1px dashed var(--panel-border);
}
.vote-bar {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  animation: vote-in 0.35s ease;
}
/* display:flex above (specificity 0,1,0) overrides UA [hidden]{display:none};
   restore hidden-wins so the hidden attribute actually collapses the bar. */
.vote-bar[hidden] { display: none !important; }
@keyframes vote-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.vote-btn {
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  background: var(--bg-raise-2);
  border: 1px solid var(--panel-border);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s;
}
.vote-btn:hover { border-color: var(--accent-deep); background: rgba(110,168,254,0.08); transform: translateY(-1px); }
.vote-btn.secondary { color: var(--ink-soft); }
.vote-btn.negative:hover { border-color: var(--bad-dim); background: rgba(240,115,107,0.08); }
.skip-reveal { font-size: 12.5px; color: var(--ink-dim); text-decoration: none; }
.skip-reveal:hover { color: var(--ink-soft); text-decoration: underline; }
.reveal-note { font-size: 14px; color: var(--good); text-align: center; }
.reveal-note.skipped { color: var(--ink-soft); }
.run-again {
  padding: 11px 26px;
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  color: #08111f;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 6px 20px rgba(61,111,212,0.28);
}
.run-again:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(61,111,212,0.38); }

/* ---------- Footer ---------- */
.site-foot {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--panel-border-soft);
  color: var(--ink-faint);
  font-size: 12px;
}
.site-foot p { margin: 4px 0; }
.method-line { color: var(--ink-dim); }

/* ---------- Toasts ---------- */
.toast-host {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 100;
  pointer-events: none;
}
.toast {
  background: var(--bg-raise-2);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent);
  color: var(--ink);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease;
  max-width: 380px;
}
.toast.warn { border-left-color: var(--warn); }
.toast.error { border-left-color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Gallery (past builds) ---------- */
.gallery-btn {
  background: var(--bg-raise);
  border: 1px solid var(--panel-border);
  color: var(--ink-soft);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s;
}
.gallery-btn:hover { border-color: var(--accent-deep); color: var(--ink); }
.gallery-btn.active { border-color: var(--accent-deep); color: var(--accent); background: rgba(110,168,254,0.08); }

.gallery-view { margin-top: 8px; }
.gallery-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.gallery-title { display: flex; align-items: baseline; gap: 12px; }
.gallery-heading { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.gallery-count { font-size: 13px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.gallery-tools { display: flex; align-items: center; gap: 16px; }
.gallery-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-soft); cursor: pointer; user-select: none;
}
.gallery-toggle input { accent-color: var(--accent); cursor: pointer; }
.gallery-status { color: var(--ink-dim); font-size: 14px; padding: 24px 0; }

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

.gallery-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.14s, transform 0.14s;
  min-height: 180px;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
}
.gallery-card:hover { border-color: var(--accent-deep); transform: translateY(-2px); }
.gallery-card.is-failed { cursor: default; }
.gallery-card.is-failed:hover { border-color: var(--panel-border); transform: none; }

.gallery-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--panel-border-soft);
  background: linear-gradient(180deg, var(--bg-raise-2), var(--panel));
}
.gallery-card-arm { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.gallery-card-date { font-size: 11px; color: var(--ink-dim); font-family: var(--mono); white-space: nowrap; }
.gallery-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.gallery-card-prompt { font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.gallery-card-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: auto;
}
.gallery-card-open {
  font-size: 12px; color: var(--accent); margin-left: auto;
}
.gallery-card.is-failed .gallery-card-open { color: var(--ink-dim); }

/* Fullscreen artifact overlay (reuses the sandboxed iframe mechanics) */
.gallery-modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(5, 7, 11, 0.86);
  display: flex; flex-direction: column;
  padding: 24px;
}
.gallery-modal[hidden] { display: none; }
.gallery-modal-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 4px 14px;
}
.gallery-modal-title { font-size: 14px; color: var(--ink-soft); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-modal-spacer { flex: 1; }
.gallery-modal-frame-wrap {
  flex: 1; background: #05070b;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius); overflow: hidden;
  display: flex;
}
.gallery-modal-frame-wrap .artifact-frame { min-height: 0; }
.gallery-modal-prompt {
  margin: 0 4px 14px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: rgba(5, 7, 11, 0.6);
}
.gallery-modal-prompt-head {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--panel-border);
}
.gallery-modal-prompt-label {
  flex: 1; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-soft);
}
.gallery-modal-prompt-text {
  margin: 0; padding: 10px 12px;
  max-height: 160px; overflow-y: auto;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 13px; line-height: 1.5; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .columns.cols-3 { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .page { padding: 0 16px 48px; }
  .prompt-block { flex-direction: column; }
  .build-col { width: 100%; flex-direction: row; align-items: center; }
  .build-btn { min-height: 52px; }
  .columns.cols-2, .columns.cols-3 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .masthead { position: static; }
}

/* ============================================================================
   Lane 3 — admin publish controls + confirm dialog + DEMO-PICKS panel.
   Additive only; uses the existing palette tokens. Hidden by default so it is
   inert for non-admins (admin-publish.js unhides / populates).
   ============================================================================ */
.demo-picks-panel {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--bg-raise);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
}
.demo-picks-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.demo-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--panel-border-soft);
}
.demo-pick-title { flex: 1; color: var(--ink); font-size: 13px; }
.demo-pick-unit {
  font-size: 11px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.demo-pick-row[data-published="1"] .demo-pick-title { color: var(--good); }

.publish-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}
/* The base rule above sets display:flex, which (class specificity 0,1,0) beats
   the UA [hidden]{display:none} rule — so without this the modal ignores its
   hidden attribute and auto-shows on load. Restore hidden-wins. */
.publish-dialog-backdrop[hidden] { display: none !important; }
.publish-dialog {
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.publish-dialog-title { font-size: 17px; margin: 0 0 10px; color: var(--ink); }
.publish-dialog-warn {
  font-size: 13px;
  color: var(--warn);
  background: rgba(230, 178, 86, 0.08);
  border: 1px solid rgba(230, 178, 86, 0.24);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 0 0 12px;
}
.publish-dialog-meta { margin: 0 0 14px; font-size: 13px; }
.publish-dialog-meta dt {
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  margin-top: 8px;
}
.publish-dialog-meta dd { margin: 2px 0 0; color: var(--ink); }
.publish-dialog-prompt {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--panel-border-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.publish-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.publish-dialog-status {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-soft);
}
