/* ============================================================================
   TrafficLens — design system
   Modern SaaS UI: tokens, layout shell, components, responsive, motion.
   ========================================================================== */

/* ---- Tokens ---------------------------------------------------------------- */
:root {
  --bg:           #f6f7f9;
  --surface:      #ffffff;
  --surface-2:    #f9fafb;
  --surface-3:    #f2f3f7;
  --border:       #e9eaef;
  --border-strong:#dcdde4;

  --text:   #14151a;
  --text-2: #5b6070;
  --text-3: #9094a1;

  --primary:      #5b5bd6;
  --primary-600:  #4f46e5;
  --primary-700:  #4338ca;
  --primary-tint: #eef0ff;
  --primary-ring: rgba(91, 91, 214, 0.28);

  --green: #15a34a;  --green-tint: #e7f8ee;
  --amber: #c2700a;  --amber-tint: #fdf1de;
  --red:   #df3550;  --red-tint:   #fdebee;
  --cyan:  #0891b2;

  --shadow-xs: 0 1px 2px rgba(16,17,26,.05);
  --shadow-sm: 0 1px 3px rgba(16,17,26,.07), 0 1px 2px rgba(16,17,26,.04);
  --shadow:    0 6px 20px rgba(16,17,26,.08);
  --shadow-lg: 0 16px 40px rgba(16,17,26,.14);

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #6d28d9 100%);
  --ease: cubic-bezier(.16,1,.3,1);

  --sidebar-w: 252px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary-600); text-decoration: none; }
a:hover { color: var(--primary-700); }
h1,h2,h3,h4 { margin: 0; font-weight: 680; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
small { font-size: 12.5px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px;
  background: var(--surface-3); padding: 2px 7px; border-radius: 6px; }
::selection { background: var(--primary-tint); }
svg { display: block; }

/* ---- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font: inherit; font-weight: 560; font-size: 14px;
  padding: 10px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s, color .15s;
}
.btn:hover { background: var(--surface-2); border-color: #c7c9d2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--primary-600); border-color: var(--primary-600); color: #fff;
  box-shadow: 0 1px 2px rgba(79,70,229,.35), 0 4px 14px rgba(79,70,229,.25);
}
.btn-primary:hover { background: var(--primary-700); border-color: var(--primary-700); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 7px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--red); border-color: transparent; background: transparent; }
.btn-danger:hover { background: var(--red-tint); color: var(--red); }

/* ---- Forms ----------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-size: 13px; font-weight: 560; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.input {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 11px 13px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.input:disabled { background: var(--surface-3); cursor: not-allowed; }

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--r);
  background: var(--surface-2); padding: 30px 22px; text-align: center;
  cursor: pointer; transition: border-color .18s, background .18s, transform .18s;
}
.dropzone:hover { border-color: var(--primary); background: var(--primary-tint); }
.dropzone.dragover { border-color: var(--primary); background: var(--primary-tint); transform: scale(1.01); }
.dropzone .dz-icon { width: 44px; height: 44px; margin: 0 auto 10px;
  display: grid; place-items: center; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--primary-600); box-shadow: var(--shadow-xs); }
.dropzone .dz-icon svg { width: 22px; height: 22px; }
.dropzone strong { color: var(--text); }
.dropzone .dz-file { color: var(--primary-700); font-weight: 560; }

/* ---- Cards ----------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm);
}
.card-pad-lg { padding: 26px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-head .sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.divider { height: 1px; background: var(--border); margin: 18px -22px; }

/* ---- Stat cards ------------------------------------------------------------ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 16px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px; box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
}
.stat-card .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary-tint); color: var(--primary-600); margin-bottom: 14px; }
.stat-card .ic svg { width: 19px; height: 19px; }
.stat-card .ic.green { background: var(--green-tint); color: var(--green); }
.stat-card .ic.amber { background: var(--amber-tint); color: var(--amber); }
.stat-card .ic.red   { background: var(--red-tint);   color: var(--red); }
.stat-card .val { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stat-card .lbl { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* ---- Badges / pills -------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 560;
  padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2);
  border: 1px solid var(--border);
}
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok      { background: var(--green-tint); color: var(--green); border-color: transparent; }
.badge-warn    { background: var(--amber-tint); color: var(--amber); border-color: transparent; }
.badge-err     { background: var(--red-tint);   color: var(--red);   border-color: transparent; }
.badge-info    { background: var(--primary-tint);color: var(--primary-700); border-color: transparent; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px; text-transform: capitalize; }
.status-pill::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
.status-queued  { background: var(--surface-3); color: var(--text-2); }
.status-running { background: var(--primary-tint); color: var(--primary-700); }
.status-done    { background: var(--green-tint); color: var(--green); }
.status-failed, .status-canceled { background: var(--red-tint); color: var(--red); }

/* ---- Progress -------------------------------------------------------------- */
.bar { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--grad); border-radius: 999px;
  transition: width .5s var(--ease); }
.bar.indeterminate > span { width: 35% !important; animation: slide 1.2s infinite var(--ease); }
@keyframes slide { 0%{margin-left:-35%} 100%{margin-left:100%} }

/* ---- Tables ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; white-space: nowrap; }
table.data thead th {
  position: sticky; top: 0; background: var(--surface-2); color: var(--text-2);
  font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border); cursor: pointer; user-select: none;
}
table.data thead th .arr { opacity: .4; font-size: 10px; }
table.data tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
table.data tbody tr:last-child { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td { color: var(--text-2); }
table.data td.num { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 560; }
table.data td .u { color: var(--text); font-weight: 560; }

/* ---- Layout: app shell ----------------------------------------------------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 16px 14px;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 8px 8px 16px; font-weight: 700; font-size: 16px; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.4); }
.brand .logo svg { width: 17px; height: 17px; }
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 540; font-size: 14px; transition: background .14s, color .14s; }
.nav a svg { width: 18px; height: 18px; opacity: .85; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--primary-tint); color: var(--primary-700); }
.nav a.active svg { opacity: 1; }
.nav .nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
  padding: 14px 11px 6px; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); }
.user-chip .av { width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.user-chip .who { overflow: hidden; }
.user-chip .who .e { font-size: 13px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who .r { font-size: 11.5px; color: var(--text-3); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.8);
  backdrop-filter: saturate(160%) blur(8px); position: sticky; top: 0; z-index: 20; }
.topbar .pt { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.topbar .actions { display: flex; align-items: center; gap: 12px; }
.content { padding: 28px; max-width: var(--maxw); width: 100%; margin: 0 auto; }
.page-head { margin-bottom: 22px; }
.page-head p { color: var(--text-2); margin-top: 5px; }
.section-gap { margin-top: 24px; }

/* ---- Access pill ----------------------------------------------------------- */
.access-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 540;
  padding: 6px 12px; border-radius: 999px; }
.access-pill svg { width: 15px; height: 15px; }
.access-on  { background: var(--green-tint); color: var(--green); }
.access-off { background: var(--amber-tint); color: var(--amber); }

/* ---- Flash / banners ------------------------------------------------------- */
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r);
  font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.banner svg { width: 18px; height: 18px; flex: none; }
.banner-ok  { background: var(--green-tint); color: #0f7a37; border-color: rgba(21,163,74,.2); }
.banner-err { background: var(--red-tint);   color: #b81f38; border-color: rgba(223,53,80,.2); }
.banner-info{ background: var(--primary-tint);color: var(--primary-700); border-color: rgba(91,91,214,.2); }

/* ---- Toasts ---------------------------------------------------------------- */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--r-sm);
  padding: 12px 15px; box-shadow: var(--shadow-lg); font-size: 14px; min-width: 240px; max-width: 360px;
  animation: toastIn .3s var(--ease); }
.toast.ok  { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---- Empty state ----------------------------------------------------------- */
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .ic { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-3); }
.empty .ic svg { width: 26px; height: 26px; }
.empty h3 { color: var(--text); margin-bottom: 5px; }

/* ---- Skeleton -------------------------------------------------------------- */
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, #eceef3 37%, var(--surface-3) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { 0%{background-position:100% 0} 100%{background-position:-100% 0} }
.spinner { width: 16px; height: 16px; border: 2px solid var(--primary-ring); border-top-color: var(--primary-600);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Job list -------------------------------------------------------------- */
.job { border: 1px solid var(--border); border-radius: var(--r); padding: 16px; background: var(--surface);
  transition: box-shadow .18s, border-color .18s; }
.job:hover { box-shadow: var(--shadow-sm); }
.job + .job { margin-top: 12px; }
.job-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.job-name { font-weight: 600; word-break: break-all; }
.job-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.job-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin-top: 12px; align-items: center; }
.job-meta .s-ok { color: var(--green); } .job-meta .s-unreg { color: var(--amber); } .job-meta .s-fail { color: var(--red); }
.job-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* ---- Single result card ---------------------------------------------------- */
.res-card { border: 1px solid var(--border); border-radius: var(--r); padding: 20px; background: var(--surface-2); }
.res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 12px; }
.res-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; }
.res-stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); }
.res-stat .v { font-size: 19px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.res-line { font-size: 13px; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-2); }
.res-line b { color: var(--text); font-weight: 560; }
.delta-up { color: var(--green); } .delta-down { color: var(--red); }

/* ---- Toolbar (results filters) -------------------------------------------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { position: relative; flex: 1; min-width: 220px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.toolbar .search .input { padding-left: 38px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; font: inherit; font-size: 13px; font-weight: 540;
  color: var(--text-2); padding: 6px 12px; border-radius: 6px; cursor: pointer; transition: all .14s; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* ---- Public nav + landing -------------------------------------------------- */
.pub-nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; max-width: 1200px; margin: 0 auto; }
.pub-wrap { background: var(--surface); border-bottom: 1px solid var(--border); }
.pub-nav .links { display: flex; align-items: center; gap: 10px; }
.pub-nav .links a.txt { color: var(--text-2); font-weight: 540; padding: 8px 12px; }
.pub-nav .links a.txt:hover { color: var(--text); }

.hero { max-width: 920px; margin: 0 auto; padding: 80px 24px 50px; text-align: center; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 560;
  color: var(--primary-700); background: var(--primary-tint); padding: 6px 14px; border-radius: 999px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.05; letter-spacing: -0.035em; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(16px, 2.4vw, 20px); color: var(--text-2); max-width: 620px; margin: 20px auto 0; }
.hero .cta { display: flex; gap: 12px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.hero .trust { margin-top: 18px; font-size: 13px; color: var(--text-3); }

.preview { max-width: 1000px; margin: 10px auto 0; padding: 0 24px; }
.preview .frame { border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface);
  box-shadow: var(--shadow-lg); overflow: hidden; }
.preview .frame .bar-top { display: flex; gap: 7px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.preview .frame .bar-top i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.preview .frame .body { padding: 22px; }
.glow { position: relative; }
.glow::before { content: ""; position: absolute; inset: -10% 10% auto 10%; height: 280px; z-index: -1;
  background: radial-gradient(60% 100% at 50% 0%, rgba(124,92,246,.25), transparent 70%); filter: blur(20px); }

.section { max-width: var(--maxw); margin: 0 auto; padding: 70px 24px; }
.section-title { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-title h2 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.03em; }
.section-title p { color: var(--text-2); margin-top: 12px; font-size: 17px; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px;
  box-shadow: var(--shadow-xs); transition: transform .2s var(--ease), box-shadow .2s; }
.feat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feat .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--primary-tint); color: var(--primary-600); margin-bottom: 16px; }
.feat .ic svg { width: 21px; height: 21px; }
.feat h3 { font-size: 17px; margin-bottom: 7px; }
.feat p { color: var(--text-2); font-size: 14px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.step { padding: 24px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.step .n { counter-increment: s; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 700; margin-bottom: 14px; }
.step .n::before { content: counter(s); }

.cta-band { max-width: var(--maxw); margin: 0 auto 70px; padding: 0 24px; }
.cta-inner { background: var(--grad); border-radius: var(--r-xl); padding: 54px 32px; text-align: center; color: #fff;
  box-shadow: var(--shadow-lg); }
.cta-inner h2 { color: #fff; font-size: clamp(26px, 4vw, 36px); }
.cta-inner p { color: rgba(255,255,255,.85); margin: 12px auto 26px; max-width: 480px; }
.cta-inner .btn { background: #fff; color: var(--primary-700); border-color: #fff; }
.cta-inner .btn:hover { background: #f3f3ff; }

.pub-foot { border-top: 1px solid var(--border); background: var(--surface); }
.pub-foot .inner { max-width: var(--maxw); margin: 0 auto; padding: 28px 24px; display: flex;
  justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--text-3); font-size: 13px; }

/* ---- Auth (split) ---------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth .form-side { background: var(--bg); }
.auth .brand-side { background: var(--grad); color: #fff; position: relative; overflow: hidden; }
.auth .brand-side .inner { max-width: 420px; padding: 48px; }
.auth .brand-side h2 { color: #fff; font-size: 30px; letter-spacing: -.03em; }
.auth .brand-side p { color: rgba(255,255,255,.85); margin-top: 14px; font-size: 16px; }
.auth .brand-side ul { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 14px; }
.auth .brand-side li { display: flex; gap: 11px; align-items: center; font-size: 15px; }
.auth .brand-side li svg { width: 20px; height: 20px; flex: none; }
.auth .brand-side .blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); filter: blur(2px); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-bottom: 26px; }
.auth-card h1 { font-size: 24px; }
.auth-card .sub { color: var(--text-2); margin: 6px 0 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .alt { text-align: center; margin-top: 20px; color: var(--text-2); font-size: 14px; }

/* ---- Helpers --------------------------------------------------------------- */
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.hide { display: none !important; }
.text-c { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* ---- Responsive ------------------------------------------------------------ */
@media (max-width: 980px) {
  .feat-grid, .steps { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth .brand-side { display: none; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center;
    overflow-x: auto; padding: 10px 14px; border-right: none; border-bottom: 1px solid var(--border); z-index: 30; }
  .sidebar .brand { padding: 0 14px 0 4px; white-space: nowrap; }
  .nav { flex-direction: row; margin-top: 0; gap: 4px; }
  .nav .nav-label, .sidebar-foot { display: none; }
  .nav a { white-space: nowrap; }
  .content { padding: 20px 16px; }
  .topbar { padding: 0 16px; height: 58px; }
  .topbar .pt { font-size: 15px; }
}
@media (max-width: 620px) {
  .feat-grid, .steps { grid-template-columns: 1fr; }
  .hero { padding-top: 52px; }
  .topbar .actions .hide-sm { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   TrafficLens — public site: sticky nav, sections, pricing, FAQ, footer
   ══════════════════════════════════════════════════════════════════════ */

/* ── Sticky nav + mobile hamburger ─────────────────────────────────── */
html, body { overflow-x: hidden; max-width: 100%; }   /* no horizontal scroll on mobile */
.hero h1 { overflow-wrap: break-word; max-width: 100%; }
.pub-nav-wrap { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border); }
.pub-nav { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; background: transparent; border: 0; }
.pub-nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); }
.nav-toggle { display: none; }

/* inline icons in flowing text must not blow up (no intrinsic size on <svg>) */
.trust { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 4px; }
.trust svg { width: 14px; height: 14px; color: var(--green); flex: none; }

/* ── Metrics strip ─────────────────────────────────────────────────── */
.metric-strip { max-width: var(--maxw); margin: 40px auto 0; padding: 24px; display: grid;
  grid-template-columns: repeat(4, 1fr); gap: 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ms-item { text-align: center; }
.ms-item strong { display: block; font-size: 27px; font-weight: 700; letter-spacing: -.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ms-item span { font-size: 13px; color: var(--text-3); }

/* ── Alternating full-bleed section background ─────────────────────── */
.section-alt { background: var(--surface-2); max-width: none; border-block: 1px solid var(--border); }
.section-alt > * { max-width: var(--maxw); margin-inline: auto; }

/* ── Data fields showcase ──────────────────────────────────────────── */
.data-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.data-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.data-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.data-card .ic { width: 42px; height: 42px; border-radius: 11px; background: var(--primary-tint);
  color: var(--primary-700); display: grid; place-items: center; margin-bottom: 14px; }
.data-card .ic svg { width: 21px; height: 21px; }
.data-card h3 { font-size: 16px; margin-bottom: 12px; }
.data-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.data-card li { position: relative; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.data-card li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--primary); }

/* ── Step number (explicit text, not counter) ──────────────────────── */
.step .n::before { content: none; }
.step .n { display: grid; place-items: center; font-weight: 700; }

/* ── Pricing ───────────────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: stretch; }
.price-card { position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 26px 22px; display: flex; flex-direction: column;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.price-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.price-card.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
.price-card.featured:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--primary), var(--shadow-lg); }
.pc-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--grad);
  color: #fff; font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.pc-name { font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.pc-price { font-size: 34px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; }
.pc-price span { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 6px; }
.pc-credits { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; font-weight: 560;
  color: var(--primary-700); background: var(--primary-tint); padding: 7px 12px; border-radius: 8px; align-self: flex-start; }
.pc-credits svg { width: 16px; height: 16px; }
.pc-rate { margin-top: 10px; font-size: 13px; color: var(--text-3); }
.pc-feats { list-style: none; padding: 0; margin: 18px 0 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pc-feats li { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); }
.pc-feats li svg { width: 16px; height: 16px; color: var(--green); flex: none; }
.pricing-note { text-align: center; color: var(--text-3); font-size: 13px; margin: 24px auto 0; max-width: 560px; }
.pc-rate { min-height: 18px; }

/* ── Pricing page header ───────────────────────────────────────────── */
.page-head { max-width: 760px; margin: 0 auto; text-align: center; padding: 64px 24px 10px; }
.page-head .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 560;
  color: var(--primary-700); background: var(--primary-tint); padding: 6px 12px; border-radius: 999px; }
.page-head .eyebrow svg { width: 15px; height: 15px; }
.page-head h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.03em; margin-top: 18px; }
.page-head .lead { font-size: clamp(15px, 2.2vw, 18px); color: var(--text-2); max-width: 600px; margin: 16px auto 0; }

/* ── "Every plan includes" grid ────────────────────────────────────── */
.incl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.incl { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px; font-size: 14px; font-weight: 540; }
.incl svg { width: 19px; height: 19px; color: var(--primary); flex: none; }

/* ── FAQ (native details/summary) ──────────────────────────────────── */
.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 560; font-size: 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .chev { color: var(--text-3); transition: transform .2s var(--ease); flex: none; }
.faq-item .chev svg { width: 18px; height: 18px; }
.faq-item[open] .chev { transform: rotate(45deg); }
.faq-item p { padding: 0 20px 18px; color: var(--text-2); font-size: 14px; line-height: 1.65; margin: 0; }

/* ── Contact card ──────────────────────────────────────────────────── */
.contact-card { max-width: 620px; margin: 0 auto; text-align: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl); padding: 44px 28px; box-shadow: var(--shadow-sm); }
.contact-card .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-tint);
  color: var(--primary-700); display: grid; place-items: center; margin: 0 auto 18px; }
.contact-card .ic svg { width: 26px; height: 26px; }
.contact-card h2 { font-size: clamp(22px, 3.4vw, 27px); letter-spacing: -.02em; }
.contact-card p { color: var(--text-2); margin: 12px 0 24px; }
.contact-card .btn svg { width: 18px; height: 18px; }

/* ── Footer ────────────────────────────────────────────────────────── */
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 48px 24px 30px; display: grid;
  grid-template-columns: 1.4fr 2fr; gap: 40px; }
.foot-brand .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); }
.foot-brand p { color: var(--text-2); font-size: 14px; margin-top: 14px; max-width: 320px; line-height: 1.6; }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.foot-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 12px; }
.foot-col a { display: block; color: var(--text-2); font-size: 14px; padding: 5px 0; }
.foot-col a:hover { color: var(--text); }
.foot-bottom { border-top: 1px solid var(--border); }
.foot-bottom { max-width: var(--maxw); margin: 0 auto; padding: 20px 24px; display: flex;
  justify-content: space-between; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; }
.foot-bottom a { color: var(--text-3); }
.foot-bottom a:hover { color: var(--text); }

/* ── Responsive: tablet ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .data-grid { grid-template-columns: repeat(2, 1fr); }
  .incl-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-strip { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .foot-inner { grid-template-columns: 1fr; gap: 28px; }
}

/* ── Responsive: mobile nav (hamburger) ────────────────────────────── */
@media (max-width: 820px) {
  .nav-toggle { display: flex; flex-direction: column; gap: 5px; width: 42px; height: 42px;
    align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; cursor: pointer; }
  .nav-toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s var(--ease); }
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .pub-nav .links { position: absolute; top: calc(100% + 1px); left: 0; right: 0; flex-direction: column;
    align-items: stretch; gap: 4px; background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); padding: 12px 16px 18px; display: none; }
  body.nav-open .pub-nav .links { display: flex; }
  .pub-nav .links a.txt { padding: 12px; border-radius: 8px; }
  .pub-nav .links a.txt:hover { background: var(--surface-2); }
  .pub-nav .links .btn { justify-content: center; width: 100%; margin-top: 6px; }
  .pub-nav .links .login-link { order: -1; }
}

/* ── Responsive: phone ─────────────────────────────────────────────── */
@media (max-width: 560px) {
  .pricing-grid, .data-grid, .incl-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); padding: 20px; }
  .section { padding: 46px 20px; }
  .hero { padding: 50px 20px 32px; }
  .hero h1 { font-size: 30px; }
  .preview { padding: 0 14px; }
  .preview .frame .body { padding: 14px; }
  .trust { font-size: 12px; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-bottom { flex-direction: column; text-align: center; }
  .contact-card { padding: 34px 20px; }
  .contact-card .btn { width: 100%; word-break: break-word; }
  .price-card.featured { order: -1; }
}
