﻿/* =========================================================================
   DZT Agent — Monochrome Obsidian Control Plane
   Inspired by Vercel Geist · Midday · Linear · Trigger.dev
   Zero cheesy gradients · 1px hairline borders · Tabular precision
   ========================================================================= */

:root {
  --font: "Geist", "Be Vietnam Pro", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --display: "Geist", "Be Vietnam Pro", "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 12px; --r-full: 999px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t: 140ms var(--ease);
  --t-slow: 220ms var(--ease);
  --z-sticky: 10; --z-header: 30; --z-modal: 100;

  /* Monochrome Obsidian Dark (Default) */
  --bg: #09090b;
  --bg-grid: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  --surface: #0c0c0f;
  --surface-solid: #0c0c0f;
  --surface-2: #111115;
  --surface-3: #18181d;
  --surface-4: #222229;
  --glass: rgba(9, 9, 11, 0.86);

  --ink: #fafafa;
  --ink-2: #a1a1aa;
  --muted: #71717a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line-hover: rgba(255, 255, 255, 0.24);

  /* Surgical Semantic Tokens (Trigger.dev Control Plane) */
  --accent: #fafafa;
  --accent-inv: #09090b;
  --accent-soft: rgba(255, 255, 255, 0.07);
  --cyan: #fafafa;
  --cyan-soft: rgba(255, 255, 255, 0.08);

  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.11);
  --ok-line: rgba(16, 185, 129, 0.28);
  --err: #ef4444;
  --err-soft: rgba(239, 68, 68, 0.11);
  --err-line: rgba(239, 68, 68, 0.3);
  --run: #38bdf8;
  --run-soft: rgba(56, 189, 248, 0.11);
  --run-line: rgba(56, 189, 248, 0.3);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.11);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 4px 16px -4px rgba(0, 0, 0, 0.6);
  --shadow-3: 0 16px 40px -12px rgba(0, 0, 0, 0.85);
  --focus-ring: 0 0 0 2px #09090b, 0 0 0 3.5px rgba(255, 255, 255, 0.45);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fafafa;
  --bg-grid: radial-gradient(rgba(9, 9, 11, 0.06) 1px, transparent 1px);
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #ececef;
  --surface-4: #e4e4e7;
  --glass: rgba(255, 255, 255, 0.88);

  --ink: #09090b;
  --ink-2: #52525b;
  --muted: #71717a;
  --line: rgba(9, 9, 11, 0.08);
  --line-strong: rgba(9, 9, 11, 0.14);
  --line-hover: rgba(9, 9, 11, 0.28);

  --accent: #09090b;
  --accent-inv: #fafafa;
  --accent-soft: rgba(9, 9, 11, 0.06);
  --cyan: #09090b;
  --cyan-soft: rgba(9, 9, 11, 0.06);

  --ok: #059669; --ok-soft: rgba(5, 150, 105, 0.1); --ok-line: rgba(5, 150, 105, 0.25);
  --err: #dc2626; --err-soft: rgba(220, 38, 38, 0.1); --err-line: rgba(220, 38, 38, 0.25);
  --run: #0284c7; --run-soft: rgba(2, 132, 199, 0.1); --run-line: rgba(2, 132, 199, 0.25);
  --warn: #d97706; --warn-soft: rgba(217, 119, 6, 0.1);

  --shadow-1: 0 1px 2px rgba(9, 9, 11, 0.04);
  --shadow-2: 0 4px 14px -4px rgba(9, 9, 11, 0.08);
  --shadow-3: 0 16px 36px -12px rgba(9, 9, 11, 0.14);
  --focus-ring: 0 0 0 2px #ffffff, 0 0 0 3.5px rgba(9, 9, 11, 0.35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background-color: var(--bg);
  background-image: var(--bg-grid);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 13.5px/1.55 var(--font);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.studio-page { height: 100vh; height: 100dvh; overflow: hidden; }

h1, h2, h3 {
  margin: 0; font-family: var(--display); font-weight: 600;
  letter-spacing: -0.025em; line-height: 1.2; color: var(--ink);
}
p { margin: 0; }
b, strong { font-weight: 600; color: var(--ink); }
code {
  font: 12px var(--mono); background: var(--surface-3); color: var(--ink);
  padding: 1.5px 5px; border-radius: var(--r-xs); border: 1px solid var(--line);
}
.mono { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
kbd {
  font: 500 10.5px/1 var(--mono); padding: 2px 5px; border-radius: var(--r-xs);
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line-strong);
  margin-left: 6px;
}
.btn.primary kbd {
  background: rgba(9, 9, 11, 0.14); color: var(--accent-inv); border-color: rgba(9, 9, 11, 0.2);
}

* { scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); border: 2px solid transparent; background-clip: padding-box; }

/* ---------------- Unified Top Command Bar (Vercel / Linear) ---------------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 0 18px; min-height: 54px;
  background: var(--glass);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-inv); flex: none;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 14px; letter-spacing: -0.04em;
}
.brand-txt h1 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; letter-spacing: -0.02em; }
.brand-badge {
  font: 500 10px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 6px; border-radius: var(--r-xs);
  background: var(--surface-3); color: var(--ink-2);
  border: 1px solid var(--line-strong);
}
.brand-sub { font-size: 11px; color: var(--muted); line-height: 1.2; margin-top: 1px; }

.nav-pills {
  display: flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
}
.nav-pill {
  text-decoration: none; color: var(--muted); font-size: 12.5px; font-weight: 500;
  padding: 5px 12px; border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.nav-pill:hover { color: var(--ink); background: var(--surface-3); }
.nav-pill.active {
  color: var(--ink); background: var(--surface-4); border-color: var(--line-strong);
}

.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cfg { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 11px/1 var(--mono); padding: 5px 9px; border-radius: var(--r-xs);
  border: 1px solid var(--line); color: var(--ink-2); background: var(--surface-2);
  font-variant-numeric: tabular-nums;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.chip.bad { color: var(--err); border-color: var(--err-line); background: var(--err-soft); }
.chip.bad::before { background: var(--err); }
.chip.cf::before { background: var(--ok); }
.user-chip { display: flex; align-items: center; gap: 6px; }

/* ---------------- Buttons & Form Controls (Midday / Geist) ---------------- */
.btn {
  font: inherit; font-size: 12.5px; font-weight: 500; min-height: 32px; padding: 6px 12px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--ink);
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--t), border-color var(--t), color var(--t), opacity var(--t);
}
.btn:hover:not(:disabled) { border-color: var(--line-hover); background: var(--surface-3); }
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.primary, .btn.primary.cyber {
  background: var(--accent); border-color: var(--accent); color: var(--accent-inv);
  font-weight: 600;
}
.btn.primary:hover:not(:disabled), .btn.primary.cyber:hover:not(:disabled) {
  opacity: 0.88; background: var(--accent); border-color: var(--accent);
}
.btn.primary:disabled {
  opacity: 0.35; background: var(--surface-3); border-color: var(--line); color: var(--muted);
}

.btn.danger { color: var(--err); border-color: var(--err-line); background: var(--err-soft); }
.btn.danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.18); border-color: var(--err); }
.btn.block { width: 100%; min-height: 40px; font-size: 13.5px; font-weight: 600; border-radius: var(--r-sm); }
.btn.sm { min-height: 28px; padding: 4px 10px; font-size: 12px; border-radius: var(--r-xs); }
.btn.icon { width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: var(--r-sm); }

.link {
  border: 0; background: none; color: var(--ink); font: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; padding: 3px 6px; border-radius: var(--r-xs); text-decoration: underline;
  text-decoration-color: var(--line-strong); text-underline-offset: 3px;
}
.link:hover { background: var(--surface-3); text-decoration-color: var(--ink); }

textarea, input[type=number], input[type=text], input[type=email], input[type=password], input[type=search], select {
  width: 100%; font: inherit; font-size: 13px; color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 7px 10px; min-height: 34px;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
textarea { resize: vertical; line-height: 1.5; }
textarea::placeholder, input::placeholder { color: var(--muted); }
textarea:hover, input:hover, select:hover { border-color: var(--line-hover); }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--ink); background: var(--surface-solid);
  box-shadow: 0 0 0 1px var(--ink);
}
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}

/* ---------------- Studio Split Layout (Trigger.dev Control Plane) ---------------- */
.layout { display: grid; grid-template-columns: minmax(360px, 410px) 1fr; flex: 1; min-height: 0; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.sidebar form { overflow-y: auto; padding: 14px 16px 20px; flex: 1; }
.workspace {
  padding: 20px clamp(16px, 2.5vw, 32px) 48px;
  display: flex; flex-direction: column; gap: 16px; min-width: 0; overflow-y: auto;
}
.workspace > * { width: 100%; max-width: 1480px; margin-inline: auto; }

@media (max-width: 960px) {
  body.studio-page { height: auto; overflow: auto; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar form { overflow: visible; }
  .workspace { overflow: visible; }
}

/* ---------------- Mode Tabs & Input Groups ---------------- */
.mode-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 12px 16px 0; padding: 3px;
  background: var(--bg); border-radius: var(--r-md); border: 1px solid var(--line);
}
.mode-tabs button {
  font: inherit; font-size: 12.5px; font-weight: 500; min-height: 32px; border: 1px solid transparent;
  border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer;
  transition: all var(--t);
}
.mode-tabs button:hover { color: var(--ink); }
.mode-tabs button[aria-selected="true"] {
  background: var(--surface-3); color: var(--ink); border-color: var(--line-strong);
}

.mode-mini {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px;
  background: var(--bg); border-radius: var(--r-sm); margin-bottom: 10px; border: 1px solid var(--line);
}
.mini-tab {
  font: inherit; font-size: 11.5px; font-weight: 500; padding: 5px 8px; border: 1px solid transparent;
  border-radius: var(--r-xs); background: transparent; color: var(--muted); cursor: pointer;
  transition: all var(--t);
}
.mini-tab[aria-checked="true"] {
  background: var(--surface-3); color: var(--ink); border-color: var(--line-strong);
}

.group {
  padding: 13px 14px; margin-bottom: 10px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--t);
}
.group:focus-within { border-color: var(--line-hover); }
.group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.group-title { font-weight: 600; font-size: 13px; flex: 1; color: var(--ink); }
.group-head .small {
  font: 500 11px/1 var(--mono); padding: 3px 7px; border-radius: var(--r-xs);
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.num {
  width: 20px; height: 20px; border-radius: var(--r-xs);
  background: var(--surface-3); color: var(--ink-2);
  font: 600 11px/1 var(--mono); display: grid; place-items: center; flex: none;
  border: 1px solid var(--line-strong);
}
.hint { font-size: 12px; color: var(--muted); margin-bottom: 9px; line-height: 1.5; }
.hint b { color: var(--ink-2); font-weight: 500; }
label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.field-label { display: block; margin: 9px 0 4px; }
.fields { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.fields label { display: block; margin: 8px 0 4px; }
.prefix-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; margin-top: 10px; }
.prefix-row label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; }
.badge {
  font: 500 10.5px/1 var(--mono); padding: 3px 6px; border-radius: var(--r-xs);
  background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); margin-left: 4px;
}

details > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  padding: 5px 0; list-style: none; display: flex; align-items: center; gap: 6px;
}
details > summary:hover { color: var(--ink); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; font-size: 10px; color: var(--muted); transition: transform var(--t); }
details[open] > summary::before { transform: rotate(90deg); color: var(--ink); }

/* ---------------- Upload Grids ---------------- */
.refs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.scene-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scene-grid .ref { aspect-ratio: 9/16; }
.ref-wrap { position: relative; }
.ref {
  position: relative; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: var(--bg);
  color: var(--muted); font: inherit; font-size: 11px; font-weight: 500; cursor: pointer; text-align: center;
  transition: border-color var(--t), background var(--t), color var(--t);
}
.ref:hover, .ref.drag { border-color: var(--ink); background: var(--surface-3); color: var(--ink); }
.ref.filled { border: 1px solid var(--line-strong); border-style: solid; }
.ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref .tag {
  position: absolute; left: 4px; bottom: 4px; padding: 2px 5px; border-radius: var(--r-xs);
  background: rgba(9, 9, 11, 0.85); color: #fafafa; font: 600 10px/1 var(--mono);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.ref-remove {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: var(--r-xs); border: 0;
  background: rgba(9, 9, 11, 0.85); color: #fafafa; cursor: pointer; font-size: 10px; display: grid; place-items: center;
  opacity: 0; transition: opacity var(--t), background var(--t);
}
.ref-wrap:hover .ref-remove, .ref-remove:focus-visible { opacity: 1; }
.ref-remove:hover { background: var(--err); }
.refs-toggle { margin-top: 6px; }

/* ---------------- Model Picker & Switches ---------------- */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.seg {
  position: relative; text-align: left; border: 1px solid var(--line-strong); background: var(--bg);
  border-radius: var(--r-sm); padding: 8px 10px 8px 28px; min-height: 48px; cursor: pointer;
  font: inherit; color: var(--ink); transition: border-color var(--t), background var(--t);
}
.seg:hover { border-color: var(--line-hover); background: var(--surface-2); }
.seg::before {
  content: ""; position: absolute; left: 10px; top: 12px; width: 10px; height: 10px;
  border-radius: 50%; border: 1.5px solid var(--muted);
}
.seg[aria-checked="true"] { border-color: var(--ink); background: var(--surface-3); }
.seg[aria-checked="true"]::before { border: 3.5px solid var(--ink); background: var(--bg); }
.seg b { display: block; font-size: 12.5px; font-weight: 600; }
.seg span { font: 400 11px/1.2 var(--mono); color: var(--muted); }
.seg .warn { color: var(--err); }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 7px; margin-top: 10px; }
.settings label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; }

.switch {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; padding: 8px 10px; cursor: pointer; border-radius: var(--r-sm);
  background: var(--bg); border: 1px solid var(--line);
}
.switch:hover { border-color: var(--line-strong); }
.switch > span { flex: 1; font-size: 12px; color: var(--ink); line-height: 1.35; }
.switch > span .muted { display: block; font-size: 11px; }
.switch input {
  flex: none; appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer;
  width: 34px; height: 18px; border-radius: var(--r-full);
  background: var(--surface-3); border: 1px solid var(--line-strong);
  background-image: radial-gradient(circle at 8px 50%, var(--muted) 5.5px, transparent 6px);
  background-repeat: no-repeat; background-position: 0 0; transition: all var(--t);
}
.switch input:checked {
  background-color: var(--accent); border-color: var(--accent);
  background-image: radial-gradient(circle at 8px 50%, var(--accent-inv) 5.5px, transparent 6px);
  background-position: 16px 0;
}

.run-bar { padding: 12px 16px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.run-bar .hint { min-height: 1.3em; margin-bottom: 8px; }
.run-bar .hint.warn { color: var(--warn); }

/* ---------------- Telemetry Progress Card & Stepper (Trigger.dev) ---------------- */
.progress-card, .seo-card, .review, .panel-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow-1);
}
.progress-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.progress-head h2 { font-size: 15.5px; font-weight: 600; }
.progress-head p { font-size: 12.5px; margin-top: 2px; color: var(--muted); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.stepper { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0; margin: 14px 0; counter-reset: st; }
.stepper li {
  counter-increment: st; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center;
  padding: 9px 11px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line);
}
.stepper .dot {
  grid-row: span 2; width: 24px; height: 24px; border-radius: var(--r-xs); display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); font: 600 11px/1 var(--mono); position: relative;
  border: 1px solid var(--line-strong);
}
.stepper .dot::before { content: counter(st); }
.stepper .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.stepper .sub { font: 400 11px/1.3 var(--mono); color: var(--muted); min-height: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper li.run { border-color: var(--run-line); background: var(--run-soft); }
.stepper li.run .dot { background: var(--run); color: #09090b; border-color: var(--run); }
.stepper li.run .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 7px;
  border: 1.5px solid transparent; border-top-color: var(--run); animation: spin 0.9s linear infinite;
}
.stepper li.ok { border-color: var(--ok-line); }
.stepper li.ok .dot { background: var(--ok); color: #09090b; border-color: var(--ok); }
.stepper li.ok .dot::before { content: "✓"; font-size: 12px; }
.stepper li.err { border-color: var(--err-line); background: var(--err-soft); }
.stepper li.err .dot { background: var(--err); color: #fafafa; border-color: var(--err); }
.stepper li.err .dot::before { content: "!"; }
.stepper li.wait { border-color: rgba(245, 158, 11, 0.35); background: var(--warn-soft); }
.stepper li.wait .dot { background: var(--warn); color: #09090b; border-color: var(--warn); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1080px) { .stepper { grid-template-columns: 1fr 1fr; } }

.bar { height: 4px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 320ms var(--ease); }

.alert {
  margin-top: 12px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--r-sm); background: var(--err-soft); color: var(--err);
  font-size: 12.5px; border: 1px solid var(--err-line); border-left: 3px solid var(--err);
}

.review { border-color: var(--line-hover); }
.review textarea { margin: 10px 0; font-family: var(--mono); font-size: 12px; }

/* ---------------- Result Cards Grid ---------------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-title { font-size: 15.5px; font-weight: 600; }
.accent-bar { display: flex; align-items: center; gap: 8px; background: var(--surface-2); padding: 4px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.accent-bar input[type=color] { width: 22px; height: 22px; border: 0; padding: 0; background: none; cursor: pointer; }

.empty {
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 44px 24px;
  text-align: center; color: var(--muted); background: var(--surface);
}
.empty-title { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.empty-sub { font-size: 13px; margin-bottom: 20px; }
.empty ol {
  list-style: none; counter-reset: es; display: grid; grid-template-columns: repeat(3, minmax(0, 220px));
  justify-content: center; gap: 10px; margin: 0; padding: 0; text-align: left; font-size: 12.5px;
}
.empty ol li { counter-increment: es; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink-2); }
.empty ol li::before {
  content: "0" counter(es); display: inline-block; margin-bottom: 6px;
  font: 600 10.5px/1 var(--mono); padding: 2px 6px; border-radius: var(--r-xs);
  background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-strong);
}
@media (max-width: 640px) { .empty ol { grid-template-columns: 1fr; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 14px; }
.grid.etsy-grid { grid-template-columns: repeat(auto-fill, minmax(276px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column; transition: border-color var(--t), box-shadow var(--t);
}
.card:hover { border-color: var(--line-hover); box-shadow: var(--shadow-2); }
.card.err { border-color: var(--err-line); }
.thumb { position: relative; aspect-ratio: 9/16; background: var(--bg); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.etsy-grid .thumb { aspect-ratio: 1/1; }
.thumb button.view { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.etsy-grid .thumb:not(.is-mockup) img { object-fit: contain; background: #fff; }
.thumb .orig { position: absolute; right: 8px; bottom: 8px; width: 28%; height: auto; border: 1.5px solid #fff; border-radius: var(--r-xs); box-shadow: var(--shadow-3); pointer-events: none; }
.thumb .state { padding: 16px; text-align: center; font-size: 12.5px; color: var(--muted); }
.thumb .state.err { color: var(--err); font-size: 12px; }
.thumb.loading::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.05) 50%, transparent 65%);
  background-size: 250% 100%; animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }

.pill {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font: 600 10px/1 var(--mono); letter-spacing: 0.03em; padding: 4px 7px; border-radius: var(--r-xs);
  background: rgba(9, 9, 11, 0.82); color: #fafafa; border: 1px solid rgba(255, 255, 255, 0.16);
}
.pill.run { background: var(--run); color: #09090b; border-color: var(--run); }
.pill.err { background: var(--err); color: #fafafa; border-color: var(--err); }
.pill.menu { background: var(--accent); color: var(--accent-inv); border-color: var(--accent); }

.card-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-title b { font-size: 13px; font-weight: 600; }
.card-title span { font: 400 11px/1.2 var(--mono); color: var(--muted); text-align: right; }
.scene { font-size: 12px; color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card textarea { font-size: 11.5px; margin-top: 4px; font-family: var(--mono); }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.card-actions .btn { flex: 1 1 auto; }
.card-actions .dl { background: var(--accent); border-color: var(--accent); color: var(--accent-inv); font-weight: 600; }
.card-actions .dl:hover { opacity: 0.88; }

.ref-select { font-size: 11px; padding: 2px 22px 2px 6px; min-height: 0; width: auto; }
.quickfix { display: flex; gap: 6px; }
.quickfix input { flex: 1; min-width: 0; min-height: 28px; padding: 4px 8px; font-size: 12px; }
.menu-tweaks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.menu-tweaks input[type=text] { min-height: 28px; padding: 3px 7px; font-size: 12px; width: auto; flex: 1 1 110px; }
.menu-tweaks select { min-height: 28px; padding: 3px 24px 3px 7px; font-size: 12px; width: auto; }

.attempts { display: flex; gap: 4px; flex-wrap: wrap; }
.att-btn {
  font: 500 11px/1 var(--mono); padding: 4px 7px; border-radius: var(--r-xs);
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink-2); cursor: pointer;
}
.att-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-inv); }

.qa { font-size: 12px; border-radius: var(--r-sm); padding: 6px 10px; border: 1px solid transparent; }
.qa summary { font-weight: 600; padding: 0; color: inherit; }
.qa ul { margin: 6px 0 2px; padding-left: 18px; }
.qa-pass, .qa-fixed { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.qa-review { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }

/* ---------------- SEO & Mapping ---------------- */
.seo-grid { display: grid; gap: 14px; margin-top: 12px; }
.seo-field { display: grid; gap: 6px; }
.seo-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seo-head b { flex: 1; font-size: 13px; }
.count-pill { font: 500 11px/1 var(--mono); padding: 3px 7px; border-radius: var(--r-xs); background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
.count-pill.over { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }
.tags-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { font: 400 11.5px/1 var(--mono); padding: 4px 8px; border-radius: var(--r-xs); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.tag-chip.over { border-color: var(--err-line); color: var(--err); background: var(--err-soft); }

/* ---------------- Details, Memory, Taskbar, Votes ---------------- */
.details-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.details-group > details { padding: 8px 16px; border-bottom: 1px solid var(--line); }
.details-group > details:last-child { border-bottom: 0; }
pre {
  white-space: pre-wrap; word-break: break-word; font: 12px/1.6 var(--mono); color: var(--ink-2);
  background: var(--bg); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--r-sm);
  max-height: 340px; overflow: auto; margin: 6px 0 10px;
}
.mem-list { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.mem-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); }
.mem-list li .mem-text { flex: 1; }
.mem-list li .mem-meta { display: block; color: var(--muted); font: 400 11px/1.3 var(--mono); margin-top: 3px; }
.mem-list li .mem-type { font-weight: 600; }
.mem-list li .mem-type.avoid { color: var(--err); } .mem-list li .mem-type.works { color: var(--ok); }

.taskbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.task-vote { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-note { flex: 1 1 100%; display: grid; gap: 4px; font-size: 12px; }
.vbtn {
  font: inherit; font-size: 12px; font-weight: 500; min-height: 28px; padding: 3px 10px;
  border-radius: var(--r-xs); border: 1px solid var(--line-strong); background: var(--bg);
  color: var(--ink-2); cursor: pointer; transition: all var(--t);
}
.vbtn:hover { border-color: var(--line-hover); color: var(--ink); }
.vbtn.v-pass[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #09090b; font-weight: 600; }
.vbtn.v-fail[aria-pressed="true"] { background: var(--err); border-color: var(--err); color: #fafafa; font-weight: 600; }
.vote { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vote .vbtn { flex: 1 1 auto; }
.vote-lbl { font: 500 10.5px/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------------- Lightbox ---------------- */
.lightbox {
  position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(9, 9, 11, 0.94);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 48px 72px 80px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-md); border: 1px solid var(--line-strong); box-shadow: var(--shadow-3); }
.lb-btn {
  position: absolute; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink);
  width: 40px; height: 40px; border-radius: var(--r-sm); cursor: pointer; display: grid; place-items: center;
}
.lb-btn:hover { background: var(--surface-3); border-color: var(--line-hover); }
.lb-btn svg { width: 18px; height: 18px; }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-compare {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink);
  font: inherit; font-size: 12px; font-weight: 500; padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer;
}
.lb-compare[aria-pressed="true"] { background: var(--accent); color: var(--accent-inv); border-color: var(--accent); }
.lb-caption {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: var(--ink-2); font: 400 12.5px/1.3 var(--mono); padding: 7px 14px;
  border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); text-align: center;
}

/* ---------------- Hub / Dashboard / Tables (Midday + OpenPanel) ---------------- */
.page-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px clamp(16px, 2.5vw, 32px) 60px; display: grid; gap: 20px; }

.hero-banner {
  position: relative; overflow: hidden; padding: 28px 30px; border-radius: var(--r-lg);
  background: var(--surface);
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.hero-banner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--surface) 38%, transparent 100%);
}
.hero-banner > * { position: relative; z-index: 1; }
.hero-banner h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 600; letter-spacing: -0.03em; margin-bottom: 8px; }
.hero-banner p { color: var(--ink-2); max-width: 660px; font-size: 13.5px; line-height: 1.6; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi {
  padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line); transition: border-color var(--t);
}
.kpi:hover { border-color: var(--line-strong); }
.kpi .lbl { font: 500 11px/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi .val { font: 600 28px/1.15 var(--display); margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.agent-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.agent-card {
  padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit;
  transition: border-color var(--t), background var(--t);
}
.agent-card:hover { border-color: var(--line-hover); background: var(--surface-2); }
.agent-card .tag-pill {
  align-self: flex-start; font: 500 10.5px/1 var(--mono); letter-spacing: 0.05em;
  padding: 4px 8px; border-radius: var(--r-xs);
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; gap: 6px;
}
.agent-card .tag-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.agent-card.is-etsy .tag-pill::before { background: var(--warn); }
.agent-card h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.agent-card ul { margin: 0; padding-left: 16px; color: var(--ink-2); font-size: 13px; display: grid; gap: 5px; }
.agent-card .go {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.agent-card:hover .go span:last-child { transform: translateX(3px); }
.agent-card .go span:last-child { transition: transform var(--t); }

.tbl-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th {
  font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); background: var(--surface-2);
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--surface-2); }

/* ---------------- Auth Modal Overlay ---------------- */
.auth-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 20px;
  background-color: var(--bg);
  background-image: var(--bg-grid);
  background-size: 24px 24px;
}
.auth-card {
  width: min(400px, 100%); display: grid; gap: 14px; padding: 28px 26px 24px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
}
.auth-card h1 { font-size: 19px; font-weight: 600; letter-spacing: -0.025em; }
.auth-card form { display: grid; gap: 10px; }
.auth-card label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.auth-err { color: var(--err); font-size: 12.5px; min-height: 1.3em; }
