:root {
  --bg0: #040810;
  --bg1: #070d18;
  --bg2: #0b1524;
  --bg3: #102038;
  --line: rgba(56, 189, 248, 0.28);
  --line2: rgba(125, 211, 252, 0.1);
  --text: #e8f4ff;
  --muted: #8ba3bc;
  --dim: #5a718a;
  /* accent aliases (kept as --gold* so existing class names still work) */
  --gold: #38bdf8;
  --gold2: #0ea5e9;
  --amber: #67e8f9;
  --cyan: #22d3ee;
  --ice: #7dd3fc;
  --blue: #3b82f6;
  --navy: #1e3a5f;
  --rose: #fb7185;
  --green: #34d399;
  --violet: #818cf8;
  --shadow: 0 20px 60px rgba(0, 10, 30, 0.65);
  --glow: 0 0 40px rgba(56, 189, 248, 0.15);
  --radius: 14px;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Cascadia Code", monospace;
  --sans: var(--font);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(1000px 520px at 8% -8%, rgba(14, 165, 233, 0.16), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, rgba(59, 130, 246, 0.12), transparent 50%),
    radial-gradient(700px 400px at 50% 100%, rgba(34, 211, 238, 0.06), transparent 55%),
    linear-gradient(180deg, #03060e 0%, var(--bg0) 40%, #02050c 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* tech grid + scan feel */
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
  z-index: 0;
}

body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--ice); text-shadow: 0 0 12px rgba(56, 189, 248, 0.45); }

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ── sidebar ── */
.sidebar {
  border-right: 1px solid var(--line2);
  background:
    linear-gradient(180deg, rgba(8, 18, 36, 0.97), rgba(3, 8, 18, 0.98));
  backdrop-filter: blur(12px);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: inset -1px 0 0 rgba(56, 189, 248, 0.06);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 8px 12px;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 32px rgba(14, 165, 233, 0.25);
  background: #061018;
}
.brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand .mark {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ef4444;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.45);
}
.brand .sub {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.genesis-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line2);
  background:
    radial-gradient(700px 200px at 0% 40%, rgba(14, 165, 233, 0.18), transparent 55%),
    radial-gradient(500px 160px at 80% 100%, rgba(59, 130, 246, 0.1), transparent 50%),
    linear-gradient(135deg, rgba(10, 22, 42, 0.95), rgba(4, 10, 20, 0.98));
  box-shadow: var(--shadow), var(--glow);
  overflow: hidden;
  position: relative;
}
.genesis-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.06), transparent);
  pointer-events: none;
}
.genesis-hero img.wordmark {
  width: min(480px, 100%);
  height: auto;
  display: block;
  position: relative;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.55));
}
.genesis-hero .tag {
  margin: 0;
  position: relative;
  color: var(--muted);
  line-height: 1.5;
  max-width: 520px;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.88rem;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.15s ease;
}
.nav button:hover {
  background: rgba(56, 189, 248, 0.06);
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.12);
}
.nav button.active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.18), rgba(14, 165, 233, 0.03));
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--ice);
  box-shadow: inset 3px 0 0 var(--cyan), 0 0 20px rgba(14, 165, 233, 0.08);
}
.nav button .n {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--dim);
}

.sidebar .foot {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: rgba(4, 12, 24, 0.7);
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--muted);
  line-height: 1.5;
  box-shadow: inset 0 0 24px rgba(14, 165, 233, 0.04);
}
.sidebar .foot strong {
  color: var(--cyan);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

/* ── main ── */
.main {
  padding: 28px 36px 80px;
  max-width: 1400px;
}

/* ── Hubbard welcome home splash ── */
.home-splash {
  position: fixed;
  inset: 0;
  z-index: 20000;
  border: 0;
  margin: 0;
  padding: 32px 24px;
  width: 100%;
  min-height: 100vh;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background:
    radial-gradient(900px 520px at 50% 18%, rgba(14, 165, 233, 0.28), transparent 60%),
    radial-gradient(700px 420px at 70% 90%, rgba(34, 211, 238, 0.12), transparent 55%),
    #030a14;
  color: var(--text);
  font: inherit;
}
.home-splash[hidden] {
  display: none !important;
}
.home-splash__glow {
  position: absolute;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
}
.home-splash__video {
  position: relative;
  z-index: 1;
  width: min(820px, 92vw);
  height: auto;
  max-height: 64vh;
  object-fit: contain;
  background: #0a121c;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.home-splash__copy {
  position: relative;
  z-index: 1;
  text-align: center;
}
.home-splash__hello {
  font-family: var(--mono);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 28px rgba(56, 189, 248, 0.45);
}
.home-splash__cta {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  animation: splash-pulse 1.8s ease-in-out infinite;
}
@keyframes splash-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes splash-pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}
.topbar h1 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 30px rgba(56, 189, 248, 0.2);
}
.topbar .welcome-user {
  margin: 0 0 6px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.5;
  font-size: 0.92rem;
}
.topbar .welcome-user + h1 + p {
  margin-top: 8px;
}

.topbar-right {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#logoutBtn {
  text-decoration: none;
  white-space: nowrap;
}
#switchProjectBtn {
  white-space: nowrap;
}

.project-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.project-pick {
  text-align: left;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  padding: 18px 16px;
  background: rgba(5, 12, 22, 0.92);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.project-pick:hover {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.15), 0 12px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
.project-pick--featured {
  border-color: rgba(56, 189, 248, 0.45);
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.16), transparent 55%),
    rgba(5, 12, 22, 0.95);
}
.project-pick--add {
  border-style: dashed;
  border-color: rgba(56, 189, 248, 0.35);
}
.project-pick--active {
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 0 28px rgba(14, 165, 233, 0.18);
}
.project-pick__kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 8px;
}
.project-pick__title {
  font-size: 1.15rem;
  font-weight: 650;
  margin-bottom: 8px;
}
.project-pick__meta {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ── pipeline rail ── */
.rail {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 28px;
}
.rail .step {
  border: 1px solid var(--line2);
  background: rgba(8, 16, 32, 0.85);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: 0.15s ease;
  min-height: 64px;
}
.rail .step:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.1);
}
.rail .step.active {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.15), 0 0 20px rgba(14, 165, 233, 0.12);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.16), rgba(8, 16, 32, 0.9));
}
.rail .step.done { border-color: rgba(52, 211, 153, 0.3); }
.rail .step .ix {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--dim);
  letter-spacing: 0.08em;
}
.rail .step .lb {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail .step.active .lb { color: var(--ice); }

/* ── cards / grid ── */
.grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.card {
  background:
    linear-gradient(160deg, rgba(12, 24, 44, 0.92), rgba(6, 12, 24, 0.96));
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.35), transparent);
  opacity: 0.8;
}
.card h2, .card h3 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card h2 { font-size: 1rem; color: var(--ice); }
.card h3 { font-size: 0.92rem; color: var(--text); }
.card .hint { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin: 0 0 16px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat {
  background: linear-gradient(160deg, rgba(10, 22, 40, 0.95), rgba(6, 12, 24, 0.98));
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(56, 189, 248, 0.08);
}
.stat .k {
  font-size: 0.68rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: var(--mono);
}
.stat .v {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.stat .v.gold { color: var(--ice); text-shadow: 0 0 16px rgba(56, 189, 248, 0.35); }
.stat .v.cyan { color: var(--cyan); }
.stat .v.rose { color: var(--rose); }
.stat .v.green { color: var(--green); }

/* ── forms ── */
label {
  display: block;
  font-size: 0.68rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 6px;
  font-family: var(--mono);
}
input[type="text"],
input[type="number"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: rgba(2, 8, 18, 0.75);
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12), 0 0 20px rgba(14, 165, 233, 0.08);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.tall { min-height: 280px; font-family: var(--mono); font-size: 0.84rem; color: #b8d4ec; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── buttons ── */
.btn {
  appearance: none;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.16), rgba(14, 165, 233, 0.05));
  color: var(--ice);
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.82rem;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.15s ease;
  white-space: nowrap;
}
.btn:hover {
  background: rgba(14, 165, 233, 0.22);
  color: #fff;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn.primary {
  background: linear-gradient(180deg, #38bdf8, #0284c7);
  color: #031018;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.25);
}
.btn.primary:hover {
  filter: brightness(1.08);
  color: #031018;
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.4);
}
.btn.ghost {
  background: transparent;
  border-color: var(--line2);
  color: var(--muted);
}
.btn.ghost:hover { color: var(--text); border-color: rgba(56, 189, 248, 0.3); }
.btn.danger {
  border-color: rgba(251, 113, 133, 0.4);
  color: var(--rose);
  background: rgba(251, 113, 133, 0.08);
}
.btn.cyan {
  border-color: rgba(34, 211, 238, 0.4);
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
}
.btn.sm { padding: 7px 12px; font-size: 0.72rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ── lists / tables ── */
.list { display: flex; flex-direction: column; gap: 10px; }
.row-card {
  border: 1px solid var(--line2);
  background: rgba(4, 12, 24, 0.55);
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  transition: 0.15s ease;
}
.row-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.08);
}
.row-card .title {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: 0.02em;
}
.row-card .meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}
.mono { font-family: var(--mono); font-size: 0.82rem; color: var(--cyan); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-family: var(--mono);
  border: 1px solid var(--line2);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.badge.ready, .badge.pending {
  color: var(--amber);
  border-color: rgba(103, 232, 249, 0.35);
  background: rgba(103, 232, 249, 0.06);
}
.badge.queued, .badge.submitted {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}
.badge.done, .badge.pass, .badge.success {
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.06);
}
.badge.failed, .badge.fail, .badge.blocked_budget {
  color: var(--rose);
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.06);
}
.badge.warn { color: var(--amber); }
.badge.fav {
  color: var(--ice);
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.1);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-family: var(--mono);
}
table.data th {
  text-align: left;
  color: var(--dim);
  font-weight: 500;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line2);
}
table.data td {
  padding: 10px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.06);
  vertical-align: top;
  color: var(--muted);
}
table.data tr:hover td {
  background: rgba(14, 165, 233, 0.04);
  color: var(--text);
}

/* ── take cards / dailies ── */
.take-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.take {
  border: 1px solid var(--line2);
  border-radius: 12px;
  overflow: hidden;
  background: #050c16;
}
.take .poster {
  aspect-ratio: 21 / 9;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.18), transparent 50%),
    linear-gradient(180deg, #0c1a30, #050c16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 0.75rem;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
}
.take.favorite {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.15), 0 0 24px rgba(14, 165, 233, 0.15);
}
.take.favorite .poster::after {
  content: "★ FAVORITE";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.62rem;
  color: #031018;
  background: linear-gradient(90deg, #38bdf8, #22d3ee);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.take .body { padding: 12px; }
.take .body .id { font-family: var(--mono); font-size: 0.78rem; color: var(--cyan); }
.take .body .note { margin-top: 6px; font-size: 0.82rem; color: var(--muted); min-height: 2.4em; }

/* ── timeline ── */
.timeline {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 16px;
}
.tl-clip {
  min-width: 140px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--bg2);
  padding: 10px;
}
.tl-clip .ord {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--dim);
}
.tl-clip .sid { color: var(--ice); font-size: 0.82rem; margin-top: 4px; font-family: var(--mono); }
.tl-clip .tid { color: var(--muted); font-size: 0.72rem; margin-top: 2px; font-family: var(--mono); }

/* ── activity ── */
.activity { max-height: 360px; overflow: auto; }
.activity .item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(56, 189, 248, 0.06);
  font-size: 0.82rem;
}
.activity .t { color: var(--dim); font-family: var(--mono); font-size: 0.7rem; }
.activity .m { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }
.activity .m.success { color: var(--green); }
.activity .m.warn { color: var(--amber); }

/* ── toast ── */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: linear-gradient(160deg, #0c1a30, #081020);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  min-width: 240px;
  max-width: 380px;
  box-shadow: var(--shadow), 0 0 24px rgba(14, 165, 233, 0.12);
  font-size: 0.84rem;
  font-family: var(--mono);
  animation: rise 0.25s ease;
}
.toast.error { border-color: rgba(251, 113, 133, 0.5); }

/* ── Genesis modal (scene slate destination picker, etc.) ── */
.gmodal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gmodal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, 0.72);
  backdrop-filter: blur(6px);
}
.gmodal__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(84vh, 720px);
  overflow: auto;
  padding: 18px 18px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 32, 56, 0.98), rgba(7, 13, 24, 0.98));
  box-shadow: var(--shadow), var(--glow);
}
.gmodal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gmodal__presets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gmodal__preset {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: rgba(8, 18, 32, 0.65);
  cursor: pointer;
}
.gmodal__preset:hover {
  border-color: rgba(56, 189, 248, 0.45);
}
.gmodal__preset input {
  margin-top: 3px;
}
.gmodal__preset span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.gmodal__preset .mono {
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--muted);
}
.gmodal__pathrow {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.gmodal__path {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.9);
  color: var(--text);
}
.gmodal__actions {
  margin-top: 16px;
  justify-content: flex-end;
}
@keyframes rise {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  border: 1px dashed rgba(56, 189, 248, 0.2);
  border-radius: var(--radius);
  background: rgba(4, 12, 24, 0.35);
}
.empty h3 {
  font-family: var(--mono);
  color: var(--ice);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1rem;
}

.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pill-tabs button {
  border-radius: 6px;
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pill-tabs button.on {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--ice);
  background: rgba(14, 165, 233, 0.12);
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  overflow: hidden;
  margin-top: 8px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #22d3ee);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.hidden { display: none !important; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.space { justify-content: space-between; }
.grow { flex: 1; }

pre.code {
  background: #020810;
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 14px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: #9ec9e8;
  max-height: 320px;
  line-height: 1.5;
  box-shadow: inset 0 0 30px rgba(14, 165, 233, 0.04);
}

/* Scene-pack prompt reader — tall, independently scrollable */
.scene-pack-prompt-wrap {
  margin-top: 12px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 12px;
  background: rgba(2, 8, 16, 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 640px);
}
.scene-pack-prompt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ice);
  flex-shrink: 0;
}
.scene-pack-prompt-head .meta {
  color: var(--dim);
  font-size: 0.7rem;
}
pre.scene-pack-prompt {
  margin: 0;
  max-height: none;
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 14px 16px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 200px;
}
.row-card.scene-pack-cov {
  cursor: pointer;
}
.row-card.scene-pack-cov.is-active {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

/* ── Bible character accordions ── */
.char-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.char-acc {
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: rgba(4, 12, 24, 0.55);
  overflow: hidden;
}
.char-acc[open] {
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.08);
}
.char-acc-sum {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  font-family: var(--mono);
  user-select: none;
}
.char-acc-sum::-webkit-details-marker { display: none; }
.char-acc-sum:hover { background: rgba(14, 165, 233, 0.06); }
.char-acc-name {
  color: var(--ice);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.88rem;
}
.char-acc-meta {
  color: var(--dim);
  font-size: 0.72rem;
  text-align: right;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.char-acc-chev {
  color: var(--cyan);
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}
.char-acc[open] > .char-acc-sum .char-acc-chev {
  transform: rotate(90deg);
}
.char-acc-body {
  padding: 4px 14px 16px;
  border-top: 1px solid rgba(56, 189, 248, 0.08);
}
.char-acc-h {
  margin: 14px 0 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
}
.char-acc-desc {
  max-height: 360px;
  white-space: pre-wrap;
  margin-top: 0;
}

/* Editor */
.editor-fav-row {
  display: flex;
}
.editor-script-tl {
  max-height: 420px;
  overflow: auto;
}
.editor-cut-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.editor-trim-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.editor-trim-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dim);
}
.editor-trim-row input {
  background: #020810;
  border: 1px solid var(--line2);
  border-radius: 6px;
  color: var(--ice);
  padding: 6px 8px;
  font-family: var(--mono);
}
.editor-cut-preview {
  width: 100%;
  max-width: 420px;
  margin-top: 10px;
  border-radius: 8px;
  background: #000;
  border: 1px solid rgba(56, 189, 248, 0.15);
}

/* Voice scene audio dropdowns */
.voice-dd-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.voice-dd {
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(2, 8, 16, 0.45);
}
.voice-dd-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}
.voice-dd-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice);
}
.voice-dd-meta {
  color: var(--dim);
  font-size: 0.7rem;
}
.voice-audio-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: #020810 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='%2338bdf8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") right 12px center / 12px no-repeat;
  border: 1px solid var(--line2);
  border-radius: 8px;
  color: var(--ice);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 10px 36px 10px 12px;
  cursor: pointer;
}
.voice-audio-select:hover:not(:disabled) {
  border-color: rgba(56, 189, 248, 0.45);
}
.voice-audio-select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}
.voice-audio-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.voice-audio-select option {
  background: #020810;
  color: var(--ice);
}
.char-ref-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.outfit-block {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 10px;
  background: rgba(0, 8, 18, 0.35);
}
.outfit-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  margin-bottom: 8px;
}
.take--zoomable .char-ref-zoom {
  display: block;
  width: 100%;
  border: 0;
  cursor: zoom-in;
  position: relative;
}
.take--zoomable .char-ref-zoom:hover {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: -2px;
}
.take--zoomable .char-ref-zoom::after {
  content: "⤢";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(3, 16, 28, 0.75);
  color: var(--cyan);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  pointer-events: none;
}
body.lightbox-open {
  overflow: hidden;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] {
  display: none !important;
}
.lightbox__scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, 0.88);
  backdrop-filter: blur(6px);
}
.lightbox__panel {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lightbox__img {
  max-width: 96vw;
  max-height: calc(92vh - 56px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
  background: #050c16;
}
.lightbox__meta {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 96vw;
}
.lightbox__caption {
  color: var(--text);
  font-size: 0.85rem;
}
.lightbox__count {
  color: var(--dim);
  font-size: 0.78rem;
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(5, 12, 22, 0.9);
  color: var(--cyan);
  cursor: pointer;
  border-radius: 10px;
  z-index: 2;
}
.lightbox__close {
  top: -8px;
  right: -8px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}
.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  font-size: 2rem;
  line-height: 1;
}
.lightbox__nav--prev { left: -56px; }
.lightbox__nav--next { right: -56px; }
.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(14, 165, 233, 0.2);
  border-color: rgba(56, 189, 248, 0.7);
}
@media (max-width: 900px) {
  .lightbox__nav--prev { left: 4px; }
  .lightbox__nav--next { right: 4px; }
  .lightbox__close { top: 4px; right: 4px; }
}
.bible-panel > .char-acc-sum {
  padding: 14px 4px;
}
.bible-panel .char-acc-body {
  border-top: 1px solid rgba(56, 189, 248, 0.08);
  padding-top: 12px;
}

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .rail { grid-template-columns: repeat(5, 1fr); }
  .grid-2, .stat-row, .field-row, .field-row.3 { grid-template-columns: 1fr; }
  .char-acc-sum { grid-template-columns: 1fr auto; }
  .char-acc-meta { display: none; }
}
