/* Dashboard (/app/ and /demo/), on top of site.css tokens. Chart colours validated with the dataviz palette
   validator: blue + orange pass CVD and contrast on the light and the dark surface; revenue is always its own panel. */
:root {
  --s1: #2a78d6; --s2: #eb6834; --s3: #8a5cd6; --s-money: var(--money); /* s1-s3 pass the dataviz validator (CVD, contrast) */
  --c-grid: #ececec; --c-axis: #d4d4d4; --c-ink: #737373;
  --side: 240px;
}
:root[data-theme="dark"] {
  --s1: #3987e5; --s2: #d95926; --s3: #9a72e8; --c-grid: #232323; --c-axis: #3a3a3a; --c-ink: #8f8f8f;
}
/* Reserve the scrollbar's width on every view, so a tall view (Pages) and a short one (Goals) keep the same column width. */
html { scrollbar-gutter: stable; }
body { background: var(--bg); }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.trunc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap { text-transform: capitalize; }
.small { font-size: 13px; }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.row-gap.end { justify-content: flex-end; }
.btn-danger { background: var(--down); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--down) 86%, #000); }
.btn-danger[disabled] { opacity: 0.45; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.icon-btn:hover { background: var(--soft); }
.icon-btn .i { width: 20px; height: 20px; }

/* Shell */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh;
  background: linear-gradient(to right, var(--surface) calc(var(--side) - 1px), var(--border) 0 var(--side), transparent 0); }
.mbar { display: none; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  padding: 16px 12px; border-right: 1px solid var(--border); background: var(--surface); }
.side-brand { margin: 2px 0 14px 6px; font-size: 16px; }
.switch { position: relative; margin-bottom: 14px; }
.switch summary, .switch-static { list-style: none; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: 10px;
  font: 500 14px/1 var(--sans); background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; }
.switch-static { cursor: default; margin-bottom: 14px; }
.switch summary::-webkit-details-marker { display: none; }
.switch summary:hover { box-shadow: inset 0 0 0 1px var(--border-2); }
.switch summary .i { margin-left: auto; color: var(--muted); transition: transform 0.15s; }
.switch[open] summary .i { transform: rotate(180deg); }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--money); flex: none; box-shadow: 0 0 0 3px var(--money-soft); }
.switch-menu { position: absolute; z-index: 20; left: 0; right: 0; top: 46px; padding: 6px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); display: grid; gap: 2px; }
.switch-menu a { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 36px; padding: 0 10px; border-radius: 8px; font-size: 14px; text-decoration: none; }
.switch-menu a:hover { background: var(--soft); }
.switch-menu a[aria-current] { font-weight: 500; }
.switch-menu .switch-add { justify-content: flex-start; color: var(--muted); border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 2px; }
.snav { display: grid; gap: 2px; }
.snav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; font: 500 14px/1 var(--sans);
  color: var(--muted); text-decoration: none; transition: background-color 0.15s, color 0.15s; }
.snav a:hover { color: var(--fg); background: var(--soft); }
.snav a[aria-current="page"] { color: var(--fg); background: var(--soft); box-shadow: inset 0 0 0 1px var(--border); }
.side-foot { margin-top: auto; padding: 14px 6px 4px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.acct-mail { font-size: 13px; color: var(--muted); padding: 0 4px; }
.signout { justify-content: flex-start; gap: 8px; padding: 0 8px; color: var(--fg-2); }
.side-note { font-size: 13px; color: var(--muted); line-height: 1.45; }
.side-foot .btn-primary { width: 100%; }
#acct { display: grid; gap: 8px; }
.side-foot .theme-ctl { display: flex; }
.side-foot .theme-ctl button { flex: 1; justify-content: center; padding: 0 6px; }
.side-foot .lang-ctl { margin-top: 8px; }
.side-foot .lang-ctl select { width: 100%; }

.body { min-width: 0; display: flex; flex-direction: column; }
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 32px; border-bottom: 1px solid var(--border);
  background: var(--money-soft); font-size: 14px; }
.demo-bar p { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  min-height: 64px; padding: 12px 32px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--border); }
.tbar h1 { font: 600 20px/1.2 var(--sans); letter-spacing: -0.025em; }
.tbar h1:focus { outline: none; }
.tbar h1:focus-visible { outline: 2px solid var(--ring); }
.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rt { height: 32px; padding: 0 12px; font-variant-numeric: tabular-nums; }
.rt .dot { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--money) 22%, transparent); } }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--soft); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--border); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 7px; font: 500 13px/1 var(--sans); color: var(--muted);
  text-decoration: none; white-space: nowrap; transition: background-color 0.15s, color 0.15s, box-shadow 0.15s; }
.seg a:hover { color: var(--fg); }
.seg a[aria-current] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.seg .short { display: none; }
.seg .pn { padding: 0 7px; }
.seg span.pn { display: inline-flex; align-items: center; height: 28px; color: var(--muted); opacity: 0.4; }
.custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.custom .input { height: 34px; width: auto; font-size: 14px; padding: 0 10px; }

.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 32px 0; }
.chips-l { font-size: 13px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border-2); font-size: 13px; max-width: 100%; }
.chip-k { color: var(--muted); }
.chip-v { font-weight: 500; max-width: 260px; }
.chip-x { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); }
.chip-x:hover { background: var(--soft); color: var(--fg); }
.chip-x .i { width: 14px; height: 14px; }
.chips-clear { font-size: 13px; color: var(--muted); }

.view { padding: 24px 32px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; max-width: 1280px; width: 100%; transition: opacity 0.2s; } /* one column that never grows past the screen: wide tables scroll inside .scroll */
.view[aria-busy="true"] { opacity: 0.55; pointer-events: none; }

/* Boxes */
.box { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.box-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; min-height: 32px; }
.h-box { font: 600 15px/1.3 var(--sans); letter-spacing: -0.015em; }
.box > .muted + * { margin-top: 14px; }
.box > .muted { font-size: 14px; }
.narrow-box { max-width: 640px; }
.narrow-box .h-box { margin-bottom: 6px; }
.empty { padding: 32px 24px; }
.empty .h-box { margin-bottom: 6px; }
.empty-in { padding: 36px 12px; text-align: center; }
.empty-t { font-weight: 600; margin-bottom: 4px; }
/* Ready-made items from the site's own traffic, in an empty Goals or board (views.js ideasBox). */
.ideas-w { padding: 8px 0 4px; }
.ideas-lead { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.ideas { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.idea { display: grid; gap: 4px; align-content: start; padding: 16px; border-radius: var(--radius); background: var(--soft); min-width: 0; }
.idea-k { font-size: 12px; color: var(--muted); }
.idea-t { font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.idea-n { margin: 6px 0 10px; font-size: 13px; }
.idea-n .num { display: block; font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.idea .btn { justify-self: start; }
@media (max-width: 520px) {
  .idea { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 12px 14px; }
  .idea > :not(.btn) { grid-column: 1; }
  .idea .btn { grid-column: 2; grid-row: 1 / 4; align-self: center; }
  .idea-n { margin: 2px 0 0; }
  .idea-n .num { display: inline; font-size: 20px; line-height: 26px; }
}
.see { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.see:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.foot-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.facts { margin-top: 10px; font-size: 13px; color: var(--muted); }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Skeletons */
.sk { border-radius: 8px; background: linear-gradient(90deg, var(--soft) 30%, color-mix(in srgb, var(--soft) 40%, var(--surface)) 50%, var(--soft) 70%);
  background-size: 300% 100%; animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk.w30 { width: 30%; } .sk.w50 { width: 50%; } .sk.w70 { width: 70%; }
.sk.mt8 { margin-top: 8px; } .sk.mt16 { margin-top: 16px; }
.chart-sk { margin-top: 14px; }

/* KPI tiles */
.kpis { display: grid; gap: 1px; background: var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); padding: 16px 18px; min-height: 108px; min-width: 0; }
.kpi-l { font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.kpi-v { margin-top: 6px; font: 600 28px/1.15 var(--sans); letter-spacing: -0.03em; }
.kpi-d { margin-top: 6px; font-size: 13px; min-height: 18px; }
/* A chartable total: the whole card is the button; the pressed one carries its series colour along the bottom. */
.kpi-btn { display: block; width: 100%; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; position: relative; transition: background-color 0.15s; }
.kpi-btn > span { display: block; }
.kpi-btn:hover { background: color-mix(in srgb, var(--soft) 60%, var(--surface)); }
.kpi-btn:focus-visible { outline: 2px solid var(--fg); outline-offset: -4px; }
.kpi-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--k) 6%, var(--surface)); }
.kpi-btn[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--k); }
.kpi-btn .spark-l { stroke: var(--c-ink); }
.kpi-btn .spark-a { fill: var(--c-ink); }
.kpi-btn:hover .spark-l, .kpi-btn[aria-pressed="true"] .spark-l { stroke: var(--k); }
.kpi-btn[aria-pressed="true"] .spark-a { fill: var(--k); opacity: 0.12; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 500; font-variant-numeric: tabular-nums; }
.delta .i { width: 13px; height: 13px; stroke-width: 1.8; }
.delta.good { color: var(--up); }
.delta.bad { color: var(--down); }
.delta.flat { color: var(--muted); }
@media (max-width: 1279px) { .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Charts */
.chart { position: relative; }
.plot { position: relative; border-radius: 8px; touch-action: pan-y; }
.plot svg { display: block; overflow: visible; }
.c-title { font: 500 12px var(--sans); fill: var(--muted); }
.c-legend { font: 12px var(--sans); fill: var(--fg-2); }
.c-key { stroke-width: 2; stroke-linecap: round; }
.c-tick { font: 11px var(--sans); fill: var(--c-ink); font-variant-numeric: tabular-nums; }
.c-end { font: 500 11px var(--sans); fill: var(--fg-2); }
.c-grid { stroke: var(--c-grid); stroke-width: 1; shape-rendering: crispEdges; }
.c-base { stroke: var(--c-axis); stroke-width: 1; shape-rendering: crispEdges; }
.c-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-area { opacity: 0.1; }
/* Chart key: each button shows its mark (line, bar or dashed) and toggles that series. */
.lg { display: flex; flex-wrap: wrap; gap: 4px; }
.lg-b { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
  font: 500 13px/1 var(--sans); color: var(--fg-2); cursor: pointer; transition: background-color 0.15s, color 0.15s, opacity 0.15s; }
.lg-b:hover { background: var(--soft); color: var(--fg); }
.lg-b[aria-pressed="false"] { color: var(--muted); opacity: 0.6; text-decoration: line-through; }
.lg-b i { width: 14px; height: 2px; border-radius: 2px; background: var(--k); flex: none; }
.lg-b i.bar { width: 9px; height: 11px; border-radius: 2px; }
.lg-b i.dash { height: 0; background: none; border-top: 2px dashed var(--k); border-radius: 0; }
.c-grad { pointer-events: none; }
.c-now { stroke-dasharray: 1 4; }
.c-bar.c-soft { opacity: 0.3; }
.plot.active .c-bar.c-soft { opacity: 0.18; }
.plot.active .c-bar.c-soft.on { opacity: 0.85; }
.c-bar.c-part { opacity: 0.45; }
.c-bar.c-soft.c-part { opacity: 0.15; }
.spark { display: block; width: 100%; height: 28px; margin-top: 10px; overflow: visible; }
.spark-l { fill: none; stroke: var(--k, var(--c-ink)); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-a { fill: var(--k, var(--c-ink)); opacity: 0.08; }
.c-dash { stroke-dasharray: 5 4; stroke-width: 1.5; opacity: 0.55; }
.c-bar { transition: opacity 0.12s; }
.plot.active .c-bar { opacity: 0.4; }
.plot.active .c-bar.on { opacity: 1; }
.c-dot { stroke: var(--surface); stroke-width: 2; }
.c-hair { stroke: var(--fg); stroke-opacity: 0.25; stroke-width: 1; pointer-events: none; }
.tip { position: absolute; top: 4px; z-index: 5; min-width: 150px; padding: 10px 12px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 13px; pointer-events: none; white-space: nowrap; }
.tip-d { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.tip-r { display: flex; align-items: center; gap: 8px; line-height: 22px; }
.tip-r i { width: 10px; height: 2px; border-radius: 2px; flex: none; background: var(--k); }
.tip-r i.dash { height: 0; background: none; border-top: 2px dashed var(--k); border-radius: 0; }
.tip-r i.none { background: transparent; }
.tip-r b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-r span { color: var(--muted); }
.tv { margin-top: 8px; }
.tv summary, .more summary { display: inline-flex; align-items: center; min-height: 40px; font-size: 13px; color: var(--muted); cursor: pointer; }
.tv summary:hover, .more summary:hover { color: var(--fg); }
.tv .scroll { max-height: 320px; overflow: auto; }

/* Top lists */
.list .box-h { margin-bottom: 8px; }
.lhead { display: grid; align-items: end; line-height: 1.25; grid-template-columns: minmax(0, 1fr) 76px 80px 60px; gap: 12px; padding: 0 10px 6px; font-size: 12px; color: var(--muted); }
.lhead span + span { text-align: right; }
.lrows { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lrow { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 76px 80px 60px; gap: 12px; align-items: center; height: 36px; padding: 0 10px;
  border-radius: 8px; text-decoration: none; font-size: 14px; isolation: isolate; }
.lbar { position: absolute; inset: 0 auto 0 0; z-index: -1; border-radius: 8px; background: color-mix(in srgb, var(--s1) 9%, transparent); }
.lrow:hover .lbar { background: color-mix(in srgb, var(--s1) 16%, transparent); }
.lk { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lv, .lr { text-align: right; font-variant-numeric: tabular-nums; }
.lr { color: var(--muted); }
.cc { font: 500 11px/1 var(--mono); padding: 3px 5px; border-radius: 5px; background: var(--soft); color: var(--muted); flex: none; }

/* Tables */
.scroll { overflow-x: auto; overscroll-behavior-x: contain; margin-inline: -20px; padding-inline: 20px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 0 12px; height: 42px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.tbl.small th, .tbl.small td { height: 34px; font-size: 13px; }
.tbl thead th { height: 36px; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom-color: var(--border-2); }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl .n { text-align: right; }
.tbl tbody th { font-weight: 400; }
.tbl tfoot th, .tbl tfoot td { font-weight: 600; border-bottom: 0; }
.tbl .k { max-width: 360px; }
.tbl .k > a, .tbl .k > span:first-child { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; vertical-align: middle; text-decoration: none; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td, .tbl tr.click:hover th { background: var(--bg); }
.tbl tr.click:hover .k a { text-decoration: underline; text-underline-offset: 3px; }
.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; min-height: 32px; }
.sort:hover { color: var(--fg); }
th[aria-sort="ascending"] .sort, th[aria-sort="descending"] .sort { color: var(--fg); }
.arr { display: inline-flex; width: 13px; }
.arr .i { width: 13px; height: 13px; stroke-width: 1.8; }
.tier { margin-left: 8px; font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 999px; vertical-align: middle; background: var(--soft); color: var(--muted); }
.tier.t1 { background: var(--money-soft); color: var(--money); }
.ab { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.ab-t { width: 48px; height: 6px; border-radius: 9px; background: var(--block-soft); overflow: hidden; }
.ab-t i { display: block; height: 100%; background: var(--block); border-radius: 9px; }

/* Events */
.ev-head, .ev summary { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px; gap: 12px; align-items: center; }
.ev-head { padding: 0 0 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border-2); }
.ev-head span + span { text-align: right; }
.ev { border-bottom: 1px solid var(--border); }
.ev summary { list-style: none; min-height: 44px; cursor: pointer; font-size: 14px; }
.ev summary::-webkit-details-marker { display: none; }
.ev summary:hover { background: var(--bg); }
.ev-k { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.ev .chev { color: var(--muted); transform: rotate(-90deg); transition: transform 0.15s; }
.ev[open] .chev { transform: none; }
.ev-body { padding: 4px 0 16px 24px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.h-prop { font: 500 12px/16px var(--mono); color: var(--muted); margin-bottom: 6px; }
.prop ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prop li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; font-size: 13px; }
.pbar { height: 6px; border-radius: 9px; background: var(--soft); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--s1); border-radius: 9px; }

/* Ads note */
.note { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 18px; border-radius: 14px;
  background: var(--money-soft); font-size: 14px; color: var(--fg-2); }
.note p { flex: 1 1 320px; }

/* Install and snippets */
.snip { position: relative; margin-top: 14px; }
.snip .code { padding-right: 84px; white-space: pre-wrap; word-break: break-all; margin: 0; }
.snip .copy { position: absolute; top: 8px; right: 8px; background: color-mix(in srgb, var(--primary-fg) 12%, transparent); color: var(--primary-fg); border-color: transparent; box-shadow: none; }
.snip .copy:hover { background: color-mix(in srgb, var(--primary-fg) 22%, transparent); }
.more { margin-top: 10px; }
.more > p { font-size: 14px; margin-top: 4px; }
.install { max-width: 760px; }
.install .h-box { margin-bottom: 6px; }
.wait { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; flex-wrap: wrap; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-2); border-top-color: var(--money); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
code { overflow-wrap: anywhere; }

/* Forms */
.form { display: grid; gap: 16px; margin-top: 16px; }
.al-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.al-form .wide { grid-column: 1 / -1; }
.al-form .row-gap { margin-top: 0; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23737373' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center / 14px; }
.form-msg { font-size: 14px; color: var(--muted); min-height: 20px; }
.fs { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.fs legend { font-size: 14px; font-weight: 500; margin-bottom: 8px; padding: 0; width: 100%; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--border-2); font-size: 14px; cursor: pointer; }
.check:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--fg); }
.check input, .switch-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--fg); }
.switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.switch-row input { margin-top: 3px; }
.switch-row > span { display: grid; gap: 2px; }
.pub-link { margin-top: 12px; font-size: 14px; overflow-wrap: anywhere; }
.dl { display: grid; gap: 0; margin: 0; }
.dl div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.dl div:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.danger { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--down) 35%, transparent); }
.dlg { border: 0; padding: 24px; border-radius: 16px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg); width: min(440px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgb(0 0 0 / 40%); }
.dlg .field { margin-top: 16px; }
.dlg .err { min-height: 20px; margin-top: 8px; }

/* Alerts */
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.alerts > li:last-child { border-bottom: 0; }
.alerts > li.al-empty { display: block; }
/* Workspaces (Settings): one disclosure per workspace, its people and forms inside. */
.ws-list li.ws { display: block; }
.ws summary { display: flex; align-items: center; gap: 12px; min-height: 40px; cursor: pointer; font-size: 14px; list-style: none; }
.ws summary::-webkit-details-marker { display: none; }
.ws summary::before { content: ""; flex: none; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .15s; }
.ws details[open] > summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .ws summary::before { transition: none; } }
.ws summary b { font-weight: 500; min-width: 0; }
.ws summary .muted { font-size: 13px; white-space: nowrap; }
.ws-in { display: grid; gap: 12px; padding: 4px 0 12px 18px; }
.ws-in > p, .ws-in .al-empty { font-size: 14px; }
.ws-in .al-form { margin: 0; }
.ws-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.ws-row .input { width: 240px; max-width: 100%; }
.ws-row .al-act { margin-left: auto; }
.ws-pick { margin-top: 16px; max-width: 420px; }
.counter-prev { margin: 12px 0 8px; line-height: 0; }
/* Board (C7): saved views as tiles, as many columns as fit. */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.btile { display: grid; gap: 12px; align-content: start; padding: 18px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.btile-h { display: grid; gap: 2px; color: inherit; text-decoration: none; min-width: 0; }
.btile-h b { font-weight: 500; font-size: 15px; }
.btile-h:hover b { text-decoration: underline; }
.bt-k { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.bt-k dt { font-size: 12px; color: var(--muted); }
.bt-k dd { margin: 0; font-size: 18px; font-variant-numeric: tabular-nums; }
.btile .spark { width: 100%; height: 40px; }
.bt-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.bt-rows li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bt-key { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.bt-rows .n { font-variant-numeric: tabular-nums; }
.bt-limit { font-size: 14px; font-weight: 500; margin: 0; }
.al-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; flex: none; }
.al-t { display: grid; gap: 2px; min-width: 0; flex: 1; font-size: 14px; }
.al-t b { font-weight: 500; }
.al-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.scrim { display: none; }

/* Phones and small tablets: the sidebar becomes a sheet under a top bar. */
@media (max-width: 899px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .mbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 8px 0 var(--gutter);
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--border); }
  .mbar-site { flex: 1; min-width: 0; text-align: right; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side { display: none; position: fixed; z-index: 29; top: 56px; left: 0; right: 0; height: auto; max-height: calc(100dvh - 56px); border-right: 0;
    border-bottom: 1px solid var(--border); padding: 12px var(--gutter) 16px; box-shadow: var(--shadow-lg); overscroll-behavior: contain; }
  .menu-open .side { display: flex; }
  .menu-open .scrim { display: block; position: fixed; inset: 56px 0 0; z-index: 28; background: rgb(0 0 0 / 30%); }
  .side-brand { display: none; }
  .snav { grid-template-columns: 1fr 1fr; }
  .snav a { height: 44px; }
  .switch summary, .switch-static { height: 44px; }
  .switch-menu a { height: 44px; }
  .side-foot .btn { height: 44px; }
  .tbar { position: static; padding: 14px var(--gutter); min-height: 0; border-bottom: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tbar h1 { font-size: 22px; }
  .tools { display: contents; }
  .period { flex: 1 1 100%; }
  .period, .vmenu, .custom { order: 1; } /* on a phone the live pill stays on the title line, the period row below */
  .custom { flex: 1 1 100%; }
  .period a { flex: 1; justify-content: center; height: 34px; padding: 0 8px; }
  .period .pn { flex: 0 0 auto; padding: 0 3px; }
  .period a:not(.pn) { padding: 0 4px; }
  .lg-b { height: 44px; }
  .chips { padding: 0 var(--gutter); }
  .view { padding: 12px var(--gutter) 48px; gap: 12px; }
  .demo-bar { padding: 10px var(--gutter); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .kpis.k6, .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .box { padding: 16px; }
  .scroll { margin-inline: -16px; padding-inline: 16px; }
  .seg a { min-height: 34px; }
}
@media (max-width: 639px) {
  .seg .long { display: none; }
  .seg .short { display: inline; }
  .kpis.k3 { grid-template-columns: minmax(0, 1fr); }
  .kpis.k3 .kpi { min-height: 0; }
  .kpi { padding: 14px; min-height: 100px; }
  .kpi-v { font-size: 24px; }
  .lhead, .lrow { grid-template-columns: minmax(0, 1fr) 58px 66px 50px; gap: 6px; }
  .lhead { font-size: 11px; }
  .lrow { height: 40px; }
  .ev-head, .ev summary { grid-template-columns: minmax(0, 1fr) 64px 64px; }
  .ev-body { padding-left: 0; grid-template-columns: minmax(0, 1fr); }
  .al-form { grid-template-columns: minmax(0, 1fr); }
  .alerts > li { flex-wrap: wrap; }
  .al-act { width: 100%; justify-content: flex-start; padding-left: 44px; }
  .dl div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .chip-v { max-width: 160px; }
  /* Tap targets on a phone (guidelines.test.mjs): the chip's match select and the map's shade switch reach 32 px. */
  .chip { height: 36px; }
  .chip .chip-op, .chip input.chip-v { height: 32px; }
  .seg-sm button { min-height: 32px; }
  .custom { width: 100%; }
  .custom label { flex: 1; }
  .custom .input { width: 100%; height: 40px; }
  .custom .btn { height: 40px; }
  .btn-sm { height: 40px; }
  /* Tables scroll inside their card; the name column stays put while the numbers scroll under it. */
  .tbl .k { max-width: 200px; }
  .tbl tbody th:first-child, .tbl thead th:first-child, .tbl tfoot th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface);
    box-shadow: 8px 0 8px -8px rgb(0 0 0 / 18%); padding-right: 10px; }
  .tbl .tier { margin-left: 6px; }
  .see { min-height: 40px; }
}

/* Settings: API keys */
.key-new { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--money-soft); }
.key-new p { margin-bottom: 10px; }
.key-form { margin-top: 16px; }

/* Settings: what gets counted */
.hint { margin-top: 6px; font-size: 13px; color: var(--muted); }
.self-ex { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.h-sub { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.self-ex .snip { margin-top: 10px; }
.self-ex .snip + p { margin-top: 12px; }
textarea.input { min-height: 84px; padding-block: 10px; resize: vertical; font-family: var(--mono); font-size: 13px; }
.tbl td.act { white-space: nowrap; }

/* Tables: tools beside a box heading (group switch, Export CSV) */
.box-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Settings: weekly email preview */
.mail-prev { margin-top: 12px; }
.mail-prev iframe { display: block; width: 100%; height: 280px; margin-top: 6px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
/* Overview: bounce rate and the estimate notice, one line under the totals */
.kpi-note { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: -6px 0 16px; font-size: 13px; color: var(--muted); }
.kpi-note b { color: var(--fg); font-weight: 600; }
.est-note { color: var(--block); }
/* Settings: team role picker in a row, and the note on a site someone else owns */
.input-sm { height: 32px; padding: 0 28px 0 10px; font-size: 13px; width: auto; }
.role-note { margin-bottom: 16px; }
/* Settings: two-factor setup */
.tfa-steps { margin: 0 0 10px; padding-left: 18px; color: var(--fg-2); }
.tfa-qr { width: 176px; height: 176px; margin: 4px 0 12px; padding: 0; background: #fff; border-radius: 10px; }
.tfa-qr svg { display: block; width: 100%; height: 100%; }

/* &embed=1: only the dashboard, inside another site's iframe */
body.embed .mbar, body.embed .side, body.embed .scrim { display: none; }
body.embed .app { grid-template-columns: minmax(0, 1fr); }
body.embed .body { margin-left: 0; padding-top: 0; }
.embed-credit { margin: 8px 0 16px; text-align: center; font-size: 12px; }
.embed-credit a { color: var(--muted); text-decoration: none; }

/* Filter chips: how a filter matches, and its value, editable in place */
.chip-op { height: 24px; padding: 0 4px; border: 0; border-radius: 6px; background: var(--soft); font: inherit; font-size: 12px; color: var(--fg-2); cursor: pointer; }
input.chip-v { height: 24px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; font-weight: 500; color: var(--fg); min-width: 3ch; }
input.chip-v:focus { border-color: var(--fg); background: var(--bg); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent); }
/* Notes on the overview chart */
.c-note { stroke: var(--block); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.7; pointer-events: none; }
.c-note-dot { fill: var(--block); }
.tip-n { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); max-width: 240px; font-size: 12px; color: var(--fg-2); }
.notes-box { margin-top: 12px; font-size: 14px; }
.notes-box summary { cursor: pointer; color: var(--fg-2); font-weight: 500; min-height: 32px; display: flex; align-items: center; gap: 8px; }
.notes-list { margin: 6px 0 10px; padding: 0; list-style: none; display: grid; gap: 4px; }
.notes-list li { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.notes-list time { flex: none; width: 56px; font: 500 12px/1 var(--mono); color: var(--muted); }
.notes-list span { flex: 1; min-width: 0; }
.notes-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.notes-form input[type=text] { flex: 1; min-width: 180px; width: auto; }
/* Saved views menu beside the period picker */
.vmenu { position: relative; }
.vmenu summary { list-style: none; }
.vmenu summary::-webkit-details-marker { display: none; }
.vmenu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px; padding: 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); }
.vlist { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 2px; }
.vlist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.vlist a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); text-decoration: none; font-size: 14px; }
.vform { display: flex; gap: 6px; }
.vform input { flex: 1; min-width: 0; }
@media (max-width: 640px) { .vmenu-pop { position: fixed; left: 16px; right: 16px; width: auto; top: auto; bottom: 16px; } }
/* A read-only page with nothing to show (not public, link off): one column, the message across the page */
.app.solo { grid-template-columns: minmax(0, 1fr); }
.app.solo .body { margin-left: 0; }
/* Revenue, the selling point, is the strongest number in a row */
.tbl td.rev { color: var(--money-ink, var(--money)); font-weight: 600; }

/* Funnels: one row per step, a bar of the share still in the funnel */
.funnel { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.fn-h { display: flex; align-items: center; gap: 10px; }
.fn-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 12px; font-weight: 600; color: var(--fg-2); }
.fn-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-v { font-variant-numeric: tabular-nums; }
.fn-bar { margin: 6px 0 0 34px; height: 10px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.fn-bar i { display: block; height: 100%; background: var(--money); border-radius: 6px; }
.fn-d { margin: 4px 0 0 34px; font-size: 12px; color: var(--muted); }
.fn-steps { display: grid; gap: 8px; }
.fn-step { display: flex; align-items: center; gap: 8px; }
.fn-step input { flex: 1; min-width: 0; width: auto; }
.jr { display: inline-flex; align-items: center; gap: 6px; }
.jr-a { color: var(--muted); }

/* Speed: a value rated good, needs work or poor (web.dev thresholds) */
.vital { font-weight: 600; font-variant-numeric: tabular-nums; }
.vital.good { color: var(--money-ink, var(--money)); }
.vital.fair { color: var(--block); }
.vital.poor { color: #b91c1c; } /* red, apart from the orange of "needs work" */
.errs { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.errs li { display: flex; align-items: center; gap: 12px; min-height: 36px; border-bottom: 1px solid var(--border); }
.errs code { flex: 1; min-width: 0; font-size: 13px; }
.errs b { font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .vital.poor { color: #f87171; }
/* Search Console upload steps */
.gsc-steps { margin: 10px 0 4px; padding-left: 20px; display: grid; gap: 4px; color: var(--fg-2); font-size: 14px; }
/* Row trend: the opened row under a table row */
.tbl td.tr-c { width: 1%; padding-right: 0; white-space: nowrap; }
.tbl tr.trend-row td { height: auto; padding: 4px 0 12px; background: var(--bg); }
.trend-box { padding: 8px 12px 0; }
/* Settings: a jump list, since the page holds twelve boxes */
.jump { display: flex; flex-wrap: wrap; gap: 6px; }
.jump a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); color: var(--fg-2); font-size: 13px; text-decoration: none; }
.jump a:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--border-2); }
.st-tabs a[aria-current] { color: var(--fg); font-weight: 500; box-shadow: inset 0 0 0 1.5px var(--fg); }
#main .h-box { scroll-margin-top: 80px; }

/* Live */
.lv-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lv-now { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; min-width: 0; }
.lv-pulse { grid-row: span 2; width: 12px; height: 12px; border-radius: 50%; background: var(--money); box-shadow: 0 0 0 0 color-mix(in srgb, var(--money) 45%, transparent); animation: lv-ring 2s ease-out infinite; }
@keyframes lv-ring { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.lv-big { font: 500 20px/1.3 var(--sans); letter-spacing: -0.015em; }
.lv-big #lv-n { font: 650 30px/1 var(--sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; display: inline-block; min-width: 2ch; }
.lv-val { font-size: 14px; margin-top: 2px; }
.lv-ctl { display: flex; align-items: center; gap: 12px; }
.lv-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.lv-map { display: block; width: 100%; height: auto; }
.lv-land { fill: var(--soft); stroke: var(--border-2); stroke-width: 0.6; stroke-linejoin: round; }
.lv-dot { fill: var(--s1); fill-opacity: 0.5; stroke: var(--s1); stroke-width: 1.5; }
.lv-pm { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.lv-pm .box-h { margin-bottom: 6px; }
@media (min-width: 1024px) { .lv-feedbox .feed { max-height: 560px; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; } }
.lv-tops { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
/* One column that may shrink: an auto column would grow to the longest path and push the counts out of the box. */
.lt { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.lt li { position: relative; display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 0 8px; font-size: 13px; }
.lt-bar { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: color-mix(in srgb, var(--s1) 7%, transparent); }
.lt-k { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.lt b { position: relative; font-weight: 600; font-variant-numeric: tabular-nums; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 10px; padding: 10px 4px; border-top: 1px solid var(--border); font-size: 13px; }
.feed li:first-child { border-top: 0; }
.feed li > :not(.f-t) { grid-column: 2; }
.feed .f-t { grid-row: span 4; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 1px; }
.feed .f-p, .feed .f-w { display: flex; align-items: center; gap: 8px; min-width: 0; }
.feed .f-p .trunc { font-weight: 500; }
.feed .f-v { flex: none; color: var(--fg-2); font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--soft); }
.feed .f-d, .feed .f-s { color: var(--muted); }
.feed .f-s:empty { display: none; }
.feed .f-ev { height: 22px; padding: 0 8px; font-size: 12px; flex: none; }
.feed li.f-empty { display: block; }
.feed li.new { animation: f-in 0.5s ease-out, f-glow 2s ease-out; }
@keyframes f-in { from { transform: translateY(-6px); opacity: 0; } }
@keyframes f-glow { from { background: color-mix(in srgb, var(--s1) 12%, transparent); } }
@media (prefers-reduced-motion: reduce) { .feed li.new, .lv-pulse { animation: none; } }
@media (max-width: 1023px) { .lv-grid { grid-template-columns: minmax(0, 1fr); } }

/* The live pill's popover: what is happening now, a step from the full Live view. */
.rt { cursor: pointer; border: 0; font: inherit; font-size: 13px; }
.rt:hover { background: var(--soft); }
.rt:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.rtpop { position: fixed; inset: auto; margin: 0; width: min(380px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 90px)); overflow-y: auto;
  padding: 16px; border: 0; border-radius: 14px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg); }
.rp-h { display: flex; align-items: baseline; gap: 8px; }
.rp-h .dot { align-self: center; }
.rp-h b { font: 650 22px/1 var(--sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rp-val { font-size: 13px; color: var(--muted); margin-top: 4px; }
.rp-spark { --k: var(--s1); margin: 10px 0 2px; }
.rp-spark .spark { height: 36px; }
.rp-cap { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.rp-sec { margin-top: 14px; }
.rp-sec h3 { font: 500 12px/1 var(--sans); color: var(--muted); margin-bottom: 6px; }
.rp-sec .lt li { min-height: 26px; }
.rp-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.rp-feed li { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.rp-feed .f-t { color: var(--muted); font-variant-numeric: tabular-nums; }
.rp-go { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; margin-top: 14px; border-radius: 10px; background: var(--soft); font: 500 14px/1 var(--sans); text-decoration: none; color: var(--fg); }
.rp-go:hover { background: color-mix(in srgb, var(--soft) 70%, var(--border)); }
.rp-msg { font-size: 13px; color: var(--muted); padding: 8px 0; }

/* A part-of-whole bar (adblock kinds): segments with a 2px surface gap, each named in the key below. */
.stack { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; }
.stack i { display: block; min-width: 3px; background: var(--k); }
.stack-key { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; }
.stack-key li { display: grid; grid-template-columns: 10px auto 1fr; column-gap: 8px; align-items: baseline; align-content: start; font-size: 13px; }
.stack-key li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--k); transform: translateY(1px); }
.stack-key em { font-style: normal; font-weight: 500; }
.stack-key b { font-variant-numeric: tabular-nums; }
.stack-key span { grid-column: 2 / -1; color: var(--muted); }

/* Page transitions under a page row: where visits came from, and where they went. */
.flow-box { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 8px 4px; }
.flow-h { font: 500 12px/1 var(--sans); color: var(--muted); margin-bottom: 8px; }
.flow-mid { display: flex; justify-content: center; padding-top: 30px; color: var(--muted); }
@media (max-width: 640px) { .flow-box { grid-template-columns: minmax(0, 1fr); } .flow-mid { display: none; } }

/* Sessions: one row per visit, opening to its pages in order. */
.sess { list-style: none; margin: 0; padding: 0; }
.sess > li { border-top: 1px solid var(--border); }
.sess > li:first-child { border-top: 0; }
.sess summary { list-style: none; display: grid; grid-template-columns: 120px minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 0.9fr) 130px; gap: 12px; align-items: center;
  min-height: 48px; padding: 8px 6px; font-size: 13px; cursor: pointer; border-radius: 8px; }
.sess summary::-webkit-details-marker { display: none; }
.sess summary:hover { background: var(--soft); }
.sess summary:focus-visible { outline: 2px solid var(--fg); outline-offset: -2px; }
.sess .s-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.sess .s-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sess .s-dev, .sess .s-src { color: var(--fg-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess .s-n { white-space: nowrap; color: var(--fg-2); text-align: right; }
.sess .s-n b { color: var(--fg); font-weight: 600; }
.sess .f-v { flex: none; color: var(--fg-2); font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--soft); }
.s-pages { list-style: none; margin: 0 0 12px 132px; padding: 4px 0 4px 14px; border-left: 2px solid var(--border); display: grid; gap: 4px; font-size: 13px; }
.s-pages li { display: flex; gap: 12px; min-width: 0; }
.s-pages time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; width: 88px; }
@media (max-width: 760px) {
  .sess summary { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .sess .s-n { text-align: right; }
  .sess .s-when { grid-column: 1; } .sess .s-n { grid-column: 2; grid-row: 1; }
  .sess .s-who, .sess .s-dev, .sess .s-src { grid-column: 1 / -1; }
  .s-pages { margin-left: 6px; }
}

/* Flags (4:3) and source icons sit beside their label at text size. */
.flag { width: 16px; height: 12px; flex: none; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px var(--border); }
.fav { width: 16px; height: 16px; flex: none; border-radius: 3px; }
.fav-none { display: inline-block; background: var(--soft); box-shadow: inset 0 0 0 1px var(--border); }
.feed .f-s, .sess .s-src { display: flex; align-items: center; gap: 6px; min-width: 0; }
.n-key { font-variant-numeric: tabular-nums; }
/* Countries map: one blue ramp, five steps from the soft fill (dataviz: sequential = one hue, light to dark). */
.cmap { display: block; width: 100%; height: auto; margin-top: 8px; }
.cmap path { fill: var(--soft); stroke: var(--border-2); stroke-width: 0.5; stroke-linejoin: round; }
.cmap path.cm-none { pointer-events: none; }
.cmap path[class^="cm-"]:not(.cm-none):not(.cm-0) { cursor: pointer; }
.cmap path:hover { stroke: var(--fg); stroke-width: 1; }
.cmap .cm-0, .cm-legend .cm-0 { fill: color-mix(in oklab, var(--s1) 8%, var(--soft)); }
.cmap .cm-1, .cm-legend .cm-1 { fill: color-mix(in oklab, var(--s1) 22%, var(--soft)); background: color-mix(in oklab, var(--s1) 22%, var(--soft)); }
.cmap .cm-2, .cm-legend .cm-2 { fill: color-mix(in oklab, var(--s1) 40%, var(--soft)); background: color-mix(in oklab, var(--s1) 40%, var(--soft)); }
.cmap .cm-3, .cm-legend .cm-3 { fill: color-mix(in oklab, var(--s1) 58%, var(--soft)); background: color-mix(in oklab, var(--s1) 58%, var(--soft)); }
.cmap .cm-4, .cm-legend .cm-4 { fill: color-mix(in oklab, var(--s1) 78%, var(--soft)); background: color-mix(in oklab, var(--s1) 78%, var(--soft)); }
.cmap .cm-5, .cm-legend .cm-5 { fill: var(--s1); background: var(--s1); }
.cm-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cm-legend i { width: 22px; height: 10px; border-radius: 2px; }
.cm-legend .cm-max { margin-left: auto; }
.seg button { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: none; font: 500 13px/1 var(--sans); color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
/* Phone top lists: name, pageviews and revenue; EPMV is in the full table (critic 2026-11-02 item 10). */
@media (max-width: 479px) {
  .lhead, .lrow { grid-template-columns: minmax(0, 1fr) 58px 66px; }
  .lhead > span:nth-child(4), .lrow .le { display: none; }
}
/* Settings > What gets counted: the census exclusions fold away until one is set. A details element's content is not
   a grid item in Chrome, so the fields sit in their own grid. */
.form details.more { margin-top: 0; }
.more-grid { display: grid; gap: 16px; align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
@media (max-width: 639px) { .more-grid { grid-template-columns: minmax(0, 1fr); } }
/* Ad rotation tags (Settings, Ad rotation): one bordered group per network and slot, network and slot side by side,
   the tag's code under them. The Networks report puts each network's share of visitors now under its rate. */
.ad-tags { display: grid; gap: 12px; }
.ad-tag { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.ad-tag .wide { grid-column: 1 / -1; margin: 0; }
.fs > .hint, .fs > .ad-tags { flex-basis: 100%; margin: 0; }
#rg-cadence { margin-top: 12px; }
.input.mono { font: 13px/1.5 var(--mono); }
.nw-w { display: block; }
@media (max-width: 640px) { .ad-tag { grid-template-columns: minmax(0, 1fr); } }
.ad-slot-help { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
