/* ═══════════════════════════════════════════════════════════════
   Bulk POD Studio — app.css
   Self-contained, no external dependencies.
   ═══════════════════════════════════════════════════════════════ */

/* ── Design tokens (light) ──────────────────────────────────── */
:root {
  color-scheme: light;
  --bg: #f6f2ea;
  --bg-soft: #efe6d8;
  --panel: rgba(255, 255, 255, 0.85);
  --panel-solid: #ffffff;
  --text: #17202a;
  --muted: #5f6b73;
  --line: rgba(23, 32, 42, 0.1);
  --accent: #0d6efd;
  --accent-2: #164b60;
  --success: #1e7d4b;
  --warning: #b66b00;
  --critical: #b42318;
  --shadow: 0 16px 40px rgba(18, 28, 38, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  /* Section accent borders */
  --panel-accent-blue:   #0d6efd;
  --panel-accent-green:  #1e7d4b;
  --panel-accent-amber:  #b66b00;
  --panel-accent-purple: #6f42c1;

  /* Icon data-URIs (inline SVG, base-64 free) */
  --icon-home:     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
  --icon-settings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z'/%3E%3C/svg%3E");
  --icon-logs:     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z'/%3E%3C/svg%3E");
  --icon-history:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M13 3a9 9 0 1 0 9 9h-2a7 7 0 1 1-7-7v3l4-4-4-4v3z'/%3E%3Cpath d='M12 8v4.41l2.29 2.29 1.42-1.41L14 11.59V8z'/%3E%3C/svg%3E");
  --icon-rocket:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 14.5c-2.49 0-4.5-2.01-4.5-4.5S9.51 7.5 12 7.5s4.5 2.01 4.5 4.5-2.01 4.5-4.5 4.5zm0-5.5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1z'/%3E%3C/svg%3E");
}

/* ── Reset / base ────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Bahnschrift", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(13, 110, 253, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(30, 125, 75, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #fff 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 32, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 42, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.3), transparent 72%);
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.45);
  outline-offset: 3px;
}

/* ═══════════════════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes slideInFromBottom {
  from { opacity: 0; transform: translateY(40px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.6; transform: scale(0.88); }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.18); }
  50%       { box-shadow: 0 0 0 8px rgba(13, 110, 253, 0.08); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes successGlow {
  0%   { box-shadow: 0 0 0 0   rgba(30, 125, 75, 0);    }
  30%  { box-shadow: 0 0 0 6px rgba(30, 125, 75, 0.35); }
  100% { box-shadow: 0 0 0 0   rgba(30, 125, 75, 0);    }
}

@keyframes progressShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT SHELL
   ═══════════════════════════════════════════════════════════════ */

.shell {
  width: min(1220px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.topbar, .nav, .panel, .warning, .queue-card, .bundle-card, .log-row, .step, .hero {
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.panel, .hero, .warning, .queue-card, .bundle-card, .log-row, .step {
  animation: riseIn 420ms ease both;
}
.panel:nth-child(2) { animation-delay: 40ms; }
.panel:nth-child(3) { animation-delay: 80ms; }
.panel:nth-child(4) { animation-delay: 120ms; }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(255,250,242,0.88));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.8);
  margin-bottom: 18px;
}

/* ── Navigation ──────────────────────────────────────────────── */
.nav {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease,
              border-color 180ms ease, box-shadow 180ms ease;
  border-bottom: 2px solid transparent;
  min-height: 44px;
}

/* Navigation icons via ::before using mask-image technique */
.nav a[href="/"]::before,
.nav a[href*="dashboard"]::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  mask-image: var(--icon-home);
  mask-repeat: no-repeat;
  mask-size: contain;
  flex-shrink: 0;
}

.nav a[href*="settings"]::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  mask-image: var(--icon-settings);
  mask-repeat: no-repeat;
  mask-size: contain;
  flex-shrink: 0;
}

.nav a[href*="logs"]::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  mask-image: var(--icon-logs);
  mask-repeat: no-repeat;
  mask-size: contain;
  flex-shrink: 0;
}

.nav a[href*="history"]::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  mask-image: var(--icon-history);
  mask-repeat: no-repeat;
  mask-size: contain;
  flex-shrink: 0;
}

.nav a[href*="onboarding"]::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  mask-image: var(--icon-rocket);
  mask-repeat: no-repeat;
  mask-size: contain;
  flex-shrink: 0;
}

.nav a:hover {
  background: rgba(23, 32, 42, 0.07);
  color: var(--text);
  transform: translateY(-1px);
}

.nav a.active {
  background: var(--text);
  color: #fff;
  transform: translateY(-1px);
  border-bottom-color: var(--accent);
  box-shadow: 0 4px 12px rgba(23, 32, 42, 0.18);
}

/* SSE connection indicator pulse */
.sse-dot,
.dot-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ── Typography ──────────────────────────────────────────────── */
.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); margin-bottom: 8px; }
.lede { max-width: 60ch; color: var(--muted); font-size: 1.04rem; line-height: 1.6; margin-bottom: 0; }

/* ── Action rows ─────────────────────────────────────────────── */
.topbar-actions, .meta-row, .hero-actions, .log-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ═══════════════════════════════════════════════════════════════
   GRID LAYOUTS
   ═══════════════════════════════════════════════════════════════ */

.grid { display: grid; gap: 18px; }
.dashboard-grid { grid-template-columns: 1.45fr 1fr; }

.hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(255,255,255,0.95), rgba(243, 235, 224, 0.82));
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  /* Subtle left accent border via box-shadow inset on left */
  border-left: 4px solid rgba(13, 110, 253, 0.15);
  transition: border-left-color 200ms ease;
}

/* Per-section panel accent colors (apply via additional class on .panel) */
.panel-accent-blue   { border-left-color: var(--panel-accent-blue); }
.panel-accent-green  { border-left-color: var(--panel-accent-green); }
.panel-accent-amber  { border-left-color: var(--panel-accent-amber); }
.panel-accent-purple { border-left-color: var(--panel-accent-purple); }
/* Default panel accent — gentle blue tint already set above */

.wide { grid-column: 1 / -1; }
.split {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

/* ── Section heading ─────────────────────────────────────────── */
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.section-heading h2, .section-heading h3 { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════
   CHIPS & STATUS BADGES
   ═══════════════════════════════════════════════════════════════ */

.chip, .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Colored dot before status badges */
.chip::before,
.status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-success::before, .status-ready::before  { background: var(--success); }
.chip-warning::before, .status-warning::before { background: var(--warning); }
.chip-critical::before  { background: var(--critical); }
.chip-info::before, .status-review::before { background: var(--accent); }
.chip-neutral::before { background: var(--muted); }

.chip-success, .status-ready   { background: rgba(30, 125, 75, 0.12);  color: var(--success);  border-color: rgba(30, 125, 75, 0.2); }
.chip-warning, .status-warning { background: rgba(182, 107, 0, 0.12);  color: var(--warning);  border-color: rgba(182, 107, 0, 0.2); }
.chip-critical                  { background: rgba(180, 35, 24, 0.12);  color: var(--critical); border-color: rgba(180, 35, 24, 0.2); }
.chip-info, .status-review      { background: rgba(13, 110, 253, 0.1);  color: var(--accent);   border-color: rgba(13, 110, 253, 0.18); }
.chip-neutral                   { background: rgba(23, 32, 42, 0.05);   color: var(--text);     border-color: rgba(23, 32, 42, 0.08); }

/* Unsynced badge */
.chip-unsynced {
  background: rgba(255, 152, 0, 0.15);
  color: #e67e00;
  border-color: rgba(255, 152, 0, 0.3);
  font-weight: 600;
}
.chip-unsynced::before { background: #e67e00; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease,
              opacity 180ms ease;
}

.button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(23, 32, 42, 0.12); }
.button:active { transform: translateY(0); }
.button-primary   { background: var(--text); color: #fff; }
.button-secondary { background: #fff; border-color: var(--line); }

/* Button with loading spinner */
.button.is-loading {
  pointer-events: none;
  opacity: 0.72;
}
.button.is-loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.button-secondary.is-loading::before {
  border-color: rgba(23,32,42,0.2);
  border-top-color: var(--text);
}

/* Button icons via unicode / pseudo-elements */
.button-scan::before  { content: "⌕"; font-size: 1.05em; line-height: 1; }
.button-save::before  { content: "✓"; font-size: 1.05em; line-height: 1; }
.button-test::before  { content: "⚡"; font-size: 0.9em; line-height: 1; }
.button-run::before   { content: "▶"; font-size: 0.75em; line-height: 1; }
.button-add::before   { content: "+"; font-size: 1.2em; line-height: 1; font-weight: 400; }
.button-delete::before { content: "✕"; font-size: 0.9em; line-height: 1; }
.button-refresh::before { content: "↺"; font-size: 1.1em; line-height: 1; }

/* Success flash state */
.success-flash {
  animation: successGlow 1.4s ease forwards;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   WARNING BOXES
   ═══════════════════════════════════════════════════════════════ */

.warning-stack { display: grid; gap: 12px; }

.warning {
  position: relative;
  padding: 16px 18px 16px 48px;
  border-radius: 18px;
  border: 1px solid rgba(180, 35, 24, 0.2);
  background: linear-gradient(135deg, rgba(255, 242, 240, 0.95), rgba(255, 250, 248, 0.9));
}

/* Triangle-exclamation icon top-left */
.warning::before {
  content: "⚠";
  position: absolute;
  left: 16px;
  top: 15px;
  font-size: 1.05rem;
  color: var(--critical);
  line-height: 1;
}

.warning strong, .warning p { margin-bottom: 0; }
.warning p { margin-top: 6px; color: var(--muted); line-height: 1.5; }
.warning-critical { box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.04); }

/* ═══════════════════════════════════════════════════════════════
   STEPPER / CHECKLIST
   ═══════════════════════════════════════════════════════════════ */

.stepper {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.8);
}

.step span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(23, 32, 42, 0.08);
  font-weight: 800;
  flex-shrink: 0;
}

.step.is-current {
  border-color: rgba(13, 110, 253, 0.3);
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.12);
}

/* Checklist items with colored circle status icons */
.checklist {
  list-style: none;
  display: grid;
  gap: 12px;
  padding-left: 0;
  margin: 0;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

/* Default circle */
.checklist li::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(23, 32, 42, 0.2);
  flex-shrink: 0;
}

/* Status-specific overrides via data-status or sibling classes */
.checklist li.check-ok::before,
.checklist li[data-status="ok"]::before   { background: var(--success); box-shadow: 0 0 0 3px rgba(30,125,75,0.15); }
.checklist li.check-warn::before,
.checklist li[data-status="warn"]::before  { background: var(--warning); box-shadow: 0 0 0 3px rgba(182,107,0,0.15); }
.checklist li.check-fail::before,
.checklist li[data-status="fail"]::before  { background: var(--critical); box-shadow: 0 0 0 3px rgba(180,35,24,0.15); }

/* ═══════════════════════════════════════════════════════════════
   QUEUE CARDS (summary cards)
   ═══════════════════════════════════════════════════════════════ */

.queue-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.queue-card, .bundle-card, .log-row {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.82);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.queue-card:hover, .bundle-card:hover, .log-row:hover, .step:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(18, 28, 38, 0.08);
}

.queue-card p, .queue-card strong { margin-bottom: 6px; }

/* Large prominent number with gradient text */
.queue-card strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

/* ── Progress bars ───────────────────────────────────────────── */
.progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(23, 32, 42, 0.08);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #4e9eff 50%, var(--accent) 100%);
  background-size: 400px 100%;
  transition: width 500ms ease;
  animation: progressShimmer 2s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════
   BUNDLE CARDS
   ═══════════════════════════════════════════════════════════════ */

.bundle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.bundle-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
  /* Gradient hover effect */
  background: rgba(255,255,255,0.82);
  position: relative;
  overflow: hidden;
}

/* Gradient overlay on hover */
.bundle-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(13,110,253,0.04), rgba(30,125,75,0.04));
  opacity: 0;
  transition: opacity 250ms ease;
  border-radius: inherit;
  pointer-events: none;
}

.bundle-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 28px rgba(18, 28, 38, 0.1);
}

.bundle-card:hover::after { opacity: 1; }

.bundle-art {
  height: 140px;
  border-radius: 18px;
  border: 1px solid rgba(23, 32, 42, 0.08);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(13,110,253,0.12), rgba(30,125,75,0.12)),
    linear-gradient(180deg, #fff, #f4f2ee);
}

.bundle-art.alt {
  background:
    linear-gradient(135deg, rgba(182,107,0,0.12), rgba(13,110,253,0.1)),
    linear-gradient(180deg, #fff, #f4f2ee);
}

.bundle-preview {
  object-fit: cover;
  width: 100%;
}

.bundle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bundle-title, .bundle-meta, .stream-item p, .log-row p, .checklist { color: var(--muted); }
.bundle-meta { margin: 0; padding-left: 18px; }

/* ═══════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .wide { grid-column: 1 / -1; }

.form-grid label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  /* Subtle divider between fields */
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

/* Remove divider from last label in each row to avoid double lines */
.form-grid label:last-child { border-bottom: none; }

.form-grid span { color: var(--text); }

.field-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: rgba(13, 110, 253, 0.45);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12),
              inset 0 1px 3px rgba(13, 110, 253, 0.06);
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

/* ── Helper / feedback text ──────────────────────────────────── */
.helper-text {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: 10px;
}

/* Info-circle icon before helper text */
.helper-text::before {
  content: "ⓘ";
  font-size: 0.95em;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 0.05em;
}

.feedback-error {
  color: var(--critical);
  border-left: 3px solid var(--critical);
  background: rgba(180, 35, 24, 0.05);
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  margin-top: 8px;
}

.feedback-error::before {
  content: "✕";
  color: var(--critical);
}

/* ── Inline check ────────────────────────────────────────────── */
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  padding: 10px 14px;
  min-height: 44px;
}

.inline-check input {
  width: 18px;
  height: 18px;
}

/* ═══════════════════════════════════════════════════════════════
   STREAM / LOG ROWS
   ═══════════════════════════════════════════════════════════════ */

.stream { display: grid; gap: 12px; }

.stream-item, .log-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}

.stream-item strong, .log-row strong { display: block; margin-bottom: 4px; }
.stream-item time, .log-row time { color: var(--muted); font-size: 0.84rem; }

.dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-ok   { background: var(--success); }
.dot-warn { background: var(--warning); }

/* ═══════════════════════════════════════════════════════════════
   MISC UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.mono { font-family: Consolas, "SFMono-Regular", monospace; }

/* Empty state — dashed border */
.empty-state {
  grid-template-columns: 140px 1fr;
  border-style: dashed !important;
  border-color: rgba(23, 32, 42, 0.18) !important;
  background: rgba(255,255,255,0.5) !important;
}

.log-list { display: grid; gap: 12px; }

/* ── Tooltip ─────────────────────────────────────────────────── */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(23, 32, 42, 0.92);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  max-width: 220px;
  white-space: normal;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 9999;
}

.tooltip::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(23, 32, 42, 0.92);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
  z-index: 9999;
}

.tooltip:hover::after,
.tooltip:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tooltip:hover::before,
.tooltip:focus::before {
  opacity: 1;
}

/* ── Loading shimmer ─────────────────────────────────────────── */
.loading {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: rgba(23, 32, 42, 0.06) !important;
  border-radius: var(--radius-sm);
  pointer-events: none;
  user-select: none;
}

.loading * { opacity: 0; }

.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.6) 40%,
    rgba(255,255,255,0.8) 50%,
    rgba(255,255,255,0.6) 60%,
    transparent 100%
  );
  background-size: 600px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* ── Fade-in utility ─────────────────────────────────────────── */
.fade-in { animation: fadeIn 300ms ease both; }

/* ═══════════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════════ */

.table-wrap { overflow-x: auto; }

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th, .history-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.history-table th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.history-table tr:hover td {
  background: rgba(13, 110, 253, 0.03);
}

/* ═══════════════════════════════════════════════════════════════
   PROJECT ITEMS
   ═══════════════════════════════════════════════════════════════ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.project-item {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.82);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.project-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(18, 28, 38, 0.08);
}

.project-active {
  border-color: rgba(30, 125, 75, 0.3);
  box-shadow: 0 8px 24px rgba(30, 125, 75, 0.12);
}

.project-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   BATCH PROGRESS
   ═══════════════════════════════════════════════════════════════ */

#batch-progress {
  margin-top: 14px;
  padding: 14px 18px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.batch-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.batch-progress-header strong { font-size: 0.95rem; }

#batch-percent {
  font-weight: 800;
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--accent), #4e9eff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.batch-bar {
  height: 10px !important;
  border-radius: 5px;
  margin-bottom: 8px;
}

.batch-bar span { transition: width 0.4s ease; }

/* ═══════════════════════════════════════════════════════════════
   PUBLISH STEPPER
   ═══════════════════════════════════════════════════════════════ */

.publish-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 12px 0 8px;
  flex-wrap: wrap;
}

.publish-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
}

.publish-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(23, 32, 42, 0.08);
  color: var(--muted);
  transition: all 300ms ease;
}

.publish-step-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  transition: color 300ms ease;
}

.publish-step-line {
  flex: 1;
  min-width: 12px;
  height: 2px;
  background: rgba(23, 32, 42, 0.1);
  margin-bottom: 20px;
  transition: background 300ms ease;
}

.publish-step-done .publish-step-dot { background: var(--success); color: #fff; }
.publish-step-done + .publish-step-line { background: var(--success); }

.publish-step-active .publish-step-dot {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.18);
  animation: pulse-dot 1.5s ease infinite;
}
.publish-step-active .publish-step-label { color: var(--accent); }

.publish-step-error .publish-step-dot  { background: var(--warning); color: #fff; }
.publish-step-error .publish-step-label { color: var(--warning); }

/* ═══════════════════════════════════════════════════════════════
   JOB CARDS
   ═══════════════════════════════════════════════════════════════ */

.job-card {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 300ms ease;
}

.job-active {
  border-color: rgba(13, 110, 253, 0.25);
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.08);
}

.job-failed { border-color: rgba(180, 35, 24, 0.2); }

.job-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.job-progress { flex: 1; }

.job-percent {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}

.job-stage-text   { font-size: 0.88rem; margin: 4px 0 8px; }
.job-publish-meta {
  font-size: 0.82rem;
  margin: -2px 0 8px;
  color: color-mix(in srgb, var(--muted) 72%, var(--accent) 28%);
}
.job-error-text { color: var(--critical); }

/* ═══════════════════════════════════════════════════════════════
   COLOR & SIZE PICKER
   ═══════════════════════════════════════════════════════════════ */

.options-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.options-split h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.option-selected-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(13, 110, 253, 0.08);
  padding: 3px 10px;
  border-radius: 999px;
}

.options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 180ms ease;
  user-select: none;
  min-height: 44px;
}

.option-check:hover {
  border-color: rgba(13, 110, 253, 0.3);
  transform: translateY(-1px);
}

.option-check.option-enabled {
  border-color: var(--success);
  background: rgba(30, 125, 75, 0.08);
}

.option-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.option-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(23, 32, 42, 0.15);
  flex-shrink: 0;
}

.option-count {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════
   BUNDLE EDITOR OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.bundle-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 36, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 2000;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bundle-editor-overlay[hidden] { display: none !important; }

.bundle-editor {
  width: min(1180px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  padding: 20px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.28);
  animation: slideInFromBottom 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bundle-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.bundle-editor-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

/* ── Listing preview ─────────────────────────────────────────── */
.listing-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.listing-preview-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 6px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.listing-preview-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(18,28,38,0.06);
}

.listing-preview-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.listing-preview-card strong { font-size: 0.82rem; }

/* ═══════════════════════════════════════════════════════════════
   LISTING IMAGE GALLERY
   ═══════════════════════════════════════════════════════════════ */

.listing-image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.listing-image-card {
  position: relative;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--panel-solid);
  transition: border-color 160ms ease;
}

.listing-image-card:hover { border-color: rgba(13,110,253,0.3); }

.listing-image-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.listing-image-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.92);
}

/* ── Move buttons ────────────────────────────────────────────── */
.move-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-solid);
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--text);
  transition: background 0.15s;
}

.move-btn:hover:not(:disabled) { background: var(--bg-soft); }
.move-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Hero star ───────────────────────────────────────────────── */
.hero-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-solid);
  cursor: pointer;
  font-size: 1rem;
  color: #ccc;
  transition: color 0.2s, background 0.15s;
}

.hero-star:hover { color: #f0b132; background: rgba(240, 177, 50, 0.08); }

.hero-star-active {
  color: #f0b132;
  border-color: rgba(240, 177, 50, 0.4);
  background: rgba(240, 177, 50, 0.1);
}

/* ── Sync status icons ───────────────────────────────────────── */
.sync-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
}

.sync-icon-synced   { color: var(--success); background: rgba(30, 125, 75, 0.12); }
.sync-icon-pending  { color: var(--warning); background: rgba(182, 107, 0, 0.12); }
.sync-icon-replaced { color: var(--critical); background: rgba(180, 35, 24, 0.12); }

/* ==========================================================================
   AUTH / LOGIN EXPERIENCE
   ========================================================================== */

@keyframes authAurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, -3%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 2%, 0) scale(0.98); }
}

@keyframes authOrbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes authFloat {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-10px); }
}

@keyframes authComet {
  0%   { transform: translate3d(-10vw, 0, 0) scale(0.95); opacity: 0; }
  20%  { opacity: 1; }
  70%  { opacity: 0.9; }
  100% { transform: translate3d(78vw, -24vh, 0) scale(1.08); opacity: 0; }
}

body.auth-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 188, 87, 0.22), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(14, 104, 184, 0.24), transparent 28%),
    linear-gradient(135deg, #071c2d 0%, #0d2740 34%, #123a4f 64%, #f6efe3 100%);
  color: #f4f0e9;
}

body.auth-body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 82%);
}

.auth-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-aurora,
.auth-comet,
.auth-grid-glow {
  position: absolute;
  display: block;
}

.auth-aurora {
  width: 54vw;
  height: 54vw;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.72;
  mix-blend-mode: screen;
  animation: authAurora 16s ease-in-out infinite alternate;
}

.auth-aurora-one {
  top: -10vw;
  left: -8vw;
  background: radial-gradient(circle, rgba(255, 168, 88, 0.7), rgba(255, 168, 88, 0));
}

.auth-aurora-two {
  right: -14vw;
  bottom: -18vw;
  background: radial-gradient(circle, rgba(99, 214, 255, 0.48), rgba(99, 214, 255, 0));
  animation-duration: 18s;
}

.auth-comet {
  width: 180px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.9), rgba(255,197,124,0));
  transform: rotate(-18deg);
  box-shadow: 0 0 18px rgba(255, 225, 181, 0.5);
  animation: authComet 14s linear infinite;
}

.auth-comet-one {
  top: 18%;
  left: 10%;
}

.auth-comet-two {
  top: 68%;
  left: -14%;
  animation-delay: -7s;
}

.auth-grid-glow {
  inset: auto 0 0;
  height: 38vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.08)),
    radial-gradient(circle at top center, rgba(255, 208, 145, 0.2), transparent 46%);
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 470px);
  gap: 28px;
  align-items: center;
  padding: 40px 0;
}

.auth-scene,
.auth-card {
  position: relative;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: 0 22px 54px rgba(5, 17, 28, 0.26);
}

.auth-scene {
  min-height: 720px;
  padding: 44px;
  background:
    linear-gradient(155deg, rgba(7, 28, 45, 0.86), rgba(15, 50, 69, 0.66)),
    radial-gradient(circle at 76% 24%, rgba(255, 205, 132, 0.18), transparent 28%);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  overflow: hidden;
}

.auth-scene::after {
  content: "";
  position: absolute;
  inset: auto -16% -20% 12%;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 120, 0.18), rgba(255, 196, 120, 0));
  filter: blur(12px);
}

.auth-scene-copy {
  max-width: 560px;
  position: relative;
  z-index: 1;
}

.auth-kicker {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 800;
  color: #ffd59a;
}

.auth-scene h1 {
  margin-bottom: 14px;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.98;
  max-width: 10ch;
  font-family: "Aptos Display", "Avenir Next", "Bahnschrift", sans-serif;
}

.auth-lede {
  max-width: 52ch;
  font-size: 1.08rem;
  line-height: 1.7;
  color: rgba(244, 240, 233, 0.82);
}

.auth-logo-cluster {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 22px;
}

.auth-logo-mark {
  position: relative;
  width: min(420px, 68vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  animation: authFloat 6s ease-in-out infinite;
}

.auth-logo-core {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 210px;
  height: 210px;
  border-radius: 38%;
  background:
    linear-gradient(155deg, rgba(255, 227, 193, 0.98), rgba(255, 192, 117, 0.92));
  color: #0c2740;
  font-size: clamp(3rem, 8vw, 5.8rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  box-shadow:
    0 20px 40px rgba(255, 184, 96, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.auth-logo-orbit {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.auth-logo-orbit::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: -11px;
  left: calc(50% - 11px);
  border-radius: 50%;
  background: linear-gradient(135deg, #fff5e0, #ffd596);
  box-shadow: 0 0 20px rgba(255, 213, 150, 0.7);
}

.auth-logo-orbit-one {
  animation: authOrbit 18s linear infinite;
}

.auth-logo-orbit-two {
  inset: 56px;
  animation: authOrbit 11s linear infinite reverse;
}

.auth-logo-orbit-two::before {
  width: 16px;
  height: 16px;
  top: auto;
  bottom: -8px;
  left: 18%;
  background: linear-gradient(135deg, #d6f3ff, #64d7ff);
  box-shadow: 0 0 18px rgba(100, 215, 255, 0.62);
}

.auth-logo-spark {
  position: absolute;
  z-index: 2;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff4dd;
  box-shadow: 0 0 14px rgba(255, 231, 188, 0.68);
}

.auth-logo-spark-one {
  top: 14%;
  right: 18%;
}

.auth-logo-spark-two {
  bottom: 18%;
  left: 16%;
  background: #91e5ff;
  box-shadow: 0 0 16px rgba(145, 229, 255, 0.66);
}

.auth-story-card {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(8, 23, 37, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.auth-story-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.auth-story-card p {
  margin-bottom: 0;
  color: rgba(244, 240, 233, 0.82);
  line-height: 1.6;
}

.auth-microcopy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-microcopy span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-microcopy span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd596, #fff1d6);
  box-shadow: 0 0 12px rgba(255, 213, 150, 0.54);
}

.auth-card {
  padding: 34px;
  background: rgba(255, 251, 244, 0.94);
  color: #142433;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, #ffb762, #67d8ff, #7fd18b);
}

.auth-card-header {
  margin-bottom: 24px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(12, 39, 64, 0.08);
  color: #0c2740;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb762, #0d6efd);
}

.auth-card h2 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.auth-card-header p,
.auth-footer p {
  color: #53606c;
  line-height: 1.62;
}

.auth-alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(180, 35, 24, 0.18);
  background: linear-gradient(135deg, rgba(255, 236, 233, 0.96), rgba(255, 246, 244, 0.98));
}

.auth-alert strong {
  display: block;
  margin-bottom: 6px;
  color: #8b241b;
}

.auth-alert p {
  margin-bottom: 0;
  color: #9e3a31;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
}

.auth-form input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(20, 36, 51, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: #142433;
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.auth-form input:focus {
  border-color: rgba(13, 110, 253, 0.38);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.11);
  transform: translateY(-1px);
}

.auth-submit {
  width: 100%;
  justify-content: center;
  min-height: 54px;
  margin-top: 8px;
  font-size: 1rem;
}

.auth-footer {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(20, 36, 51, 0.1);
}

.auth-footer p {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.auth-footer p:last-child {
  margin-bottom: 0;
}

.auth-footer a {
  color: #0d6efd;
  font-weight: 700;
}

@media (max-width: 1040px) {
  .auth-shell {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 900px);
  }

  .auth-scene {
    min-height: auto;
    padding: 28px;
  }

  .auth-logo-mark {
    width: min(320px, 72vw);
  }
}

@media (max-width: 720px) {
  .auth-shell {
    gap: 18px;
    padding: 18px 0 28px;
  }

  .auth-scene,
  .auth-card {
    padding: 22px;
    border-radius: 24px;
  }

  .auth-scene h1 {
    max-width: none;
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .auth-logo-core {
    width: 154px;
    height: 154px;
    font-size: 3.2rem;
  }

  .auth-logo-orbit {
    inset: 10px;
  }

  .auth-logo-orbit-two {
    inset: 38px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1318;
    --bg-soft: #181e26;
    --panel: rgba(26, 34, 46, 0.88);
    --panel-solid: #1a222e;
    --text: #e8edf3;
    --muted: #7e8fa0;
    --line: rgba(232, 237, 243, 0.1);
    --accent: #4e9eff;
    --accent-2: #7ec8e3;
    --success: #34a86e;
    --warning: #d4820a;
    --critical: #e5534b;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }

  body {
    background:
      radial-gradient(circle at top left, rgba(78, 158, 255, 0.08), transparent 28%),
      radial-gradient(circle at top right, rgba(52, 168, 110, 0.08), transparent 24%),
      linear-gradient(180deg, var(--bg) 0%, #0a0e13 100%);
  }

  body::before {
    background-image:
      linear-gradient(rgba(232, 237, 243, 0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(232, 237, 243, 0.025) 1px, transparent 1px);
  }

  .topbar {
    background: linear-gradient(135deg, rgba(26,34,46,0.96), rgba(20,28,38,0.92));
  }

  .nav {
    background: rgba(26, 34, 46, 0.72);
  }

  .nav a.active {
    background: rgba(78, 158, 255, 0.2);
    color: var(--accent);
  }

  .hero {
    background: linear-gradient(140deg, rgba(26,34,46,0.95), rgba(22,30,42,0.82));
  }

  .panel {
    background: var(--panel);
  }

  .bundle-editor {
    background: rgba(22, 30, 40, 0.99);
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    background: rgba(26, 34, 46, 0.92);
    color: var(--text);
    border-color: var(--line);
  }

  .form-grid input:focus,
  .form-grid select:focus,
  .form-grid textarea:focus {
    border-color: rgba(78, 158, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(78, 158, 255, 0.12),
                inset 0 1px 3px rgba(78, 158, 255, 0.06);
  }

  .queue-card, .bundle-card, .log-row, .step {
    background: rgba(26, 34, 46, 0.82);
  }

  .step {
    background: rgba(26, 34, 46, 0.8);
  }

  .loading::after {
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255,255,255,0.06) 40%,
      rgba(255,255,255,0.1) 50%,
      rgba(255,255,255,0.06) 60%,
      transparent 100%
    );
  }

  .loading {
    background: rgba(232, 237, 243, 0.06) !important;
  }

  .tooltip::after {
    background: rgba(232, 237, 243, 0.95);
    color: #0f1318;
  }
  .tooltip::before {
    border-top-color: rgba(232, 237, 243, 0.95);
  }

  .listing-image-controls {
    background: rgba(26, 34, 46, 0.92);
  }

  .listing-preview-card {
    background: rgba(26, 34, 46, 0.9);
  }

  .warning {
    background: linear-gradient(135deg, rgba(42, 18, 16, 0.95), rgba(38, 22, 20, 0.9));
  }

  .inline-check,
  .option-check {
    background: rgba(26, 34, 46, 0.82);
  }

  .project-item {
    background: rgba(26, 34, 46, 0.82);
  }

  .history-table tr:hover td {
    background: rgba(78, 158, 255, 0.04);
  }

  .move-btn, .hero-star {
    background: var(--panel-solid);
  }

  #batch-progress {
    background: var(--bg-soft);
  }

  .bundle-card::after {
    background: linear-gradient(135deg, rgba(78,158,255,0.06), rgba(52,168,110,0.06));
  }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤1040px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1040px) {
  .dashboard-grid, .hero, .split, .bundle-grid, .form-grid, .options-split,
  .bundle-editor-grid, .listing-preview-grid {
    grid-template-columns: 1fr;
  }

  /* Summary cards: 2×2 on tablets */
  .queue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤720px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  .shell { width: min(100% - 20px, 1220px); margin-top: 10px; }
  .topbar, .panel, .hero { padding: 18px; }
  .nav { overflow-x: auto; }
  .bundle-card, .stream-item, .log-row { grid-template-columns: 1fr; }

  /* Stack summary cards to 2 columns on small phones if needed */
  .queue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Ensure touch targets are at least 44px */
  .button, .nav a, .option-check, .inline-check, .move-btn, .hero-star {
    min-height: 44px;
  }

  .move-btn, .hero-star {
    min-width: 44px;
  }

  /* Bundle editor overlay — full-screen scroll on mobile */
  .bundle-editor-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .bundle-editor {
    width: 100%;
    max-height: 92dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: slideUp 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  /* Collapse options-split to single column */
  .options-split { grid-template-columns: 1fr; gap: 16px; }

  .listing-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION — always last
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .progress span { animation: none; }
  .loading::after { animation: none; }
  .publish-step-active .publish-step-dot { animation: none; }
}
