/* Line Drive Digital tokens (from linedrivedigital.com src/css/base/variables.css) */
:root {
  --white: #fff;
  --text: #000;
  --muted: #595959;
  --oat: #f7f4f1;
  --oat-line: #ece7e2;
  --oat-fill: #f0ebe6;
  --oat-input: #e6e0da;
  --oat-tint: #fcfbfa;
  --brown: #3b281d;
  --dark: #211006;
  --on-dark-muted: #d9cfc8;
  --on-dark-soft: #e8e0da;
  --accent: #d66733;
  --accent-soft: #f3c6ad;
  --accent-text: #a64f12;
  --success: #1e681d;
  --success-bg: #e3efe2;
  --warning: #6b5100;
  --warning-bg: #f6efd6;
  --danger: #99001c;
  --danger-bg: #f8e1e5;
  --font-sans: inter, arial, 'Helvetica Neue', sans-serif;
  --font-display: outfit, inter, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --radius: 1rem;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--oat); color: var(--text); font-family: var(--font-sans); font-size: 15px; line-height: 1.45; letter-spacing: -0.0187rem; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
a { color: var(--accent-text); }
a:hover { color: #8f430f; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* Top bar */
.topbar { background: var(--white); border-bottom: 1px solid var(--oat-line); }
.topbar__inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--muted); }
.brand img { height: 26px; width: auto; }
.brand__divider { width: 1px; height: 28px; background: var(--oat-line); }
.brand__label { font-size: 13px; font-weight: 500; }
.topbar__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.control { min-height: 44px; padding: 0 16px; border: 1px solid var(--oat-input); border-radius: 10px; background: var(--white); font: inherit; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); text-decoration: none; }
.control:hover { background: var(--oat); color: var(--text); }
.control--dark { background: var(--dark); border-color: var(--dark); color: var(--white); font-weight: 600; }
.control--dark:hover { background: var(--brown); color: var(--white); }

main { display: flex; flex-direction: column; gap: 24px; padding-top: 32px; padding-bottom: 32px; }
.loading, .error { padding: 64px 0; text-align: center; color: var(--muted); }

/* Title */
.title { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: center; justify-content: space-between; }
.title__client { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.title__logo { width: 120px; height: 84px; background: var(--white); border: 1px solid var(--oat-line); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; padding: 10px; }
.title__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.title h1 { font-size: 36px; line-height: 1.1; }
.title__meta { font-size: 14px; color: var(--muted); }
.pill { display: inline-flex; align-self: flex-start; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--warning-bg); color: var(--warning); }
.updated { font-size: 13px; color: var(--muted); }

.summary { background: var(--white); border: 1px solid var(--oat-line); border-left: 0; border-radius: var(--radius); padding: 20px 24px; font-size: 16px; line-height: 1.55; }
.summary strong { font-family: var(--font-display); display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-text); margin-bottom: 6px; }

/* Cards */
.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 24px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; }
.row > * { min-width: 0; }
.card { background: var(--white); border: 1px solid var(--oat-line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card--dark { background: var(--dark); border-color: var(--dark); color: var(--white); }
.card__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card__head h2 { font-size: 20px; }
.card--dark h2 { color: var(--white); }
.source { font-size: 12px; color: var(--muted); }
.card--dark .source { color: var(--on-dark-muted); }
.empty { color: var(--muted); font-size: 14px; background: var(--oat); border-radius: 12px; padding: 16px; }

.kpi { padding: 22px; gap: 8px; }
.kpi__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.card--dark .kpi__label { color: var(--on-dark-muted); }
.kpi__value { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kpi__num { font-family: var(--font-display); font-size: 36px; font-weight: 700; line-height: 1; }
.card--dark .kpi__num { font-size: 44px; }
.kpi__note { font-size: 12px; color: var(--muted); }
.card--dark .kpi__note { color: var(--on-dark-soft); font-size: 13px; }
.delta { font-size: 14px; font-weight: 600; white-space: nowrap; }
.delta--up { color: var(--success); }
.delta--down { color: var(--danger); }
.delta--flat { color: var(--muted); }
.card--dark .delta--up { color: #9fd89e; }
.card--dark .delta--down { color: #ffb4bf; }

/* Insights */
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 12px; }
.insight { border: 1px solid var(--oat-line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--oat-tint); }
.insight__top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.insight__rank { width: 26px; height: 26px; border-radius: 999px; background: var(--dark); color: var(--white); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.insight h3 { font-size: 16px; line-height: 1.3; flex: 1 1 200px; }
.insight p { margin: 0; font-size: 14px; color: #3d3d3d; }
.insight__action { font-weight: 500; color: var(--text) !important; }
.insight__action::before { content: 'Next step: '; font-weight: 700; color: var(--accent-text); }
.tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.tag--search { background: #fbe3d6; color: #8f430f; }
.tag--conversion { background: var(--oat-fill); color: var(--brown); }
.tag--local { background: #e5ecf6; color: #23466e; }
.tag--speed, .tag--health { background: var(--warning-bg); color: var(--warning); }
.tag--tracking { background: var(--danger-bg); color: var(--danger); }
.tag--impact { background: var(--success-bg); color: var(--success); text-transform: none; letter-spacing: 0; }
.wins { display: flex; flex-direction: column; gap: 10px; }
.win { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.win svg { flex: none; margin-top: 2px; color: var(--success); }

[hidden] { display: none !important; }
.insight__cta { align-self: flex-start; font-size: 13px; font-weight: 600; padding: 8px 12px; min-height: 36px; display: inline-flex; align-items: center; border-radius: 8px; background: var(--white); border: 1px solid var(--oat-input); text-decoration: none; }
.insight__cta:hover { background: var(--oat); }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.plan { border: 1px solid var(--oat-line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: var(--oat-tint); }
.plan--current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--white); }
.plan__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan__top h3 { font-size: 18px; }
.plan__price { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.plan__summary { margin: 0; font-size: 14px; color: #3d3d3d; }
.plan__list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; flex: 1; }
.plan__cta { align-self: flex-start; margin-top: 6px; }

/* Charts */
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: #3d3d3d; }
.legend span { display: flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 240px; border-bottom: 1px solid var(--oat-line); }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bar__total { font-size: 12px; font-weight: 600; color: #3d3d3d; }
.bar__stack { width: 100%; max-width: 44px; display: flex; flex-direction: column; border-radius: 6px 6px 0 0; overflow: hidden; }
.bar__labels { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; margin-top: -8px; }
.bar__labels span { font-size: 12px; color: var(--muted); text-align: center; }
.bar--partial .bar__stack { opacity: .55; }
.c-forms { background: var(--dark); }
.c-site { background: var(--accent); }
.c-profile { background: var(--accent-soft); }

.meter { display: flex; flex-direction: column; gap: 6px; }
.meter__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.meter__track { height: 10px; background: var(--oat-fill); border-radius: 999px; overflow: hidden; }
.meter__fill { height: 100%; border-radius: 999px; background: var(--brown); }
.callout { background: var(--oat-tint); border: 1px solid var(--oat-line); border-radius: 12px; padding: 14px; font-size: 13px; color: #3d3d3d; }
.callout strong { display: block; color: var(--dark); margin-bottom: 2px; }

.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 12px; }
.funnel__step { display: flex; flex-direction: column; gap: 8px; }
.funnel__bar { height: 110px; display: flex; align-items: flex-end; background: var(--oat); border-radius: 12px; overflow: hidden; }
.funnel__bar div { width: 100%; }
.funnel__num { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.funnel__label { font-size: 14px; font-weight: 500; }
.funnel__note { font-size: 13px; color: var(--muted); }
.funnel__note--drop { color: var(--danger); font-weight: 600; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--oat-line); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
td { font-size: 14px; padding: 12px; border-bottom: 1px solid var(--oat-fill); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-family: var(--font-mono); font-size: 13px; }
.q { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 500; }
.chip { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #fbe3d6; color: #8f430f; }
.chip--brand { background: var(--oat-fill); color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--oat); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.tile__label { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile__num { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.reviews { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--oat-fill); padding-top: 14px; }
.reviews__num { font-family: var(--font-display); font-size: 32px; font-weight: 700; }
.stars { color: var(--accent); letter-spacing: 2px; }
.keywords { display: flex; flex-wrap: wrap; gap: 6px; }
.keywords span { font-size: 12px; background: var(--oat); border-radius: 999px; padding: 4px 10px; }

.vital { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.vital__name { font-size: 14px; font-weight: 500; }
.vital__help { font-size: 12px; color: var(--muted); }
.vital__val { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.rating { font-family: var(--font-sans); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; }
.rating--good { background: var(--success-bg); color: var(--success); }
.rating--needs-improvement { background: var(--warning-bg); color: var(--warning); }
.rating--poor { background: var(--danger-bg); color: var(--danger); }
.split { display: flex; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--oat-fill); padding-top: 14px; font-size: 13px; color: #3d3d3d; }

.ring { width: 64px; height: 64px; border-radius: 999px; border: 6px solid var(--accent); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 20px; flex: none; }

.list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; }
.card--dark .list { color: var(--on-dark-soft); }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 8px 0 24px; font-size: 12px; color: var(--muted); }
.sources { display: flex; flex-wrap: wrap; gap: 12px; }
.sources span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--oat-input); }
.dot--ok { background: var(--success); }
.dot--error { background: var(--danger); }

@media print {
  .no-print, .insight__cta, .plan__cta { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .topbar { border: 0; }
  main { padding-top: 12px; gap: 14px; }
  .card { break-inside: avoid; padding: 16px; }
  .row, .grid { break-inside: avoid; }
  @page { size: letter; margin: 0.5in; }
}
