/* Analytic Traffic base styles. Mobile-first, no framework. */

/* ======== Design tokens (dark default) ======== */
:root {
  --bg:            #07080f;
  --surface:       #0d1020;
  --surface-2:     #131727;
  --border:        #1c2236;
  --text:          #eaefff;
  --muted:         #8591b3;
  --primary:       #7c6ff7;
  --primary-hover: #6457e8;
  --primary-light: rgba(124,111,247,.15);
  --primary-glow:  rgba(124,111,247,.28);
  --success:       #23d981;
  --warn:          #f6a929;
  --danger:        #f25b6b;
  --radius:        12px;
  --shadow:        0 8px 32px rgba(0,0,0,.5);
  --chart-grid:    rgba(28,34,54,.95);
  --max:           1200px;
}

/* ======== Light theme ======== */
[data-theme="light"] {
  --bg:            #f0eeff;
  --surface:       #ffffff;
  --surface-2:     #ede9fe;
  --border:        #d8d0fc;
  --text:          #1e1348;
  --muted:         #595d78;
  --primary:       #6d28d9;
  --primary-hover: #5b21b6;
  --primary-light: rgba(109,40,217,.1);
  --primary-glow:  rgba(109,40,217,.22);
  --success:       #059669;
  --warn:          #b45309;
  --danger:        #dc2626;
  --shadow:        0 4px 24px rgba(109,40,217,.12);
  --chart-grid:    rgba(216,208,252,.85);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; }

h1,h2,h3,h4 { margin: 0 0 .6em 0; line-height: 1.25; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ======== Navbar ======== */
/* Sticky header: fully opaque background, no backdrop-filter, no transform, no transition.
   Any of those would shimmer on scroll or turn the header into the containing block
   for the fixed mobile drawer. */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: #07080f;
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .nav {
  background: #f0eeff;
}
.nav-inner {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px;
  padding: 10px 20px; max-width: var(--max); margin: 0 auto;
}
.nav-brand {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.1rem; color: var(--text);
}
.nav-brand svg rect { fill: var(--primary); }
.nav-links-wrap {
  flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 12px;
}
.nav-links {
  display: flex; gap: 4px; align-items: center; list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  color: var(--muted); padding: 8px 14px; border-radius: 8px;
  font-weight: 500; font-size: 0.95rem;
  min-height: 44px; display: inline-flex; align-items: center;
  transition: color .15s, background .15s;
}
.nav-links a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-links a.active { background: var(--primary-light); color: var(--primary); }
.nav-cta { display: flex; gap: 8px; align-items: center; }

/* nav-right: theme toggle + hamburger (always visible) */
.nav-right { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; margin-left: 4px; }
.nav-toggle {
  display: none;
  background: transparent; border: 1px solid var(--border); padding: 8px; cursor: pointer;
  width: 40px; height: 40px; border-radius: 8px;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); margin: 3px auto; transition: 0.25s; border-radius: 2px; }

/* Theme toggle button */
.theme-toggle {
  width: 38px; height: 38px; padding: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 50%; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center;
  transition: background .2s, border-color .2s, transform .15s;
  color: var(--muted); flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--primary); background: var(--primary-light);
  color: var(--primary); transform: rotate(20deg);
}
.theme-toggle svg { display: block; }
@media (max-width: 820px) { .theme-toggle { width: 44px; height: 44px; } }

/* Sun shown in dark mode, moon shown in light mode */
.icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

@media (max-width: 820px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
  /* Mobile drawer. Lives inside .nav (z-index 50) so it sits above the .nav-overlay sibling (z-index 40).
     --nav-h is set by app.js from the real header height; 65px is the fallback (64px + 1px border). */
  .nav-links-wrap {
    position: fixed; top: var(--nav-h, 65px); left: 0; right: 0; bottom: 0;
    z-index: 60;
    flex: none; margin-left: 0;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 16px; display: none; flex-direction: column;
    justify-content: flex-start; align-items: stretch; gap: 0;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .nav-links-wrap.open { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; width: 100%; gap: 2px; }
  .nav-links a { width: 100%; padding: 14px 12px; border-radius: 8px; font-size: 1rem; min-height: 48px; }
  .nav-cta { flex-direction: column; align-items: stretch; margin-top: 12px; gap: 8px; }
  .nav-cta .btn { width: 100%; justify-content: center; }
  .nav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 40; display: none; }
  .nav-overlay.open { display: block; }
}

/* ======== Buttons ======== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 8px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  text-decoration: none; transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; background: var(--border); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 0 18px var(--primary-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #9333ea 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 0 28px var(--primary-glow);
}
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #c41e3a; border-color: #c41e3a; color: #fff; }

/* ======== Badges ======== */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 20px; font-size: 0.78rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-primary { background: var(--primary-light); color: var(--primary); border-color: rgba(124,111,247,.3); }
.badge-success { background: rgba(35,217,129,.12); color: var(--success); border-color: rgba(35,217,129,.3); }
.badge-warn    { background: rgba(246,169,41,.12);  color: var(--warn);    border-color: rgba(246,169,41,.3); }
.badge-danger  { background: rgba(242,91,107,.12);  color: var(--danger);  border-color: rgba(242,91,107,.3); }
.badge-muted   { background: var(--surface-2); color: var(--muted); }
[data-theme="light"] .badge-success { background: #dcfce7; color: #065f46; border-color: #86efac; }
[data-theme="light"] .badge-warn    { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
[data-theme="light"] .badge-danger  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
[data-theme="light"] .badge-primary { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }
@media (max-width: 820px) { .btn-sm { min-height: 44px; } }
.btn-block { width: 100%; }

/* ======== Cards ======== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card h2, .card h3 { margin-top: 0; }

/* ======== Forms ======== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; color: var(--text); }
.form-control, input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 1rem; font-family: inherit; background: var(--surface-2); color: var(--text);
  min-height: 44px; transition: border-color .15s, box-shadow .15s;
}
input[disabled], input:disabled { opacity: .45; cursor: not-allowed; }
select option { background: var(--surface-2); color: var(--text); }
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }
.form-help  { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

/* ======== Alerts ======== */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.95rem; border: 1px solid transparent; }
.alert-info    { background: rgba(124,111,247,.12); color: #c4bafc; border-color: rgba(124,111,247,.28); }
.alert-success { background: rgba(35,217,129,.1);   color: #6ee7b7; border-color: rgba(35,217,129,.28); }
.alert-danger  { background: rgba(242,91,107,.1);   color: #fca5a5; border-color: rgba(242,91,107,.28); }
.alert-warn    { background: rgba(246,169,41,.1);   color: #fcd34d; border-color: rgba(246,169,41,.28); }

[data-theme="light"] .alert-info    { background: #ede9fe; color: #4c1d95; border-color: #c4b5fd; }
[data-theme="light"] .alert-success { background: #dcfce7; color: #14532d; border-color: #86efac; }
[data-theme="light"] .alert-danger  { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; }
[data-theme="light"] .alert-warn    { background: #fef3c7; color: #78350f; border-color: #fde68a; }

/* ======== Breadcrumb ======== */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0; font-size: 0.9rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ======== Tables ======== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; background: var(--surface); }
table.table th, table.table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
table.table th { background: var(--surface-2); font-weight: 600; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: .05em; }
table.table tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover td { background: var(--surface-2); }

/* ======== Hero / landing ======== */
.hero { padding: 90px 0 70px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 10% 60%, rgba(168,85,247,.18), transparent),
    radial-gradient(ellipse 50% 40% at 90% 20%, rgba(99,102,241,.14), transparent),
    radial-gradient(ellipse 70% 60% at 50% -15%, rgba(124,111,247,.24), transparent);
}
.hero h1 {
  font-size: 2.9rem; max-width: 820px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--text) 35%, var(--primary) 80%, #a855f7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.hero-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; padding: 60px 0; }
.feature {
  background: var(--surface); padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--border); transition: border-color .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.feature::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), #a855f7);
}
.feature:hover { border-color: rgba(124,111,247,.5); box-shadow: 0 0 24px var(--primary-glow); }
.feature h3 { margin-top: 8px; }

@media (max-width: 600px) {
  .hero { padding: 50px 0 30px; }
  .hero h1 { font-size: 2rem; }
  .hero p.lead { font-size: 1rem; }
}

/* ======== Metric cards (app-wide) ======== */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.metric .label { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.metric .value { font-size: 1.7rem; font-weight: 700; color: var(--text); }
.metric .delta { font-size: 0.85rem; margin-top: 4px; }
.metric .delta.up { color: var(--success); }
.metric .delta.down { color: var(--danger); }

/* ======== Footer ======== */
.footer { margin-top: auto; border-top: 1px solid var(--border); padding: 32px 0; background: var(--surface); color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }

/* ======== Layout helpers ======== */
.main { padding: 20px 0 60px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col { flex: 1 1 300px; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.flex { display: flex; } .flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.card-subtitle { font-weight: 400; font-size: 0.9rem; }
.code-sm { font-size: 0.85em; }
.dash-public-label { font-size: 0.82rem; padding: 0 8px; }
.goals-table-wrap__table { margin: 0; }
.site-key-label { font-size: 0.85rem; }

/* Trial banner */
.trial-banner { background: rgba(246,169,41,.1); color: #fcd34d; padding: 10px 16px; text-align: center; font-size: 0.9rem; border-bottom: 1px solid rgba(246,169,41,.2); }
.trial-banner a { color: #fcd34d; font-weight: 600; text-decoration: underline; }
[data-theme="light"] .trial-banner { background: #fef3c7; color: #78350f; border-bottom-color: #fde68a; }
[data-theme="light"] .trial-banner a { color: #78350f; }

/* Scroll-to-top */
.scroll-top {
  position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), #a855f7); color: #fff;
  border-radius: 50%; border: 0; box-shadow: 0 0 20px var(--primary-glow);
  cursor: pointer; display: none; font-size: 20px;
}
.scroll-top.show { display: flex; align-items: center; justify-content: center; }

/* ======== Admin sidebar layout ======== */
.admin-shell { display: flex; min-height: calc(100vh - 65px); }
.sidebar {
  width: 240px; color: #e0d8ff; flex-shrink: 0;
  padding: 20px 12px; position: sticky; top: 65px; align-self: flex-start;
  height: calc(100vh - 65px); overflow-y: auto;
  /* Always deep purple, looks sharp in both themes */
  background: #140f2e; border-right: 1px solid #2a1f5a;
}
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: #9b8fd4; font-weight: 500; min-height: 44px; transition: background .15s, color .15s; }
.sidebar a:hover { background: rgba(124,111,247,.2); color: #e0d8ff; text-decoration: none; }
.sidebar a.active { background: linear-gradient(135deg, rgba(124,111,247,.35), rgba(168,85,247,.25)); color: #fff; box-shadow: inset 0 0 0 1px rgba(124,111,247,.3); }
.sidebar h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: #6b5fa8; margin: 18px 12px 6px; }
.admin-main { flex: 1; padding: 24px; max-width: 100%; overflow-x: auto; }
.sidebar-toggle { display: none; }
.sidebar-overlay { display: none; }
@media (max-width: 820px) {
  .admin-shell { flex-direction: column; }
  /* Mobile: sidebar becomes a fixed drawer below the header, above the dimming overlay */
  .sidebar {
    position: fixed; top: var(--nav-h, 65px); left: 0; bottom: 0;
    width: 280px; max-width: 85vw; height: auto; z-index: 60;
    display: none; border-right: 1px solid #2a1f5a;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { display: block; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 55; }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: inline-flex; margin-bottom: 12px; }
}

/* Visually hidden (a11y) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ======== Extended text utilities ======== */
.text-sm      { font-size: 0.85rem; }
.text-body-sm { font-size: 0.9rem; }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-warn    { color: var(--warn); }
.text-nowrap  { white-space: nowrap; }
.d-none       { display: none; }
.ms-2         { margin-left: .5rem; }

/* ======== Card variants ======== */
.card-empty       { padding: 40px 20px; }
.card-compact     { padding: 12px 20px; }
.card-accent      { border-color: rgba(124,111,247,.5); }
.card-featured    { border-color: var(--primary); box-shadow: 0 0 24px var(--primary-glow); }
.card-danger-zone { border-color: rgba(242,91,107,.4); }
.card-sm          { max-width: 560px; }
.card-md          { max-width: 720px; }
.card-link        { display: block; color: inherit; text-decoration: none; }
.card-link:hover  { color: inherit; text-decoration: none; }

/* ======== Admin panel: rich layout ======== */
.admin-kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px;
}
@media (max-width: 1100px) { .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .admin-kpi-grid { grid-template-columns: 1fr; } }

.admin-kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px;
  position: relative; overflow: hidden;
}
.admin-kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.admin-kpi-primary::before { background: linear-gradient(90deg, #7c6ff7, #a78bfa); }
.admin-kpi-green::before   { background: linear-gradient(90deg, #10b981, #34d399); }
.admin-kpi-cyan::before    { background: linear-gradient(90deg, #06b6d4, #38bdf8); }
.admin-kpi-amber::before   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.admin-kpi-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; margin-top: 4px; }
.admin-kpi-value { font-size: 1.9rem; font-weight: 700; color: var(--text); line-height: 1; }
.admin-kpi-value-sm { font-size: 1.1rem; word-break: break-all; }
.admin-kpi-value .card-subtitle { font-size: 0.7rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
.admin-kpi-sub { margin-top: 10px; font-size: 0.82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }

.admin-chart-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px;
}
@media (max-width: 900px) { .admin-chart-row { grid-template-columns: 1fr; } }
.admin-chart-wrap { height: 220px; }

.admin-feed-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px;
}
@media (max-width: 1100px) { .admin-feed-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  { .admin-feed-row { grid-template-columns: 1fr; } }
.admin-feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-feed li { border-bottom: 1px solid var(--border); }
.admin-feed li:last-child { border-bottom: 0; }
.admin-feed-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; text-decoration: none;
  color: var(--text); font-size: 0.88rem;
  transition: background .12s, padding .12s;
}
.admin-feed-link:hover {
  background: var(--surface-2); text-decoration: none;
  color: var(--text); padding-left: 8px;
}
.admin-feed-icon { font-size: 1rem; flex-shrink: 0; }
.admin-feed-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.admin-feed-main strong { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-feed-main .text-muted { font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-feed-when { font-size: 0.78rem; white-space: nowrap; flex-shrink: 0; }

/* Filter bar at top of list pages */
.admin-filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px;
}
.admin-filter-search {
  flex: 1; min-width: 240px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text);
  font-size: 0.9rem;
}
.admin-filter-bar select {
  padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 0.9rem; min-height: 38px;
}

/* User detail action row */
.admin-action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-action-row .form-inline { display: inline; }

/* Health page bars */
.health-bar-wrap {
  display: inline-block; vertical-align: middle;
  width: 120px; height: 6px; background: var(--border); border-radius: 3px;
  margin-right: 8px;
}
.health-bar {
  height: 6px; width: var(--bw, 0%);
  background: linear-gradient(90deg, var(--primary), #a855f7);
  border-radius: 3px;
}
.health-log-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }

/* Admin god-mode banner (above sites list) */
.admin-banner {
  padding: 10px 14px; border-radius: 8px;
  background: rgba(124,111,247,.12); color: var(--text);
  border: 1px solid rgba(124,111,247,.3);
  font-size: 0.9rem; margin-bottom: 16px;
}
[data-theme="light"] .admin-banner { background: #ede9fe; border-color: #c4b5fd; }
.admin-banner strong { color: var(--primary); }
.card-site-owner { font-size: 0.78rem; margin: -4px 0 8px; }

/* Site card on dashboard: main body + footer settings strip */
.card-site { padding: 0; display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s; }
.card-site:hover { border-color: rgba(124,111,247,.4); box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.card-site-body { display: block; flex: 1; padding: 18px 20px 14px; color: inherit; text-decoration: none; }
.card-site-body:hover { color: inherit; text-decoration: none; }
.card-site-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-site-head h3 { font-size: 1.05rem; }
.card-site-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); color: transparent;
  margin-left: auto; flex-shrink: 0;
  animation: rt-pulse 2s ease-out infinite;
}
.card-site-spark {
  width: 100%; height: 36px; display: block;
  color: var(--primary);
  margin: 6px 0 10px;
}
.card-site-spark-line { opacity: 0.85; }
.card-site:hover .card-site-spark-line { opacity: 1; }
.card-site-stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-site-stat { display: flex; flex-direction: column; gap: 2px; }
.card-site-stat-num { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1; }
.card-site-stat-label { font-size: 0.78rem; color: var(--muted); }
.card-site-delta { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.card-site-delta-up   { color: var(--success); }
.card-site-delta-down { color: var(--danger); }
.card-site-delta-flat { color: var(--muted); }
.card-site-footer { border-top: 1px solid var(--border); padding: 6px 12px; display: flex; align-items: center; gap: 4px; }
.card-site-added { font-size: 0.78rem; margin-left: auto; padding: 5px 4px; }
.card-site-action {
  font-size: 0.82rem; font-weight: 500; color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 6px; min-height: 32px;
  transition: background .15s, color .15s;
}
.card-site-action:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

/* ======== Row/Col layout helpers ======== */
.row-centered { justify-content: center; }
.col-site     { max-width: 420px; }
.col-form-sm  { flex: 0 0 440px; max-width: 440px; }
.col-form-md  { flex: 0 0 520px; max-width: 520px; }
@media (max-width: 520px) {
  .col-form-sm, .col-form-md { flex: 1 1 auto; max-width: 100%; }
}

/* ======== Inline form rows ======== */
.form-row          { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.form-row-center   { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.form-group-0      { margin: 0; }
.form-group-flex   { margin: 0; flex: 1; }
.form-group-flex-min { margin: 0; flex: 1; min-width: 140px; }
.form-group-flex-2 { margin: 0; flex: 2; min-width: 160px; }
.select-auto       { width: auto; }
.form-inline       { margin: 0; }

/* ======== Code variants ======== */
.code-input {
  width: 100%; font-family: 'Courier New', monospace; font-size: 0.83rem;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; resize: vertical;
}
.code-break { font-size: 0.9rem; word-break: break-all; }

/* ======== Invoice / billing ======== */
.inv-card    { max-width: 520px; margin: 0 auto; }
.inv-address {
  font-family: monospace; font-size: 0.85rem; word-break: break-all;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; color: var(--text);
}
.inv-amount { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.inv-qr     { text-align: center; padding: 16px 0; }
.inv-qr svg { width: 180px; height: 180px; }
#countdown  { font-size: 1.1rem; font-weight: 600; color: var(--warn); }
.step-num {
  display: inline-flex; width: 28px; height: 28px; background: var(--primary);
  color: #fff; border-radius: 50%; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; margin-right: 8px; flex-shrink: 0;
}
.step       { display: flex; align-items: flex-start; gap: 0; margin-bottom: 12px; }
.inv-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.inv-label  { font-size: 0.85rem; margin-bottom: 4px; }

/* ======== Status pills (billing) ======== */
.status-pill          { padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.status-pill-active   { background: rgba(35,217,129,.15); color: var(--success); }
.status-pill-inactive { background: rgba(242,91,107,.15); color: var(--danger); }
[data-theme="light"] .status-pill-active   { background: #dcfce7; color: #065f46; }
[data-theme="light"] .status-pill-inactive { background: #fee2e2; color: #991b1b; }

/* Invoice row status text */
.inv-status         { font-size: 0.82rem; font-weight: 600; }
.inv-status-paid    { color: var(--success); }
.inv-status-pending { color: var(--warn); }
.inv-status-expired { color: var(--danger); }

/* ======== Table cell helpers ======== */
.td-truncate { font-size: 0.8rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-muted    { color: var(--muted); }

/* ======== Pricing cards ======== */
.price-tag    { font-size: 2.2rem; font-weight: 700; margin: 0; }
.price-period { font-size: 1rem; font-weight: 400; }

/* ======== Lists ======== */
.step-list { color: var(--muted); line-height: 2; }

/* ======== Admin nav label ======== */
.nav-admin-tag { font-weight: 400; margin-left: 4px; }

/* ======== Error pages ======== */
.error-container { padding: 80px 20px; text-align: center; max-width: 560px; margin: 0 auto; }
.error-icon { font-size: 4rem; margin-bottom: 16px; }
.error-code { font-size: 3rem; margin: 0 0 8px; }
.error-text { color: var(--muted); font-size: 1.1rem; margin-bottom: 28px; }

/* ======== Logged-in nav: trial pill, upgrade btn, user dropdown ======== */
.nav-right-auth { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.trial-pill {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 20px;
  background: rgba(246,169,41,.12); color: var(--warn);
  border: 1px solid rgba(246,169,41,.32);
  font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}
[data-theme="light"] .trial-pill { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.trial-pill-ended { background: rgba(242,91,107,.12); color: var(--danger); border-color: rgba(242,91,107,.3); }
[data-theme="light"] .trial-pill-ended { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

.btn-upgrade {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff; border-color: transparent;
  box-shadow: 0 0 12px rgba(249,115,22,.35);
}
.btn-upgrade:hover {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #fff; border-color: transparent;
  box-shadow: 0 0 20px rgba(249,115,22,.5);
}

/* User menu trigger + dropdown */
.user-menu { position: relative; }
.user-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px; border-radius: 24px;
  background: transparent; border: 1px solid transparent;
  cursor: pointer; color: var(--text); min-height: 40px;
  transition: background .15s, border-color .15s;
}
.user-trigger:hover { background: var(--surface-2); border-color: var(--border); }
.user-menu.open .user-trigger { background: var(--surface-2); border-color: var(--border); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  color: #fff; font-weight: 700; font-size: 0.85rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name-text { font-size: 0.9rem; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-caret { color: var(--muted); transition: transform .2s; }
.user-menu.open .user-caret { transform: rotate(180deg); }

.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 220px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 32px rgba(0,0,0,.35);
  padding: 6px; z-index: 50;
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.user-menu.open .user-dropdown { opacity: 1; transform: translateY(0); pointer-events: auto; }

.user-dropdown-header { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-dropdown-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.user-dropdown-email { font-size: 0.88rem; color: var(--text); font-weight: 500; word-break: break-all; }

.user-dropdown-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 6px;
  font-size: 0.9rem; color: var(--text); text-decoration: none;
  background: transparent; border: 0; cursor: pointer;
  transition: background .12s, color .12s;
}
.user-dropdown-item:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }
.user-dropdown-form { margin: 0; }
.user-dropdown-logout { color: var(--danger); }
.user-dropdown-logout:hover { background: rgba(242,91,107,.1); color: var(--danger); }

/* Hide username text on small screens (avatar only) */
@media (max-width: 640px) {
  .user-name-text { display: none; }
  .nav-right-auth { gap: 8px; }
  .trial-pill { display: none; }
}

/* ======== Onboarding stepper ======== */
.onboard-stepper {
  display: flex; align-items: center; justify-content: center;
  gap: 0; list-style: none; padding: 0; margin: 0 0 32px;
  flex-wrap: wrap;
}
.onboard-step {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 500; color: var(--muted);
  position: relative;
}
.onboard-step + .onboard-step::before {
  content: ''; display: inline-block;
  width: 32px; height: 1px; background: var(--border);
  margin: 0 16px;
}
.onboard-step-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.85rem; font-weight: 600; color: var(--muted);
  flex-shrink: 0;
}
.onboard-step.current .onboard-step-mark {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 0 0 3px var(--primary-light);
}
.onboard-step.current .onboard-step-label { color: var(--text); font-weight: 600; }
.onboard-step.done .onboard-step-mark {
  background: var(--success); border-color: var(--success); color: #fff;
}
.onboard-step.done .onboard-step-label { color: var(--text); }
.onboard-step.done + .onboard-step::before { background: var(--success); }
@media (max-width: 640px) {
  .onboard-step-label { display: none; }
  .onboard-step.current .onboard-step-label { display: inline; }
  .onboard-step + .onboard-step::before { margin: 0 8px; width: 16px; }
}

/* ======== Verify-installation screen ======== */
.verify-card { text-align: center; padding: 32px 24px; }
.verify-icon-wrap {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--primary-light); border: 2px solid rgba(124,111,247,.4);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px; transition: background .25s, border-color .25s;
}
.verify-icon-wrap.success { background: rgba(35,217,129,.15); border-color: var(--success); }
.verify-icon-wrap.waiting .verify-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: verify-spin 0.9s linear infinite;
}
@keyframes verify-spin { to { transform: rotate(360deg); } }
.verify-icon-wrap.success .verify-check {
  width: 36px; height: 36px; color: var(--success);
  animation: verify-pop .4s ease-out;
}
@keyframes verify-pop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.verify-title { font-size: 1.5rem; margin: 0 0 8px; }
.verify-sub   { color: var(--muted); margin: 0 0 20px; }
.verify-snippet-wrap { text-align: left; margin: 24px auto 0; max-width: 720px; }
.verify-snippet-hint { font-size: 0.85rem; }
.verify-action-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.verify-check-hidden { display: none; }
.verify-spinner-hidden { display: none; }
.verify-cta-hidden { display: none; }

/* ======== Filter bar (active dashboard filters) ======== */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 10px 14px;
  background: var(--primary-light); border: 1px solid rgba(124,111,247,.3);
  border-radius: 10px;
}
[data-theme="light"] .filter-bar { background: #ede9fe; border-color: #c4b5fd; }
.filter-bar-label {
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid rgba(124,111,247,.4);
  color: var(--text); font-size: 0.85rem; font-weight: 500;
  text-decoration: none; transition: background .15s, border-color .15s;
}
.filter-pill:hover {
  background: rgba(242,91,107,.12); border-color: var(--danger); color: var(--text);
  text-decoration: none;
}
.filter-pill-x {
  font-size: 1.1rem; line-height: 1; color: var(--muted);
  font-weight: 700; margin-left: 2px;
}
.filter-pill:hover .filter-pill-x { color: var(--danger); }
.filter-clear-link {
  font-size: 0.82rem; color: var(--muted); text-decoration: none;
  margin-left: auto; font-weight: 500;
}
.filter-clear-link:hover { color: var(--primary); text-decoration: underline; }

/* ======== Webhook event picker ======== */
.webhook-events-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
}
.webhook-event-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); cursor: pointer; font-size: 0.88rem;
}
.webhook-event-row:hover { border-color: rgba(124,111,247,.4); }

/* ======== 2FA setup ======== */
.twofa-setup { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.twofa-qr-wrap {
  padding: 12px; border-radius: 12px;
  background: #fff; flex-shrink: 0;
}
.twofa-qr { display: block; width: 200px; height: 200px; }
.twofa-secret { flex: 1; min-width: 200px; }
.twofa-secret-code {
  display: inline-block; padding: 8px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; font-size: 1rem; letter-spacing: 1px;
  word-break: break-all;
}
.twofa-code-input {
  font-size: 1.4rem; letter-spacing: 8px; text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 220px;
}

/* ======== Funnel step picker ======== */
.funnel-step-list { display: flex; flex-direction: column; gap: 6px; }
.funnel-step-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); cursor: pointer; font-size: 0.9rem;
  transition: border-color .15s, background .15s;
}
.funnel-step-row:hover { border-color: rgba(124,111,247,.4); }
.funnel-step-row input[type="checkbox"] { margin: 0; }

/* ======== Funnel result viz ======== */
.funnel-card { margin-top: 24px; }
.funnel-steps-viz { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.funnel-step-bar {
  position: relative; display: flex; align-items: center;
  padding: 14px 16px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  overflow: hidden;
}
.funnel-step-bar::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--rate, 0%);
  background: linear-gradient(90deg, var(--primary), #a855f7);
  opacity: 0.18; transition: width .4s ease-out;
}
.funnel-step-bar > * { position: relative; z-index: 1; }
.funnel-step-idx { font-weight: 700; color: var(--primary); margin-right: 12px; min-width: 24px; }
.funnel-step-label { flex: 1; font-weight: 500; }
.funnel-step-count { font-weight: 700; margin-right: 10px; }
.funnel-step-rate { color: var(--muted); font-size: 0.85rem; min-width: 50px; text-align: right; }
.funnel-drop {
  font-size: 0.75rem; color: var(--danger); text-align: center;
  padding: 2px 0; margin: 0;
}

/* ======== Toggle switch ======== */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toggle-label { font-weight: 500; margin-bottom: 2px; }
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 26px;
  transition: background .2s;
}
.toggle-switch input:checked + .toggle-track { background: var(--primary); }
.toggle-switch input:focus-visible + .toggle-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: transform .2s;
  pointer-events: none;
}
.toggle-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(20px); }

/* Share URL reveal */
.share-url-box { margin-top: 14px; }
.share-url-box.hidden { display: none; }
.share-url-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.share-url-input {
  flex: 1; min-width: 200px; font-size: 0.85rem;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; cursor: text;
}
.share-url-pending { font-size: 0.85rem; color: var(--muted); padding: 8px 0; }

/* ======== Integration tabs (Settings, Integration methods) ======== */
.integration-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 20px; padding-bottom: 0; }
.integ-tab {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 14px; font-size: 0.875rem; font-weight: 600; color: var(--muted);
  cursor: pointer; white-space: nowrap; min-height: 40px;
  transition: color .15s;
}
.integ-tab:hover { color: var(--text); }
.integ-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.integ-panel { display: none; }
.integ-panel.active { display: block; }
.integ-steps { color: var(--muted); line-height: 1.9; padding-left: 20px; margin: 0 0 14px; }
.integ-steps li { margin-bottom: 2px; }

/* ======== Mobile tap targets (44px minimum) ======== */
@media (max-width: 820px) {
  .user-trigger { min-height: 44px; padding: 5px 12px 5px 5px; }
  .user-dropdown-item { min-height: 44px; display: flex; align-items: center; padding: 10px 12px; }
  .card-site-action { min-height: 44px; padding: 8px 12px; }
  .card-site-added { min-height: 44px; display: inline-flex; align-items: center; }
  .filter-pill { min-height: 44px; padding: 8px 14px 8px 14px; }
  .filter-clear-link { min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; }
  .admin-filter-bar select, .admin-filter-search { min-height: 44px; }
  .admin-feed-link { min-height: 44px; }
  .integ-tab { min-height: 44px; }
  .sidebar-toggle { min-height: 44px; }
  .sidebar a { min-height: 48px; }
  .breadcrumb a { display: inline-flex; align-items: center; min-height: 32px; }
  .footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
}

/* Admin header on phones: hide the "Admin" tag and tighten the action buttons so
   "Back to app" and "Log out" stay inside a 375px viewport. */
@media (max-width: 480px) {
  .nav-admin-tag { display: none; }
  .nav-right-auth { gap: 6px; }
  .nav-right-auth .btn-sm { padding-left: 10px; padding-right: 10px; font-size: 0.8rem; }
}

/* ======== Homepage FAQ (SEO / AIO content) ======== */
.faq { max-width: 820px; margin: 56px auto; padding: 0 16px; }
.faq > h2 { margin: 0 0 24px; }
.faq-list { display: grid; gap: 12px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius, 12px); padding: 18px 20px;
}
.faq-q { margin: 0 0 6px; font-size: 1.02rem; font-weight: 600; }
.faq-a { margin: 0; line-height: 1.6; }

/* ======== Billing coupon ======== */
.input-coupon {
  padding: 10px 14px; border-radius: var(--radius, 10px);
  border: 1px solid var(--border); background: var(--surface-2, var(--surface));
  color: var(--text); text-transform: uppercase; letter-spacing: 1px; min-width: 240px;
}
.input-coupon::placeholder { text-transform: none; letter-spacing: normal; color: var(--muted); }
.billing-coupon-hint { font-size: 0.85rem; margin-top: 10px; }
.inv-coupon-badge {
  display: inline-block; margin-top: 8px; padding: 4px 10px; border-radius: 999px;
  background: rgba(124, 111, 247, 0.15); color: var(--primary); font-size: 0.85rem; font-weight: 600;
}

/* ======== Promo banner (home + pricing) ======== */
.promo {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  max-width: 760px; margin: 0 auto 32px; padding: 16px 20px;
  background:
    radial-gradient(140% 160% at 0% 0%, rgba(124,111,247,.16), transparent 58%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px -14px var(--primary-glow);
}
.promo-icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-light); color: var(--primary);
}
.promo-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.promo-title { font-size: 1.05rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; line-height: 1.2; }
.promo-sub { font-size: 0.85rem; color: var(--muted); line-height: 1.4; }
.promo-code {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  background: var(--surface-2); border: 1px dashed var(--primary); color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700; letter-spacing: 1px; font-size: 0.9rem;
  transition: background .15s ease, border-color .15s ease;
}
.promo-code:hover { background: var(--primary-light); }
.promo-code.copied { border-style: solid; border-color: var(--success); }
.promo-code-copy {
  font-family: inherit; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--primary);
}
.promo-code.copied .promo-code-copy { color: var(--success); }
.promo-cta {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 10px; white-space: nowrap;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 0.92rem;
  box-shadow: 0 4px 14px -4px var(--primary-glow);
  transition: background .15s ease, transform .15s ease;
}
.promo-cta:hover { background: var(--primary-hover); transform: translateY(-1px); }
.promo-cta:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.promo-close {
  flex: 0 0 auto; align-self: flex-start;
  background: none; border: 0; color: var(--muted); font-size: 1.25rem; line-height: 1;
  cursor: pointer; padding: 2px 6px; border-radius: 6px; transition: color .15s ease, background .15s ease;
}
.promo-close:hover { color: var(--text); background: var(--surface-2); }

@media (max-width: 680px) {
  .promo { flex-wrap: wrap; gap: 12px; padding: 16px; padding-right: 40px; }
  .promo-copy { flex: 1 1 100%; }
  .promo-code, .promo-cta { flex: 1 1 auto; justify-content: center; }
  .promo-close { position: absolute; top: 10px; right: 12px; align-self: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .promo-cta, .promo-code, .promo-close { transition: none; }
  .promo-cta:hover { transform: none; }
}

/* ======== Visitor alert config box ======== */
.alert-config-box {
  margin-top: 14px; padding: 16px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.alert-config-box.hidden { display: none; }
.alert-config-box input[type="text"] { max-width: 280px; }
