/* =============================================
   SHARED DESIGN TOKENS & COMPONENT STYLES
   Used by: index.html, multipage-audit/index.html, start-audit/index.html
   ============================================= */

/* --- Design Tokens --- */
:root {
  --white: #ffffff;
  --off-white: #f7f8fa;
  --surface: #f7f9fb;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.9);
  --slate-50: #f8f9fb;
  --slate-100: #eef0f4;
  --slate-200: #dde1e9;
  --slate-300: #bec5d1;
  --slate-400: #8e99aa;
  --slate-500: #5f6b7c;
  --slate-600: #404d5c;
  --slate-700: #2a3441;
  --slate-800: #1a2130;
  --slate-900: #0f1520;
  --accent: #111827;
  --accent-deep: #1f2937;
  --accent-light: #f3f4f6;
  --accent-mid: rgba(17, 24, 39, 0.08);
  --red: #ef4444;
  --red-light: #fef2f2;
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --blue-mid: rgba(37, 99, 235, 0.12);
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --shadow-sm: 0 1px 3px rgba(15, 21, 32, 0.06), 0 1px 2px rgba(15, 21, 32, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 21, 32, 0.08), 0 2px 4px rgba(15, 21, 32, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 21, 32, 0.10), 0 4px 8px rgba(15, 21, 32, 0.06);
  --shadow-card: 0 1px 1px rgba(15, 21, 32, 0.04), 0 2px 8px rgba(15, 21, 32, 0.06);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-body: 'DM Sans', sans-serif;
  --font-display: 'Fraunces', serif;
  --font-mono: 'DM Mono', monospace;

  /* === Option 3 "Futuristic Studio" semantic layer (light defaults) === */
  /* Applies when no [data-theme] is set, and for [data-theme="light"]. */
  --canvas-grad-a: #f4f6fb;
  --canvas-grad-b: #e7ebf3;
  --lx-accent: #5b6cff;          /* single luminous accent — swappable */
  --lx-accent-2: #7d8bff;
  --lx-accent-soft: rgba(91, 108, 255, 0.14);
  --lx-accent-line: rgba(91, 108, 255, 0.30);
  --lx-panel: rgba(255, 255, 255, 0.72);
  --lx-panel-solid: #ffffff;
  --lx-panel-border: rgba(15, 21, 32, 0.08);
  --lx-panel-shadow: 0 1px 1px rgba(15, 21, 32, 0.04), 0 18px 40px -18px rgba(15, 21, 32, 0.22);
  --lx-rail: rgba(255, 255, 255, 0.55);
  --lx-ink: #11151f;
  --lx-text: #2a3441;
  --lx-muted: #596374;
  --lx-faint: #6d7a8c;
  --lx-field: #f6f8fc;
  --lx-field-border: rgba(15, 21, 32, 0.12);
  --lx-hair: rgba(15, 21, 32, 0.07);
  --lx-danger: #e2483d;
  --lx-danger-soft: rgba(226, 72, 61, 0.10);
  --lx-danger-line: rgba(226, 72, 61, 0.32);
  --lx-ok: #1f9d6b;
  --lx-glow: none;
}

/* === Dark theme overrides === */
html[data-theme="dark"] {
  --canvas-grad-a: #10131b;
  --canvas-grad-b: #0b0d13;
  --lx-accent: #7c8aff;
  --lx-accent-2: #9aa6ff;
  --lx-accent-soft: rgba(124, 138, 255, 0.16);
  --lx-accent-line: rgba(124, 138, 255, 0.40);
  --lx-panel: rgba(255, 255, 255, 0.045);
  --lx-panel-solid: #161a24;
  --lx-panel-border: rgba(255, 255, 255, 0.09);
  --lx-panel-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --lx-rail: rgba(255, 255, 255, 0.03);
  --lx-ink: #f4f6fb;
  --lx-text: #cfd6e4;
  --lx-muted: #8b94a7;
  --lx-faint: #8a96a7;
  --lx-field: rgba(255, 255, 255, 0.04);
  --lx-field-border: rgba(255, 255, 255, 0.12);
  --lx-hair: rgba(255, 255, 255, 0.08);
  --lx-danger: #ff6b5e;
  --lx-danger-soft: rgba(255, 107, 94, 0.12);
  --lx-danger-line: rgba(255, 107, 94, 0.34);
  --lx-ok: #36c08a;
  --lx-glow: 0 0 0 1px var(--lx-accent-line), 0 0 28px -4px rgba(124, 138, 255, 0.55);
}

/* --- Global Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 700px at 78% -10%, var(--lx-accent-soft), transparent 60%),
    linear-gradient(160deg, var(--canvas-grad-a), var(--canvas-grad-b));
  background-attachment: fixed;
  color: var(--lx-text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- Utilities --- */
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* --- Top Navigation --- */
.topnav {
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  text-decoration: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-name {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--slate-800);
  line-height: 1.2;
}

.brand-tagline {
  font-size: 6px;
  color: var(--slate-800);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.nav-brand-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-brand-mark svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--slate-800);
  letter-spacing: -0.2px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--slate-600);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Navigation Tabs --- */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-500);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1.5px solid var(--slate-200);
  background: transparent;
  font-family: var(--font-body);
  text-decoration: none;
}

.nav-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.nav-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.nav-btn {
  padding: 7px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-600);
  text-decoration: none;
  border-radius: 6px;
  border: 1.5px solid var(--slate-200);
  transition: all 0.15s ease;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
  background: var(--slate-50);
  color: var(--slate-800);
  border-color: var(--slate-300);
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.05);
}

.nav-btn:active {
  background: var(--slate-100);
}

.nav-btn-active {
  background: var(--slate-50);
  color: var(--slate-800);
  border-color: var(--slate-300);
}

.btn-logout {
  padding: 6px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: white;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-500);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-logout:hover {
  border-color: var(--red);
  color: var(--red);
}

.btn-logout svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Page Header --- */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--slate-800);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.page-header p {
  font-size: 14px;
  color: var(--slate-400);
}

/* --- Progress Overlay --- */
.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 21, 32, 0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.progress-overlay.visible {
  display: flex;
}

.progress-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  width: 480px;
  box-shadow: var(--shadow-lg);
}

/* --- Cancel Confirmation Modal --- */
.cancel-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.cancel-confirm-overlay.visible {
  display: flex;
}

.cancel-confirm-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  width: 320px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.cancel-confirm-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--red);
}

.cancel-confirm-icon svg {
  width: 100%;
  height: 100%;
}

.cancel-confirm-modal h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--slate-800);
  margin-bottom: 8px;
}

.cancel-confirm-modal p {
  font-size: 13px;
  color: var(--slate-500);
  line-height: 1.5;
  margin-bottom: 24px;
}

.cancel-confirm-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-continue-scan,
.btn-confirm-cancel {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-continue-scan {
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  color: var(--slate-600);
}

.btn-continue-scan:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-confirm-cancel {
  background: var(--red);
  border: none;
  color: white;
}

.btn-confirm-cancel:hover {
  background: #dc2626;
}

.progress-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.progress-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.progress-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--slate-800);
}

.progress-header p {
  font-size: 12px;
  color: var(--slate-400);
  margin-top: 2px;
  font-family: var(--font-mono);
}

.progress-message {
  font-size: 12px;
  color: var(--blue);
  font-family: var(--font-mono);
  padding: 8px 12px;
  background: var(--blue-light);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 24px;
}

.progress-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}

.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 32px;
  width: 1px;
  height: calc(100% - 22px);
  background: var(--slate-200);
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--slate-200);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.step-dot.done {
  border-color: var(--blue);
  background: var(--white);
}

.step-dot.active {
  border-color: var(--blue);
  background: var(--white);
}

.step-dot.done svg {
  width: 11px;
  height: 11px;
  stroke: var(--blue);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.step-dot.active::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse-dot 1s ease infinite;
}

.step-text h4 {
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-700);
  margin-bottom: 2px;
}

.step-text p {
  font-size: 12px;
  color: var(--slate-400);
}

.step-text.inactive h4 { color: var(--slate-300); }
.step-text.inactive p { color: var(--slate-300); }

.progress-bar-outer {
  height: 4px;
  background: var(--slate-100);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s ease;
}

/* --- Cancel Scan Button --- */
.btn-cancel-scan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 140px;
  margin-top: 16px;
  padding: 10px 20px;
  background: transparent;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  color: var(--slate-500);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-cancel-scan:hover {
  border-color: var(--red);
  color: var(--red);
}

/* --- Run Button --- */
.btn-run {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.1px;
}

.btn-run svg {
  width: 14px;
  height: 14px;
}

.btn-run:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-run:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.run-hint {
  font-size: 12px;
  color: var(--slate-400);
}

/* --- Active Scan Banner --- */
.active-scan-banner {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--blue-light);
  border-bottom: 1px solid var(--blue-mid);
  padding: 12px 24px;
  display: none;
}

.active-scan-banner.visible {
  display: block;
}

.active-scan-banner-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.active-scan-banner-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.active-scan-banner-text {
  flex: 1;
  font-size: 13px;
  color: var(--slate-700);
}

.active-scan-banner-actions {
  display: flex;
  gap: 8px;
}

.btn-resume-scan {
  padding: 6px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.btn-dismiss-scan {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--slate-500);
  cursor: pointer;
}

/* --- CTA Banner --- */
.cta-banner {
  margin-top: 20px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--accent-light);
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.cta-banner span {
  font-size: 14px;
  color: var(--slate-600);
}

.cta-banner-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.cta-banner-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  display: none;
  align-items: center;
  gap: 8px;
  animation: slide-up 0.2s ease;
  max-width: 420px;
  white-space: normal;
  line-height: 1.4;
}

.toast.visible {
  display: flex;
}

.toast.success::before {
  content: '\2713';
  color: var(--accent);
  font-weight: 700;
}

/* --- Status Pills --- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.complete { background: var(--accent-light); color: var(--accent); }
.status-pill.running  { background: var(--blue-light); color: var(--blue); }
.status-pill.failed   { background: var(--red-light); color: var(--red); }
.status-pill.cancelled { background: var(--accent-light); color: var(--slate-500); }

/* --- Badge --- */
.badge-latest {
  display: inline-block !important;
  margin-right: 6px;
  padding: 2px 6px;
  background: var(--lx-accent-soft);
  color: var(--lx-accent);
  border: 1px solid var(--lx-accent-line);
  border-radius: 4px;
  font-size: 9px !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  line-height: 1;
}

/* --- Status Text (inline in history table) --- */
.status-text { font-size: 12px; }
.status-text.running { color: var(--slate-400); }
.status-text.cancelled { color: var(--amber); }
.status-text.failed { color: var(--red); }

/* --- History Link --- */
.history-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.history-link:hover {
  text-decoration: underline;
}

.history-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =============================================
   OPTION 3 — NAV (Futuristic Studio, themed)
============================================= */
.lx-nav {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 40px;
  border-bottom: 1px solid var(--lx-hair);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lx-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  text-decoration: none;
}

.lx-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(150deg, var(--lx-accent), var(--lx-accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--lx-glow);
}

.lx-brand-mark svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lx-brand-text {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

.lx-brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--lx-ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
  display: block;
  /* spread "Lumnio" to match tagline width — works when white-space allows it */
  text-align: justify;
  text-align-last: justify;
}

.lx-brand-tagline {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--lx-muted);
  line-height: 1;
  white-space: nowrap;
}

/* Footer logo: normal left-align */
.lx-footer .lx-brand-name {
  text-align: left;
  text-align-last: left;
}

.lx-nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lx-nav-link {
  font-size: 13px;
  color: var(--lx-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.lx-nav-link:hover {
  color: var(--lx-ink);
}

.lx-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--lx-panel-border);
  background: var(--lx-panel);
  color: var(--lx-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lx-theme-toggle:hover {
  color: var(--lx-ink);
  border-color: var(--lx-accent-line);
}

.lx-theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Show moon in light mode (click → dark), sun in dark mode (click → light) */
.lx-theme-toggle .ic-sun { display: none; }
.lx-theme-toggle .ic-moon { display: block; }
html[data-theme="dark"] .lx-theme-toggle .ic-sun { display: block; }
html[data-theme="dark"] .lx-theme-toggle .ic-moon { display: none; }

.lx-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--lx-accent), var(--lx-accent-2));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: var(--lx-glow);
  transition: transform 0.15s ease;
}

.lx-avatar:hover {
  transform: scale(1.05);
}

.lx-signout {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--lx-panel-border);
  background: var(--lx-panel);
  color: var(--lx-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lx-signout:hover {
  color: var(--lx-danger);
  border-color: var(--lx-danger-line);
  background: var(--lx-danger-soft);
}

.lx-signout svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =============================================
   OPTION 3 — PROGRESS MODAL + PERSISTENT ERROR
============================================= */
.progress-modal {
  background: var(--lx-panel-solid);
  border: 1px solid var(--lx-panel-border);
  box-shadow: var(--lx-panel-shadow);
}
.progress-header h3 { color: var(--lx-ink); }
.progress-header p { color: var(--lx-muted); }
.progress-spinner { border-color: var(--lx-panel-border); border-top-color: var(--lx-accent); }
.progress-message { background: var(--lx-accent-soft); color: var(--lx-accent); }
.progress-bar-outer { background: var(--lx-hair); }
.progress-bar-inner { background: var(--lx-accent); }
.step-dot { background: var(--lx-panel-solid); border-color: var(--lx-panel-border); }
.step-dot.done, .step-dot.active { border-color: var(--lx-accent); }
.step-dot.done svg { stroke: var(--lx-accent); }
.step-dot.active::after { background: var(--lx-accent); }
.progress-step:not(:last-child)::after { background: var(--lx-hair); }
.step-text h4 { color: var(--lx-text); }
.step-text p { color: var(--lx-faint); }
.step-text.inactive h4, .step-text.inactive p { color: var(--lx-faint); opacity: 0.6; }
.btn-cancel-scan { border-color: var(--lx-panel-border); color: var(--lx-muted); }
.btn-cancel-scan:hover { border-color: var(--lx-danger); color: var(--lx-danger); }

/* OPTION 3 — CANCEL / GENERIC CONFIRM MODAL (was left on the legacy --white/--slate
   tokens, so it never followed the dark-mode toggle - surfaced when the admin page's
   is_admin toggle started reusing this component instead of a native confirm()). */
.cancel-confirm-modal {
  background: var(--lx-panel-solid);
  border: 1px solid var(--lx-panel-border);
  box-shadow: var(--lx-panel-shadow);
}
.cancel-confirm-icon { color: var(--lx-danger); }
.cancel-confirm-modal h3 { color: var(--lx-ink); }
.cancel-confirm-modal p { color: var(--lx-muted); }
.btn-continue-scan {
  background: transparent;
  border: 1.5px solid var(--lx-panel-border);
  color: var(--lx-muted);
}
.btn-continue-scan:hover { border-color: var(--lx-accent-line); color: var(--lx-accent); }
.btn-confirm-cancel { background: var(--lx-danger); border: none; color: white; }
.btn-confirm-cancel:hover { filter: brightness(1.08); }

/* Error state: hide the running UI, show the error card */
.progress-modal.error .progress-header,
.progress-modal.error .progress-message,
.progress-modal.error .progress-steps,
.progress-modal.error .progress-bar-outer,
.progress-modal.error #btn-cancel-scan { display: none; }

.progress-error { display: none; }
.progress-modal.error .progress-error { display: block; }

.progress-error-top { display: flex; gap: 15px; align-items: flex-start; }
.progress-error-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--lx-danger-line);
  background: var(--lx-danger-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--lx-danger);
}
.progress-error-icon svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.progress-error h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  color: var(--lx-ink);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-error-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lx-danger);
  border: 1px solid var(--lx-danger-line);
  padding: 2px 7px;
  border-radius: 5px;
}
.progress-error-msg {
  font-size: 13.5px;
  color: var(--lx-text);
  line-height: 1.6;
}
.progress-error-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.progress-error-actions .btn-run-confirm,
.progress-error-actions .btn-back-cancel { flex: 0 0 auto; min-width: 120px; }
.progress-error-actions .btn-run-confirm {
  background: var(--lx-danger);
}
.progress-error-actions .btn-run-confirm:hover { background: var(--lx-danger); filter: brightness(1.06); }
.progress-error-actions .btn-back-cancel {
  background: transparent;
  border-color: var(--lx-panel-border);
  color: var(--lx-muted);
}

/* =============================================
   OPTION 3 — FOOTER (themed)
============================================= */
.lx-footer {
  background: transparent;
  border-top: 1px solid var(--lx-hair);
  padding: 40px 24px;
  margin-top: auto;
}
.lx-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.lx-footer-brand { display: flex; align-items: center; gap: 12px; }
.lx-footer-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(150deg, var(--lx-accent), var(--lx-accent-2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--lx-glow);
}
.lx-footer-mark svg {
  width: 16px; height: 16px; stroke: #fff; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.lx-footer .lx-brand-text { align-items: flex-start; }
.lx-footer-tagline {
  font-size: 13px;
  color: var(--lx-muted);
  max-width: 480px;
  line-height: 1.5;
}
.lx-footer-links {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px;
}
.lx-footer-links a {
  font-size: 12px;
  color: var(--lx-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.lx-footer-links a:hover { color: var(--lx-ink); }
.lx-footer-dot { font-size: 10px; color: var(--lx-faint); }
.lx-footer-copy { font-size: 11px; color: var(--lx-faint); line-height: 1.4; }
.lx-footer-credit {
  color: var(--lx-text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--lx-panel-border);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.lx-footer-credit:hover { color: var(--lx-accent); border-color: var(--lx-accent-line); }
