/* TightStats dashboard.
   Tokens first: surfaces, ink, lines, the brand accent, and the data-viz
   roles (series colours from the validated reference palette; status
   colours reserved for vitals and deltas). Dark mode is its own set of
   steps, under the OS setting and under data-theme="dark". */
:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f3f4f6;   /* hover, subtle fills */
  --surface-3: #e9ebef;   /* pressed, tracks */
  --border: #e4e6eb;
  --border-strong: #d2d6dd;
  --text: #0f1115;
  --text-2: #4a4f59;
  --muted: #6c727d;
  --accent: #2a78d6;
  --accent-ink: #1f63b5;  /* accent as text/links: 4.5:1 on surface */
  --accent-soft: #2a78d61a;
  --accent-soft-2: #2a78d62e;
  --on-accent: #ffffff;
  --s-vis: #2a78d6;       /* series 1, blue: visitors */
  --s-pv: #1baf7a;        /* series 3, aqua: pageviews */
  --meter: #2a78d614;
  --meter-edge: #2a78d6;
  --map-empty: #e7e9ee;
  --map-line: #ffffff;
  --grid: #eceef2;
  --good: #0a7a3c; --good-bg: #e3f4e9;
  --warn: #8a5a00; --warn-bg: #fdf1d6;
  --bad: #b3261e; --bad-bg: #fbe4e2;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / .05);
  --shadow: 0 1px 3px rgb(16 24 40 / .06), 0 1px 2px rgb(16 24 40 / .04);
  --shadow-lg: 0 12px 32px rgb(16 24 40 / .14), 0 2px 6px rgb(16 24 40 / .06);
  --radius: 12px;
  --radius-sm: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --page: 1240px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0f11; --surface: #16181b; --surface-2: #1d2024; --surface-3: #262a2f;
    --border: #262a30; --border-strong: #343941;
    --text: #f1f2f4; --text-2: #b9bdc6; --muted: #8d939d;
    --accent: #3987e5; --accent-ink: #7fb2f0; --accent-soft: #3987e521; --accent-soft-2: #3987e538; --on-accent: #ffffff;
    --s-vis: #3987e5; --s-pv: #199e70;
    --meter: #3987e51f; --meter-edge: #3987e5;
    --map-empty: #262a30; --map-line: #16181b; --grid: #22252a;
    --good: #6fd39a; --good-bg: #173524; --warn: #f0c060; --warn-bg: #3a2e12; --bad: #f2867f; --bad-bg: #3d1a18;
    --shadow-sm: none; --shadow: 0 0 0 1px rgb(0 0 0 / .2); --shadow-lg: 0 12px 32px rgb(0 0 0 / .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0f11; --surface: #16181b; --surface-2: #1d2024; --surface-3: #262a2f;
  --border: #262a30; --border-strong: #343941;
  --text: #f1f2f4; --text-2: #b9bdc6; --muted: #8d939d;
  --accent: #3987e5; --accent-ink: #7fb2f0; --accent-soft: #3987e521; --accent-soft-2: #3987e538; --on-accent: #ffffff;
  --s-vis: #3987e5; --s-pv: #199e70;
  --meter: #3987e51f; --meter-edge: #3987e5;
  --map-empty: #262a30; --map-line: #16181b; --grid: #22252a;
  --good: #6fd39a; --good-bg: #173524; --warn: #f0c060; --warn-bg: #3a2e12; --bad: #f2867f; --bad-bg: #3d1a18;
  --shadow-sm: none; --shadow: 0 0 0 1px rgb(0 0 0 / .2); --shadow-lg: 0 12px 32px rgb(0 0 0 / .5);
}
/* Legacy token names (kept for templates and pages that use them). */
:root { --surface-1: var(--surface); --text-primary: var(--text); --text-secondary: var(--text-2); --text-muted: var(--muted);
  --series-1: var(--s-vis); --series-1-soft: var(--accent-soft); --series-2: var(--s-pv); --link: var(--accent-ink); }

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 1.25rem 1.5rem 2rem; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, pre, kbd { font: 12.5px/1.5 var(--mono); }
code { background: var(--surface-2); border-radius: 4px; padding: .05rem .3rem; }
pre { background: var(--surface-2); border: 1px solid var(--border); padding: .8rem 1rem; border-radius: var(--radius-sm); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
pre code { background: none; padding: 0; }
h1 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 .6rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: .95rem; line-height: 1.3; margin: 0 0 .75rem; font-weight: 600; }
h1 .muted, h2 .muted { font-weight: 400; font-size: .85em; }
.muted, .empty { color: var(--muted); font-weight: 400; }
.empty { margin: .5rem 0; }
.small { font-size: .8rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1; }
.ico { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* Buttons and inputs */
button, .button { font: inherit; font-weight: 550; font-size: .875rem; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); border-radius: var(--radius-sm); padding: .45rem .95rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; line-height: 1.3; box-shadow: var(--shadow-sm); white-space: nowrap; }
button:hover, .button:hover { filter: brightness(1.06); text-decoration: none; }
button.ghost, .button.ghost { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
button.ghost:hover, .button.ghost:hover { background: var(--surface-2); color: var(--text); filter: none; }
button.small, .button.small { padding: .3rem .65rem; font-size: .8rem; }
button.link { background: none; border: none; color: var(--accent-ink); padding: 0; box-shadow: none; }
input, select, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .42rem .6rem; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent-soft-2); border-color: var(--accent); }
label { color: var(--text-2); font-size: .8rem; font-weight: 500; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-in { max-width: var(--page); margin: 0 auto; display: flex; align-items: center; gap: .6rem; padding: .6rem 1.5rem; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.02rem; color: var(--text); letter-spacing: -.015em; }
.brand:hover { text-decoration: none; }
.logo { width: 28px; height: 28px; flex: none; }
.logo-bg { fill: var(--accent); }
.logo-ln { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.logo-dot { fill: #fff; }
.crumb { display: inline-flex; align-items: center; gap: .45rem; color: var(--text-2); min-width: 0; overflow: hidden; white-space: nowrap; font-size: .9rem; }
.crumb strong { overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 600; }
.crumb-c { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.sep { color: var(--border-strong); font-size: 1.1rem; }
.logout { display: flex; align-items: center; gap: .55rem; margin: 0; color: var(--text-2); font-size: .85rem; min-width: 0; }
.who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14rem; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft-2); color: var(--accent-ink); font-weight: 650; font-size: .8rem; flex: none; }

/* Site header and section tabs */
.sitehead { background: var(--surface); border-bottom: 1px solid var(--border); }
.sitehead-in { max-width: var(--page); margin: 0 auto; padding: 1rem 1.5rem .25rem; }
.site-title { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.site-title > div { min-width: 0; }
.site-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--s-pv))); color: #fff; font-weight: 700; }
.site-name { margin: 0; font-size: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-domain { color: var(--muted); font-size: .82rem; }
.tabs { max-width: var(--page); margin: 0 auto; display: flex; gap: .15rem; padding: .35rem 1.5rem 0; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .75rem .7rem; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; font-size: .9rem; }
.tabs a:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); }
.tabs a[aria-current] { color: var(--text); border-color: var(--accent); font-weight: 600; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #12b76a; display: inline-block; flex: none; box-shadow: 0 0 0 3px #12b76a33; }
@media (prefers-reduced-motion: no-preference) { .live-dot { animation: pulse 2s ease-in-out infinite; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px #12b76a00; } }
.subnav { background: var(--surface); border-bottom: 1px solid var(--border); }
.subnav-in { max-width: var(--page); margin: 0 auto; display: flex; flex-wrap: wrap; gap: .35rem; padding: .6rem 1.5rem; }
.subnav a { padding: .28rem .7rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); font-size: .82rem; white-space: nowrap; font-weight: 500; }
.subnav a:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.subnav a[aria-current] { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.subnav.inline-nav { padding: 0; background: none; border: 0; display: flex; flex-wrap: wrap; gap: .35rem; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; min-width: 0; box-shadow: var(--shadow-sm); }
.card.narrow { max-width: 40rem; margin: 2.5rem auto; }
.card-head { display: flex; align-items: center; gap: .4rem .9rem; flex-wrap: wrap; margin-bottom: .9rem; min-height: 1.6rem; }
.card-head h1, .card-head h2 { margin: 0; }
.card-head .csv, .card-head .seg, .card-head form, .card-head .right { margin-left: auto; }
.csv { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted); font-weight: 500; border: 1px solid var(--border); border-radius: 6px; padding: .15rem .5rem; }
.csv:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .4rem; padding: 1.6rem .5rem; color: var(--muted); }
.empty-state svg { width: 28px; height: 28px; fill: none; stroke: var(--border-strong); stroke-width: 2; stroke-linecap: round; }
.empty-state p { margin: 0; font-size: .875rem; }
.empty-state strong { color: var(--text-2); }
.note { color: var(--text-2); font-size: .85rem; border-left: 3px solid var(--accent); padding: .5rem .8rem; background: var(--accent-soft); border-radius: 0 8px 8px 0; }
h2.sub { margin-top: 1.4rem; }
.id { font: 12px/1.4 var(--mono); word-break: break-all; }

/* Filter bar: date picker, toggles, chips */
.controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.controls .zone { white-space: nowrap; }
.picker { display: inline-flex; align-items: stretch; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.picker .arrow { display: grid; place-items: center; width: 34px; color: var(--text-2); }
.picker .arrow:first-child { border-right: 1px solid var(--border); }
.picker .arrow:last-child { border-left: 1px solid var(--border); }
.picker .arrow:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.picker .arrow.off { color: var(--border-strong); cursor: default; }
.picker .arrow.off:hover { background: none; }
.picker .arrow svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.picker .range-menu summary { border: 0; box-shadow: none; border-radius: 0; height: 100%; font-weight: 550; color: var(--text); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: .85rem; white-space: nowrap; box-shadow: var(--shadow-sm); user-select: none; }
.menu summary:hover { background: var(--surface-2); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translate(-2px, -1px); margin-left: .15rem; }
.menu[open] summary { background: var(--surface-2); }
.menu .pop { position: absolute; z-index: 20; left: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 13rem; max-width: calc(100vw - 2rem); box-shadow: var(--shadow-lg); padding: .35rem; }
.presets { list-style: none; margin: 0; padding: 0; }
.presets a { display: block; padding: .42rem .65rem; border-radius: 6px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .875rem; }
.presets a:hover { background: var(--surface-2); text-decoration: none; }
.presets a[aria-current] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.range-menu .pop { width: 19rem; }
.range-menu .presets { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
.custom-range { border-top: 1px solid var(--border); margin: .35rem -.35rem -.35rem; padding: .7rem .8rem .8rem; display: grid; gap: .55rem; }
.pop-h { margin: 0; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.custom-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.custom-row input { width: 100%; padding: .35rem .45rem; font-size: .82rem; }
.custom-range button { justify-self: end; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg a { padding: .38rem .75rem; color: var(--text-2); font-size: .85rem; }
.seg a + a { border-left: 1px solid var(--border); }
.seg a:hover { background: var(--surface-2); text-decoration: none; }
.seg a[aria-current] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.seg.small a { padding: .25rem .6rem; font-size: .8rem; }
.toggle { display: inline-flex; align-items: center; gap: .5rem; padding: .42rem .75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font-size: .85rem; box-shadow: var(--shadow-sm); }
.toggle:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.toggle .knob { position: relative; width: 28px; height: 16px; flex: none; border-radius: 999px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); transition: background .15s; }
.toggle .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: left .15s; }
.toggle[aria-checked="true"] { color: var(--text); }
.toggle[aria-checked="true"] .knob { background: var(--accent); box-shadow: none; }
.toggle[aria-checked="true"] .knob::after { left: 14px; }
.chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent-soft-2); border-radius: 999px; padding: .28rem .4rem .28rem .75rem; font-size: .82rem; max-width: 100%; overflow: hidden; white-space: nowrap; }
.chip a { color: var(--text); }
.chip .op { color: var(--text-2); text-decoration: underline dotted; text-underline-offset: 3px; }
.chip.neg { background: var(--bad-bg); border-color: transparent; }
.chip .v { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.chip .x { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: .95rem; line-height: 1; color: var(--text-2); }
.chip .x:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.chip .op:hover { text-decoration: none; }
.badge { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; font-weight: 600; border-radius: 999px; padding: .08rem .5rem; vertical-align: middle; white-space: nowrap; }
.badge.good { color: var(--good); background: var(--good-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.bad { color: var(--bad); background: var(--bad-bg); }
.badge.share { background: var(--accent-soft); color: var(--accent-ink); font-size: .78rem; padding: .2rem .65rem; }
.badge.rec { background: var(--accent-soft); color: var(--accent-ink); }

/* Summary metrics: one card, a cell per metric */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.stat { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; box-shadow: -1px 0 0 var(--border), 0 -1px 0 var(--border); color: inherit; }
.stat .label { color: var(--text-2); font-size: .8rem; font-weight: 550; display: inline-flex; align-items: center; gap: .4rem; }
.stat .value { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.delta { font-size: .78rem; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.delta.up, .delta.down { align-self: flex-start; padding: .05rem .45rem; border-radius: 999px; }
.delta.up { color: var(--good); background: var(--good-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.delta.up::before { content: "↑"; }
.delta.down::before { content: "↓"; }
.prev-val { color: var(--muted); font-weight: 400; }
a.stat:hover { background: var(--surface-2); text-decoration: none; }
.live .value { color: var(--text); }

/* Plot frame: HTML axes around a stretched SVG */
.chart-wrap { width: 100%; position: relative; }
.plot { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; column-gap: .6rem; height: 260px; padding-top: 6px; }
.plot.bars { height: 220px; }
.plot .yax { position: relative; grid-row: 1; min-width: 2rem; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.plot .yax span { position: absolute; right: 0; transform: translateY(50%); line-height: 1; white-space: nowrap; }
.plot .pa { position: relative; grid-row: 1; grid-column: 2; min-width: 0; }
.plot .gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--grid); }
.plot .gl.base { border-top: 1px solid var(--border-strong); }
.plot .xax { position: relative; grid-row: 2; grid-column: 2; height: 1.6rem; font-size: 11px; color: var(--muted); }
.plot .xax span { position: absolute; top: .45rem; transform: translateX(-50%); white-space: nowrap; line-height: 1; }
.plot .xax span:first-child { transform: none; left: 0 !important; }
svg.chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
svg .hit { fill: transparent; }
svg .ln { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
svg .ln.s-vis { stroke: var(--s-vis); }
svg .ln.s-pv { stroke: var(--s-pv); }
svg .ln.dash { stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .75; }
svg stop.s-vis { stop-color: var(--s-vis); }
svg stop.s-pv { stop-color: var(--s-pv); }
svg .ar { pointer-events: none; }
svg .guide { stroke: var(--border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0; }
svg .dot { stroke-width: 9; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0; }
svg .dot.s-vis { stroke: var(--s-vis); }
svg .dot.s-pv { stroke: var(--s-pv); }
svg .col:hover .guide, svg .col:hover .dot, svg .col.on .guide, svg .col.on .dot { opacity: 1; }
svg .bar { fill: var(--s-vis); }
svg .bar.s-pv { fill: var(--s-pv); fill-opacity: .55; }
svg .mark:hover .bar { fill-opacity: .78; }
svg .note-line { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; opacity: .6; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 0; padding: 0; font-size: .8rem; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: .4rem; }
.sw { display: inline-block; width: 12px; height: 12px; flex: none; border-radius: 3px; }
.sw-vis, .sw-bar { background: var(--s-vis); }
.sw-pv { background: var(--s-pv); }
.sw-prev { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed var(--muted); }
/* Annotations: hairline in the plot + a focusable pin above it */
.pins { position: absolute; left: 0; right: 0; top: -14px; height: 12px; z-index: 2; }
.pin { position: absolute; top: 0; width: 10px; height: 10px; margin-left: -5px; background: var(--text-2); transform: rotate(45deg); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface); cursor: help; }
.pin::before { content: ""; position: absolute; inset: -6px; }
.chart-card .chart-wrap { padding-top: 10px; }
.notes { list-style: none; margin: .9rem 0 0; padding: .7rem 0 0; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-2); display: grid; gap: .3rem; }
.notes time { color: var(--text); font-variant-numeric: tabular-nums; margin-right: .3rem; font-weight: 550; }
.pin-key { display: inline-block; width: 8px; height: 8px; background: var(--text-2); transform: rotate(45deg); margin: 0 .5rem 0 .1rem; border-radius: 1px; }

/* Tooltip */
#tip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: .45rem .65rem; border-radius: 8px; font-size: .8rem; max-width: min(80vw, 22rem); box-shadow: var(--shadow-lg); line-height: 1.4; }
#tip .tt-t { font-weight: 650; margin-bottom: .25rem; }
#tip .tt-r { display: flex; align-items: center; gap: .45rem; white-space: nowrap; }
#tip .tt-r b { margin-left: auto; padding-left: 1rem; font-variant-numeric: tabular-nums; font-weight: 650; }
#tip .tt-r .sw { width: 9px; height: 9px; border-radius: 50%; }
#tip .tt-r .sw.s-vis { background: var(--s-vis); }
#tip .tt-r .sw.s-pv { background: var(--s-pv); }
#tip .tt-r .sw.s-prev { background: none; border: 1.5px dashed var(--muted); }

/* Panel grid and bar-in-row tables */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.grid .card { margin: 0; }
.grid .wide { grid-column: 1 / -1; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
table.bars { width: 100%; border-collapse: separate; border-spacing: 0 2px; table-layout: fixed; font-size: .875rem; }
table.bars th, table.bars td { padding: 0; text-align: left; font-weight: 400; }
table.bars thead th { color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 0 0 .4rem; }
table.bars thead th:first-child { padding-left: .55rem; }
table.bars .num { text-align: right; width: 5.2rem; font-variant-numeric: tabular-nums; padding-left: .5rem; color: var(--text-2); }
table.bars tbody .num { font-weight: 550; }
table.bars tbody td.num:last-child { color: var(--text); }
table.funnel .num { width: 6.5rem; }
table.bars tbody th { position: relative; overflow: hidden; border-radius: 6px; }
table.bars td { position: relative; height: 2rem; }
table.bars tbody tr:hover th { background: var(--surface-2); }
table.bars tbody th a, table.bars tbody th > .k { position: relative; display: block; color: var(--text); }
table.bars tbody th a:hover { text-decoration: none; }
table.bars tbody th a:hover .k { text-decoration: underline; text-underline-offset: 2px; }
table.bars .k { position: relative; display: block; padding: .38rem .55rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
table.bars .k .code { color: var(--muted); font-size: .75rem; margin-left: .2rem; }
.meter { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--meter); border-radius: 6px; box-shadow: inset 2px 0 0 var(--meter-edge); }
table.bars .rating-col { width: 7.5rem; }

/* Overview panel order: content, sources, map, tech, conversions. */
.grid > .p-path { order: 1; } .grid > .p-entry { order: 2; } .grid > .p-referrer { order: 3; }
.grid > .p- { order: 4; } .grid > .p-utm_source { order: 5; } .grid > .p-event { order: 6; }
.grid > .p-country { order: 7; } .grid > .p-device { order: 8; } .grid > .p-browser { order: 9; } .grid > .p-os { order: 10; }
.grid > .p-goals { order: 11; } .grid > .p-weekly { order: 12; } .grid > .p-vitals { order: 13; }

/* World map */
.map-split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.map-wrap { position: relative; }
svg.world { width: 100%; height: auto; display: block; }
svg.world .land { fill: var(--map-empty); stroke: var(--map-line); stroke-width: .6; stroke-linejoin: round; }
svg.world .land.on { fill: color-mix(in srgb, var(--s-vis) calc(var(--a) * 100%), var(--map-empty)); }
svg.world a:hover .land, svg.world .land.on:hover { stroke: var(--text); stroke-width: 1; }
.map-key { display: flex; margin-bottom: .75rem; align-items: center; gap: .5rem; font-size: .72rem; color: var(--muted); margin-top: .5rem; }
.map-key i { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--s-vis) 18%, var(--map-empty)), var(--s-vis)); }

/* Heatmaps (click grid) */
.heat-wrap { max-height: 70vh; overflow-y: auto; border-radius: 8px; border: 1px solid var(--border); }
svg.heat { width: 100%; height: auto; display: block; }
svg.heat .page { fill: var(--surface-2); }
svg.heat .cell { fill: var(--s-vis); }
svg.heat .cell:hover { stroke: var(--text); stroke-width: 1; }

/* Web vitals */
.vitals { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin: 0; }
.vitals div { border: 1px solid var(--border); border-radius: 10px; padding: .7rem .85rem; background: var(--surface); }
.vitals dt { color: var(--muted); font-size: .72rem; font-weight: 650; letter-spacing: .05em; }
.vitals dd { margin: .2rem 0 0; font-size: 1.2rem; font-weight: 650; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; }

/* Home: site cards */
.page-head { display: flex; align-items: flex-end; gap: .5rem 1rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.page-head h1 { margin: 0; font-size: 1.5rem; }
.page-head p { margin: 0; color: var(--muted); }
.site-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.site-card { display: flex; flex-direction: column; gap: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.site-card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow); }
.site-card header { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.site-card header > div { min-width: 0; }
.site-card .site-icon { width: 32px; height: 32px; border-radius: 9px; font-size: .9rem; }
.site-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card .sub { display: block; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card .nums { display: flex; gap: 1.5rem; }
.site-card .nums span { display: flex; flex-direction: column; font-size: .75rem; color: var(--muted); font-weight: 550; }
.site-card .nums b { font-size: 1.3rem; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
svg.spark { width: 100%; height: 44px; display: block; overflow: visible; }
svg.spark .ln { stroke: var(--s-vis); stroke-width: 1.75; }
svg.spark .ar { fill: var(--s-vis); fill-opacity: .1; }
.totals { margin-bottom: 1.25rem; }
.hero { text-align: center; padding: 2.25rem 1.5rem; }
.hero .logo { width: 48px; height: 48px; margin-bottom: .75rem; }
.hero h1 { font-size: 1.7rem; letter-spacing: -.02em; }
.hero p { color: var(--text-2); max-width: 30rem; margin: .5rem auto 1rem; }

/* Lists: sites (legacy), replays, sessions */
.sites, .replays, .sessions { list-style: none; margin: 0; padding: 0; }
.sites li a, .replays li a { display: flex; flex-direction: column; padding: .7rem .6rem; border-bottom: 1px solid var(--border); color: var(--text); border-radius: 6px; }
.replays li:last-child a, .sessions li:last-child a { border-bottom: 0; }
.sites span, .replays span { color: var(--muted); font-size: .82rem; }
.replays li a:hover, .sessions li a:hover { background: var(--surface-2); text-decoration: none; }
.sessions li a { display: grid; grid-template-columns: 34px minmax(0, 1fr) 10rem 10rem 8.5rem; gap: .9rem; align-items: center; padding: .6rem .6rem; border-bottom: 1px solid var(--border); color: var(--text); border-radius: 6px; font-size: .875rem; }
.sessions .avatar { width: 34px; height: 34px; font-size: .72rem; }
.sessions .s-main { min-width: 0; }
.sessions .s-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sessions .s-main > span { display: block; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sessions .s-dev { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sessions .s-num { color: var(--text-2); font-variant-numeric: tabular-nums; line-height: 1.35; }
.sessions time { color: var(--muted); font-size: .8rem; text-align: right; white-space: nowrap; }
.session-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1rem; align-items: start; }
.session-grid .card { margin-bottom: 1rem; }
.session-grid .props { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.pager { display: flex; gap: 1rem; padding-top: .9rem; }
.pager a { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .3rem .75rem; color: var(--text-2); font-size: .85rem; }
.pager a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }

/* Session detail */
.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem 1.25rem; margin: 0; }
.props div { min-width: 0; }
.props dt { color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.props dd { margin: .1rem 0 0; overflow-wrap: anywhere; font-weight: 500; }
.session-head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-bottom: 1rem; }
.session-head .avatar { width: 44px; height: 44px; font-size: 1.05rem; }
.session-head h1 { margin: 0; }
.session-head .button { margin-left: auto; }
.kpis { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: 0 0 1.1rem; padding: .8rem 0; border-block: 1px solid var(--border); }
.kpis div { display: flex; flex-direction: column; }
.kpis dt { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpis dd { margin: 0; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 .4rem; position: relative; }
.timeline li { display: grid; grid-template-columns: 4.6rem 4.6rem 1fr; gap: .6rem; padding: .5rem 0 .5rem .9rem; align-items: baseline; position: relative; border-left: 2px solid var(--border); }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .85rem; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.timeline li.t-event::before { border-color: var(--accent); background: var(--accent); }
.timeline li.t-pageview::before { border-color: var(--s-pv); }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; }
.timeline .kind { justify-self: start; min-width: 3.6rem; font-size: .7rem; font-weight: 650; border-radius: 999px; padding: .08rem .5rem; background: var(--surface-2); color: var(--text-2); text-align: center; }
.timeline .t-event .kind { background: var(--accent-soft); color: var(--accent-ink); }
.timeline .what { min-width: 0; overflow-wrap: anywhere; }
.timeline .data { display: block; color: var(--text-2); font-size: 11.5px; margin-top: .25rem; width: fit-content; max-width: 100%; }

/* Data tables (wide reports) */
.grid-scroll { overflow-x: auto; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th, table.data td { text-align: left; padding: .5rem .75rem .5rem 0; border-bottom: 1px solid var(--border); white-space: nowrap; font-weight: 400; }
table.data thead th { color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border-bottom-color: var(--border-strong); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data.custom th.key { position: relative; min-width: 8rem; }
table.data.custom th.key .k { position: relative; padding-left: .4rem; }
table.data.custom th.key .meter { inset: 4px auto 4px 0; }

/* Funnels */
.funnel-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.funnel-steps li { display: grid; grid-template-columns: 28px 1fr; gap: .8rem; align-items: start; padding: .55rem 0; position: relative; }
.funnel-steps li + li::before { content: ""; position: absolute; left: 13px; top: -.6rem; height: 1rem; border-left: 2px dotted var(--border-strong); }
.funnel-steps .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft-2); color: var(--accent-ink); font-weight: 700; font-size: .8rem; }
.funnel-steps .fs { min-width: 0; }
.fs-top { display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; }
.fs-top strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-top span { color: var(--text-2); font-size: .85rem; white-space: nowrap; }
.fs-top b { color: var(--text); font-variant-numeric: tabular-nums; }
.fs-track { height: 10px; border-radius: 999px; background: var(--surface-2); margin: .4rem 0 .3rem; overflow: hidden; }
.fs-bar { height: 100%; width: var(--w); border-radius: 999px; background: var(--s-vis); }
.fs-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.fs-meta .drop { color: var(--bad); }

/* Journeys */
table.bars ol.path { list-style: none; margin: 0; padding: .38rem .55rem; display: flex; flex-wrap: wrap; gap: .15rem .4rem; position: relative; color: var(--text); overflow-wrap: anywhere; }
ol.path li + li::before { content: "→ "; color: var(--muted); }
table.journeys tbody th { overflow: visible; }

/* Sequential single-hue cells (retention, weekly grid) */
table.retention { border-collapse: separate; border-spacing: 3px; font-size: .8rem; font-variant-numeric: tabular-nums; }
table.retention th { font-weight: 500; color: var(--text-2); text-align: left; white-space: nowrap; padding: .25rem .5rem .25rem 0; }
table.retention thead th { color: var(--muted); font-size: .72rem; }
table.retention td { padding: .35rem .5rem; text-align: right; border-radius: 4px; min-width: 3.2rem; }
table.retention td.cell { background: color-mix(in srgb, var(--s-vis) calc(var(--a) * 60%), var(--surface-2)); color: var(--text); }
table.retention td.na { background: transparent; }
table.retention .num { text-align: right; }
table.heatgrid { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 340px; table-layout: fixed; }
table.heatgrid th { font-weight: 400; color: var(--muted); font-size: .7rem; text-align: left; padding: 0; }
table.heatgrid thead th:first-child, table.heatgrid tbody th { width: 2.3rem; }
table.heatgrid td { height: 18px; border-radius: 3px; background: color-mix(in srgb, var(--s-vis) calc(var(--a) * 100%), var(--surface-2)); }
table.heatgrid td:hover { outline: 1.5px solid var(--text); }

/* Forms on report pages */
form.inline .row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; align-items: flex-end; }
form.inline .row input, form.inline .row select { flex: 1 1 12rem; }
form.inline .row label.field input, form.inline .row label.field select { flex: none; width: 100%; }
form.compact { display: flex; gap: .4rem; align-items: center; margin: 0; }
label.field { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 9rem; min-width: 0; }
fieldset.checks { border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 0 0 .6rem; padding: .5rem .75rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; min-width: 0; }
fieldset.checks legend { color: var(--text-2); font-size: .8rem; font-weight: 600; padding: 0 .3rem; }
label.check { display: inline-flex; align-items: center; gap: .35rem; color: var(--text); font-size: .875rem; font-weight: 400; }
label.check input { width: auto; accent-color: var(--accent); }

/* Realtime */
.rt-top { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 1rem; margin-bottom: 1rem; }
.rt-top .card { margin: 0; }
.rt-now { display: flex; flex-direction: column; justify-content: center; gap: .2rem; }
.rt-now .value { font-size: 3rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.rt-now .label { display: inline-flex; align-items: center; gap: .45rem; color: var(--text-2); font-weight: 600; font-size: .85rem; }
.rt-now .sub { color: var(--muted); font-size: .8rem; }
.rt-now dl { display: flex; gap: 1.25rem; margin: .8rem 0 0; }
.rt-now dl div { display: flex; flex-direction: column; }
.rt-now dt { font-size: .72rem; color: var(--muted); font-weight: 600; }
.rt-now dd { margin: 0; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.rt-status { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 26px 1fr auto; gap: .65rem; align-items: center; padding: .5rem .25rem; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed .fi { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--s-pv) 16%, transparent); color: var(--s-pv); }
.feed .ev .fi { background: var(--accent-soft-2); color: var(--accent-ink); }
.feed .fi svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feed .fw { min-width: 0; }
.feed .fw strong { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .fw span { display: block; color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed time { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.rt-grid > .card { margin: 0; }
.rt-side { display: grid; gap: 1rem; }
.rt-side .card { margin: 0; }

/* Replay player */
#player { width: 100%; overflow-x: auto; }
#player .rr-player { max-width: 100%; }

/* Footer */
.foot { max-width: var(--page); width: 100%; margin: 0 auto; padding: 1rem 1.5rem 1.5rem; display: flex; gap: .75rem; flex-wrap: wrap; font-size: .78rem; color: var(--text-2); }
.foot span:first-child { font-weight: 650; }

@media (max-width: 860px) {
  .map-split, .rt-grid, .session-grid { grid-template-columns: 1fr; }
  .rt-top { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  main { padding: .85rem .75rem 1.5rem; }
  .top-in { padding: .5rem .75rem; gap: .45rem; min-height: 50px; }
  .brand > span { display: none; }
  .sitehead-in { padding: .8rem .75rem .1rem; }
  .site-name { font-size: 1.1rem; }
  .site-icon { width: 32px; height: 32px; }
  .tabs { padding: .2rem .5rem 0; gap: 0; flex-wrap: wrap; overflow-x: visible; }
  .tabs a { padding: .5rem .55rem .55rem; font-size: .85rem; }
  .subnav-in { padding: .5rem .75rem; }
  .card { padding: .9rem .85rem; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats.totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { padding: .75rem .85rem; }
  .stat .value { font-size: 1.4rem; }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .who { display: none; }
  .plot { height: 200px; }
  .plot.bars { height: 180px; }
  .controls .zone { display: none; }
  .range-menu .pop { width: min(19rem, calc(100vw - 1.5rem)); }
  .timeline li { grid-template-columns: 4.2rem 1fr; }
  .plot .xax span:nth-child(even) { display: none; }
  .sessions li a { grid-template-columns: 34px minmax(0, 1fr) auto; gap: .65rem; }
  .sessions .s-dev, .sessions .s-num { display: none; }
  .session-head .button { margin-left: 0; }
  .timeline .what { grid-column: 1 / -1; }
  table.bars .num { width: 3.8rem; }
  table.funnel .num { width: 4.6rem; }
  .rt-now .value { font-size: 2.4rem; }
  .foot { padding: .75rem; }
}
.card > p.empty, .card > .grid-scroll + p.empty { text-align: center; padding: 1.5rem .5rem; margin: 0; }
table.bars .num.money { width: 8.5rem; }

/* Admin forms: one field per row. */
form.stack { display: flex; flex-direction: column; gap: .75rem; max-width: 46rem; margin: 0; }
form.stack label.field { flex: none; }
form.stack label.field input, form.stack label.field select, form.stack label.field textarea { width: 100%; box-sizing: border-box; }
form.stack textarea { font-family: var(--mono, ui-monospace, monospace); font-size: .85rem; }
form.stack p, form.stack h2 { margin: 0; }
form.stack button { align-self: flex-start; }

/* Phones: a wide data table scrolls inside its card instead of widening the page
   (which made mobile browsers zoom the whole page out); compact forms wrap. */
@media (max-width: 640px) {
  table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data td, table.data tbody th { white-space: normal; overflow-wrap: break-word; min-width: 5.5rem; }
  table.data td code, table.data tbody th code { word-break: break-all; }
  form.compact { flex-wrap: wrap; align-items: flex-end; }
  form.compact label.field { flex: 1 1 100%; }
  form.compact label.field input, form.compact label.field select { width: 100%; box-sizing: border-box; }
}

/* Roles and groups (admin) */
table.matrix td.mark { text-align: center; font-weight: 600; color: var(--good); }
table.matrix tr.group th { background: var(--surface-2); color: var(--text-2); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
table.matrix tbody th { font-weight: 500; min-width: 12rem; }
dl.roles { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 1rem 0 0; font-size: .875rem; }
dl.roles dt { font-weight: 600; }
dl.roles dd { margin: 0; color: var(--text-2); }
fieldset.caps { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .75rem; display: grid; gap: .5rem; min-width: 0; }
fieldset.caps legend { color: var(--text-2); font-size: .8rem; font-weight: 600; padding: 0 .3rem; }
fieldset.caps label.check { align-items: flex-start; }
fieldset.caps label.check input { margin-top: .2rem; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 640px) {
  dl.roles { grid-template-columns: 1fr; }
  dl.roles dd { margin-bottom: .4rem; }
}
