/* =========================================================================
   Oikos — Design System
   ========================================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #06080d;
  --surface: #0c1118;
  --surface-2: #11161f;
  --surface-3: #161c27;
  --border: #1a2130;
  --border-strong: #28324a;
  --text: #e6edf7;
  --text-strong: #ffffff;
  --muted: #7c8aa2;
  --muted-2: #525d75;
  --accent: #4f7cff;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  --r-sm: 7px;
  --r: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-md: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.02);
  --sh-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --glow: 0 0 0 3px rgba(79, 124, 255, 0.18);

  --font: "Inter", system-ui, -apple-system, "Segoe UI Variable", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(79, 124, 255, 0.10), transparent 55%),
    radial-gradient(900px 500px at -10% 110%, rgba(139, 92, 246, 0.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "tnum" 0;
}
a { color: #93b4ff; text-decoration: none; }
a:hover { color: #b7ccff; }
button { font: inherit; }

/* =========================================================================
   App shell
   ========================================================================= */

.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.005));
  border-right: 1px solid var(--border);
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.brand .logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 6px 18px rgba(79, 124, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand .name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.brand .sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 10px;
  flex: 1;
  overflow-y: auto;
}
.nav-section {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 12px 6px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 120ms ease, color 120ms ease;
  position: relative;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(79, 124, 255, 0.14), rgba(79, 124, 255, 0.04));
  color: var(--text-strong);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.nav-item.active svg { color: var(--accent); opacity: 1; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.status-pills { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- Topbar --- */
.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 11, 17, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar .crumb { min-width: 0; }
.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .crumb-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .toolbar {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* --- Page --- */
.page {
  padding: 24px 32px 80px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.section-title {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin: 22px 4px 10px;
}
.section-title:first-child { margin-top: 4px; }

.grid2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
}
@media (max-width: 980px) { .grid2 { grid-template-columns: 1fr; } }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* =========================================================================
   Cards
   ========================================================================= */

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.012), transparent), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--sh-sm);
  position: relative;
  overflow: hidden;
}
.card + .card { margin-top: 14px; }

.card.is-interactive {
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease,
    box-shadow 150ms ease, background 150ms ease;
}
.card.is-interactive:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}
.card .h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.card .meta {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
}
.card .desc {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
}
.card .actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

/* =========================================================================
   Buttons
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--r-sm);
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background 120ms ease, border-color 120ms ease,
    transform 80ms ease, box-shadow 120ms ease;
  white-space: nowrap;
}
.btn:hover { background: #1c2333; border-color: #2f3a55; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn svg { width: 14px; height: 14px; }
.btn--primary {
  background: linear-gradient(180deg, #5b86ff, #4267e8);
  border-color: rgba(79, 124, 255, 0.5);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 16px rgba(79, 124, 255, 0.28);
}
.btn--primary:hover {
  background: linear-gradient(180deg, #6b94ff, #4f7cff);
  border-color: rgba(79, 124, 255, 0.7);
}
.btn--success {
  background: linear-gradient(180deg, #10b981, #0ea271);
  border-color: rgba(16, 185, 129, 0.5);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn--success:hover { background: #0ea271; }
.btn--danger {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  border-color: rgba(239, 68, 68, 0.5);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn--danger:hover { background: #dc2626; }
.btn--warn { background: var(--warn); border-color: rgba(245, 158, 11, 0.5); color: #1a1206; }
.btn--ghost { background: transparent; }
.btn--sm { padding: 5px 10px; font-size: 12px; gap: 5px; }
.btn--icon { padding: 7px; }

/* =========================================================================
   Forms
   ========================================================================= */

.field { display: grid; gap: 6px; margin-bottom: 10px; }
.field label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-weight: 500;
  text-transform: uppercase;
}
.input, textarea, select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--glow);
}
textarea {
  resize: vertical;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.check input {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  position: relative;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.file-input {
  display: inline-flex;
  padding: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
  width: 100%;
  cursor: pointer;
}

/* =========================================================================
   Pills / badges
   ========================================================================= */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid transparent;
  text-transform: capitalize;
  white-space: nowrap;
  line-height: 1;
}
.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}
.pill.is-live .pill-dot {
  animation: pulse-dot 1.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.35); }
}
.pill--pending { color: var(--muted); }
.pill--running,
.pill--live {
  color: #93b4ff;
  background: rgba(79, 124, 255, 0.12);
  border-color: rgba(79, 124, 255, 0.25);
}
.pill--waiting_approval,
.pill--waiting_takeover,
.pill--waiting {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
}
.pill--success,
.pill--done,
.pill--completed {
  color: #34d399;
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.22);
}
.pill--failed,
.pill--error {
  color: #f87171;
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.22);
}
.pill--skipped,
.pill--cancelled {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}
.pill--info {
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.10);
  border-color: rgba(6, 182, 212, 0.22);
}
.pill--risk {
  color: #fda4af;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.20);
}
.pill--mock {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.10);
  border-color: rgba(139, 92, 246, 0.22);
}
.pill--claude {
  color: #fbbf77;
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.25);
}
.pill--accent {
  color: #93b4ff;
  background: rgba(79, 124, 255, 0.08);
  border-color: rgba(79, 124, 255, 0.22);
}
.pill svg { width: 11px; height: 11px; }

/* =========================================================================
   Banner (approval / takeover)
   ========================================================================= */

.banner {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--r);
  border: 1px solid;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  animation: banner-in 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes banner-in {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(800px 200px at 0% 0%, currentColor, transparent 60%);
  opacity: 0.05;
  pointer-events: none;
}
.banner--approval {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.04);
  color: var(--warn);
}
.banner--takeover {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.04);
  color: var(--accent-2);
}
.banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
}
.banner-icon svg { width: 24px; height: 24px; }
.banner-body { align-self: center; color: var(--text); min-width: 0; }
.banner-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
}
.banner-text {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}
.banner-actions {
  align-self: center;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================================
   Step timeline
   ========================================================================= */

.timeline { position: relative; padding: 4px 0 4px 32px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 18px;
  bottom: 14px;
  width: 1.5px;
  background: linear-gradient(180deg, var(--border-strong), var(--border));
}
.tl-item {
  position: relative;
  padding: 9px 0;
}
.tl-dot {
  position: absolute;
  left: -28px;
  top: 12px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.tl-dot svg { width: 11px; height: 11px; }
.tl-item.is-running .tl-dot {
  background: var(--accent);
  border-color: rgba(79, 124, 255, 0.4);
  color: white;
  animation: pulse-ring 1.6s ease-out infinite;
}
.tl-item.is-waiting .tl-dot {
  background: var(--warn);
  border-color: rgba(245, 158, 11, 0.4);
  color: #1a1206;
  animation: pulse-ring-amber 1.6s ease-out infinite;
}
.tl-item.is-done .tl-dot {
  background: var(--success);
  border-color: rgba(16, 185, 129, 0.4);
  color: white;
}
.tl-item.is-failed .tl-dot {
  background: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
  color: white;
}
.tl-item.is-skipped .tl-dot {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--muted-2);
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(79, 124, 255, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(79, 124, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 124, 255, 0); }
}
@keyframes pulse-ring-amber {
  0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
.tl-title {
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tl-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  font-family: var(--mono);
}
.tl-sub code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--text);
  border: 1px solid var(--border);
}
.tl-reason {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 4px;
}

/* =========================================================================
   Recording detail — captured-step screenshots with cursor + click marker
   ========================================================================= */

.timeline--rec .tl-item { padding: 12px 0; }
.rec-detail { color: var(--muted); font-size: 13px; }

/* Per-step delete: pushed to the right. Always legible in light + dark (explicit
   danger colour overrides the btn--danger white-on-transparent that vanished in
   light mode); dims slightly when its step isn't hovered, never fully hidden. */
.tl-del {
  margin-left: auto;
  padding: 5px;
  line-height: 0;
  color: var(--danger);
  background: transparent;
  border: 1px solid transparent;
  opacity: 0.6;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease,
    border-color 0.12s ease;
}
.tl-del svg { width: 13px; height: 13px; }
.timeline--rec .tl-item:hover .tl-del,
.tl-del:focus-visible { opacity: 1; }
.tl-del:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

/* Screenshot framed so the absolutely-positioned marker is relative to it. */
.shot {
  position: relative;
  display: inline-block;
  margin-top: 10px;
  max-width: 560px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  line-height: 0;
  background: var(--surface-2);
}
.shot > img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

/* Marker group anchored at the recorded click point (left/top set inline). */
.click-fx {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 2;
}
/* Expanding ring — the "click effect". */
.click-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 2px solid rgba(79, 124, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(8, 12, 24, 0.45);
  animation: click-ripple 1.8s ease-out infinite;
}
/* Solid centre dot marking the exact point. */
.click-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(8, 12, 24, 0.55), 0 1px 3px rgba(0, 0, 0, 0.4);
}
/* Mouse pointer; its tip (top-left of the SVG) anchors at the point. */
.cursor-ptr {
  position: absolute;
  left: -3px;
  top: -2px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}
@keyframes click-ripple {
  0%   { transform: scale(0.4); opacity: 0.9; }
  70%  { transform: scale(3.4); opacity: 0; }
  100% { transform: scale(3.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .click-ring { animation: none; opacity: 0.8; }
}

/* =========================================================================
   Audit log
   ========================================================================= */

.log { border-top: 1px solid var(--border); }
.log-row {
  display: grid;
  grid-template-columns: 78px 156px 1fr auto;
  gap: 14px;
  padding: 9px 8px;
  font-size: 12.5px;
  align-items: start;
  border-bottom: 1px solid var(--border);
  transition: background 100ms ease;
}
.log-row:hover { background: rgba(255, 255, 255, 0.015); }
.log-time {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 11px;
  padding-top: 2px;
}
.log-kind {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  padding-top: 2px;
}
.log-kind .pill { padding: 2px 7px; font-size: 10px; }
.log-msg { color: var(--text); min-width: 0; word-break: break-word; }
.log-msg code {
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid var(--border);
}
.log-shots { display: flex; gap: 6px; align-items: flex-start; }
.log-shots img {
  height: 44px;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform 100ms ease, border-color 100ms ease;
}
.log-shots img:hover {
  transform: scale(1.04);
  border-color: var(--accent);
}

/* =========================================================================
   Metrics
   ========================================================================= */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metric .l {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.metric .v {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  font-feature-settings: "tnum" 1;
}

/* =========================================================================
   Empty / skeleton
   ========================================================================= */

.empty {
  text-align: center;
  padding: 64px 24px 32px;
  color: var(--muted);
}
.empty .empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.empty .empty-icon svg { width: 28px; height: 28px; }
.empty h3 { color: var(--text-strong); margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.empty p { margin: 0 auto; font-size: 13px; max-width: 460px; line-height: 1.6; }
.empty .kbd {
  font-family: var(--mono);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text);
}

.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    var(--surface-3) 50%,
    var(--surface-2) 100%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card { height: 110px; border-radius: var(--r); }

/* =========================================================================
   Lightbox
   ========================================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 8, 0.88);
  display: grid;
  place-items: center;
  padding: 48px;
  z-index: 50;
  animation: fade-in 160ms ease-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: var(--sh-lg);
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  color: white;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background 160ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 160ms ease;
}
.lightbox-close svg { width: 18px; height: 18px; }
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
  transform: rotate(90deg);
}
.lightbox-close:active { transform: scale(0.9); }
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =========================================================================
   Modal (manage-subscription + generic confirm dialogs)
   ========================================================================= */

.modal-card {
  position: relative;
  padding: 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(79, 124, 255, 0.07), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 140px),
    var(--surface);
  box-shadow: var(--sh-lg);
  animation: modal-pop 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease,
    border-color 150ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-close svg { width: 17px; height: 17px; }
.modal-close:hover {
  background: var(--surface-3);
  color: var(--text-strong);
  border-color: var(--border);
  transform: rotate(90deg);
}
.modal-close:active { transform: scale(0.9); }

.modal-head {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding-right: 38px;
  margin-bottom: 18px;
}
.modal-head-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.18), rgba(139, 92, 246, 0.13));
  border: 1px solid rgba(79, 124, 255, 0.26);
}
.modal-head-icon svg { width: 19px; height: 19px; }
.modal-head-text { min-width: 0; }
.modal-title {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.modal-sub {
  margin: 5px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.modal-sub strong { color: var(--text); font-weight: 600; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Subdued danger button — visible intent without shouting red */
.btn--quiet-danger { color: #ef6b6b; }
.btn--quiet-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ff8585;
}

/* =========================================================================
   Toasts
   ========================================================================= */

.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  box-shadow: var(--sh-md);
  animation: toast-in 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.is-success { border-color: rgba(16, 185, 129, 0.4); }
.toast.is-error { border-color: rgba(239, 68, 68, 0.4); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast.is-success svg { color: var(--success); }
.toast.is-error svg { color: var(--danger); }
@keyframes toast-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* =========================================================================
   Misc
   ========================================================================= */

.id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  font-feature-settings: "tnum" 1;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.strong { color: var(--text-strong); }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }

/* List rows (Runs list / Pilot runs) */
.list-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: border-color 120ms ease, transform 120ms ease,
    box-shadow 120ms ease;
  cursor: pointer;
}
.list-row + .list-row { margin-top: 8px; }
.list-row.has-actions { grid-template-columns: auto 1fr auto auto auto; }
.list-row:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}
.list-row .name { color: var(--text-strong); font-weight: 500; }
.list-row .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.list-row .right {
  text-align: right;
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--mono);
}


/* Progress bar */
.progress {
  width: 100%;
  height: 6px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}
.progress > .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 240ms ease;
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .topbar { padding: 14px 18px; }
  .page { padding: 18px; }
}

/* =========================================================================
   Theming — light mode + smooth transition
   ========================================================================= */

html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

body,
.sidebar,
.topbar,
.card,
.btn,
.input,
.metric,
.list-row,
.banner,
.pill,
.nav-item,
.stat,
.metric,
.icon-btn,
.chip,
.toast,
textarea,
select { transition: background-color 260ms ease, border-color 260ms ease, color 220ms ease; }

/* While the theme is switching, fade *everything* — colours, borders, shadows,
   icon fills — together for one smooth pass. The class is added on toggle and
   removed once the transition settles, so it never slows down hover states. */
html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition: background-color 320ms ease, border-color 320ms ease,
    color 280ms ease, fill 280ms ease, stroke 280ms ease,
    box-shadow 320ms ease, opacity 280ms ease !important;
}

/* --- Fancy toggle: gold circular reveal (View Transitions API, Chromium) ---
   toggleTheme() snapshots the page, flips the theme, then the NEW palette wipes
   in as a circle expanding from the toggle switch (origin + radius set as
   --vt-* on <html>). A gold drop-shadow rides the clip edge, so the wipe reads
   as an expanding gold ring. Browsers without the API fall back to .theme-anim;
   reduced-motion skips it entirely (handled in JS). */
@media (prefers-reduced-motion: no-preference) {
  html.theme-reveal::view-transition-old(root),
  html.theme-reveal::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }
  html.theme-reveal::view-transition-old(root) { z-index: 1; }
  html.theme-reveal::view-transition-new(root) {
    z-index: 2;
    animation: vt-gold-reveal 560ms cubic-bezier(0.22, 1, 0.36, 1);
    filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.7));
  }
  @keyframes vt-gold-reveal {
    from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 50%)); }
    to   { clip-path: circle(var(--vt-r, 150%) at var(--vt-x, 50%) var(--vt-y, 50%)); }
  }
}

[data-theme="light"] {
  /* Silver-&-gold light theme: cool near-white / silver surfaces with metallic
     GOLD as the single brand accent. Status colours (green/red/amber) are kept
     for meaning; everything else that was blue/purple is recoloured to gold so
     the whole app reads as one coordinated palette in light mode. */
  --bg: #eef0f5;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --surface-3: #e9ebf1;
  --border: #dce0e8;
  --border-strong: #c2c8d4;
  --text: #2a2e38;
  --text-strong: #16181f;
  --muted: #6b7180;
  --muted-2: #9aa0ad;

  /* Gold accent family (replaces the blue/purple/cyan trio). --accent is a
     deep, legible metallic gold for borders/icons/text-on-light; --accent-2 a
     brighter classic gold and --accent-3 a bronze, so var()-based gradients
     come out all-gold automatically. */
  --accent: #c79a2e;
  --accent-2: #d4af37;
  --accent-3: #a87913;

  --sh-sm: 0 1px 2px rgba(40, 33, 8, 0.05);
  --sh-md: 0 6px 20px rgba(40, 33, 8, 0.08), 0 0 0 1px rgba(40, 33, 8, 0.02);
  --sh-lg: 0 24px 56px rgba(40, 33, 8, 0.15);
  --glow: 0 0 0 3px rgba(199, 154, 46, 0.22);
}
[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 88% -12%, rgba(212, 175, 55, 0.10), transparent 55%),
    radial-gradient(900px 520px at -10% 110%, rgba(199, 154, 46, 0.06), transparent 55%),
    var(--bg);
}
[data-theme="light"] .topbar { background: rgba(242, 245, 250, 0.8); }
[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(16, 30, 54, 0.03), rgba(16, 30, 54, 0.012));
}
/* Plain (non-coloured) buttons: hover DARKENS so they gain contrast instead of
   washing into the page. Scoped with :not() so the primary/success/danger/warn
   variants keep their own colours on hover (a blanket .btn:hover would outrank
   them and turn them grey/near-white — that's what made them "disappear"). */
[data-theme="light"] .btn:not(.btn--primary):not(.btn--success):not(.btn--danger):not(.btn--warn):hover {
  background: #ccd6e4;
  border-color: #97a7bf;
}
[data-theme="light"] .btn--ghost { background: transparent; }
[data-theme="light"] .btn--ghost:not(.btn--danger):hover { background: rgba(16, 30, 54, 0.06); border-color: var(--border-strong); }
[data-theme="light"] .icon-btn:hover { background: #d2dbe7; }
[data-theme="light"] .pill { background: rgba(16, 30, 54, 0.05); }
/* Light-mode pill recolours: the base pill text colours are pale pastels tuned
   for dark surfaces (cyan #67e8f9, rose #fda4af, green #34d399 …). On the light
   grey pill background above they wash out, so swap in deeper, saturated tones
   for contrast. Colours only — no layout/behaviour change. */
[data-theme="light"] .pill--running,
[data-theme="light"] .pill--live {
  color: #8a6a12;
  background: rgba(199, 154, 46, 0.14);
  border-color: rgba(199, 154, 46, 0.34);
}
[data-theme="light"] .pill--waiting_approval,
[data-theme="light"] .pill--waiting_takeover,
[data-theme="light"] .pill--waiting {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.30);
}
[data-theme="light"] .pill--success,
[data-theme="light"] .pill--done,
[data-theme="light"] .pill--completed {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.30);
}
[data-theme="light"] .pill--failed,
[data-theme="light"] .pill--error {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.28);
}
[data-theme="light"] .pill--info {
  color: #0e7490;
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.30);
}
[data-theme="light"] .pill--risk {
  color: #be123c;
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(239, 68, 68, 0.26);
}
[data-theme="light"] .pill--mock {
  color: #6b6147;
  background: rgba(140, 120, 80, 0.13);
  border-color: rgba(140, 120, 80, 0.30);
}
[data-theme="light"] .pill--claude {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.30);
}
[data-theme="light"] .pill--accent {
  color: #8a6a12;
  background: rgba(199, 154, 46, 0.14);
  border-color: rgba(199, 154, 46, 0.34);
}
[data-theme="light"] .nav-item:hover { background: rgba(40, 33, 8, 0.05); }
[data-theme="light"] .nav-item.active {
  background: linear-gradient(90deg, rgba(199, 154, 46, 0.16), rgba(199, 154, 46, 0.04));
}
/* Tame the hero aurora and tint it gold so it matches the rest of light mode. */
[data-theme="light"] .home-hero .aurora {
  opacity: 0.28;
  filter: blur(80px);
  background:
    radial-gradient(40% 40% at 25% 30%, rgba(212, 175, 55, 0.55), transparent 60%),
    radial-gradient(36% 36% at 78% 28%, rgba(199, 154, 46, 0.45), transparent 60%),
    radial-gradient(40% 40% at 60% 80%, rgba(168, 121, 19, 0.40), transparent 60%);
}
[data-theme="light"] .home-hero {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(199, 154, 46, 0.05) 45%, transparent 70%), var(--surface);
}
/* Light-theme refinements: readable gold links, crisper card lift, softer modal. */
[data-theme="light"] a { color: #a87913; }
[data-theme="light"] a:hover { color: #c79a2e; }
[data-theme="light"] .card {
  box-shadow: 0 1px 2px rgba(16, 30, 54, 0.04), 0 5px 16px rgba(16, 30, 54, 0.05);
}
[data-theme="light"] .modal-card {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(212, 175, 55, 0.08), transparent 55%),
    var(--surface);
}
[data-theme="light"] .modal-head-icon {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(199, 154, 46, 0.12));
  border-color: rgba(199, 154, 46, 0.34);
}
[data-theme="light"] .theme-toggle { box-shadow: inset 0 1px 2px rgba(16, 30, 54, 0.1); }
[data-theme="light"] .plan-opt:hover { box-shadow: 0 6px 18px rgba(16, 30, 54, 0.1); }
[data-theme="light"] .btn--quiet-danger { color: #d83a3a; }
[data-theme="light"] .btn--quiet-danger:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #c42d2d;
}

/* ---- Light-mode gold coordination: every remaining blue/purple spot ----
   These targets hard-code blue/purple in the base (dark) styles, so they
   don't follow --accent. We re-skin them to gold *only* in light mode. White
   text on gold is illegible, so gold fills carry dark (#2a2008) text. */

/* Primary action button — gold fill, dark label. */
[data-theme="light"] .btn--primary {
  background: linear-gradient(180deg, #d9b545, #c0972a);
  border-color: rgba(199, 154, 46, 0.55);
  color: #2a2008;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 6px 16px rgba(199, 154, 46, 0.32);
}
[data-theme="light"] .btn--primary:hover {
  background: linear-gradient(180deg, #e3c156, #cea235);
  border-color: rgba(199, 154, 46, 0.75);
}

/* Card lift shadow, warmed to match gold. */
[data-theme="light"] .card {
  box-shadow: 0 1px 2px rgba(40, 33, 8, 0.04), 0 5px 16px rgba(40, 33, 8, 0.05);
}

/* Avatars + favicon fallback (var()-gradient is already gold — fix text/shadow). */
[data-theme="light"] .avatar,
[data-theme="light"] .side-account .avatar {
  color: #2a2008;
  box-shadow: 0 8px 20px rgba(199, 154, 46, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* Home stat icon tiles. */
[data-theme="light"] .stat .stat-ico {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(199, 154, 46, 0.12));
}

/* Takeover banner was purple — bronze keeps it distinct from the amber approval. */
[data-theme="light"] .banner--takeover {
  border-color: rgba(199, 154, 46, 0.45);
  background: rgba(199, 154, 46, 0.05);
  color: #8a6a12;
}

/* Step timeline — running dot + recorded click marker. */
[data-theme="light"] .tl-item.is-running .tl-dot {
  border-color: rgba(199, 154, 46, 0.45);
  color: #2a2008;
  animation: pulse-ring-gold 1.6s ease-out infinite;
}
[data-theme="light"] .click-ring { border-color: rgba(199, 154, 46, 0.95); }

/* Hero "record → automate" scene: gold shadows, gold scan sweep, dark labels. */
[data-theme="light"] .wb-submit { color: #2a2008; box-shadow: 0 6px 16px rgba(199, 154, 46, 0.32); }
[data-theme="light"] .wb-submit.is-sent { color: #fff; }
[data-theme="light"] .wb-badge { color: #2a2008; box-shadow: 0 6px 16px rgba(199, 154, 46, 0.4); }
[data-theme="light"] .wb-bot {
  box-shadow: 0 8px 20px rgba(199, 154, 46, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
[data-theme="light"] .wb-scan {
  background: linear-gradient(180deg, transparent, rgba(212, 175, 55, 0.22) 70%, rgba(199, 154, 46, 0.5));
  border-bottom-color: rgba(199, 154, 46, 0.9);
  box-shadow: 0 0 22px rgba(199, 154, 46, 0.5);
}

/* Info note on auth/upgrade screens (shares this stylesheet). */
[data-theme="light"] .auth-note {
  background: rgba(199, 154, 46, 0.10);
  border-color: rgba(199, 154, 46, 0.35);
}

/* Gold variant of the running-step pulse ring. */
@keyframes pulse-ring-gold {
  0%   { box-shadow: 0 0 0 0 rgba(199, 154, 46, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(199, 154, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(199, 154, 46, 0); }
}

/* =========================================================================
   Brand plate + theme toggle
   ========================================================================= */

.brand { flex-direction: column; align-items: stretch; gap: 9px; }
.brand-plate {
  background: transparent;
  padding: 2px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo { height: 150px; width: auto; max-width: 100%; display: block; object-fit: contain; }
.brand .sub {
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
}

.footer-row { display: flex; align-items: center; gap: 10px; }
.footer-row .status-pills { flex: 1; }
.theme-toggle {
  position: relative;
  width: 50px;
  height: 27px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: background 200ms ease, border-color 200ms ease;
}
/* Faint sun (left) + moon (right) etched into the track. The knob parks over
   the current mode, leaving the mode you'd switch *to* visible. */
.theme-toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 3v1.5M12 19.5V21M3 12h1.5M19.5 12H21M5.6 5.6l1 1M17.4 17.4l1 1M18.4 5.6l-1 1M6.6 17.4l-1 1'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 6px center, right 6px center;
  background-size: 13px 13px, 12px 12px;
}
.theme-toggle::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  z-index: 1;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 9px rgba(245, 158, 11, 0.4);
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), background 280ms ease,
    box-shadow 280ms ease;
}
.theme-toggle:hover { border-color: var(--accent); }
[data-theme="light"] .theme-toggle::before {
  transform: translateX(23px);
  background: linear-gradient(180deg, #ffffff, #c9ccd6);
  box-shadow: 0 2px 6px rgba(40, 33, 8, 0.22), 0 0 9px rgba(199, 154, 46, 0.4);
}

/* =========================================================================
   Page transitions
   ========================================================================= */

.page { animation: page-in 320ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { opacity: 0; animation: fade-up 560ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   Home / account
   ========================================================================= */

.home-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 46px 42px;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.10), rgba(139, 92, 246, 0.06) 45%, transparent 70%), var(--surface);
  box-shadow: var(--sh-md);
}
.home-hero .aurora {
  position: absolute;
  inset: -45%;
  z-index: 0;
  background:
    radial-gradient(40% 40% at 25% 30%, rgba(79, 124, 255, 0.55), transparent 60%),
    radial-gradient(36% 36% at 78% 28%, rgba(139, 92, 246, 0.45), transparent 60%),
    radial-gradient(40% 40% at 60% 80%, rgba(6, 182, 212, 0.40), transparent 60%);
  filter: blur(70px);
  opacity: 0.55;
  animation: aurora 20s linear infinite;
  pointer-events: none;
}
@keyframes aurora {
  0%   { transform: rotate(0deg) scale(1.05); }
  50%  { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1.05); }
}
.home-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}
@media (max-width: 820px) { .home-hero-grid { grid-template-columns: 1fr; } }

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.home-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(16,185,129,0.5); animation: pulse-ring 1.8s infinite; }
.home-title {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 16px 0 0;
  color: var(--text-strong);
}
.home-title .grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 45%, var(--accent-3));
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-pan 6s ease-in-out infinite;
}
@keyframes grad-pan {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.home-sub { color: var(--muted); font-size: 14.5px; margin: 14px 0 0; max-width: 540px; line-height: 1.6; }
.home-cta { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }

/* =========================================================================
   Hero animation — "record once → AI takes over" browser scene
   ========================================================================= */
.hero-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

/* Faux browser window */
.wb {
  width: 340px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--sh-lg), inset 0 0 0 1px rgba(255,255,255,0.02);
  overflow: hidden;
}
.wb-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
}
.wb-dot { width: 9px; height: 9px; border-radius: 50%; opacity: 0.9; }
.wb-dot--r { background: #ff5f57; }
.wb-dot--y { background: #febc2e; }
.wb-dot--g { background: #28c840; }
.wb-url {
  flex: 1;
  margin-left: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: -0.01em;
}
.wb-lock {
  width: 8px; height: 7px;
  border-radius: 2px;
  background: var(--muted-2);
  position: relative;
}
.wb-lock::before {
  content: "";
  position: absolute;
  left: 1.5px; top: -3px;
  width: 5px; height: 5px;
  border: 1.3px solid var(--muted-2);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

/* Window body — the cursor/bot/scan overlay coordinate space */
.wb-body {
  position: relative;
  padding: 20px;
  height: 232px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* Form fields */
.wf { position: relative; }
.wf-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.wf-box {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 13px;
  color: var(--text-strong);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.wf.is-focus .wf-box {
  border-color: var(--accent);
  box-shadow: var(--glow);
}
.wf.is-done .wf-box {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.16);
}
.wf-text { white-space: nowrap; overflow: hidden; }
.wf-caret {
  width: 1.5px;
  height: 15px;
  margin-left: 1px;
  background: var(--accent);
  opacity: 0;
}
.wf.is-focus .wf-caret { opacity: 1; animation: caret-blink 1s steps(1) infinite; }
.wf.is-done .wf-caret { display: none; }
@keyframes caret-blink { 50% { opacity: 0; } }

/* Per-field success checkmark */
.wf-tick {
  position: absolute;
  right: 9px;
  bottom: 8px;
  width: 19px; height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--success);
  transform: scale(0);
  transition: transform 0.35s cubic-bezier(.2,1.5,.4,1);
}
.wf-tick svg { width: 12px; height: 12px; stroke-width: 2.6; }
.wf.is-done .wf-tick { transform: scale(1); }

/* Submit button */
.wb-submit {
  margin-top: auto;
  position: relative;
  height: 38px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: default;
  box-shadow: 0 6px 16px rgba(79,124,255,0.32);
  transition: transform 0.12s ease, box-shadow 0.25s ease, background 0.3s ease;
  overflow: hidden;
}
.wb-submit.is-press { transform: scale(0.96); box-shadow: 0 2px 8px rgba(79,124,255,0.3); }
.wb-submit-on, .wb-submit-off {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.wb-submit-off { opacity: 0; transform: translateY(100%); }
.wb-submit-off svg { width: 15px; height: 15px; stroke-width: 2.6; }
.wb-submit.is-sent { background: linear-gradient(135deg, var(--success), #0ea5e9); }
.wb-submit.is-sent .wb-submit-on { opacity: 0; transform: translateY(-100%); }
.wb-submit.is-sent .wb-submit-off { opacity: 1; transform: translateY(0); }

/* Pointer cursor */
.wb-cursor {
  position: absolute;
  top: 0; left: 0;
  z-index: 6;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35));
  transform: translate(150px, 200px);
}
.wb-cursor.is-click svg { animation: cursor-tap 0.2s ease; }
@keyframes cursor-tap {
  40% { transform: scale(0.78); }
}
.wb-cursor.is-click::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: cursor-ripple 0.45s ease-out;
}
@keyframes cursor-ripple {
  from { transform: scale(0.4); opacity: 0.8; }
  to { transform: scale(3.2); opacity: 0; }
}

/* Learning scan sweep */
.wb-scan {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 46px;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(79,124,255,0.22) 70%, rgba(139,92,246,0.45));
  border-bottom: 1.5px solid rgba(139,92,246,0.9);
  box-shadow: 0 0 22px rgba(99,102,241,0.55);
}
.hero-scene.learning .wb-scan { opacity: 1; animation: scan-sweep 1.5s ease-in-out; }
@keyframes scan-sweep {
  0% { transform: translateY(-40px); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(210px); opacity: 0; }
}

/* "Automated" badge */
.wb-badge {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px rgba(79,124,255,0.4);
  transform: scale(0) translateY(-4px);
  transform-origin: top right;
  transition: transform 0.4s cubic-bezier(.2,1.5,.4,1);
}
.wb-badge svg { width: 12px; height: 12px; }
.wb-badge.show { transform: scale(1) translateY(0); }

/* AI bot */
.wb-bot {
  position: absolute;
  right: 16px;
  bottom: 56px;
  z-index: 5;
  width: 46px; height: 40px;
  border-radius: 13px;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(79,124,255,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
  opacity: 0;
  transform: scale(0.4) translateY(14px);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(.2,1.6,.4,1);
}
.wb-bot.show { opacity: 1; transform: scale(1) translateY(0); }
.wb-bot.show { animation: bot-bob 2.4s ease-in-out infinite 0.5s; }
@keyframes bot-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5px) rotate(2deg); }
}
.wb-bot-antenna {
  position: absolute;
  top: -9px; left: 50%;
  width: 2px; height: 8px;
  margin-left: -1px;
  background: var(--accent-2);
}
.wb-bot-antenna::before {
  content: "";
  position: absolute;
  top: -4px; left: -2px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 8px var(--accent-3);
}
.wb-bot-eye {
  position: absolute;
  top: 15px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
}
.wb-bot-eye:nth-of-type(2) { left: 11px; }
.wb-bot-eye:nth-of-type(3) { right: 11px; }
.wb-bot.think .wb-bot-eye { animation: bot-blink 1.1s ease-in-out infinite; }
.wb-bot.ready .wb-bot-eye {
  height: 4px;
  border-radius: 0 0 6px 6px;
  top: 18px;
}
@keyframes bot-blink { 45%, 55% { transform: scaleY(0.15); } }
.wb-bot-think {
  position: absolute;
  top: -16px; right: 40px;
  display: flex;
  gap: 3px;
  padding: 4px 6px;
  border-radius: 8px 8px 8px 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.wb-bot.think .wb-bot-think { opacity: 1; }
.wb-bot-think i {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: think-dot 1.2s ease-in-out infinite;
}
.wb-bot-think i:nth-child(2) { animation-delay: 0.2s; }
.wb-bot-think i:nth-child(3) { animation-delay: 0.4s; }
@keyframes think-dot {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* Tagline caption */
.scene-cap {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.01em;
  transition: color 0.4s ease, transform 0.4s ease;
}
.scene-cap b {
  font-weight: 700;
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.scene-cap.lit { color: var(--text-strong); transform: scale(1.04); }

@media (max-width: 820px) {
  .hero-scene { margin-top: 8px; }
}

/* Capability marquee */
.marquee {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; gap: 10px; width: max-content; animation: marquee 26s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.chip svg { width: 13px; height: 13px; color: var(--accent); }

/* Stat tiles with count-up */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.stat {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--sh-sm);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.stat:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--sh-md); }
.stat .stat-ico {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(79,124,255,0.18), rgba(139,92,246,0.12));
  color: var(--accent);
}
.stat .stat-ico svg { width: 17px; height: 17px; }
.stat .stat-v { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); font-feature-settings: "tnum" 1; }
.stat .stat-l { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Account card */
.account-card { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 20px; color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(79,124,255,0.35), inset 0 1px 0 rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.account-meta { min-width: 0; }
.account-name { font-weight: 600; font-size: 16px; color: var(--text-strong); }
.account-mail { color: var(--muted); font-size: 13px; font-family: var(--mono); }

/* =========================================================================
   Row actions (Runs list edit/delete)
   ========================================================================= */

.row-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 80ms ease;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--text-strong); border-color: var(--border-strong); background: var(--surface-3); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn.danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.list-row.removing { animation: row-out 260ms ease forwards; }
@keyframes row-out {
  to { opacity: 0; transform: translateX(18px); height: 0; padding-top: 0; padding-bottom: 0; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* =========================================================================
   Auth pages (login / signup) + plan picker
   ========================================================================= */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 30px 28px;
  animation: fade-up 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.auth-brand img { height: 62px; width: auto; }
/* Theme-aware logo swap: show the dark-theme logo only in dark mode. */
[data-theme="dark"] .logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
.auth-title {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 650;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  text-align: center;
}
.auth-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.auth-card .field { margin-bottom: 14px; }
.pw-reqs {
  list-style: none;
  margin: 8px 2px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pw-reqs li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.3;
  transition: color 0.15s ease;
}
.pw-req-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  font-size: 9px;
  line-height: 1;
  transition: all 0.15s ease;
}
.pw-reqs li.met {
  color: #4ade80;
}
.pw-reqs li.met .pw-req-icon {
  border-color: #4ade80;
  background: #4ade80;
  color: #0a0a0a;
}
.pw-reqs li.met .pw-req-icon::before {
  content: "✓";
}
.auth-submit { width: 100%; justify-content: center; margin-top: 6px; padding: 10px; }
.auth-alt {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

/* =========================================================================
   Settings page — calm single-column account console
   ========================================================================= */
.set-wrap {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Cards cascade in with a slight stagger (--d set per card in the markup). */
.set-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  position: relative;
  animation: set-in 420ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--d, 0) * 70ms);
}
@keyframes set-in {
  from { opacity: 0; transform: translateY(10px); }
}
@media (prefers-reduced-motion: reduce) {
  .set-card { animation: none; }
}

/* --- Identity hero ------------------------------------------------------- */
.set-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  overflow: hidden;
}
.set-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 150px at 0% 0%, rgba(79, 124, 255, 0.13), transparent 62%),
    radial-gradient(420px 150px at 100% 100%, rgba(139, 92, 246, 0.09), transparent 62%);
  pointer-events: none;
}
[data-theme="light"] .set-hero::before {
  /* Light mode is silver-and-gold — recolour the ambience to match. */
  background:
    radial-gradient(420px 150px at 0% 0%, rgba(199, 154, 46, 0.12), transparent 62%),
    radial-gradient(420px 150px at 100% 100%, rgba(212, 175, 55, 0.08), transparent 62%);
}
.set-hero-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 19px;
  color: #fff;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: var(--sh-md);
}
.set-hero-meta { min-width: 0; }
.set-hero-name {
  font-size: 16.5px;
  font-weight: 650;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.set-hero-mail { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.set-hero-side {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.set-hero-since { color: var(--muted-2); font-size: 11.5px; }

/* --- Section anatomy ------------------------------------------------------ */
.set-head {
  display: flex;
  gap: 13px;
  padding: 18px 22px 0;
  align-items: flex-start;
}
.set-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--accent);
}
.set-ico svg { width: 17px; height: 17px; }
.set-head h3 {
  margin: 1px 0 0;
  font-size: 14px;
  color: var(--text-strong);
  letter-spacing: 0.1px;
}
.set-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.set-body { padding: 16px 22px 20px; }
.set-divider { height: 1px; background: var(--border); margin: 18px 0 16px; border: 0; }

/* .actions is only styled under .card in the base system — restate it for
   settings cards so button rows get their breathing room and gap. */
.set-card .actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* A label/action row (sign-out-everywhere, billing actions, …). */
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.set-row-title { font-size: 13px; color: var(--text); font-weight: 550; }
.set-row-sub { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.45; }

.set-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.set-inline { display: flex; gap: 10px; align-items: stretch; }
.set-inline .input { flex: 1; }

/* --- Password fields ------------------------------------------------------ */
.pw-wrap { position: relative; }
.pw-wrap .input { width: 100%; padding-right: 38px; }
.pw-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 7px;
  display: flex;
}
.pw-eye:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
[data-theme="light"] .pw-eye:hover { background: rgba(0, 0, 0, 0.06); }
.pw-eye svg { width: 15px; height: 15px; }

/* Live strength meter under the new-password field. */
.pw-meter { display: flex; gap: 10px; margin-top: 9px; align-items: center; }
.pw-meter-segs { display: flex; gap: 4px; flex: 1; }
.pw-seg {
  height: 4px;
  flex: 1;
  border-radius: 99px;
  background: var(--surface-3);
  transition: background 220ms ease;
}
.pw-meter-label {
  font-size: 10.5px;
  color: var(--muted);
  min-width: 52px;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 650;
}
.pw-meter[data-level="1"] .pw-seg:nth-child(-n + 1) { background: var(--danger); }
.pw-meter[data-level="2"] .pw-seg:nth-child(-n + 2) { background: var(--warn); }
.pw-meter[data-level="3"] .pw-seg:nth-child(-n + 3) { background: var(--accent); }
.pw-meter[data-level="4"] .pw-seg { background: var(--success); }
.pw-meter[data-level="1"] .pw-meter-label { color: var(--danger); }
.pw-meter[data-level="2"] .pw-meter-label { color: var(--warn); }
.pw-meter[data-level="3"] .pw-meter-label { color: var(--accent); }
.pw-meter[data-level="4"] .pw-meter-label { color: var(--success); }

.input.is-bad { border-color: rgba(239, 68, 68, 0.55); }

/* --- Danger zone ----------------------------------------------------------- */
.set-danger { border-color: rgba(239, 68, 68, 0.32); }
.set-danger .set-ico {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}
.set-danger-reveal {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(239, 68, 68, 0.3);
  animation: set-in 300ms ease both;
}
.btn--outline-danger {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}
.btn--outline-danger:hover { background: rgba(239, 68, 68, 0.1); border-color: var(--danger); }
[data-theme="light"] .btn--outline-danger { color: #dc2626; }

@media (max-width: 760px) {
  .set-grid { grid-template-columns: 1fr; }
  .set-hero { flex-wrap: wrap; }
  .set-hero-side { align-items: flex-start; margin-left: 0; }
  .set-row { flex-direction: column; align-items: flex-start; }
}
.auth-note {
  background: rgba(79, 124, 255, 0.08);
  border: 1px solid rgba(79, 124, 255, 0.3);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

/* Plan / package picker (signup step 2 + in-app upgrade modal) */
.plan-list { display: grid; gap: 10px; }
.plan-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  overflow: hidden;
  border-radius: var(--r);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease,
    transform 140ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 140ms ease;
}
.plan-opt::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 140ms ease;
}
.plan-opt:hover {
  border-color: var(--accent);
  background: var(--surface-3);
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}
.plan-opt:hover::before { opacity: 1; }
.plan-opt:active { transform: translateY(0); }
.plan-opt-main { flex: 1; min-width: 0; }
.plan-opt-name { font-weight: 600; color: var(--text-strong); font-size: 14px; }
.plan-opt-tokens { color: var(--muted); font-size: 12px; margin-top: 2px; }
.plan-opt-price { font-weight: 650; color: var(--text-strong); font-size: 15px; white-space: nowrap; }
.plan-opt-price span { color: var(--muted); font-weight: 400; font-size: 11px; }

/* Sidebar account block */
.side-account {
  display: grid;
  gap: 9px;
  padding: 11px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.side-account-top { display: flex; align-items: center; gap: 9px; }
.side-account .avatar {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.side-account-meta { min-width: 0; }
.side-account-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-account-plan { font-size: 11px; color: var(--muted); }
.side-account-plan.is-past_due { color: var(--warn); }
.side-account-plan.is-none, .side-account-plan.is-canceled { color: var(--muted-2); }
.token-meter { display: grid; gap: 4px; }
.token-meter-bar {
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.token-meter-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.token-meter-fill.is-low { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.token-meter-label { font-size: 10.5px; color: var(--muted); display: flex; justify-content: space-between; }
.side-account .btn { width: 100%; justify-content: center; }

/* Sign-up Terms & Conditions declaration (signup.html). The label wraps over
   several lines, so align the box to the first line instead of centring. */
.auth-terms {
  align-items: flex-start;
  line-height: 1.55;
  font-size: 12.5px;
  color: var(--muted);
}
.auth-terms input { flex: none; margin-top: 2px; }
.auth-terms a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-terms a:hover { text-decoration: underline; }
