/* ReportFalcon design system.
   Brand (from the logo): navy #041532, blue #2665f3, sky #309bfe, cyan #0ad3fe. Font: Plus Jakarta Sans.
   Agencies with their own colours override the brand variables below (see branding.css_variables), so components
   use the variables, never raw brand hex values. */
:root {
  /* brand (overridable per agency) */
  --navy: #041532;
  --navy-2: #0a2150;
  --accent: #2665f3;
  --accent-hover: #2056cf;
  --accent-soft: #eef4ff;
  --accent-border: #c7d7fe;
  --accent-ring: rgba(38, 101, 243, .28);
  --accent-glow: rgba(10, 211, 254, .35);
  --ice: #0ad3fe;
  --ice-tint: rgba(10, 211, 254, .14);
  --login-end: #1e3a8a;
  --sky: #309bfe;

  /* neutrals */
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e7f0;
  --border-soft: #edf0f6;
  --border-strong: #cfd6e4;
  --heading: #0b1530;
  --text: #1d2939;
  --text-2: #475467;
  --muted: #5d6679;

  /* status */
  --good: #067647;
  --good-soft: #ecfdf3;
  --bad: #b42318;
  --bad-soft: #fef3f2;
  --warn: #93370d;
  --warn-soft: #fffaeb;

  /* shape */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(11, 21, 48, .12), 0 2px 6px rgba(11, 21, 48, .05);
  --sidebar-w: 256px;

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Plus Jakarta Sans', system-ui, sans-serif;

  /* source colours, shared by the page-traffic cards (colour-blind-safe; keep) */
  --src-google: #2a78d6;
  --src-bing: #1baf7a;
  --src-ai: #4a3aa7;
  --src-direct: #eb6834;
  --src-other: #9aa5b4;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; color: var(--heading); }
h1 { font: 700 26px/1.2 var(--display); letter-spacing: -0.022em; }
h2 { font: 700 19px/1.25 var(--display); letter-spacing: -0.012em; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -0.005em; }
h4 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 1em; }
code { background: var(--accent-soft); color: var(--heading); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; word-break: break-all; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
.error-text { color: var(--bad); }
.print-only { display: none; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--surface); color: var(--heading); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-weight: 600; }
.skip-link:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; } }

/* ---------------------------------------------------------------- app shell: sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40; display: flex; flex-direction: column; gap: 14px; padding: 18px 14px 14px; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.sidebar ~ main, .sidebar ~ .support-bar { margin-left: var(--sidebar-w); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 6px; }
.sidebar-logo { display: inline-flex; }
.sidebar-logo img { height: 30px; width: auto; }
.sidebar .sidebar-close { display: none; }
.workspace { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface-2); }
.workspace:hover { border-color: var(--border-strong); text-decoration: none; color: var(--text); }
.workspace-mark { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--navy); color: #fff; font-weight: 800; font-size: 15px; overflow: hidden; }
.workspace-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.workspace-text { min-width: 0; display: grid; line-height: 1.25; }
.workspace-text strong { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--heading); }
.workspace-text small { font-size: 12px; color: var(--muted); }
.side-nav { display: grid; gap: 2px; }
.side-label { margin: 14px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.side-link { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 550; font-size: 14px; }
.side-link .i { color: #8a93a6; }
.side-link:hover { background: var(--surface-2); color: var(--heading); text-decoration: none; }
.side-link:hover .i { color: var(--text-2); }
.side-link.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-border); font-weight: 650; }
.side-link.active .i { color: var(--accent); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.user-chip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: var(--text); }
.user-chip:hover, .user-chip.active { background: var(--surface-2); text-decoration: none; color: var(--text); }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--sky)); color: #fff; font-weight: 700; font-size: 13px; }
.user-chip-text { min-width: 0; display: grid; line-height: 1.25; }
.user-chip-text strong { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--heading); text-decoration: none; }
.mobile-bar { display: none; }
.sidebar-scrim { display: none; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar { transform: none; }
  .sidebar .sidebar-close { display: inline-grid; }
  .sidebar ~ main, .sidebar ~ .support-bar { margin-left: 0; }
  .sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(11, 21, 48, .35); }
  .mobile-bar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; height: 56px; padding: 0 10px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
  .mobile-bar img { height: 26px; width: auto; display: block; }
}

/* ---------------------------------------------------------------- page layout */
.container { max-width: 1220px; margin: 0 auto; padding: 30px 32px 72px; }
.report-container { max-width: 1260px; margin: 0 auto; padding: 0 32px 72px; }
@media (max-width: 640px) { .container { padding: 20px 16px 56px; } .report-container { padding: 0 16px 56px; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 2px 0 4px; }
.page-head p { margin: 0; max-width: 680px; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 550; color: var(--muted); }
.back-link .i { width: 15px; height: 15px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card > h3:first-child, .card > h2:first-child { margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.container-form > * { max-width: 900px; }
.card h3 > .i { width: 18px; height: 18px; color: var(--accent); margin-right: 8px; vertical-align: -3px; }
.callout { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 12px; padding: 13px 16px; margin-bottom: 20px; color: var(--heading); }
.flash { border-radius: 12px; padding: 12px 16px; margin: 0 0 18px; border: 1px solid; font-weight: 500; }
.flash-success { background: var(--good-soft); border-color: #abefc6; color: #054f31; }
.flash-error { background: var(--bad-soft); border-color: #fecdca; color: #7a271a; }
.flash-warning { background: var(--warn-soft); border-color: #fedf89; color: var(--warn); }
.empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty p { max-width: 520px; margin: 0 auto 20px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.tag-muted { background: #f0f2f7; color: var(--text-2); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
h1 .badge { font-size: 13px; vertical-align: middle; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: 600 14px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn .i { width: 17px; height: 17px; }
.btn:hover { text-decoration: none; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-sm .i { width: 15px; height: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .08), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--heading); border-color: var(--border); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--heading); background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #fecdca; }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn-google { background: #fff; color: #1f1f1f; border-color: #c4c7c5; gap: 10px; font-weight: 600; }
.btn-google:hover { background: #f8faff; color: #1f1f1f; border-color: #8e918f; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 16px; color: var(--heading); }
label .muted { font-weight: 500; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; font: 500 14px var(--font); color: var(--heading); background: #fff; border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; min-height: 42px; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:hover, select:hover, textarea:hover { border-color: #b4bdd0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; padding: 0; box-shadow: none; accent-color: var(--accent); }
input[type=file] { padding: 8px; }
input[type=color] { padding: 4px; }
textarea { resize: vertical; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.danger-zone { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); }
label.check { display: flex; align-items: center; gap: 9px; font-weight: 550; }
label.check input { margin: 0; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.props-status-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: -8px 0 14px; }
.props-status-row p { margin: 0; }
.copy-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.copy-value { font-size: 14.5px; padding: 9px 12px; background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 10px; }
.instructions { white-space: pre-wrap; font-size: 13px; line-height: 1.6; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px; margin: 8px 0 10px; max-height: 320px; overflow: auto; }
.steps { padding-left: 20px; display: grid; gap: 6px; }
.sa-upload { margin-top: 12px; max-width: 520px; }

/* ---------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th:first-child { border-top-left-radius: 10px; }
.table th:last-child { border-top-right-radius: 10px; }
.table td { padding: 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfe; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table.compact td { padding: 8px 10px; }
.table.compact th { padding: 8px 10px; }
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]:hover { color: var(--heading); }
.table th[data-dir="desc"]::after { content: " ↓"; }
.table th[data-dir="asc"]::after { content: " ↑"; }
.table td.kw { font-weight: 550; max-width: 340px; min-width: 150px; }
/* max-width: 0 + width: 100% lets the URL column take the leftover space and truncate, instead of widening the table */
.table td.url { max-width: 0; width: 100%; min-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table td.url a { color: var(--text); }
.table-card { padding: 6px; overflow-x: auto; }
.table-card > h3, .table-card > .card-head, .table-card > h4 { padding: 12px 14px 0; }
.table-scroll { overflow-x: auto; }
.collapsible:not(.expanded) tr.extra { display: none; }
.more-btn { margin: 10px 10px 6px; font-size: 13px; }
.chg { font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 600; }
.chg.up, .delta.up { color: var(--good); }
.chg.down, .delta.down { color: var(--bad); }
.chg.flat, .delta.flat { color: var(--muted); }
.badge-new { font-size: 11px; font-weight: 650; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; }
.delta { font-size: 12.5px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.swatch, .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }

/* ---------------------------------------------------------------- dialog, shared reports */
.dialog { border: 0; border-radius: 18px; padding: 26px; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--text); }
.dialog::backdrop { background: rgba(11, 21, 48, .45); backdrop-filter: blur(2px); }
.dialog h3 { font: 700 19px var(--display); margin-bottom: 6px; }
.dialog-close { position: absolute; right: 14px; top: 12px; }
.dialog-close button { border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.dialog .copy-row input { flex: 1 1 220px; margin: 0; font-size: 13px; }
.share-ok { color: var(--good); font-weight: 650; margin: 4px 0 8px; }
.link-cell { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.actions-cell { width: 1%; white-space: nowrap; }
.link-cell form.inline { display: contents; }
.report-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.report-list a.report-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); }
.report-list a.report-item:hover { border-color: var(--border-strong); text-decoration: none; }
.report-item strong { display: block; font-size: 15px; color: var(--heading); }
.report-list a.report-item .report-item-text { flex: 1; min-width: 0; }
.report-item-icon { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------------------- sign-in and other single-card pages */
.login-page { min-height: 100vh; background:
    radial-gradient(900px 520px at 85% -10%, rgba(10, 211, 254, .16), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(38, 101, 243, .14), transparent 60%),
    linear-gradient(180deg, #f6f9ff 0%, #eef3fc 100%); }
.login-page .container { padding-bottom: 10vh; }
.login-card { max-width: 400px; margin: 10vh auto 0; background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 34px 32px; box-shadow: var(--shadow-lg); }
.login-card-wide { max-width: 460px; margin-top: 7vh; }
.login-card h1 { font-size: 24px; margin-bottom: 8px; }
.login-logo { height: 34px; max-width: 100%; object-fit: contain; object-position: left; margin-bottom: 26px; display: block; }
.login-card .brand-text.login-logo { height: auto; font-size: 22px; color: var(--navy); }
.auth-foot { margin: 20px 0 0; color: var(--muted); }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12.5px; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.legal-links { margin: 10px 0 0; }
.legal-links a { color: var(--muted); }

/* ---------------------------------------------------------------- agency logos, team, branding page */
.brand-text { font: 800 18px/1.1 var(--display); letter-spacing: -0.015em; }
.logo-on-dark { background: #fff; border-radius: 8px; padding: 5px 9px; box-sizing: content-box; }
.cover-agency img.logo-on-dark { height: 30px; }
.cover-agency .brand-text { display: inline; margin: 0; font-size: 22px; color: #fff; text-transform: none; letter-spacing: -0.01em; }
.report-footer .brand-text { font-size: 17px; color: var(--navy); }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.color-grid input[type=color] { height: 44px; cursor: pointer; }
.logo-field + .logo-field { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.logo-preview { height: 76px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border-strong); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.logo-preview.on-dark { background: var(--navy); border-style: solid; }
.logo-preview img { max-height: 48px; max-width: 80%; }
.brand-preview { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.brand-preview-cover { background: var(--navy); color: #fff; padding: 18px 18px 16px; display: grid; gap: 6px; }
.brand-preview-cover strong { font: 800 20px var(--display); color: #fff; }
.brand-preview-agency { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #aab4d6; text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; }
.brand-preview-agency img { height: 26px; }
.brand-preview-agency img.logo-on-dark { height: 20px; }
.brand-preview-agency .brand-text { font-size: 15px; color: #fff; text-transform: none; letter-spacing: 0; }
.brand-preview-body { padding: 16px 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand-preview-line { width: 120px; height: 32px; }
.how-steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.how-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.how-steps strong { display: block; color: var(--heading); font-size: 14px; margin-bottom: 2px; }
.how-steps span:not(.how-num) { font-size: 13px; color: var(--muted); line-height: 1.45; }
.how-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font: 700 13px var(--display); }
@media (max-width: 900px) { .how-steps { grid-template-columns: 1fr; } }
.invite-form { display: grid; grid-template-columns: minmax(200px, 1.6fr) minmax(250px, 1.4fr) auto; gap: 12px; align-items: end; }
.invite-form label { margin: 0; }
.invite-form .btn { height: 42px; }
@media (max-width: 640px) { .invite-form, .color-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- clients (dashboard) */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.client-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; transition: border-color .15s, box-shadow .15s; }
.client-card:hover { border-color: var(--border-strong); box-shadow: 0 4px 16px rgba(16, 24, 40, .07); }
.client-card-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.client-card-head > div { min-width: 0; }
.client-card h2 { font-size: 16.5px; margin: 0 0 2px; }
.client-card h2 a { color: var(--heading); }
.client-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 11px; border: 1px solid var(--border); padding: 4px; background: #fff; flex: none; }
.client-initial { width: 44px; height: 44px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 800 18px var(--display); flex-shrink: 0; }
.conn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
.conn-list li { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn-list .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.conn-list .ok .dot { background: #17b26a; box-shadow: 0 0 0 3px #dcfae6; }
.conn-list .missing .dot { background: #d0d5dd; }
.client-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.client-card-foot .card-via { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.client-card-foot .actions { flex-wrap: nowrap; margin-left: auto; gap: 2px; }
.client-card h3 { font-size: 16px; margin: 0 0 2px; line-height: 1.3; }
.client-card h3 a { color: var(--heading); }
.client-site { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-card .card-via { margin: -6px 0 0; overflow-wrap: anywhere; }
.source-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.source-chips li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.source-chips .i { width: 13px; height: 13px; stroke-width: 2.6; }
.source-chips .on { background: var(--good-soft); color: var(--good); }
.source-chips .off { background: #f2f4f7; color: #667085; }
.client-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 12px; background: var(--surface-2); border-radius: 12px; }
.client-meta div { min-width: 0; }
.client-meta dt { font-size: 11.5px; color: var(--muted); font-weight: 550; }
.client-meta dd { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.list-toolbar h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: #eaecf2; color: var(--text-2); font-size: 12px; font-weight: 700; }
.search-field { position: relative; margin: 0; width: min(320px, 100%); }
.search-field .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search-field input { margin: 0; padding-left: 36px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.empty-icon .i { width: 24px; height: 24px; }
.empty-search { text-align: center; padding: 30px 0; }
.dash-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-email { gap: 8px; }
.stat-code { display: block; font-size: 12.5px; padding: 6px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
@media (max-width: 1180px) { .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .dash-stats { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- stat tiles (dashboard, admin) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-grid-sm { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.stat { position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; color: var(--text); }
a.stat:hover { border-color: var(--border-strong); text-decoration: none; color: var(--text); }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-label .i { width: 16px; height: 16px; color: var(--accent); }
.stat-value { font: 700 28px/1.15 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--heading); margin-top: 4px; }
.stat-value-sm { font-size: 20px; }
.stat-of { font-size: 16px; font-weight: 600; color: var(--muted); }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.meter { display: block; height: 6px; border-radius: 999px; background: var(--border-soft); overflow: hidden; margin: 6px 0 4px; }
.meter span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--sky)); }

/* ---------------------------------------------------------------- platform admin */
.support-bar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 9px 16px; background: #fef3c7; color: #78350f; border-bottom: 1px solid #fcd34d; font-size: 13.5px; text-align: center; }
.support-bar .support-exit { background: #78350f; color: #fff; }
.support-bar .support-exit:hover { background: #92400e; color: #fff; }
.admin-alert { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin-alert a { white-space: nowrap; font-weight: 650; }
.admin-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.admin-two > .card { margin-bottom: 0; }
.admin-chart { position: relative; height: 220px; }
.activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; }
.activity-list li { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--border-soft); }
.activity-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-action { font: 600 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text-2); }
.filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-row input, .filter-row select { width: auto; flex: 1 1 220px; max-width: 360px; margin: 0; }
.filter-row select { flex: 0 1 200px; }
.src-tags { display: inline-flex; gap: 4px; }
.src-tag { font-size: 11px; font-weight: 650; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); color: var(--muted); background: #fff; text-decoration: line-through; text-decoration-color: rgba(93, 102, 121, .5); }
.src-tag.on { border-color: transparent; background: var(--good-soft); color: var(--good); text-decoration: none; }
.row-actions { position: relative; display: inline-block; text-align: left; }
.row-actions summary { list-style: none; }
.row-actions summary::-webkit-details-marker { display: none; }
/* Opens inside the row (tables scroll sideways, which would clip a floating menu). */
.row-actions-menu { margin-top: 6px; min-width: 230px; display: grid; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.row-actions-menu form { margin: 0; }
.link-btn.error-text { color: var(--bad); }
.row-actions-menu .link-btn { display: block; width: 100%; text-align: left; padding: 7px 9px; border-radius: 8px; font-size: 13px; }
.row-actions-menu .link-btn:hover { background: var(--accent-soft); text-decoration: none; }
.admin-brand { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-left: 6px; border: 1px solid rgba(0, 0, 0, .1); }
.danger-card { border-color: #fecdca; }
.danger-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--border-soft); }
.danger-row:first-of-type { border-top: 0; }
.danger-row p { margin: 0; flex: 1 1 260px; }
.danger-row .grow { flex: 1 1 320px; margin: 0; }
.input-sm { width: 120px; margin: 0; }

/* Public website styles live in site.css. */

/* ---------------------------------------------------------------- report toolbar */
.report-toolbar { position: sticky; top: 0; z-index: 20; background: rgba(244, 246, 251, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); margin: 0 -32px 24px; padding: 14px 32px 12px; display: grid; gap: 12px; }
.toolbar-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar-title { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.toolbar-title strong { font: 700 19px/1.25 var(--display); color: var(--heading); letter-spacing: -0.012em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar-brand { display: block; margin-bottom: 4px; }
.toolbar-logo { height: 26px; width: auto; max-width: 180px; display: block; }
.toolbar-brand .brand-text { font: 700 14px var(--display); color: var(--accent); }
.toolbar-sub { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.toolbar-sub .i { width: 14px; height: 14px; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar-actions .count { margin-left: 2px; background: var(--accent-soft); color: var(--accent); height: 20px; min-width: 20px; font-size: 11.5px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field-chip { display: inline-flex; align-items: center; gap: 0; margin: 0; height: 36px; padding-left: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-xs); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field-chip:hover { border-color: var(--border-strong); }
.field-chip:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.field-chip > span { display: inline-flex; align-items: center; gap: 6px; padding-right: 9px; margin-right: 2px; border-right: 1px solid var(--border-soft); height: 20px; white-space: nowrap; }
.field-chip > span .i { width: 15px; height: 15px; color: var(--accent); }
.field-chip select, .field-chip input { margin: 0; height: 34px; min-height: 0; border: 0; box-shadow: none; background: transparent; padding: 0 10px 0 8px; font: 600 13px var(--font); color: var(--heading); width: auto; border-radius: 10px; }
.field-chip select:focus, .field-chip input:focus { box-shadow: none; }
.share-reset { margin-top: 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.shared .report-toolbar { margin-top: 0; }
@media (max-width: 760px) { .hide-sm { display: none; } }

.loading { text-align: center; padding: 120px 16px; color: var(--muted); }
.spinner { width: 36px; height: 36px; margin: 0 auto 16px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- report: cover */
.cover { position: relative; overflow: hidden; background: var(--navy); color: #fff; border-radius: 20px; padding: 38px 40px 34px; margin-bottom: 28px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cover::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 36px 36px; pointer-events: none; }
.cover::after { content: ""; position: absolute; right: -80px; top: -120px; width: 420px; height: 420px; background: radial-gradient(circle, var(--accent-glow), transparent 65%); pointer-events: none; }
.cover > * { position: relative; z-index: 1; }
.cover h1 { color: #fff; font-size: 38px; letter-spacing: -0.03em; margin: 8px 0 6px; }
.eyebrow { margin: 0; color: var(--ice); font-size: 13px; font-weight: 650; letter-spacing: .01em; }
.cover-site { margin: 0; color: #b9c3dd; font-size: 14px; }
.cover-client-logo { max-height: 48px; max-width: 200px; background: #fff; border-radius: 10px; padding: 6px 10px; margin-bottom: 16px; }
.cover-dates { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.cover-dates > div { padding: 9px 14px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.cover-dates span { display: block; color: #b9c3dd; font-size: 12px; font-weight: 550; }
.cover-dates strong { font-size: 15px; font-weight: 650; }
.cover-agency { align-self: flex-end; text-align: right; margin-left: auto; }
.cover-agency span { display: block; color: #9fabca; font-size: 12px; font-weight: 550; margin-bottom: 8px; }
.cover-agency img { height: 40px; }

/* ---------------------------------------------------------------- report: sections */
.section { margin-bottom: 40px; scroll-margin-top: 170px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 20px; }
.section-num { font: 700 12px var(--display); color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 8px; padding: 3px 8px; font-variant-numeric: tabular-nums; }
#report-root { counter-reset: report-section; }
.section-num::before { counter-increment: report-section; content: counter(report-section, decimal-leading-zero); }
.stars { color: #e3a008; letter-spacing: 1px; }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.review-list li { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.review-list p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.review-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.section-sub { color: var(--muted); font-size: 13px; }
/* Per-client on/off switch for each report section (agency view only) */
.section-switch { order: 9; margin: 0 0 0 auto; align-self: center; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); user-select: none; padding: 5px 10px 5px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.section-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 32px; height: 18px; border-radius: 999px; background: #d0d5dd; transition: background .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .25); transition: transform .15s; }
.section-switch input:checked + .switch-track { background: var(--accent); }
.section-switch input:checked + .switch-track::after { transform: translateX(14px); }
.section-switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.section.is-hidden { margin-bottom: 18px; }
.section.is-hidden > :not(.section-head) { display: none; }
.section.is-hidden .section-head { margin-bottom: 0; padding: 10px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.section.is-hidden .section-head h2 { color: var(--muted); }
.section.is-hidden .section-num::before { counter-increment: none; content: "–"; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.two-col-wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.two-col > .card, .three-col > .card { margin-bottom: 0; }
.footnote { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.source-hint { font-size: 13px; color: var(--muted); margin: -10px 0 20px; }

/* summary */
.summary-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.summary-card { margin-bottom: 0; padding: 24px 26px; }
.summary-headline { font: 700 20px/1.3 var(--display); letter-spacing: -0.015em; margin-bottom: 14px; color: var(--heading); }
.summary-points { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 10px; color: var(--text-2); }
.summary-points li { position: relative; padding-left: 20px; }
.summary-points li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.summary-side { display: flex; flex-direction: column; gap: 16px; }
.summary-side .card { margin: 0; }
.wins, .focus { padding: 18px 20px; }
.wins { background: linear-gradient(180deg, #f3fdf7, #fff 60%); border-color: #c8f0d8; }
.focus { background: linear-gradient(180deg, var(--accent-soft), #fff 60%); border-color: var(--accent-border); }
.wins h4, .focus h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.wins .icon, .focus .icon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-size: 10px; color: #fff; }
.wins .icon { background: #17b26a; }
.focus .icon { background: var(--accent); font-weight: 700; }
.wins ul, .focus ul { margin: 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 6px; color: var(--text-2); }
.notes-card { margin-top: 16px; }
.notes-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.notes-card textarea { margin-top: 6px; }
.notes-print { white-space: pre-wrap; color: var(--text-2); }

/* KPI tiles */
.kpi-group-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; margin: 6px 0 12px; color: var(--heading); }
.kpi-group-title .muted { font-weight: 500; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-value { font: 700 27px/1.15 var(--display); letter-spacing: -0.025em; color: var(--heading); margin: 8px 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 22px; }
.kpi-prev { font-size: 12px; color: var(--muted); }
.kpi .delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.kpi .delta.up { background: var(--good-soft); }
.kpi .delta.down { background: var(--bad-soft); }
.kpi .delta.flat { background: #f2f4f7; }

/* charts */
.chart-card { padding: 20px 22px 18px; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.chart-head h3 { margin-bottom: 2px; font-size: 15.5px; }
.chart-head p { margin: 0; }
.chart-box { position: relative; height: 320px; }
.chart-box-sm { height: 260px; }
.tabs { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; font: 600 12.5px var(--font); color: var(--muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.tabs button:hover { color: var(--heading); }
.tabs button.active { background: #fff; color: var(--heading); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

/* top pages by traffic */
.source-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin: -4px 0 12px; }
.source-legend .sw { margin-right: 6px; }
.sw-google, .seg-google { background: var(--src-google); }
.sw-bing, .seg-bing { background: var(--src-bing); }
.sw-ai, .seg-ai { background: var(--src-ai); }
.sw-direct, .seg-direct { background: var(--src-direct); }
.sw-other, .seg-other { background: var(--src-other); }
.seg-dev1 { background: #2a78d6; }
.seg-dev2 { background: #eb6834; }
.seg-dev3 { background: #1baf7a; }
.seg-dev4 { background: #eda100; }
.seg-brand { background: var(--ice); }
.seg-nonbrand { background: var(--accent); }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; break-inside: avoid; }
.pt-top { display: flex; gap: 12px; align-items: flex-start; }
.pt-rank { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 13px var(--display); }
.pt-title { min-width: 0; }
.pt-name { font-weight: 650; line-height: 1.3; color: var(--heading); }
.tag-top { background: var(--navy); color: var(--ice); margin-left: 4px; vertical-align: 1px; }
.pt-path { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-total { margin: 12px 0 8px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.pt-total strong { font-size: 24px; font-weight: 700; color: var(--heading); letter-spacing: -0.02em; }
.pt-total span { color: var(--muted); font-size: 12.5px; }
.stackbar, .sharebar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--border-soft); margin-bottom: 12px; }
.stackbar .seg, .sharebar .seg { display: block; height: 100%; min-width: 2px; }
.pt-sources { display: flex; gap: 6px; margin: 0; }
.pt-sources div { flex: 1 1 0; min-width: 0; }
.pt-sources dt { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-sources dt .sw { width: 7px; height: 7px; margin-right: 4px; border-radius: 2px; }
.pt-sources dd { margin: 2px 0 0; font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; }

.ai-total { margin: 8px 0 12px; display: flex; gap: 8px; align-items: baseline; }
.ai-total strong { font-size: 28px; font-weight: 700; color: var(--heading); }

.report-footer { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; gap: 24px; align-items: flex-start; }
.report-footer p { margin: 0 0 6px; }
.footer-logo { height: 34px; }

/* ---------------------------------------------------------------- responsive (report) */
@media (max-width: 1000px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid, .two-col, .two-col-wide-left, .three-col { grid-template-columns: minmax(0, 1fr); }
  .two-col > .card, .three-col > .card { margin-bottom: 0; }
}
@media (max-width: 640px) {
  .cover { padding: 24px 20px; }
  .cover h1 { font-size: 28px; }
  .cover-agency { text-align: left; align-self: flex-start; margin-left: 0; }
  .kpi-value { font-size: 22px; }
  .report-footer { flex-direction: column; }
  .chart-box { height: 260px; }
  .report-toolbar { position: static; margin: 0 -16px 20px; padding: 12px 16px; }
  .field-chip { flex: 1 1 150px; }
  .field-chip select, .field-chip input { flex: 1; min-width: 0; }
}

/* ---------------------------------------------------------------- PDF download (desktop layout on any device) */
body.pdf-mode .no-print, body.pdf-mode .more-btn, body.pdf-mode .tabs, body.pdf-mode .section.is-hidden { display: none !important; }
body.pdf-mode .print-only { display: block; }
body.pdf-mode .notes-card.is-empty { display: none; }
body.pdf-mode #report-root { max-width: none; background: #fff; }
body.pdf-mode .card, body.pdf-mode .kpi, body.pdf-mode .pt-card { box-shadow: none; border-color: var(--border); }
body.pdf-mode .section { margin-bottom: 22px; }
body.pdf-mode .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.pdf-mode .summary-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
body.pdf-mode .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.pdf-mode .two-col-wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
body.pdf-mode .three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.pdf-mode .pt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.pdf-mode .chart-box { height: 280px; }
body.pdf-mode .chart-box-sm { height: 230px; }
body.pdf-mode .cover { padding: 36px; }
body.pdf-mode .cover h1 { font-size: 36px; }
body.pdf-mode .table-card { overflow: visible; }
body.pdf-mode .table td.url { white-space: normal; word-break: break-all; }

/* ---------------------------------------------------------------- print / PDF */
@page { size: A4; margin: 12mm; }
@media print {
  body { background: #fff; font-size: 11.5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print, .topbar, .sidebar, .mobile-bar, .report-toolbar, .share-reset, .more-btn, .tabs, .section.is-hidden { display: none !important; }
  .print-only { display: block; }
  .notes-card.is-empty { display: none; }
  .report-container { max-width: none; padding: 0; }
  .card, .kpi, .pt-card { box-shadow: none; border-color: var(--border); }
  .section { break-inside: auto; margin-bottom: 18px; }
  .section-head { break-after: avoid; }
  .card, .kpi, .pt-card, .chart-card, tr { break-inside: avoid; }
  #search-trends, #traffic, #top-keywords { break-before: page; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col-wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart-box { height: 250px; }
  .chart-box-sm { height: 210px; }
  .pt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .table-card { overflow: visible; }
  .table td.url { white-space: normal; word-break: break-all; }
  a { color: inherit; }
}
