/* ==========================================================================
   Glimmetric — main stylesheet (original work, no frameworks)
   Dark-first glassmorphism with animated gradients.
   Accessibility: every state uses icon + text + border/underline, never colour alone.
   All animation is disabled under prefers-reduced-motion.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --c1: #8b5cf6; /* violet */
  --c2: #3b82f6; /* blue */
  --c3: #22d3ee; /* cyan */
  --c4: #ec4899; /* magenta */
  --grad: linear-gradient(120deg, var(--c1), var(--c2) 35%, var(--c3) 65%, var(--c4));
  --grad-soft: linear-gradient(135deg, rgba(139,92,246,.22), rgba(34,211,238,.16) 60%, rgba(236,72,153,.18));
  --bg: #07070f;
  --bg-2: #0e0e1c;
  --surface: rgba(255,255,255,.055);
  --surface-2: rgba(255,255,255,.09);
  --border: rgba(255,255,255,.14);
  --border-strong: rgba(255,255,255,.32);
  --text: #f5f6ff;
  --muted: #b7bbd6;
  --focus: #ffe066;
  --ok: #4ade80; --bad: #fb7185; --warn: #fbbf24; --info: #67e8f9;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.7);
  --glow: 0 0 0 1px rgba(255,255,255,.08), 0 10px 40px -10px rgba(139,92,246,.6), 0 0 60px -20px rgba(34,211,238,.6);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Space Grotesk", var(--font);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f5ff; --bg-2: #ffffff;
  --surface: rgba(255,255,255,.72); --surface-2: rgba(255,255,255,.92);
  --border: rgba(20,20,60,.16); --border-strong: rgba(20,20,60,.4);
  --text: #0d0d24; --muted: #474a6a; --focus: #1d4ed8;
  --ok: #15803d; --bad: #be123c; --warn: #b45309; --info: #0e7490;
  --shadow: 0 20px 50px -25px rgba(40,30,120,.35);
  --glow: 0 0 0 1px rgba(20,20,60,.06), 0 10px 30px -12px rgba(139,92,246,.45);
  color-scheme: light;
}

@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

/* ---------- Base ---------- */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
code { font: .85em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--c1); color: #fff; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 1rem; }
.ic { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.2em; }
.ic-lg { width: 2rem; height: 2rem; } .ic-xl { width: 3rem; height: 3rem; }
.muted { color: var(--muted); } .center { text-align: center; } .nowrap { white-space: nowrap; }
.container { width: min(1200px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(820px, 100% - 2.5rem); }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--c3); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
.link:hover { text-decoration-color: var(--c4); }
.spacer { flex: 1; }
.stack > * + * { margin-top: 1.25rem; }
.h2 { font-size: clamp(1.9rem, 3.5vw, 2.8rem); } .h3 { font-size: 1.2rem; display: flex; align-items: center; gap: .5rem; }
.display { font-size: clamp(2.5rem, 6vw, 4.6rem); font-weight: 800; }
.lead { font-size: 1.15rem; color: var(--muted); }
.grad-text { background: var(--grad); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
.eyebrow { display: inline-flex; gap: .45rem; align-items: center; font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; padding: .35rem .8rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); }

/* ---------- Aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 600px at 50% -10%, rgba(139,92,246,.25), transparent 60%), var(--bg); }
.aurora span { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; filter: blur(90px); opacity: .45; animation: drift 22s ease-in-out infinite alternate; mix-blend-mode: screen; }
.aurora span:nth-child(1) { background: var(--c1); top: -20%; left: -10%; }
.aurora span:nth-child(2) { background: var(--c3); top: 10%; right: -20%; animation-duration: 28s; animation-delay: -6s; }
.aurora span:nth-child(3) { background: var(--c4); bottom: -30%; left: 20%; animation-duration: 32s; animation-delay: -12s; }
.aurora span:nth-child(4) { background: var(--c2); bottom: -10%; right: 10%; animation-duration: 26s; }
.aurora-soft span { opacity: .18; }
[data-theme="light"] .aurora span { mix-blend-mode: multiply; opacity: .18; }
.aurora::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, #000, transparent 80%); }

/* ---------- Glass & gradient borders ---------- */
.glass { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); box-shadow: var(--shadow); }
.glow-border { position: relative; isolation: isolate; }
.glow-border::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; background: conic-gradient(from var(--angle), var(--c1), var(--c3), var(--c4), var(--c2), var(--c1)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 6s linear infinite; z-index: -1; pointer-events: none; }
.card-pad { padding: 1.5rem; }
.grad-0 { background: linear-gradient(135deg, var(--c1), var(--c2)); }
.grad-1 { background: linear-gradient(135deg, var(--c2), var(--c3)); }
.grad-2 { background: linear-gradient(135deg, var(--c4), var(--c1)); }

/* ---------- Buttons ---------- */
.btn { --b: var(--border-strong); display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.2rem; border-radius: 999px; border: 1.5px solid var(--b); background: var(--surface); color: var(--text); font: 600 .95rem/1.1 var(--font); text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .25s ease, background .25s ease; position: relative; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); background: var(--surface-2); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: not-allowed; transform: none; }
.btn-glow { border: 0; color: #fff; background: var(--grad); background-size: 220% auto; box-shadow: var(--glow); animation: shine 5s linear infinite; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.btn-glow::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; background: inherit; filter: blur(14px); opacity: .55; z-index: -1; transition: opacity .25s; }
.btn-glow:hover { box-shadow: 0 0 0 2px rgba(255,255,255,.5), var(--glow); }
.btn-glow:hover::after { opacity: .9; }
.btn-outline { background: transparent; border-color: var(--border-strong); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { border-color: var(--border); }
.btn-danger { color: var(--bad); } .btn-danger:hover { border-color: var(--bad); }
.btn-danger-solid { background: #9f1239; border-color: #fecdd3; color: #fff; }
.btn-lg { padding: .95rem 1.6rem; font-size: 1.05rem; }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .55rem; border-radius: 12px; }
.btn.is-loading .ic:first-child { animation: spin-ic 1s linear infinite; }
.btn-row { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Public header / footer ---------- */
.site-header { position: sticky; top: .75rem; z-index: 20; margin: .75rem auto 0; width: min(1240px, 100% - 1.5rem); border-radius: 999px; }
.nav-row { display: flex; align-items: center; gap: 1rem; padding: .55rem .5rem .55rem 1rem; width: 100%; }
.site-nav { display: flex; gap: .25rem; margin-left: 1rem; }
.site-nav a { padding: .5rem .8rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; text-decoration-color: var(--c3); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.25rem; }
.brand-mark { width: 34px; height: 34px; animation: float 6s ease-in-out infinite; }
.flash-wrap { margin-top: 1rem; }
.site-footer { padding: 3rem 0; border-top: 1px solid var(--border); margin-top: 4rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.footer-links { display: flex; gap: 1rem; } .footer-links a { color: var(--muted); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 5rem 0 3rem; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; position: relative; z-index: 2; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0; }
.hero-ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; color: var(--muted); font-weight: 600; }
.hero-ticks li { display: flex; align-items: center; gap: .35rem; } .hero-ticks .ic { color: var(--ok); }
.hero-visual { position: relative; }
.float-chip { position: absolute; display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; border-radius: 999px; font-weight: 700; font-size: .85rem; animation: float 7s ease-in-out infinite; z-index: 4; }
.chip-a { left: -1.5rem; top: 12%; } .chip-b { right: -1rem; top: 46%; animation-delay: -2s; } .chip-c { right: 6%; bottom: -2.6rem; animation-delay: -4s; }
.chip-ok { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #14532d; color: #bbf7d0; border: 1.5px solid #bbf7d0; }

/* ---------- Stats, features ---------- */
.stats-strip { padding: 1rem 0 2rem; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: 1.2rem; border-radius: var(--radius); border: 1px dashed var(--border-strong); background: var(--surface); text-align: center; }
.stat strong { font-family: var(--display); font-size: 2rem; } .stat span { color: var(--muted); font-size: .9rem; } .stat .ic { color: var(--c3); }
.section { padding: 5rem 0; } .section-sm { padding: 2rem 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 3rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature { padding: 1.75rem; transition: transform .3s ease, border-color .3s ease, box-shadow .3s; }
.feature:hover { transform: translateY(-6px) rotateX(2deg); border-color: var(--border-strong); box-shadow: var(--glow); }
.feature p { color: var(--muted); margin: 0; }
.feature-ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; margin-bottom: 1rem; box-shadow: 0 10px 30px -10px var(--c1); flex: none; }
.feature-ic .ic { width: 26px; height: 26px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; counter-reset: s; }
.step { padding: 2rem 1.5rem; position: relative; } .step p { color: var(--muted); margin: 0; }
.step-num { position: absolute; top: 1rem; right: 1.25rem; font: 800 3rem/1 var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--border-strong); }
.step-ic { width: 2rem; height: 2rem; color: var(--c3); margin-bottom: .8rem; }
.faq { display: grid; gap: .75rem; }
.faq details { padding: 0; border-radius: var(--radius-sm); }
.faq summary { cursor: pointer; padding: 1.1rem 1.25rem; font-weight: 700; list-style: none; display: flex; gap: .7rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq-ic { transition: transform .25s; } .faq details[open] .faq-ic { transform: rotate(45deg); }
.faq details[open] { border-color: var(--border-strong); } .faq details[open] summary { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--c3); }
.faq details p { padding: 0 1.25rem 1.2rem 3.1rem; color: var(--muted); margin: 0; }
.cta-band { text-align: center; padding: 4rem 2rem; border-radius: 28px; background: var(--grad-soft), var(--surface); }

/* ---------- Plans ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; align-items: stretch; }
.plan { padding: 2rem 1.6rem; display: flex; flex-direction: column; gap: .4rem; position: relative; }
.plan-hl { transform: translateY(-8px); background: var(--grad-soft), var(--surface); }
.plan-flag { position: absolute; top: -.85rem; left: 50%; transform: translateX(-50%); display: inline-flex; gap: .3rem; align-items: center; background: var(--text); color: var(--bg); font-weight: 800; font-size: .78rem; padding: .3rem .8rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.plan-price strong { font: 800 2.4rem/1 var(--display); } .plan-price span { color: var(--muted); margin-left: .3rem; }
.plan-credits { font-weight: 700; display: flex; gap: .4rem; align-items: center; } .plan-credits .ic { color: var(--warn); }
.plan-feats { list-style: none; padding: 0; margin: .5rem 0 1.25rem; display: grid; gap: .45rem; flex: 1; }
.plan-feats li { display: flex; gap: .5rem; } .plan-feats .ic { color: var(--ok); margin-top: .2em; }

/* ---------- Alerts, badges, tags, toasts ---------- */
.alert { display: flex; align-items: flex-start; gap: .55rem; padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; background: var(--surface-2); border: 1.5px solid var(--border-strong); border-left-width: 6px; }
.alert-success { border-left-color: var(--ok); } .alert-success > .ic { color: var(--ok); }
.alert-error { border-left-color: var(--bad); border-style: solid solid solid double; } .alert-error > .ic { color: var(--bad); }
.alert-info { border-left-color: var(--info); border-left-style: dashed; } .alert-info > .ic { color: var(--info); }
.alert span { flex: 1; }
.alert-close { background: none; border: 0; color: inherit; cursor: pointer; padding: .1rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1.5px solid currentColor; white-space: nowrap; }
.badge-done { color: var(--ok); } .badge-failed { color: var(--bad); border-style: double; border-width: 3px; }
.badge-processing { color: var(--info); border-style: dashed; } .badge-processing .ic { animation: spin-ic 2s linear infinite; }
.badge-queued { color: var(--muted); border-style: dotted; }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 8px; font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); }
.toast-wrap { position: fixed; right: 1rem; bottom: 1rem; z-index: 90; display: grid; gap: .5rem; max-width: min(380px, 100% - 2rem); }
.toast { display: flex; gap: .55rem; align-items: center; padding: .8rem 1rem; border-radius: 14px; background: var(--bg-2); border: 1.5px solid var(--border-strong); border-left-width: 6px; box-shadow: var(--shadow); animation: toast-in .35s cubic-bezier(.2,.9,.3,1.3); font-weight: 600; }
.toast-success { border-left-color: var(--ok); } .toast-error { border-left-color: var(--bad); border-left-style: double; } .toast-info { border-left-color: var(--info); border-left-style: dashed; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > label, .field legend { font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .4rem; }
.field small { color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; padding: .7rem .9rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); background: var(--bg-2); color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s; }
textarea { resize: vertical; min-height: 6rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--c3); box-shadow: 0 0 0 3px var(--focus); }
input[aria-invalid="true"] { border-color: var(--bad); border-style: dashed; }
input[disabled] { opacity: .6; }
input[type=color] { width: 100%; height: 2.6rem; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-2); padding: .2rem; }
input[type=range] { accent-color: var(--c3); width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--c1); width: 1.1rem; height: 1.1rem; }
.check { display: flex; gap: .55rem; align-items: center; font-weight: 500; cursor: pointer; }
.check.inline { display: inline-flex; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hint { font-size: .82rem; color: var(--muted); display: flex; gap: .35rem; margin: 0; }
.form-error { color: var(--bad); font-weight: 700; display: flex; gap: .4rem; border: 1.5px dashed var(--bad); padding: .5rem .75rem; border-radius: 10px; margin: 0; }
.form-error::before { content: "⚠"; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span, .seg-link { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 10px; border: 1.5px solid var(--border); cursor: pointer; font-weight: 600; font-size: .88rem; text-decoration: none; background: var(--surface); }
.seg-item input:checked + span, .seg-link.is-active { border-color: var(--text); border-width: 2px; background: var(--grad-soft), var(--surface-2); text-decoration: underline; text-underline-offset: 4px; }
.seg-item input:checked + span::before, .seg-link.is-active::before { content: "✓"; font-weight: 800; }
.seg-item input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.ratio-box { display: inline-block; width: calc(var(--w) / max(var(--w), var(--h)) * 16px); height: calc(var(--h) / max(var(--w), var(--h)) * 16px); border: 2px solid currentColor; border-radius: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; gap: .35rem; align-items: center; padding: .35rem .75rem; border-radius: 999px; border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text); font: 600 .8rem var(--font); cursor: pointer; transition: transform .15s, border-color .2s; }
.chip:hover { transform: translateY(-1px); border-style: solid; border-color: var(--c3); }
.inline-range { display: grid; grid-template-columns: 6.5rem 1fr 2.5rem; gap: .5rem; align-items: center; font-size: .85rem; font-weight: 600; }
.inline-range output { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.search { display: flex; align-items: center; gap: .4rem; flex: 1; max-width: 420px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 220px); display: grid; place-items: center; padding: 3rem 1rem; }
.auth-card { width: min(440px, 100%); padding: 2.2rem; }
.auth-head { text-align: center; margin-bottom: 1.25rem; } .auth-head .feature-ic { margin-inline: auto; }
.auth-alt { text-align: center; margin: 1.25rem 0 0; color: var(--muted); }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; gap: 1rem; padding: 1rem; }
.sidebar { position: sticky; top: 1rem; height: calc(100vh - 2rem); display: flex; flex-direction: column; padding: 1.2rem .9rem; overflow-y: auto; }
.sidebar .brand { padding: 0 .5rem 1.2rem; }
.side-nav { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .2rem; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 600; border: 1.5px solid transparent; transition: background .2s, color .2s; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.is-active { color: var(--text); background: var(--grad-soft); border-color: var(--border-strong); box-shadow: inset 4px 0 0 var(--c3); }
.side-nav a.is-active span { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.side-heading { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: .5rem .8rem; display: flex; gap: .4rem; align-items: center; font-weight: 700; }
.side-foot { margin-top: auto; }
.credit-card { display: grid; gap: .3rem; padding: 1rem; border-radius: 16px; text-decoration: none; background: var(--grad-soft), var(--surface-2); border: 1px solid var(--border-strong); }
.credit-card > .ic { color: var(--warn); width: 1.6rem; height: 1.6rem; } .credit-card strong { font: 800 1.6rem var(--display); }
.credit-plus { display: inline-flex; gap: .3rem; align-items: center; font-size: .85rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.main-col { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .65rem 1rem; position: sticky; top: 1rem; z-index: 15; }
.page-title { font-size: 1.25rem; margin: 0; }
.topbar-actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.pill { display: inline-flex; gap: .35rem; align-items: center; padding: .4rem .85rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); font-weight: 700; }
.pill .ic { color: var(--warn); }
.pill.bump, .credit-card.bump { animation: bump .5s ease; }
.content { min-width: 0; }
.only-mobile { display: none !important; }
.theme-toggle .only-light { display: none; }
[data-theme="light"] .theme-toggle .only-dark { display: none; } [data-theme="light"] .theme-toggle .only-light { display: inline-flex; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.grid-2.wide-left { grid-template-columns: 1.6fr 1fr; align-items: start; }
.big-number { font: 800 3.4rem/1 var(--display); margin: .4rem 0 .2rem; }
.delta { display: inline-flex; gap: .25rem; align-items: center; font-weight: 700; }
.delta.is-plus { color: var(--ok); } .delta.is-minus { color: var(--bad); }
.danger-zone { border: 2px dashed var(--bad); margin-top: 1rem; max-width: 560px; }
.toolbar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.empty { padding: 3rem; text-align: center; display: grid; justify-items: center; gap: .5rem; }
.pager { display: flex; gap: .35rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pager-link { min-width: 2.4rem; padding: .4rem .6rem; text-align: center; border-radius: 10px; border: 1.5px solid var(--border); text-decoration: none; font-weight: 700; }
.pager-link.is-current { border-color: var(--text); border-width: 2px; text-decoration: underline; background: var(--surface-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .6rem .7rem; border-bottom: 2px solid var(--border-strong); }
.table td { padding: .65rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: var(--surface); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.compact td { padding: .45rem .5rem; }
.inline { display: inline; }
.user-form { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.user-form select, .user-form input { width: auto !important; padding: .35rem .5rem !important; }
.w-sm { width: 5.5rem !important; }

/* ---------- Admin ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { display: flex; gap: .9rem; align-items: center; padding: 1.1rem; } .stat-card .feature-ic { margin: 0; } .stat-card p { margin: 0; }
.stat-value { font: 800 1.7rem var(--display); }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .35rem; height: 200px; align-items: end; padding-top: 1.5rem; }
.bar { height: var(--h); min-height: 3px; background: var(--grad); border-radius: 6px 6px 0 0; position: relative; animation: grow .8s ease both; }
.bar-val { position: absolute; top: -1.3rem; left: 0; right: 0; text-align: center; font-size: .7rem; font-weight: 700; }
.bar-day { position: absolute; bottom: -1.3rem; left: 0; right: 0; text-align: center; font-size: .7rem; color: var(--muted); }
.status-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.provider-grid section { display: grid; gap: .9rem; align-content: start; }
.routing { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.test-result { margin: 0; padding: .6rem .8rem; border-radius: 10px; font-weight: 700; border: 1.5px solid; display: flex; gap: .4rem; }
.test-result.ok { color: var(--ok); } .test-result.bad { color: var(--bad); border-style: dashed; }
.error-card { margin-top: 4rem; } .error-code { font: 800 6rem/1 var(--display); margin: 0; }
.prose { max-width: 760px; } .prose h2 { margin-top: 1.5em; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease var(--d, 0ms), transform .7s ease var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes shine { to { background-position: 220% center; } }
@keyframes spin { to { --angle: 360deg; } }
@keyframes spin-ic { to { transform: rotate(360deg); } }
@keyframes drift { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(8vw, 6vh) scale(1.15); } 100% { transform: translate(-6vw, 10vh) scale(.95); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes scroll-y { to { transform: translateY(-50%); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes bump { 40% { transform: scale(1.15); } }
@keyframes grow { from { height: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {


  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; } .hero { padding-top: 3rem; }
  .site-nav { display: none; }
  .shell { grid-template-columns: 1fr; padding: .6rem; }
  .sidebar { position: fixed; left: .6rem; top: .6rem; bottom: .6rem; height: auto; width: 270px; z-index: 50; transform: translateX(-120%); transition: transform .3s ease; background: var(--bg-2); }
  .sidebar.is-open { transform: none; }
  .only-mobile { display: inline-flex !important; }
  .grid-2, .grid-2.wide-left, .steps, .stats-row { grid-template-columns: 1fr 1fr; }
  .topbar { top: .6rem; }
}
@media (max-width: 640px) {
  .feature-grid, .grid-2, .grid-2.wide-left, .steps, .row-2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .nav-actions:has(.btn-ghost) .btn-glow { display: none; } /* guests: keep "Log in", hero already has the sign-up CTA */
  .float-chip { display: none; }
  .site-header { border-radius: 20px; }
  .section { padding: 3.5rem 0; }
}

/* ---------- Motion & contrast preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }

}
@media (prefers-contrast: more) {
  :root { --border: rgba(255,255,255,.5); --border-strong: #fff; --muted: #e4e6f5; }
  [data-theme="light"] { --border: #333; --border-strong: #000; --muted: #222; }
  .glass { backdrop-filter: none; background: var(--bg-2); }
}
@media print { .aurora, .sidebar, .topbar, .site-header { display: none; } }

/* v1.1 SaaS: plan strip, upgrade prompt, low-credit flag (shape + text cues, not colour only) */
.plan-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.plan-strip > div { display: flex; flex-direction: column; gap: .2rem; }
.plan-strip-name { font: 800 1.25rem var(--display); }
.plan-strip-actions { flex-direction: row !important; flex-wrap: wrap; gap: .5rem !important; justify-content: flex-end; }
.plan-strip.is-low { border: 2px dashed var(--warn); }
.low-flag { display: inline-flex; gap: .3rem; align-items: center; padding: .1rem .5rem; border: 2px solid currentColor; border-radius: 8px; width: fit-content; }
.upgrade-box { display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center; padding: 1.5rem; border: 2px dashed var(--warn); border-radius: 16px; }
.upgrade-box .ic-lg { width: 2.2rem; height: 2.2rem; }
.rate-grid input { width: 5.5rem; }
.saas-off-flag { display: inline-flex; gap: .35rem; align-items: center; font-weight: 700; padding: .2rem .6rem; border: 2px solid currentColor; border-radius: 999px; }

/* v1.1 public demo mode: high-contrast banner (text + icon, never colour only) */
.demo-banner { position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center;
  padding: .55rem 1rem; background: #000; color: #fff; border-bottom: 3px dashed #fff; font-size: .95rem; text-align: center; }
.demo-banner strong { letter-spacing: .12em; padding: .1rem .5rem; border: 2px solid #fff; border-radius: 6px; }
.demo-banner .ic { width: 1.1em; height: 1.1em; }
.demo-logins { display: grid; gap: .6rem; margin-bottom: 1.2rem; padding: 1rem; border: 2px dashed var(--border-strong); border-radius: 14px; }
.demo-logins p { margin: 0; }

/* ==========================================================================
   Analytics UI (v1.0). Series and states always differ by shape, pattern,
   arrow or word as well as colour (colour-blind safe).
   ========================================================================== */
.alert-warn { border-left: 4px dashed var(--warn); }
.alert-inline { display: flex; gap: .4rem; align-items: center; margin: 0; font-weight: 600; text-decoration: underline dotted; }
.small { font-size: .88rem; } .empty-sm { margin: .25rem 0 0; }
.btn-xs { padding: .2rem .5rem; font-size: .78rem; border-radius: 8px; gap: .25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.grid-2 + .grid-3, .grid-3 + .grid-2, .glass + .grid-2, .grid-2 + .glass { margin-top: 1rem; }

/* Site cards */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.site-card { display: grid; gap: .6rem; color: inherit; text-decoration: none; transition: transform .25s, border-color .25s, box-shadow .25s; }
.site-card:hover, .site-card:focus-visible { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--glow); }
.site-card-head { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.site-card-head strong { font: 700 1.15rem var(--display); }
.site-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.site-card-stats span { display: flex; flex-direction: column; } .site-card-stats strong { font: 800 1.3rem var(--display); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 48px; }
.spark span { flex: 1; min-height: 4px; border-radius: 3px 3px 0 0; background: var(--grad); opacity: .85; }
.add-site { max-width: 760px; }

/* Live */
.live-pill { display: inline-flex; gap: .4rem; align-items: center; padding: .3rem .75rem; border-radius: 999px; border: 2px solid var(--ok); font-weight: 700; font-size: .88rem; background: var(--surface); }
.live-pill.is-zero { border-style: dashed; border-color: var(--border-strong); }
.live-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: live 2s infinite; display: inline-block; }
.live-pill.is-zero .live-dot { animation: none; background: transparent; border: 2px solid var(--muted); }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); } 70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
.live-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.live-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem .6rem; border-radius: 8px; background: var(--surface); }

/* Toolbar */
.site-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.toolbar-end { margin-left: auto; display: flex; flex-wrap: wrap; gap: .4rem; }
.share-head { margin-bottom: 1rem; }

/* Deltas: arrow + sign + word */
.delta { font-size: .85rem; } .delta small { font-weight: 600; opacity: .9; }
.delta.is-flat { color: var(--muted); }

/* Chart */
.chart { margin: 0; }
.chart > svg { width: 100%; height: 240px; display: block; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-bar { fill: var(--c1); opacity: .75; }
.chart-col:hover .chart-bar { opacity: 1; }
.chart-line { fill: none; stroke: var(--c3); stroke-width: 2.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.chart-dot { fill: var(--bg); stroke: var(--c3); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: .5rem; font-size: .88rem; }
.chart-legend span { display: inline-flex; gap: .45rem; align-items: center; }
.lg-bar { width: 14px; height: 14px; border-radius: 3px; background: var(--c1); display: inline-block; }
.lg-dot { width: 22px; height: 12px; display: inline-block; background: radial-gradient(circle, var(--bg) 2.5px, var(--c3) 3px, var(--c3) 4.5px, transparent 5px) center/12px 12px no-repeat, linear-gradient(90deg, var(--c3) 50%, transparent 0) center/6px 2px repeat-x; }
.chart-table { margin-top: .5rem; } .chart-table summary { cursor: pointer; font-weight: 600; display: inline-flex; gap: .35rem; align-items: center; }

/* Top lists: bar + visible number + percent */
.toplist h2 { display: flex; gap: .4rem; align-items: center; margin-top: 0; }
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.tl li { position: relative; display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem; border-radius: 8px; overflow: hidden; }
.tl-bar { position: absolute; inset: 0 auto 0 0; background: var(--grad-soft); border-right: 2px solid var(--c3); border-radius: 8px; z-index: 0; }
.tl-label, .tl-num, .tl-act { position: relative; z-index: 1; }
.tl-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-num { white-space: nowrap; } .tl-num small { color: var(--muted); margin-left: .2rem; }
.tl-act { opacity: .85; } .tl li:hover .tl-act, .tl-act:focus-visible { opacity: 1; }

/* AI panel + chat */
.ai-panel { margin: 1rem 0; display: grid; gap: .8rem; }
.ai-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: center; } .ai-head h2 { margin: 0; }
.chat { display: grid; gap: .6rem; max-height: 420px; overflow-y: auto; padding-right: .25rem; }
.msg { padding: .7rem .9rem; border-radius: 14px; line-height: 1.55; max-width: 92%; }
.msg-me { justify-self: end; background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom-right-radius: 4px; }
.msg-ai { justify-self: start; background: var(--grad-soft), var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c3); border-bottom-left-radius: 4px; }
.msg b { display: inline-flex; gap: .3rem; align-items: center; }
.msg-body p { margin: .35rem 0; } .msg-body ul { margin: .35rem 0; padding-left: 1.2rem; } .msg-body li { margin: .2rem 0; }
.msg-body small { display: flex; gap: .3rem; align-items: center; margin-top: .4rem; }
.ask-form { display: flex; gap: .5rem; }
.ask-form input { flex: 1; min-width: 0; }
.chip-strong { border-style: solid; border-width: 2px; font-weight: 700; }
.chip:disabled, .ask-form button:disabled { opacity: .55; cursor: progress; }
.tips-out { margin: 1rem 0; border-left: 4px solid var(--c3); }

/* Code box / settings lists */
.code-box { position: relative; display: grid; gap: .5rem; padding: .9rem; border-radius: 12px; background: rgba(0,0,0,.45); border: 1px solid var(--border-strong); }
[data-theme="light"] .code-box { background: #0d0d24; color: #f5f6ff; }
.code-box pre { margin: 0; overflow-x: auto; font-size: .85rem; white-space: pre-wrap; word-break: break-all; }
.code-box .btn { justify-self: start; }
.row-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .4rem; }
.row-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem .7rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }

/* Landing mock dashboard */
.mock { padding: 1.3rem; border-radius: 24px; display: grid; gap: 1rem; }
.mock-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.mock-stats > div { display: flex; flex-direction: column; gap: .15rem; padding: .7rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.mock-stats strong { font: 800 1.35rem var(--display); }
.mock-bars { display: flex; align-items: flex-end; gap: 5px; height: 130px; }
.mock-bars span { flex: 1; border-radius: 4px 4px 0 0; background: var(--grad); animation: grow 1.2s ease both; }
.mock-ai { display: flex; gap: .6rem; padding: .8rem; border-radius: 14px; background: var(--grad-soft); border: 1px solid var(--border-strong); border-left: 4px solid var(--c3); }
.mock-ai p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; } .mock-ai > .ic { color: var(--c3); flex: none; margin-top: .15rem; }

@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .grid-3, .mock-stats { grid-template-columns: 1fr; }
  .ask-form { flex-direction: column; }
  .toolbar-end { margin-left: 0; }
  .msg { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Stat cards on the site dashboard: label, value and delta stacked */
.stat-cards .stat-card { flex-direction: column; align-items: flex-start; gap: .3rem; min-width: 0; }
.stat-cards .stat-card small.muted { display: inline-flex; gap: .35rem; align-items: center; }
.stat-value { font: 800 1.9rem/1.1 var(--display); letter-spacing: -.02em; }
.stat-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.delta { display: inline-flex; gap: .3rem; align-items: baseline; flex-wrap: wrap; font-weight: 700; }
.chart-table .table-wrap { max-height: 320px; overflow: auto; margin-top: .5rem; }
