/* PopupBox – warm, friendly, content-first. System fonts only (no third-party requests). */
:root {
  --ink: #221226;          /* headings, primary text */
  --navy: #4a1538;         /* dark brand surface (plum) */
  --navy-2: #6e1f4f;
  --blue: #e8365d;         /* primary action (PopupBox rose) */
  --blue-hover: #cf2350;
  --blue-soft: #fdeef2;
  --sky: #fbd3dd;
  --bg: #faf7f8;
  --surface: #ffffff;
  --text: #2e2230;
  --muted: #72647a;
  --line: #efe6ea;
  --line-strong: #dccfd6;
  --ok: #0a8a55;
  --ok-bg: #e5f6ee;
  --warn: #9a5b00;
  --warn-bg: #fff4e0;
  --error: #c4221b;
  --error-bg: #fdecea;
  --brand-rgb: 232, 54, 93;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(34, 18, 38, .06);
  --shadow: 0 2px 6px rgba(34, 18, 38, .04), 0 12px 32px rgba(34, 18, 38, .08);
  --shadow-lg: 0 24px 64px rgba(74, 21, 56, .18);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-hover); }
h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
code { font-family: var(--mono); font-size: .88em; background: var(--blue-soft); color: var(--navy); padding: .15em .45em; border-radius: 8px; word-break: break-all; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--sky); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 36px; padding-bottom: 80px; min-height: 70vh; }
.main--full { padding-top: 0; padding-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.inline { display: inline; }
.ok { color: var(--ok); font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }

/* ---------- Top bar ---------- */
.topbar { background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.brand__mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--blue), var(--navy)); color: #fff; box-shadow: 0 6px 16px rgba(var(--brand-rgb), .3); }
.topbar__nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.topbar__nav > a:not(.btn) { text-decoration: none; font-weight: 600; color: var(--ink); }
.topbar__nav > a:not(.btn):hover { color: var(--blue); }
.topbar__user { color: var(--muted); font-size: .9rem; }

/* ---------- Buttons (pill) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 22px; border-radius: 999px; border: 2px solid transparent; font: inherit; font-weight: 700; letter-spacing: -.005em; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .18s, border-color .18s, color .18s, transform .08s, box-shadow .18s; }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(var(--brand-rgb), .28); }
.btn--primary:hover { background: var(--blue-hover); color: #fff; box-shadow: 0 8px 24px rgba(var(--brand-rgb), .36); }
.btn--dark { background: var(--navy); color: #fff; }
.btn--dark:hover { background: var(--ink); color: #fff; }
.btn--outline, .btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--outline:hover, .btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--ghost { border-color: var(--line-strong); background: var(--surface); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--white { background: #fff; color: var(--navy); }
.btn--white:hover { background: var(--sky); color: var(--navy); }
.btn--danger { background: var(--error); color: #fff; }
.btn--danger:hover { background: #a31a14; color: #fff; }
.btn--sm { min-height: 36px; padding: 6px 16px; font-size: .9rem; }
.btn--lg { min-height: 52px; padding: 12px 28px; font-size: 1.05rem; }
.btn--xl { min-height: 58px; padding: 14px 34px; font-size: 1.1rem; }
.btn--block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--blue); cursor: pointer; text-decoration: none; }
.link-button:hover { text-decoration: underline; }
.link-button.danger { color: var(--error); }

/* ---------- Alerts & badges ---------- */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin: 0 0 20px; background: var(--blue-soft); color: var(--navy); border: 1px solid #f6cdd8; font-weight: 500; }
.main--full > .alert { margin-top: 20px; }
.alert--success { background: var(--ok-bg); border-color: #bfe6d3; color: #065f3b; }
.alert--error { background: var(--error-bg); border-color: #f5c7c3; color: var(--error); }
.alert--warn { background: var(--warn-bg); border-color: #f3dcae; color: var(--warn); }
.alert--info { background: #f6f1f7; border-color: #e6dbea; color: var(--ink); } /* plum tint: never confused with an error */
.alert ul { margin: 6px 0; padding-left: 20px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--muted { background: #edf1f7; color: var(--muted); }
.badge--error { background: var(--error-bg); color: var(--error); }

/* ---------- Landing ---------- */
.display { font-size: clamp(2.6rem, 6.4vw, 4.6rem); line-height: 1.02; letter-spacing: -.04em; font-weight: 800; margin-bottom: 24px; }
.headline { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; }
.eyebrow { display: inline-block; color: var(--blue); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; margin: 0 0 14px; }
.pill-label { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--navy); font-weight: 700; font-size: .85rem; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.pill-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }

.ico-check { width: 20px; height: 20px; flex: none; color: #fff; background: var(--ok); border-radius: 50%; padding: 3px; }

/* Hero media: looping video in a large rounded frame + floating product UI */
@keyframes l-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; }

/* Audience cards (photo / video on top) */
.ico-arrow { width: 18px; height: 18px; transition: transform .2s; }

/* Split photo sections */

/* CTA with photo */

.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot--ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }







/* ---------- Forms ---------- */
.auth-card { max-width: 540px; margin: 32px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 44px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2rem; }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; font-weight: 600; color: var(--ink); }
.field > span { font-size: .92rem; }
.field em { font-style: normal; font-weight: 400; }
input:not([type="checkbox"]):not([type="color"]):not([type="radio"]):not([type="range"]), select, textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 0; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #aebcd6; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .15); }
.field__error { color: var(--error); font-size: .85rem; margin: 0; font-weight: 600; }
.field-hint { margin: -10px 0 0; font-size: .88rem; text-align: right; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; color: var(--text); }
.check input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--blue); flex: none; }
.check--strong { font-weight: 700; color: var(--ink); }
.check--warn { background: var(--warn-bg); padding: 12px 14px; border-radius: var(--radius-sm); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--muted); margin: 24px 0; font-size: .85rem; font-weight: 600; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.inline-form input { flex: 1 1 260px; }
.inline-form--compact { margin: 0; flex-wrap: nowrap; }
.inline-form--compact select { width: auto; min-height: 36px; padding: 4px 10px; }

/* ---------- Dashboard ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.035em; margin: 0; }
.breadcrumb { margin: 0 0 6px; font-size: .9rem; font-weight: 600; }
.breadcrumb a { text-decoration: none; }
.tabs { display: flex; gap: 6px; margin: 24px 0 28px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs a { padding: 9px 18px; text-decoration: none; color: var(--muted); font-weight: 700; border-radius: 999px; white-space: nowrap; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--ink); background: var(--bg); }
.tabs a.is-active { color: #fff; background: var(--navy); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; }
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.panel { margin-bottom: 22px; }
.panel.narrow { max-width: 680px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-weight: 600; }
.error-list { padding-left: 18px; margin: 0; }
.danger-zone { border-color: #f3c9c5; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: grid; gap: 2px; box-shadow: var(--shadow-sm); }
.stat__value { font-size: 2.3rem; font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1.1; }
.stat__label { color: var(--muted); font-size: .9rem; font-weight: 600; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .93rem; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.table tbody tr:hover { background: #fafbfe; }

/* ---------- Config editor ---------- */
.subhead { margin-top: 8px; }
.sticky-actions { position: sticky; bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 18px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }


/* ---------- Instructions ---------- */
.kv--wide { grid-template-columns: 140px 1fr; }
.steps { padding-left: 22px; display: grid; gap: 10px; }
.steps li::marker { color: var(--blue); font-weight: 800; }
.copy { cursor: copy; }
.prose { max-width: 820px; margin-left: auto; margin-right: auto; }
.prose p, .prose li { color: var(--text); }
.prose h2 { margin-top: 1.6em; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 28px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.footer__inner nav { display: flex; gap: 20px; }
.footer__inner a { color: var(--ink); font-weight: 600; text-decoration: none; }
.footer__inner a:hover { color: var(--blue); }

/* ---------- FAQ + opt-in stats ---------- */

/* ---------- Auth imagery ---------- */
.auth-split { display: grid; grid-template-columns: minmax(0, 540px) minmax(0, 1fr); gap: 32px; align-items: stretch; max-width: 1120px; margin: 8px auto; }
.auth-split .auth-card { margin: 0; align-self: center; }
.auth-visual { position: relative; border-radius: 36px; overflow: hidden; min-height: 560px; box-shadow: var(--shadow-lg); background: #dfe7f5; }
.auth-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-visual__card { position: absolute; left: 24px; right: 24px; bottom: 24px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 22px; padding: 22px 24px; box-shadow: var(--shadow); color: var(--ink); }
.auth-visual__card strong { display: block; font-size: 1.15rem; margin-bottom: 10px; letter-spacing: -.01em; }
.auth-visual__card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-weight: 600; }
.auth-visual__card li { display: flex; align-items: center; gap: 10px; }


/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
@media (max-width: 720px) {
  .hide-sm, .topbar__user { display: none; }
  .topbar__inner { min-height: 64px; }
  .topbar__nav { gap: 10px; }
  .auth-card { padding: 28px 22px; }
  .card, .panel { padding: 22px; }
  .kv, .kv--wide { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .sticky-actions { border-radius: var(--radius); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .topbar, .footer, .no-print, .tabs { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; box-shadow: none; }
  details { display: block; }
  details > summary { font-weight: 700; }
  a { color: inherit; }
}

/* ---------- Accounts & team ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.otp-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.4rem; letter-spacing: .3em; text-align: center; max-width: 220px; }

/* ---------- Password tools (registration) ---------- */
.password-group { display: grid; gap: 14px; }
.password-input { position: relative; display: block; }
.password-input input { padding-right: 96px; }
.password-toggle { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: .9rem; }
.password-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Unverified e-mail banner */
.verify-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.verify-banner .link-button { font-weight: 600; text-decoration: underline; }

/* v1.2 – automatic website analysis panel */

/* v1.2 – colours from the website */

/* v1.2 – browser cookie scan */
.app-version { margin: -6px 0 18px; color: var(--muted); font-size: 14px; }

/* =====================================================================
   App shell (logged-in)
   Everything below is scoped to body.app-shell (dashboard, sites, team,
   account, superadmin) so the public marketing pages stay untouched.
   ===================================================================== */
.app-shell {
  --shell-sidebar: 248px;
  --shell-gutter: clamp(16px, 3vw, 40px);
  --shell-radius: 16px;
  --shell-radius-sm: 10px;
  --violet: #5b34c7;
  --violet-bg: #f1ecfe;
  --ease: cubic-bezier(.2, .8, .2, 1);
  background: var(--bg);
}
.app-shell .icon { width: 18px; height: 18px; flex: none; }
.app-shell .icon--inline { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; color: var(--muted); }
.app-shell .skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 10px 16px; border-radius: var(--shell-radius-sm); background: var(--navy); color: #fff; font-weight: 700; text-decoration: none; }
.app-shell .skip-link:focus { top: 12px; }

/* Layout: sidebar + content */
.shell { display: grid; grid-template-columns: var(--shell-sidebar) minmax(0, 1fr); min-height: 100vh; }
.shell__sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 20px 14px 16px; background: var(--surface); border-right: 1px solid var(--line); z-index: 30; }
.shell__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px 16px; }
.shell__brand { font-size: 1.1rem; }
.shell__brand .brand__mark { width: 34px; height: 34px; border-radius: 10px; }
.shell__toggle { display: none; }
.shell__panel { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; flex: 1; min-height: 0; }
.shell__nav { display: grid; gap: 2px; align-content: start; }
.shell__link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 8px 12px; border-radius: var(--shell-radius-sm); color: var(--muted); font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.shell__link:hover { background: var(--bg); color: var(--ink); }
.shell__link.is-active { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.shell__link.is-active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.shell__link:focus-visible { outline-offset: -2px; border-radius: var(--shell-radius-sm); }
.shell__user { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center; padding: 14px 8px 0; border-top: 1px solid var(--line); }
.shell__avatar, .person__avatar, .profile__avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--navy)); color: #fff; font-weight: 800; letter-spacing: .02em; }
.shell__avatar { width: 38px; height: 38px; font-size: .85rem; }
.shell__who { display: grid; min-width: 0; line-height: 1.3; }
.shell__who strong { color: var(--ink); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell__who span { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell__logout-form { grid-column: 1 / -1; margin: 0; }
.shell__logout { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--shell-radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.shell__logout:hover { border-color: var(--error); color: var(--error); background: var(--error-bg); }
.shell__main { display: flex; flex-direction: column; min-width: 0; }
.shell__content { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px var(--shell-gutter) 72px; }
.shell__content:focus { outline: none; }
.shell__footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px var(--shell-gutter) 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.shell__footer nav { display: flex; gap: 18px; margin-right: 56px; } /* room for the fixed help button */
.shell__footer a { color: var(--muted); font-weight: 600; text-decoration: none; }
.shell__footer a:hover { color: var(--blue); }

/* Page header */
.app-shell .app-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.app-shell .app-head__text { min-width: 0; }
.app-shell .app-head__eyebrow { display: block; margin-bottom: 4px; color: var(--blue); font-size: .75rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.app-shell .app-head h1 { margin: 0; font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -.03em; }
.app-shell .app-head__sub { margin: 6px 0 0; color: var(--muted); max-width: 44em; }
.app-shell .app-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.app-shell .breadcrumb { margin: 0 0 12px; font-size: .88rem; color: var(--muted); }
.app-shell .breadcrumb a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.app-shell .breadcrumb a:hover { color: var(--blue); }
.app-shell .breadcrumb .icon { width: 16px; height: 16px; }

/* Buttons: tighter for the app, same pill shape as the site and the editor */
.app-shell .btn { min-height: 40px; padding: 8px 16px; border-width: 1px; border-radius: 999px; font-size: .94rem; font-weight: 650; }
.app-shell .btn--sm { min-height: 34px; padding: 5px 12px; font-size: .86rem; }
.app-shell .btn--sm .icon { width: 16px; height: 16px; }
.app-shell .btn--primary { box-shadow: 0 1px 2px rgba(34, 18, 38, .12), 0 4px 12px rgba(var(--brand-rgb), .22); }
.app-shell .btn--primary:hover { box-shadow: 0 1px 2px rgba(34, 18, 38, .12), 0 6px 16px rgba(var(--brand-rgb), .3); }
.app-shell .btn--ghost { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.app-shell .btn--ghost:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.app-shell .btn:disabled { opacity: .6; cursor: not-allowed; }
.app-shell .link-button { display: inline-flex; align-items: center; gap: 6px; }
.app-shell .link-button .icon { width: 16px; height: 16px; }
.app-shell .icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; vertical-align: middle; font: inherit; font-weight: 700; transition: color .15s, border-color .15s; }
.app-shell .icon-btn:hover { color: var(--blue); border-color: var(--blue); }
.app-shell .icon-btn .icon { width: 15px; height: 15px; }
.app-shell .is-copied { color: var(--ok) !important; border-color: var(--ok) !important; }
.app-shell .form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.app-shell .form > .btn { justify-self: start; }

/* Surfaces */
.app-shell .card, .app-shell .panel { border-radius: var(--shell-radius); padding: 24px; box-shadow: var(--shadow-sm); }
.app-shell .panel { margin-bottom: 20px; }
.app-shell .cards { gap: 16px; }
.app-shell .card-title { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 1.08rem; letter-spacing: -.01em; }
.app-shell .card-title__icon, .app-shell .legend-icon, .app-shell .scan-panel__icon { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: var(--shell-radius-sm); background: var(--blue-soft); color: var(--blue); }
.app-shell .card-title__icon--danger { background: var(--error-bg); color: var(--error); }
.app-shell .section-title { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; font-size: 1.05rem; }
.app-shell .section-title__count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 999px; background: #edf1f7; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: 0; }
.app-shell .danger-zone { border-color: #f3c9c5; }
.app-shell .kv { gap: 10px 20px; }
.app-shell .kv dt { display: flex; align-items: center; font-size: .92rem; }
.app-shell .kv dd { font-size: .95rem; }
.app-shell .subhead { font-size: 1rem; }

/* Alerts & badges */
.app-shell .alert { border-radius: 12px; }
.app-shell .alert .icon { width: 18px; height: 18px; vertical-align: -4px; margin-right: 8px; }
.app-shell .alert__text { display: inline-flex; align-items: flex-start; gap: 10px; }
.app-shell .alert__text .icon { margin: 3px 0 0; }
.app-shell .badge--icon { gap: 5px; padding: 4px 10px 4px 8px; }
.app-shell .badge--icon::before { display: none; }
.app-shell .badge .icon { width: 14px; height: 14px; }
.app-shell .status-line { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 0; font-weight: 600; }
.app-shell .status-line--ok { color: var(--ok); }
.app-shell .empty-inline { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); }
.app-shell .role-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #edf1f7; color: var(--muted); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.app-shell .role-badge--owner { background: var(--navy); color: #fff; }
.app-shell .role-badge--admin { background: var(--blue-soft); color: var(--blue-hover); }
.app-shell .role-badge--editor { background: var(--ok-bg); color: #065f3b; }

/* KPI / stat cards */
.app-shell .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.app-shell .kpi { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--shell-radius); box-shadow: var(--shadow-sm); }
.app-shell .kpi__icon { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: #edf1f7; color: var(--ink); }
.app-shell .kpi__icon .icon { width: 22px; height: 22px; }
.app-shell .kpi__icon--blue { background: var(--blue-soft); color: var(--blue); }
.app-shell .kpi__icon--ok { background: var(--ok-bg); color: var(--ok); }
.app-shell .kpi__icon--violet { background: var(--violet-bg); color: var(--violet); }
.app-shell .kpi__icon--error { background: var(--error-bg); color: var(--error); }
.app-shell .kpi__body { display: grid; min-width: 0; }
.app-shell .kpi__value { color: var(--ink); font-size: 1.65rem; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.app-shell .kpi__label { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* Dashboard: site cards */
.app-shell .site-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.app-shell .site-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--shell-radius); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease); }
.app-shell .site-card:hover { border-color: #b9ccf5; box-shadow: var(--shadow); transform: translateY(-2px); }
.app-shell .site-card__top { display: flex; align-items: center; gap: 12px; }
.app-shell .site-card__favicon, .app-shell .site-head__favicon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--blue), var(--navy)); color: #fff; font-weight: 800; font-size: 1.1rem; }
.app-shell .site-card__title { display: grid; min-width: 0; flex: 1; }
.app-shell .site-card__link { color: var(--ink); font-weight: 800; font-size: 1.05rem; text-decoration: none; overflow-wrap: anywhere; }
.app-shell .site-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.app-shell .site-card__link:focus-visible { outline: none; }
.app-shell .site-card__link:focus-visible::after { outline: 3px solid var(--blue); outline-offset: 2px; }
.app-shell .site-card:hover .site-card__link { color: var(--blue); }
.app-shell .site-card__chevron { color: var(--line-strong); transition: transform .2s var(--ease), color .15s; }
.app-shell .site-card:hover .site-card__chevron { color: var(--blue); transform: translateX(3px); }
.app-shell .site-card__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.app-shell .site-card__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.app-shell .site-card__meta dt { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .76rem; font-weight: 600; }
.app-shell .site-card__meta dt .icon { width: 13px; height: 13px; }
.app-shell .site-card__meta dd { margin: 2px 0 0; color: var(--ink); font-size: .88rem; font-weight: 600; }
.app-shell .site-card__meta code { font-size: .78rem; }
.app-shell .site-card__actions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; margin-top: auto; }
.app-shell .chip-link { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 6px; border-radius: 8px; background: var(--bg); color: var(--ink); font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.app-shell .chip-link .icon { width: 14px; height: 14px; color: var(--muted); }
.app-shell .chip-link:hover { background: var(--blue-soft); color: var(--blue); }
.app-shell .chip-link:hover .icon { color: var(--blue); }
.app-shell .site-card--add { padding: 0; background: transparent; border: 2px dashed var(--line-strong); box-shadow: none; }
.app-shell .site-card--add:hover { border-color: var(--blue); box-shadow: none; }
.app-shell .site-card--add a { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 200px; padding: 20px; border-radius: inherit; color: var(--muted); font-weight: 700; text-decoration: none; }
.app-shell .site-card--add a:hover { color: var(--blue); }
.app-shell .site-card__plus { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); }
.app-shell .empty-state { display: grid; justify-items: center; gap: 6px; padding: 56px 24px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--shell-radius); box-shadow: var(--shadow-sm); }
.app-shell .empty-state__icon { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 10px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); box-shadow: 0 0 0 10px #fff5f7; }
.app-shell .empty-state__icon .icon { width: 34px; height: 34px; }
.app-shell .empty-state h2 { margin: 0; }
.app-shell .empty-state p { max-width: 30em; margin: 0 0 14px; color: var(--muted); }

/* Site header + tabs */
.app-shell .site-head { display: block; margin-bottom: 4px; }
.app-shell .site-head__row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; }
.app-shell .site-head__favicon { width: 52px; height: 52px; border-radius: 14px; font-size: 1.3rem; }
.app-shell .site-head__text { flex: 1; min-width: 0; }
.app-shell .site-head h1 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.03em; overflow-wrap: anywhere; }
.app-shell .site-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.app-shell .site-head__id { display: inline-flex; align-items: center; gap: 6px; }
.app-shell .site-head__status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.app-shell .tabs { display: flex; gap: 4px; width: auto; max-width: 100%; margin: 20px 0 28px; padding: 0; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; overflow-x: auto; scrollbar-width: thin; }
.app-shell .tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 650; }
.app-shell .tabs a:hover { background: none; color: var(--ink); }
.app-shell .tabs a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; }
.app-shell .tabs a.is-active { background: none; color: var(--blue); }
.app-shell .tabs a.is-active::after { background: var(--blue); }
.app-shell .tabs a:focus-visible { outline-offset: -3px; }

/* Overview */
.app-shell .next-step { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; margin-bottom: 24px; padding: 24px; border: 1px solid #f9d6df; border-radius: var(--shell-radius); background: radial-gradient(500px 200px at 100% 0%, rgba(var(--brand-rgb), .1), transparent 70%), linear-gradient(135deg, #fff7f9, #fdeef2); }
.app-shell .next-step__icon { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--blue), var(--navy)); color: #fff; box-shadow: 0 8px 20px rgba(var(--brand-rgb), .28); }
.app-shell .next-step__icon .icon { width: 26px; height: 26px; }
.app-shell .next-step__body { flex: 1 1 320px; min-width: 0; }
.app-shell .next-step .eyebrow { margin: 0 0 4px; font-size: .72rem; }
.app-shell .next-step h2 { margin: 0 0 4px; font-size: 1.3rem; }
.app-shell .next-step p { margin: 0; }
.app-shell .next-step__progress { display: flex; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.app-shell .next-step__progress li { width: 36px; height: 5px; border-radius: 5px; background: #f6cdd8; }
.app-shell .next-step__progress li.is-on { background: var(--blue); }
.app-shell .health { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; background: var(--bg); color: var(--muted); }
.app-shell .health > span { display: grid; min-width: 0; }
.app-shell .health strong { color: var(--ink); }
.app-shell .health__icon { width: 26px; height: 26px; }
.app-shell .health--ok { background: var(--ok-bg); color: var(--ok); }
.app-shell .health--warn { background: var(--warn-bg); color: var(--warn); }
.app-shell .optin__item { border-radius: 12px; }

/* Config editor */
.app-shell .sticky-actions { border-radius: 14px; padding: 12px 14px; }
.app-shell .sticky-actions__note { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); font-size: .88rem; font-weight: 600; }
.app-shell .color-input input[type="color"] { width: 50px; }

/* Scan panels */
.app-shell .scan-panel { margin-bottom: 20px; padding: 20px 24px; }
.app-shell .scan-panel + .scan-panel { margin-top: 0; }
.app-shell .scan-panel__head { flex-wrap: nowrap; align-items: center; gap: 14px; }
.app-shell .scan-panel__intro { flex: 1; min-width: 0; }
.app-shell .scan-panel__intro p { margin: 0; }
.app-shell .scan-panel__head form { flex: none; }
.app-shell .scan-list li { border: 1px solid var(--line); background: var(--surface); }
.app-shell .scan-list strong { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.app-shell .scan-list strong .icon { width: 16px; height: 16px; color: var(--ok); }
.app-shell .scan-progress { display: flex; align-items: center; gap: 10px; }
.app-shell .scan-details summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.app-shell .scan-details summary::-webkit-details-marker { display: none; }
.app-shell .summary-chevron { width: 16px; height: 16px; transition: transform .15s; }
.app-shell details[open] > summary .summary-chevron { transform: rotate(90deg); }
.app-shell .spin { animation: app-spin 1.1s linear infinite; }
@keyframes app-spin { to { transform: rotate(360deg); } }

/* Tables */
.app-shell .table-wrap { position: relative; margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.app-shell .table-wrap .table { margin: 0; }
.app-shell .table th, .app-shell .table td { padding: 12px 14px; vertical-align: middle; }
.app-shell .table th { background: #fcf8f9; font-size: .74rem; }
.app-shell .table-wrap .table th { white-space: nowrap; }
.app-shell .instructions { grid-template-columns: minmax(0, 1fr); }
.app-shell .table tbody tr:last-child td { border-bottom: 0; }
.app-shell .table-wrap .table:not(.scan-table) { min-width: 560px; }
.app-shell .person { display: inline-flex; align-items: center; gap: 10px; }
.app-shell .person__avatar { width: 32px; height: 32px; font-size: .75rem; }
.app-shell .gcm { display: inline-flex; }
.app-shell .gcm--ok { color: var(--ok); }
.app-shell .gcm--warn { color: var(--warn); }
.app-shell .role-legend { display: block; margin: 14px 0 0; }

/* Account, team, superadmin */
.app-shell .account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.app-shell .account-grid .panel { margin-bottom: 0; }
.app-shell .profile { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.app-shell .profile__avatar { width: 60px; height: 60px; font-size: 1.2rem; }
.app-shell .profile h2 { margin: 0 0 6px; font-size: 1.2rem; }
.app-shell .app-version { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 20px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.app-shell .channel-title { display: flex; align-items: center; margin: 0; font-size: 1rem; }

/* Mobile: sidebar becomes a top bar with a menu toggle */
@media (max-width: 899px) {
  .shell { display: block; }
  .shell__sidebar { position: sticky; top: 0; height: auto; padding: 0; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); }
  .shell__top { min-height: 60px; padding: 8px 16px; }
  .shell__toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: var(--shell-radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
  .shell__toggle[aria-expanded="true"] { background: var(--blue-soft); border-color: #f6cdd8; color: var(--blue); }
  .shell__panel { display: none; position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100vh - 60px); overflow-y: auto; padding: 12px 16px 16px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .shell__panel.is-open { display: flex; }
  .shell__link.is-active::before { display: none; }
  .shell__content { padding-top: 24px; }
}
@media (max-width: 720px) {
  .app-shell .card, .app-shell .panel, .app-shell .scan-panel { padding: 18px; }
  .app-shell .kpis { grid-template-columns: 1fr; gap: 8px; margin-bottom: 20px; }
  .app-shell .kpi { padding: 12px 14px; }
  .app-shell .kpi__icon { width: 38px; height: 38px; }
  .app-shell .kpi__body { display: flex; align-items: baseline; gap: 8px; }
  .app-shell .kpi__value { font-size: 1.3rem; }
  .app-shell .scan-panel__head { flex-wrap: wrap; }
  .app-shell .site-grid, .app-shell .account-grid { grid-template-columns: 1fr; }
  .app-shell .app-head__actions, .app-shell .app-head__actions .btn { width: 100%; }
  .app-shell .tabs a { padding: 10px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell .site-card:hover, .app-shell .site-card:hover .site-card__chevron { transform: none; }
  .app-shell .spin { animation: none; }
}
@media print {
  .shell { display: block; }
  .shell__sidebar, .shell__footer, .skip-link { display: none !important; }
}
