/* Jastreb dashboard.
 *
 * The page is dressed like the bird. A dark band across the top in the
 * brown of a goshawk's back, faintly barred like its chest, holds the
 * navigation and the title; the content sits on cream below it, its first
 * card overlapping the band's edge. The steel blue of the hawk's back is
 * the one second hue in the charts (the comparison line). The two chart
 * colours were checked for colour-blind separation and for contrast against
 * both the light and the dark surface.
 *
 * Headings and big numbers are set in Fraunces (SIL Open Font Licence,
 * see fraunces-OFL.txt), everything else in the system's own sans-serif.
 * The font files are referred to by bare name; the server rewrites those
 * references to versioned addresses.
 */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/static/fraunces-latin-ext.woff2?v=a2930b27d13a) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/static/fraunces-latin.woff2?v=7234ed860a9c) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --display: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --page: #f6f0e6;
  --surface: #fffdf9;
  --surface-2: #f8f0e4;
  --ink: #2a1c12;
  --ink-2: #66533f;
  --ink-3: #7d6a56;
  --line: #ece0cf;
  --axis: #d5c3ab;
  --brand: #7a4420;
  --brand-hover: #683917;
  --on-brand: #fff8ee;
  --series-1: #a4572b;
  --series-2: #2f79b8;
  --series-1-soft: color-mix(in srgb, var(--series-1) 28%, var(--surface));
  /* Categorical colours, for the events chart: the dataviz reference
     palette in its validated order. On this cream surface every adjacent
     pair clears the colour-blind separation target (worst 9.1); three
     sit under 3:1 contrast, so the chart has a table view. Others is a
     warm grey at 3.2:1. */
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100;
  --cat-5: #e87ba4; --cat-6: #008300; --cat-7: #6250d6; --cat-8: #e34948;
  --cat-other: #9c8d7d;
  --amber: #d99a2b;
  --live: #2ea043;
  --good: #006300;
  --bad: #c23030;
  --bot-tag: #c23030; /* behind white text, in both themes: 5.4:1 */
  --focus: #2f79b8;
  --focus-surface: #2f79b8;
  --shadow: 0 1px 2px rgb(74 46 22 / 6%), 0 10px 28px -8px rgb(74 46 22 / 14%);
  --shadow-lift: 0 2px 4px rgb(74 46 22 / 8%), 0 22px 44px -14px rgb(74 46 22 / 32%);
  --radius: 16px;

  /* The band */
  --band: #2b1d13;
  --band-raised: rgb(255 240 220 / 8%);
  --band-raised-2: rgb(255 240 220 / 15%);
  /* Buttons and menus on the band: darker than the band, so they stand out
     from the feathers behind them, and lighter when pointed at. */
  --band-control: rgb(20 12 6 / 62%);
  --band-control-hover: rgb(64 45 31 / 82%);
  --band-line: rgb(255 236 210 / 16%);
  --band-ink: #f8eddc;
  --band-ink-2: #cbb497;
  --band-live: #57cf68;
  --band-focus: #f2b65a;
  --glow: rgb(226 156 52 / 26%);
  --plumage: .7;
  /* Behind referrers' icons: none on cream, which suits them as they are
     drawn; a light tile on the dark page, where a black one would vanish. */
  --icon-backing: transparent;
  color-scheme: light;
}

/* The dark colours are in dark.css, which the page loads when the system
   is dark, always, or never, as the viewer chose in the theme menu. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--axis) var(--page); }
::selection { background: color-mix(in srgb, var(--amber) 38%, transparent); }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
}

h1, h2, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
button, input { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 30; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 8px; }

[hidden] { display: none !important; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

#content { display: flex; flex-direction: column; min-height: 100vh; }

/* ----- the band ----------------------------------------------------------- */

.band, .login-page, .foot {
  position: relative;
  background: var(--band);
  color: var(--band-ink);
  --focus: var(--band-focus);
  --live: var(--band-live);
}
.band { padding-bottom: 92px; } /* the first card covers the last 64px */
/* The band must not be a stacking context of its own: its decoration sits
   at z-index 0 and its content at 1 in the page's, so the cards that overlap
   the band cover its background, and menus dropping out of it cover them. */
.band > *, .login-page > *, .foot > * { position: relative; z-index: 1; }
/* The header row's own menu (the theme) drops over the page's title. */
.band > .top { z-index: 2; }

/* Plumage, as on a hawk's back: rows of feathers with pale fringes, each
   row laid over the one below (feathers.svg, one seamless tile), strongest
   in the top right corner and fading into plain brown. */
.band::before, .login-page::before, .foot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url(/static/feathers.svg?v=219442abd6a8) right top;
  opacity: var(--plumage);
  -webkit-mask-image: radial-gradient(130% 170% at 100% 0%, #000 12%, transparent 72%);
  mask-image: radial-gradient(130% 170% at 100% 0%, #000 12%, transparent 72%);
}
/* And the warm light of the hawk's eye. */
.band::after, .login-page::after, .foot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(720px 380px at 90% -14%, var(--glow), transparent 70%);
  pointer-events: none;
}

.top {
  display: flex; align-items: center; gap: 10px 22px;
  max-width: 1240px; margin: 0 auto; padding: 14px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--band-ink); }
.brand:hover { color: var(--band-ink); }
.brand-name { font-family: var(--display); font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.hawk { display: block; width: 36px; height: 36px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px rgb(255 236 210 / 16%); }

.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 6px 13px; border-radius: 999px; white-space: nowrap;
  color: var(--band-ink-2); font-size: 14px; font-weight: 500;
}
.tabs a:hover { color: var(--band-ink); background: var(--band-raised); }
.tabs a[aria-current] { color: var(--band-ink); background: var(--band-raised-2); box-shadow: inset 0 0 0 1px var(--band-line); }
.tabs a[aria-current]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
/* A site's own icon marks its tab; on the dark band, on a light tile. */
.tabs a[aria-current]:has(.row-icon)::before { content: none; }
.tabs .row-icon.favicon { padding: 1px; border-radius: 4px; background: #f8eddc; }
.tabs .row-icon.letter { border-radius: 4px; background: var(--band-raised-2); box-shadow: inset 0 0 0 1px var(--band-line); color: var(--band-ink); }
.tabs a:not([aria-current]) .row-icon { opacity: .8; }
.tabs a:hover .row-icon { opacity: 1; }
.tabs a:focus-visible { outline-offset: -2px; }

.top-right { display: flex; align-items: center; gap: 14px; flex: none; margin-left: auto; }

.langs { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--band-control); box-shadow: inset 0 0 0 1px var(--band-line); }
.langs a { padding: 3px 9px; border-radius: 999px; color: var(--band-ink-2); font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.langs a:hover { color: var(--band-ink); }
.langs a[aria-current] { background: var(--band-ink); color: var(--band); }

.who { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; color: var(--band-ink); }
.who:hover, .who[aria-current] { background: var(--band-raised); color: var(--band-ink); }
.top-link { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; color: var(--band-ink-2); font-size: 14px; }
.top-link:hover, .top-link[aria-current] { background: var(--band-raised); color: var(--band-ink); }
.gear { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: linear-gradient(140deg, #f0c06a, #b5662a); color: #2b1d13;
  font-family: var(--display); font-size: 14px; font-weight: 700; line-height: 1;
}
.who-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--band-ink); font-size: 14px; }

/* ----- page head, on the band ----------------------------------------------- */

.head { width: 100%; max-width: 1240px; margin: 0 auto; padding: 26px 24px 0; transition: opacity .15s; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.title { min-width: 0; }
.page-head h1 {
  font-family: var(--display); font-weight: 600; font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.04; letter-spacing: -.022em; color: var(--band-ink); overflow-wrap: anywhere;
}
.eyebrow { margin-bottom: 6px; color: var(--band-ink-2); font-size: 13.5px; }
.subtitle { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin-top: 12px; color: var(--band-ink-2); font-size: 14px; }
.subtitle .domain { color: var(--band-ink-2); }
.subtitle .domain:hover { color: var(--band-ink); }
.ext { margin-left: 3px; font-size: 12px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; }

.live { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
a.live { color: var(--band-ink-2); }
a.live:hover { color: var(--band-ink); }
.live-dot { position: relative; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--live); }
.live-dot:not(.idle)::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--live); animation: ping 2.4s cubic-bezier(0, 0, .2, 1) infinite; }
.live-dot.idle { background: var(--band-line); }
@keyframes ping { 70%, 100% { transform: scale(2.8); opacity: 0; } }

/* Active filters */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.chips-label { color: var(--band-ink-2); font-size: 13px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 5px 4px 12px; border-radius: 999px;
  background: rgb(233 166 72 / 16%); box-shadow: inset 0 0 0 1px rgb(233 166 72 / 50%);
  color: var(--band-ink); font-size: 13px;
}
.chip:hover { background: rgb(233 166 72 / 28%); color: var(--band-ink); }
.chip-name { color: var(--band-ink-2); }
.chip .animal { width: 18px; height: 18px; margin-right: -2px; box-shadow: 0 0 0 1px var(--band-line); }
.chip-x { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--band-raised-2); font-size: 14px; line-height: 1; }
.chips-clear { color: var(--band-ink-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.chips-clear:hover { color: var(--band-ink); }

/* ----- buttons and menus ---------------------------------------------------- */

button, .button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 14px; cursor: pointer; white-space: nowrap;
}
button:hover, .button:hover { background: var(--surface-2); color: var(--ink); }
button.primary, .button.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; justify-content: center; }
button.primary:hover, .button.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }

.menu { position: relative; }
/* The period's neighbours, either side of its menu. */
.period-nav { display: inline-flex; align-items: stretch; gap: 4px; }
.step-period {
  display: inline-grid; place-items: center; width: 34px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
}
a.step-period:hover { background: var(--surface-2); color: var(--ink); }
span.step-period { opacity: .35; }
.chev { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.band .step-period { border-color: var(--band-line); background: var(--band-control); color: var(--band-ink); }
.band a.step-period:hover { background: var(--band-control-hover); color: var(--band-ink); }
/* Days, weeks, months: the chart's steps. */
.intervals { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--surface-2); }
.intervals a { padding: 2px 10px; border-radius: 7px; color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.intervals a:hover { color: var(--ink); }
.intervals a[aria-current] { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
.menu > summary {
  display: inline-flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; user-select: none;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; white-space: nowrap;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ""; width: 7px; height: 7px; margin: -3px 2px 0 2px; border: solid var(--ink-3); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.menu > summary:hover, .menu[open] > summary { background: var(--surface-2); }
.menu-kicker { color: var(--ink-3); font-size: 13px; }

.band .menu > summary, .band .button { border-color: var(--band-line); background: var(--band-control); color: var(--band-ink); }
.band .menu > summary:hover, .band .menu[open] > summary, .band .button:hover { background: var(--band-control-hover); color: var(--band-ink); }
/* The feathers behind a control, softened. */
.langs, .band .step-period, .band .menu > summary, .band .button, .sign-out button { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
/* The theme menu opens from a plain icon, like the settings link beside it. */
.band .theme-menu > summary {
  padding: 6px; border: 0; border-radius: 999px; background: none; color: var(--band-ink-2);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.band .theme-menu > summary:hover, .band .theme-menu[open] > summary { background: var(--band-raised); color: var(--band-ink); }
.band .theme-menu > summary::after { display: none; }
.theme-menu .menu-body { min-width: 220px; }
.theme-choice { display: inline-flex; align-items: center; gap: 10px; }
.theme-choice .gear { color: var(--ink-3); }
.band .menu > summary::after { border-color: var(--band-ink-2); }
.band .menu-kicker { color: var(--band-ink-2); }

.menu-body {
  position: absolute; z-index: 20; right: 0; top: calc(100% + 8px); min-width: 240px; padding: 6px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift);
  --focus: var(--focus-surface);
}
.menu-body li a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 10px; border-radius: 7px; color: var(--ink); font-size: 14px; }
.menu-body li a:hover { background: var(--surface-2); }
.menu-body li a[aria-current] { font-weight: 650; }
.menu-body li a[aria-current]::after { content: "✓"; font-weight: 700; color: var(--brand); }

.menu-heading { margin: 0; padding: 6px 10px 4px; color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.menu-note { max-width: 250px; margin: 6px 0 0; padding: 9px 10px 4px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; line-height: 1.45; white-space: normal; }

/* The likely-bots menu opens from a small robot at the end of a site's
   tabs, quiet while bots are counted, amber while the choice changes what
   is shown: crossed out when they are hidden, lit when only they are. */
.subnav-row { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.subnav-row .subnav { flex: 1; min-width: 0; margin-top: 0; }
.band .bots-menu > summary {
  padding: 7px; border: 0; border-radius: 999px; background: none; color: var(--band-ink-2);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.band .bots-menu > summary:hover, .band .bots-menu[open] > summary { background: var(--band-raised); color: var(--band-ink); }
.band .bots-menu > summary::after { display: none; }
.band .bots-menu.is-hide > summary, .band .bots-menu.is-only > summary { background: var(--band-raised); color: var(--amber); }
.bots-menu .menu-body { min-width: 270px; }
.robot { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.robot .solid { fill: currentColor; stroke: none; }
.robot .slash { stroke-width: 1.9; }

/* A likely bot, beside the robot that stands in for its animal: in words
   too, so colour is not all that says it. */
.bot-tag { display: inline-block; padding: 0 7px; border-radius: 999px; background: var(--bot-tag); color: #fff; font-size: 11px; font-weight: 650; line-height: 17px; vertical-align: 1px; white-space: nowrap; }

.custom-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; padding: 10px 6px 4px; border-top: 1px solid var(--line); }
.custom-title { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }
.custom-range label { display: grid; gap: 3px; font-size: 12px; color: var(--ink-2); }
.custom-range input { width: 100%; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.custom-range button { grid-column: 1 / -1; justify-content: center; }

/* ----- page frame ------------------------------------------------------------ */

/* A stacking context of its own, at the band's decoration level: whatever
   is raised inside it (the "?" buttons over their tiles' links) stays
   under the menus that drop out of the band. */
main { position: relative; z-index: 0; flex: 1; width: 100%; max-width: 1240px; margin: -64px auto 0; padding: 0 24px 40px; transition: opacity .15s; }
/* While new numbers load, keep the old ones in place, dimmed. */
#content.htmx-request .head, #content.htmx-request main { opacity: .55; transition: opacity .2s .15s; }
/* And a streak of amber light runs along the top of the window. */
#content::before {
  content: ""; position: fixed; z-index: 60; top: 0; left: 0; width: 40%; height: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, transparent, var(--amber) 45%, #f7d08a);
  transform: translateX(-100%); pointer-events: none;
}
#content.htmx-request::before { animation: loading 1.3s .15s cubic-bezier(.45, 0, .25, 1) infinite; }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* The tail end: a short band like the one on top, its feathers rising from
   the bottom left corner instead, so the two frame the page between them. */
.foot { margin-top: 24px; box-shadow: inset 0 1px 0 var(--band-line); color: var(--band-ink-2); font-size: 13px; }
.foot::before {
  background-position: left bottom;
  -webkit-mask-image: radial-gradient(70% 260% at 0% 100%, #000 10%, transparent 70%);
  mask-image: radial-gradient(70% 260% at 0% 100%, #000 10%, transparent 70%);
}
.foot::after { background: radial-gradient(560px 240px at 6% 135%, var(--glow), transparent 70%); }
.foot-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px;
  max-width: 1240px; margin: 0 auto; padding: 26px 24px 30px;
}
.foot-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.foot-hawk { display: block; width: 40px; height: 40px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px rgb(255 236 210 / 16%); }
.foot-text { display: grid; gap: 1px; min-width: 0; }
.foot-name { font-family: var(--display); font-size: 18px; font-weight: 650; line-height: 1.2; letter-spacing: -.01em; color: var(--band-ink); }
.foot-line { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.foot-line > * + *::before { content: "·"; margin-right: 8px; }
.foot a { color: var(--band-ink-2); }
.foot a:hover { color: var(--band-ink); text-decoration: underline; text-underline-offset: 3px; }
.sign-out { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-left: auto; }
.sign-out button { padding: 6px 14px; border-color: var(--band-line); background: var(--band-control); color: var(--band-ink); font-size: 13px; }
.sign-out button:hover { background: var(--band-control-hover); color: var(--band-ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 20px 8px; }
.card-head h2 { font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.005em; }
.card-sub { margin-left: 8px; color: var(--ink-3); font-family: var(--sans); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.col-label { color: var(--ink-3); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.empty { padding: 6px 20px 20px; color: var(--ink-3); font-size: 14px; }
.empty-state { display: grid; justify-items: center; gap: 16px; padding: 36px 24px; color: var(--ink-2); text-align: center; }
.muted { color: var(--ink-3); }

.delta {
  display: inline-flex; align-items: center; gap: 4px; justify-self: start;
  padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, currentColor 11%, transparent);
  font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.delta.good { color: var(--good); }
.delta.bad { color: var(--bad); }
.delta.flat { color: var(--ink-3); }
.delta-icon { font-size: 8px; }

/* ----- one site: headline numbers and chart ---------------------------------- */

.hero { margin-bottom: 20px; }

/* One-pixel gaps over a line-coloured background draw the dividers, in any
   number of columns. */
.tiles {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; overflow: hidden;
}
.tile { position: relative; display: grid; align-content: start; gap: 8px; min-width: 0; padding: 18px 22px 20px; background: var(--surface); color: var(--ink); }
.tile.linked:hover { background: var(--surface-2); }
.tile.current { background: linear-gradient(to bottom, color-mix(in srgb, var(--series-1) 10%, var(--surface)), var(--surface) 85%); }
.tile.current::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--series-1); }
.tile-label { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.tile-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A tile's link covers the whole tile, and so does its focus ring. */
.tile-link, .tile-link:hover { color: inherit; }
.tile-link::after { content: ""; position: absolute; inset: 0; }
.tile-link:focus-visible { outline: none; }
.tile-link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -3px; }
.tile-value { font-family: var(--display); font-size: 38px; font-weight: 600; line-height: 1; letter-spacing: -.02em; white-space: nowrap; }

.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 18px 22px 0; }
.chart-head h2 { font-family: var(--display); font-size: 19px; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink-2); font-size: 13px; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.key { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid; border-radius: 2px; }
.key.cur { border-color: var(--series-1); }
.key.prev { border-color: var(--series-2); border-top-style: dashed; }

.chart { display: grid; grid-template-columns: max-content minmax(0, 1fr); grid-template-rows: 280px 24px; column-gap: 12px; padding: 18px 24px 12px 18px; }
.y-axis { position: relative; min-width: 28px; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.y-axis span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; line-height: 1; }
/* Invisible copy of the widest label gives the column its width. */
.y-axis::after { content: attr(data-widest); visibility: hidden; }
.plot { position: relative; cursor: crosshair; border-radius: 2px; touch-action: pan-y; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grid { position: absolute; left: 0; right: 0; height: 1px; margin-bottom: -.5px; background: var(--line); }
.grid:first-of-type { background: var(--axis); }
.line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.line.cur { stroke: var(--series-1); }
.line.prev { stroke: var(--series-2); stroke-width: 2; stroke-dasharray: 5 5; }
/* The bucket still running (today, this hour) is not finished yet. */
.line.tail { stroke-dasharray: 2 6; }
.area { fill: url(#fade); }
.fade-from { stop-color: var(--series-1); stop-opacity: .3; }
.fade-to { stop-color: var(--series-1); stop-opacity: 0; }
.x-axis { grid-column: 2; position: relative; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.x-axis span { position: absolute; top: 8px; transform: translateX(-50%); white-space: nowrap; line-height: 1; }
.x-axis span.first { transform: none; }
.x-axis span.last { transform: translateX(-100%); }

.crosshair { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: var(--axis); pointer-events: none; }
.dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; box-shadow: 0 0 0 2.5px var(--surface), 0 1px 4px rgb(0 0 0 / 25%); pointer-events: none; }
.dot.cur { background: var(--series-1); }
.dot.prev { background: var(--series-2); }
.tip {
  position: absolute; top: 6px; z-index: 5; display: grid; gap: 5px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lift);
  font-size: 13px; white-space: nowrap; pointer-events: none;
}
.tip-row { display: flex; align-items: center; gap: 8px; }
/* What a bar's readout is about, said first and plainly. */
.tip-title { padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13.5px; font-weight: 650; }
.tip-note { color: var(--ink-3); font-weight: 400; }
/* The hovered bar's step, named under it on the axis. */
.col-mark {
  display: none; position: absolute; top: calc(100% + 5px); left: 50%; z-index: 2;
  padding: 2px 8px; border-radius: 6px; background: var(--ink); color: var(--surface);
  font-size: 12px; font-weight: 650; line-height: 1.4; white-space: nowrap; transform: translateX(-50%); pointer-events: none;
}
.tip-row b { min-width: 3ch; font-weight: 650; font-variant-numeric: tabular-nums; }
.tip-when { color: var(--ink-2); }

/* Notes on a chart. Each colour class sets --note; the emoji says which
   category it is, the colour only backs it up. The colours are the
   categorical ones, without the blue and orange of the chart's lines. */
.note-amber { --note: var(--cat-4); }
.note-green { --note: var(--cat-3); }
.note-forest { --note: var(--cat-6); }
.note-purple { --note: var(--cat-7); }
.note-pink { --note: var(--cat-5); }
.note-red { --note: var(--cat-8); }
.note-grey, .note-none { --note: var(--cat-other); }
.note-badge {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 7px;
  background: color-mix(in srgb, var(--note) 16%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--note) 45%, transparent);
  font-size: 14px; line-height: 1;
}
.chart.has-notes { padding-top: 46px; }
.note-span { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--note) 11%, transparent); pointer-events: none; }
/* Solid and thin, so it reads as a mark and not as the dashed comparison line. */
.note-line { position: absolute; top: -10px; bottom: 0; width: 1.5px; margin-left: -.75px; background: color-mix(in srgb, var(--note) 75%, transparent); pointer-events: none; }
.note-flag {
  position: absolute; top: -36px; z-index: 2; display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 6px;
  border: 1.5px solid var(--note); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow);
  font-size: 14px; line-height: 1; white-space: nowrap; transform: translateX(-50%); cursor: default;
}
.note-flag.first { transform: translateX(-4px); }
.note-flag.last { transform: translateX(calc(-100% + 4px)); }
.note-flag small { margin-left: 2px; color: var(--ink-2); font-size: 11.5px; font-weight: 650; }
.note-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 0 22px 14px 24px; color: var(--ink-2); font-size: 13px; }
.note-legend ul { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.note-legend li { display: inline-flex; align-items: center; gap: 7px; }
.note-legend .note-badge { width: 22px; height: 22px; font-size: 12.5px; }
.note-legend .add-note { margin-left: auto; color: var(--ink-2); }
.note-legend .add-note:hover { color: var(--ink); }
.day-notes { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 22px 0; color: var(--ink); font-size: 14px; }
.day-notes li { display: inline-flex; align-items: center; gap: 8px; }
.day-notes .note-badge { width: 22px; height: 22px; font-size: 12.5px; }
.tip-notes { display: grid; gap: 5px; max-width: 300px; padding-top: 6px; border-top: 1px solid var(--line); white-space: normal; }
.tip-noteline { display: flex; align-items: flex-start; gap: 8px; }
.tip-noteline .note-badge { width: 20px; height: 20px; font-size: 12px; border-radius: 6px; }

.table-view { border-top: 1px solid var(--line); }
.table-view > summary { padding: 11px 22px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.table-view > summary:hover { color: var(--ink); }
.table-scroll { overflow-x: auto; }
.table-view .table-scroll { max-height: 420px; overflow-y: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 20px; border-top: 1px solid var(--line); font-weight: 400; text-align: left; }
thead th { position: sticky; top: 0; border-top: 0; background: var(--surface); color: var(--ink-3); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
tbody th { width: 60%; max-width: 0; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
tbody th.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.list tbody tr:hover { background: var(--surface-2); }
table.list thead th { padding-top: 14px; padding-bottom: 10px; }

/* ----- panels -------------------------------------------------------------- */

.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.panel { display: flex; flex-direction: column; min-width: 0; }
/* Paths are long; give them room. */
.panel-pages { grid-column: span 2; }
.rows { padding: 0 10px 10px; }
.row { position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--ink); }
a.row:hover { background: var(--surface-2); color: var(--ink); }
/* A wash, not a block: the bar says "how much" without shouting. */
.bar { position: absolute; left: 0; top: 3px; bottom: 3px; min-width: 3px; border-radius: 8px; background: color-mix(in srgb, var(--series-1) 15%, transparent); pointer-events: none; transition: background .15s; }
a.row:hover .bar { background: color-mix(in srgb, var(--series-1) 26%, transparent); }
.row-label { position: relative; flex: 1; min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.row-part { position: relative; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.row-value { position: relative; min-width: 4ch; font-size: 14px; font-weight: 550; font-variant-numeric: tabular-nums; text-align: right; }
/* The picture before a name: a round flag, a logo in the text's colour, a
   referrer's own icon, or its initial while the server has none. */
.row-icon { position: relative; display: block; flex: none; width: 16px; height: 16px; }
.row .row-icon { margin-right: -2px; }
.row-icon.flag { border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.row-icon.logo { fill: currentColor; color: var(--ink-2); }
/* Logos without a full-colour file take their brand's colour. Apple's and
   Linux's are black, and keep the text's, like the plain window, screen
   and arrow. */
.row-icon.logo-windows { color: #0078d4; }
.row-icon.logo-android { color: #1f9d55; }
.row-icon.logo-facebook { color: #0866ff; }
.row-icon.logo-instagram { color: #e1306c; }
.row-icon.logo-duckduckgo { color: #de5833; }
.row-icon.logo-xiaomi { color: #ff6900; }
.row-icon.brand { object-fit: contain; }
.row-icon.favicon { padding: 1px; border-radius: 4px; background: var(--icon-backing); object-fit: contain; }
.row-icon.letter {
  display: grid; place-items: center; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--axis);
  color: var(--ink-2); font: 700 10px/1 var(--sans);
}
.with-icon { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
dd.with-icon { display: flex; }
/* A card's other panels, one click away. */
.panel-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: -2px; padding: 0 12px 8px; }
.panel-tabs a { padding: 3px 9px; border-radius: 7px; color: var(--ink-3); font-size: 13px; font-weight: 500; white-space: nowrap; }
.panel-tabs a:hover { background: var(--surface-2); color: var(--ink); }
.panel-tabs a[aria-current] { background: var(--surface-2); color: var(--ink); font-weight: 650; }
.more { display: block; margin-top: auto; padding: 11px 20px 13px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; }

/* Devices: one bar split into its parts, and a swatch per row. Each kind
   of device keeps its colour from site to site. */
.split { display: flex; gap: 3px; height: 12px; margin: 6px 20px 12px; overflow: hidden; border-radius: 999px; }
.seg { min-width: 3px; }
.swatch { position: relative; width: 10px; height: 10px; flex: none; border-radius: 3px; }
.seg, .swatch { background: var(--axis); }
.kind-desktop { background: var(--series-1); }
.kind-mobile { background: var(--series-2); }
.kind-tablet { background: var(--amber); }

/* ----- overview ------------------------------------------------------------- */

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 20px; }
.site-card {
  display: flex; flex-direction: column; gap: 20px; padding: 22px 24px 0; overflow: hidden; color: var(--ink);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.site-card:hover { transform: translateY(-2px); border-color: var(--axis); box-shadow: var(--shadow-lift); color: var(--ink); }
.site-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.site-card-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
/* The site's own icon as it is, rounded: no tile around it. Behind it the
   icon backing, which shows only where the icon is see-through (a light one
   on the dark page, so a black icon does not vanish). Until there is an
   icon, the site's initial on a tile of the same size. */
.site-icon { display: block; flex: none; width: 46px; height: 46px; }
.site-icon .row-icon { width: 100%; height: 100%; border-radius: 11px; }
.site-icon .row-icon.favicon { padding: 0; }
.site-icon .row-icon.letter { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--brand); font: 600 23px/1 var(--display); }
.site-card-name { display: grid; gap: 2px; min-width: 0; }
.site-card-name h2 { font-family: var(--display); font-size: 25px; font-weight: 600; line-height: 1.15; letter-spacing: -.012em; }
.site-card .domain { color: var(--ink-3); font-size: 13.5px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 4px 11px 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--live) 13%, transparent); color: var(--ink); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.site-card-main { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.figure { display: grid; gap: 8px; }
.figure-value { font-family: var(--display); font-size: 54px; font-weight: 600; line-height: .92; letter-spacing: -.03em; }
.figure-label { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; }
.mini { display: flex; gap: 26px; }
.mini dt { color: var(--ink-3); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.mini dd { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.spark { display: block; width: calc(100% + 48px); height: 96px; margin: auto -24px 0; overflow: visible; }
.spark .line { stroke: var(--series-1); stroke-width: 2.25; }
/* Where a card's sparkline would be, when there is nothing to draw. */
.spark-quiet {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 96px; margin: auto -24px 0; padding: 0 24px;
  border-top: 1px dashed var(--axis); background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); color: var(--ink-3); font-size: 13.5px;
}
.spark-quiet .quiet-hawk { width: 34px; height: 34px; margin: 0; box-shadow: 0 0 0 3px var(--surface); }

/* ----- settings and account ------------------------------------------------------ */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow a { color: var(--band-ink-2); }
.eyebrow a:hover { color: var(--band-ink); text-decoration: underline; text-underline-offset: 3px; }

/* Sites | Users, on the band under the title. */
.subnav { display: flex; gap: 4px; margin-top: 22px; }
.subnav a { flex: none; padding: 7px 14px; border-radius: 999px; white-space: nowrap; color: var(--band-ink-2); font-size: 14px; font-weight: 500; }
.subnav a:hover { background: var(--band-raised); color: var(--band-ink); }
.subnav a[aria-current] { background: var(--band-ink); color: var(--band); font-weight: 600; }

.notice, .page-error {
  display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 16px;
  border-radius: 12px; font-size: 14px; box-shadow: var(--shadow);
}
.notice { background: color-mix(in srgb, var(--good) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--good) 30%, var(--line)); color: var(--ink); }
.notice::before { content: "✓"; display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--good); color: var(--surface); font-size: 12px; font-weight: 700; }
.page-error { border: 1px solid color-mix(in srgb, var(--bad) 30%, var(--line)); }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-side, .settings-main { display: grid; gap: 20px; min-width: 0; }

.form-card { display: grid; gap: 16px; padding: 22px 24px 24px; }
.form-card h2 { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.form-card > .help { margin-top: -8px; }
.form-card form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend { padding: 0; font-size: 14px; font-weight: 600; }
.optional { margin-left: 4px; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
.help { color: var(--ink-3); font-size: 13px; line-height: 1.45; }
.field input[type="text"], .field input[type="password"], .field input[type="date"], .field textarea, .field select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--axis); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15px;
}
.field textarea { min-height: 76px; resize: vertical; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13.5px; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline-offset: 0; border-color: var(--focus); }
.field-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.field-pair + .help { margin-top: -8px; }

/* Note categories: an emoji, one of a few colours, and the list of them. */
.emoji-input { max-width: 7em; font-size: 20px !important; text-align: center; }
.emoji-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 10px; font-size: 19px; line-height: 1; }
.color-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.color-choice { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 9px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14px; }
.color-choice:hover { background: var(--surface-2); }
.color-choice input { position: absolute; opacity: 0; pointer-events: none; }
.color-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--note); }
.color-choice:has(input:checked) { border-color: var(--note); background: color-mix(in srgb, var(--note) 12%, var(--surface)); font-weight: 600; }
.color-choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.category-list { display: grid; gap: 2px; margin: -4px -10px 0; }
.category-list a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.category-list a:hover { background: var(--surface-2); }
.category-list .muted { margin-left: auto; font-size: 13px; }
.notes-table .when { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.note-cell { display: flex; align-items: flex-start; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 400; }
.note-cat { font-size: 13px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-top: 4px; }
.form-actions .primary { padding: 9px 18px; }

.roles { gap: 8px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice:hover { background: var(--surface-2); }
.choice:has(input:checked) { border-color: var(--series-1); background: color-mix(in srgb, var(--series-1) 7%, var(--surface)); }
.choice input { margin: 3px 0 0; accent-color: var(--series-1); }
.choice b { display: block; font-weight: 600; }

.snippet { position: relative; padding: 14px 16px; padding-right: 88px; border-radius: 10px; background: var(--band); color: var(--band-ink); }
.snippet code { display: block; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; line-height: 1.55; overflow-wrap: anywhere; }
.snippet .copy { position: absolute; top: 10px; right: 10px; padding: 5px 11px; border-color: var(--band-line); background: var(--band-raised); color: var(--band-ink); font-size: 13px; --focus: var(--band-focus); }
.snippet .copy:hover { background: var(--band-raised-2); color: var(--band-ink); }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92em; }
.form-card > .help code { overflow-wrap: anywhere; }
.link-events { display: grid; gap: 4px; margin: 0; padding-left: 18px; }
.form-card > .link-events { margin-top: -8px; }

.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.danger-zone h2 { color: var(--bad); }
button.danger { border-color: var(--bad); background: var(--bad); color: #fff; font-weight: 600; justify-content: center; }
button.danger:hover { border-color: color-mix(in srgb, var(--bad) 80%, black); background: color-mix(in srgb, var(--bad) 80%, black); color: #fff; }
.danger-outline { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); color: var(--bad); }
.danger-outline:hover { background: color-mix(in srgb, var(--bad) 8%, var(--surface)); color: var(--bad); }
details.confirm > summary { list-style: none; cursor: pointer; }
details.confirm > summary::-webkit-details-marker { display: none; }
details.confirm[open] > summary { display: none; }
.confirm-body { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.settings-table tbody th { width: auto; max-width: none; }
.settings-table td, .settings-table th { vertical-align: middle; }
.strong-link { color: var(--ink); font-weight: 600; }
a:hover .strong-link, a.strong-link:hover { color: var(--brand); }
.user-cell { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.avatar.small { width: 26px; height: 26px; font-size: 12.5px; }
.avatar.large { width: 44px; height: 44px; font-size: 20px; }
.user-title { display: flex; align-items: center; gap: 14px; }
.badge { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.role { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; }
.role-admin { background: color-mix(in srgb, var(--series-1) 14%, transparent); color: var(--brand); }
.role-viewer { background: color-mix(in srgb, var(--series-2) 14%, transparent); color: color-mix(in srgb, var(--series-2) 75%, var(--ink)); }

.facts { display: grid; gap: 14px; }
.facts dt { color: var(--ink-3); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.facts dd { margin-top: 3px; }
.facts dd .help { display: block; margin-top: 4px; }

/* ----- visits --------------------------------------------------------------- */

/* The same visitor gets the same animal and code wherever they appear. */
.visitor { display: inline-grid; justify-items: center; gap: 2px; flex: none; }
.animal { display: block; width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.animal.large { width: 56px; height: 56px; box-shadow: 0 0 0 3px var(--band-raised-2); }
.visitor-code { color: var(--ink-3); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 11px; letter-spacing: .04em; }
.visit-summary .visitor-code { padding: 1px 7px; border-radius: 6px; background: var(--band-raised-2); color: var(--band-ink); font-size: 12px; }
.visit-heading { display: flex; align-items: center; gap: 16px; }
.icon { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.visits-card { padding-bottom: 6px; }
.day {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 6px 0 0; padding: 14px 20px 6px; border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: 12px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
}
.day-count { color: var(--ink-3); font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-head + .day { border-top: 0; }
.visits { padding: 0 10px 6px; }
/* The busiest visits, not grouped by day, follow the head directly. */
.card-head + .visits { padding-top: 4px; }
.visit {
  position: relative;
  display: grid; grid-template-columns: 3.4em auto minmax(0, 1fr) auto 28px; align-items: center; gap: 4px 14px;
  padding: 9px 10px; border-radius: 10px; color: var(--ink);
}
.visit:hover { background: var(--surface-2); }
.visit-time { color: var(--ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.visit-main { display: grid; gap: 3px; min-width: 0; }
/* The busiest visits, from any day: the day above the time. */
.visits.busiest .visit { grid-template-columns: 5.4em auto minmax(0, 1fr) auto 28px; }
.visit-day { display: block; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
/* The path is the visit's link, stretched over the whole row. What has a
   job of its own (the visitor, the returning mark, the button that unfolds
   the row) sits above the stretch. */
.visit-link, .visit-link:hover { display: block; min-width: 0; color: var(--ink); }
.visit-link::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.visit-link:focus-visible { outline: none; }
.visit-link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; }
a.visitor, .visit-return, .visit-toggle { position: relative; z-index: 1; }
/* Positioned, so it also clips the screen-reader-only comma inside it. */
.visit-path { position: relative; display: block; overflow: hidden; font-size: 14.5px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.visit-arrow { margin: 0 6px; color: var(--ink-3); font-weight: 400; }
/* Where it came from and on what: a flag and logos, named on hover. */
.visit-meta { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.visit-meta > * { flex: none; }
.visit-facts { display: inline-flex; align-items: center; gap: 7px; }
.visit-fact { display: inline-flex; }
.visit-fact .row-icon { width: 15px; height: 15px; }
.visit-ref { display: inline-flex; flex: 0 1 auto; align-items: center; gap: 5px; min-width: 0; color: var(--brand); }
.visit-ref .row-icon { width: 14px; height: 14px; }
.visit-ref-name { overflow: hidden; text-overflow: ellipsis; }
/* A visitor who came more than once: which of their visits this is. */
.visit-return {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 8px 0 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--series-2) 13%, transparent); color: color-mix(in srgb, var(--series-2) 70%, var(--ink));
  font-size: 12px; font-weight: 600; line-height: 19px; font-variant-numeric: tabular-nums;
}
a.visit-return:hover { background: color-mix(in srgb, var(--series-2) 24%, transparent); color: color-mix(in srgb, var(--series-2) 70%, var(--ink)); }
.visit-return .icon { width: 12px; height: 12px; stroke-width: 1.7; }
a.visitor .animal { transition: box-shadow .15s; }
a.visitor:hover .animal { box-shadow: 0 0 0 2px var(--series-2); }
/* The custom events that happened, the first few. */
.visit-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; min-width: 0; }
.event-chip {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; padding: 1px 8px 1px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--ink); font-size: 12.5px; line-height: 18px;
}
.event-chip .icon { width: 12px; height: 12px; color: var(--amber); }
.event-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-times, .event-more { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.visit-stats { display: flex; justify-content: flex-end; gap: 14px; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.visit-stats > span { display: inline-flex; align-items: center; gap: 5px; }
.visit-stats .icon { color: var(--ink-3); }
.visit-events, .visit-events .icon { color: var(--amber); }
/* Unfolds the row into what happened in the visit. */
.visit-toggle {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-3);
}
.visit-toggle:hover { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--axis); }
.visit-toggle .chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.visit-toggle[aria-expanded="true"] { color: var(--ink); }
.visit-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
li.htmx-request .visit-toggle { opacity: .5; }
.visit:has(+ .visit-steps:not([hidden])) { background: var(--surface-2); border-radius: 10px 10px 0 0; }
/* Its times under the row's time and animal, its pages under the path. */
.visit-steps { margin: 0 0 6px; padding: 12px 16px 14px 10px; border-radius: 0 0 10px 10px; background: var(--surface-2); }
.visit-steps .timeline { font-size: 14px; }
.visit-steps .timeline li { grid-template-columns: 5.2em 18px minmax(0, 1fr); padding-bottom: 12px; }
.visit-steps .timeline li::before { left: calc(5.2em + 12px + 8.5px); }
.visit-steps .tl-mark { background: var(--surface-2); }
.busiest .visit-steps .timeline li { grid-template-columns: 7.2em 18px minmax(0, 1fr); }
.busiest .visit-steps .timeline li::before { left: calc(7.2em + 12px + 8.5px); }
.visit-steps .timeline li:last-child { padding-bottom: 0; }
.steps-note { color: var(--ink-3); font-size: 13px; }
.visits.compact { padding: 0; margin: 0 -10px; }
.visits.compact .visit { grid-template-columns: auto minmax(0, 1fr) auto; }
.visits.compact .visitor, .visits.compact .visit-meta, .visits.compact .visit-toggle-space { display: none; }
.visits.compact .visit-time { font-size: 13px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 10px; border-top: 1px solid var(--line); font-size: 14px; }

.visit-summary { gap: 6px 18px; }
.visit-summary b { color: var(--band-ink); font-weight: 650; }

/* What happened in a visit: a line through time, pages as dots, events as
   amber diamonds. */
.timeline { position: relative; display: grid; gap: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 6.2em 18px minmax(0, 1fr); gap: 12px; padding: 0 0 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: calc(6.2em + 12px + 8.5px); top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-when { display: grid; justify-items: end; align-content: start; gap: 1px; padding-top: 1px; font-variant-numeric: tabular-nums; }
.tl-time { font-size: 13px; font-weight: 600; }
.tl-offset { color: var(--ink-3); font-size: 12px; }
.tl-mark { position: relative; z-index: 1; width: 11px; height: 11px; margin: 5px 0 0 3.5px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--series-1); }
.tl-event .tl-mark { width: 10px; height: 10px; margin-left: 4px; border-radius: 2px; background: var(--amber); box-shadow: none; transform: rotate(45deg); }
.tl-body { display: grid; justify-items: start; gap: 3px; min-width: 0; }
.tl-path { max-width: 100%; overflow-wrap: anywhere; color: var(--ink); font-weight: 600; }
.tl-path:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.tl-title { color: var(--ink-2); font-size: 13.5px; }
.tl-detail { color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }
.tl-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.tl-name .icon { color: var(--amber); }
.props { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.prop { display: inline-flex; gap: 6px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; overflow-wrap: anywhere; }
.prop-key { color: var(--ink-3); }

/* ----- realtime ---------------------------------------------------------------- */

.tiles.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile-live { display: inline-flex; align-items: center; gap: 12px; }
.tile-live .live-dot { width: 11px; height: 11px; }
.tile-live .live-dot.idle { background: var(--axis); }
.tile-help { color: var(--ink-3); font-size: 12.5px; }

/* A bar per minute: visitors in front, pageviews behind. */
.block-key { display: inline-block; width: 11px; height: 11px; flex: none; border-radius: 3px; }
.vis { background: var(--series-1); }
.pv { background: var(--series-1-soft); }
.chart.minutes { grid-template-rows: 220px 24px; }
.bars { position: relative; display: flex; gap: 3px; }
.minute { position: relative; flex: 1; min-width: 0; border-radius: 4px 4px 0 0; }
.minute:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.minute-bar { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 3px 3px 0 0; transition: height .4s ease-out; }
/* The minute still under way is not finished yet. */
.minute.running .minute-bar { opacity: .5; }
/* Beside the bar, never over it. */
.minute-tip { display: none; left: calc(100% + 6px); }
.minute.tip-before .minute-tip { left: auto; right: calc(100% + 6px); }
.minute:hover .minute-tip { display: grid; }
.minute:hover .col-mark { display: block; }
.chart.minutes .x-axis span { transform: translateX(-50%); }
.now-status { padding: 11px 22px 12px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; }
/* Nobody about: the hawk keeps watch over the empty chart. */
.chart.is-quiet { position: relative; }
.chart.is-quiet .bars, .chart.is-quiet .y-axis { opacity: .35; }
.quiet {
  position: absolute; inset: 0; grid-column: 2; grid-row: 1;
  display: grid; place-content: center; justify-items: center; gap: 4px; padding: 0 16px; text-align: center;
}
.quiet-hawk { display: block; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 50%; box-shadow: 0 0 0 6px color-mix(in srgb, var(--series-1) 12%, transparent), var(--shadow); }
.quiet-title { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.quiet-text { max-width: 48ch; color: var(--ink-3); font-size: 13.5px; }

.now-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.now-panels { display: grid; gap: 20px; min-width: 0; }
.now-panels .panel-pages { grid-column: auto; }
.hits { padding: 0 10px 10px; }
.hit a {
  display: grid; grid-template-columns: 4.7em 30px minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 6px 10px; border-radius: 10px; color: var(--ink);
}
.hit a:hover { background: var(--surface-2); color: var(--ink); }
.hit .animal { width: 30px; height: 30px; }
.hit-time { display: grid; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.hit-date { color: var(--ink-3); font-size: 11.5px; }
.hit-main { display: grid; gap: 1px; min-width: 0; }
.hit-what { position: relative; display: flex; align-items: center; gap: 6px; overflow: hidden; font-size: 14px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.hit-event .hit-what .icon { color: var(--amber); }
.hit-meta { overflow: hidden; color: var(--ink-3); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.hit-meta > span + span::before { content: "·"; margin: 0 .45em; color: var(--ink-3); }
/* Activity that arrived with the last refresh glows for a moment. */
.hit.fresh a { animation: arrive 2.4s ease-out; }
@keyframes arrive { from { background: color-mix(in srgb, var(--amber) 26%, var(--surface)); } }

/* ----- events -------------------------------------------------------------------- */

.event-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; padding: 18px 22px 16px; }
.event-head h2 { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.15; letter-spacing: -.012em; overflow-wrap: anywhere; }
.event-head .icon, .events-list .icon { color: var(--amber); fill: color-mix(in srgb, var(--amber) 30%, transparent); }
.event-head h2 .icon { width: 20px; height: 20px; }
.event-note { margin-top: 4px; color: var(--ink-3); font-size: 13.5px; }
.event-card .tiles { border-radius: 0; border-top: 1px solid var(--line); }
.section-title { margin: 30px 4px 12px; font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.005em; }
.panel-note { padding: 0 20px 14px; color: var(--ink-3); font-size: 13px; }
.event-empty { padding: 18px 20px; }
/* Event names are what the list is about: they wrap rather than shrink. */
.events-list tbody th { white-space: normal; }
.events-list tbody th a { display: inline-flex; align-items: flex-start; gap: 8px; max-width: 100%; overflow-wrap: break-word; color: var(--ink); font-weight: 550; }
.events-list tbody th a .icon { margin-top: 3px; }
.stack-plot:focus-visible { outline-offset: 4px; }
.events-list tbody th a:hover { color: var(--brand); }
.events-howto { display: grid; gap: 10px; padding: 4px 20px 22px; }
.example { margin: 4px 0 0; padding: 12px 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 13px; line-height: 1.55; }
a.tl-name { color: var(--ink); }
a.tl-name:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

/* A bar per step of the period, stacked by event: the most frequent at the
   bottom, Others on top. Bars stay thin, a 2px gap of the surface between
   segments, the top rounded. */
.cat-1 { background: var(--cat-1); } .cat-2 { background: var(--cat-2); }
.cat-3 { background: var(--cat-3); } .cat-4 { background: var(--cat-4); }
.cat-5 { background: var(--cat-5); } .cat-6 { background: var(--cat-6); }
.cat-7 { background: var(--cat-7); } .cat-8 { background: var(--cat-8); }
.cat-other { background: var(--cat-other); }
.stack-legend { padding: 10px 22px 0; }
.stack-legend a { color: var(--ink-2); }
.stack-legend a:hover { color: var(--brand); }
.chart.stacks { grid-template-rows: 240px 24px; }
.stack-plot { position: relative; display: flex; border-radius: 2px; }
.stack-col { position: relative; flex: 1; min-width: 0; border-radius: 4px 4px 0 0; }
.stack-col:not(.future):hover, .stack-col.focused { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.stack-col:not(.future):hover .col-mark, .stack-col.focused .col-mark { display: block; }
.stack-bar { position: absolute; bottom: 0; left: 50%; display: flex; flex-direction: column-reverse; width: min(24px, calc(100% - 2px)); transform: translateX(-50%); }
.stack-seg { flex: none; }
.stack-seg + .stack-seg { border-bottom: 2px solid var(--surface); }
.stack-seg:last-child { border-radius: 4px 4px 0 0; }
.stack-col:hover .stack-bar, .stack-col.focused .stack-bar { filter: brightness(1.08); }
.stack-col.running .stack-bar { opacity: .55; }
.stack-tip { display: none; left: calc(100% + 6px); min-width: 12em; }
.stack-col.tip-before .stack-tip { left: auto; right: calc(100% + 6px); }
.stack-col:hover .stack-tip, .stack-col.focused .stack-tip { display: grid; }
.line-key { display: inline-block; width: 12px; height: 3px; flex: none; border-radius: 2px; }
.tip-total { padding-top: 4px; border-top: 1px solid var(--line); }
.chart.stacks .x-axis span { transform: translateX(-50%); }
.events-table { margin-top: 20px; }
.events-list tbody th a .block-key { margin-top: 4px; }

/* ----- explanations ------------------------------------------------------------ */

.help-q {
  position: relative; z-index: 1; display: inline-grid; place-items: center; flex: none;
  width: 18px; height: 18px; padding: 0; border: 1px solid var(--axis); border-radius: 50%;
  background: var(--surface); color: var(--ink-3); font: 650 11px/1 var(--sans);
  letter-spacing: 0; text-transform: none; vertical-align: middle; cursor: help;
}
.help-q:hover, .help-q:focus-visible { border-color: var(--ink-3); background: var(--surface-2); color: var(--ink); }
/* One card for the page, fixed to the window by app.js, so that no
   scrolling table or rounded box cuts it off. */
.help-card {
  position: fixed; z-index: 50; max-width: min(300px, calc(100vw - 16px)); padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lift); font: 400 13.5px/1.45 var(--sans); white-space: pre-line; pointer-events: none;
}

/* ----- journeys ----------------------------------------------------------------- */

.flow-help { max-width: 78ch; padding: 4px 22px 0; color: var(--ink-3); font-size: 13.5px; }
/* Below a width its text would be too small to read, so it scrolls. */
.flow { overflow-x: auto; padding: 14px 22px 18px; }
.flow svg { display: block; width: 100%; min-width: 900px; height: auto; overflow: visible; }
.flow-col { fill: var(--ink-3); font: 650 12px var(--sans); letter-spacing: .05em; text-transform: uppercase; }
.flow-link { fill: var(--series-1); fill-opacity: .17; transition: fill-opacity .15s; }
.flow-link.other { fill: var(--cat-other); fill-opacity: .2; }
.flow-link:hover { fill-opacity: .4; }
.flow-node { fill: var(--series-1); }
.flow-node.other { fill: var(--cat-other); }
.flow a:hover .flow-node { fill: var(--brand-hover); }
.flow a:focus-visible { outline: none; }
.flow a:focus-visible .flow-node { stroke: var(--focus); stroke-width: 3px; }
.flow-label, .flow-count { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.flow-label { fill: var(--ink); font: 550 13.5px var(--sans); }
.flow a:hover .flow-label { fill: var(--brand); }
.flow-count { fill: var(--ink-3); font: 12.5px var(--sans); font-variant-numeric: tabular-nums; }
/* Pointing at a page lights up the routes through it (app.js). */
.flow [data-node] { transition: opacity .15s; }
.flow.tracing .flow-link { fill-opacity: .05; }
.flow.tracing .flow-link.on { fill-opacity: .5; }
.flow.tracing [data-node]:not(.on) { opacity: .3; }

.journeys-card { margin-top: 20px; }
.journeys { padding: 6px 10px 10px; }
.journey { position: relative; display: flex; align-items: center; gap: 14px; min-height: 36px; padding: 6px 10px; }
.journey-pages { position: relative; display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 3px 8px; min-width: 0; font-size: 14px; }
.journey-page { overflow-wrap: anywhere; }
.journey-arrow { color: var(--ink-3); }
.journey-more { color: var(--ink-3); font-style: italic; }
.journey-share { position: relative; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ----- sign-in ----------------------------------------------------------------- */

.login-page { display: grid; min-height: 100vh; margin: 0; padding: 32px 16px; place-items: center; }
/* The plumage spreads out from behind the hawk. */
.login-page::before {
  background-position: center top;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 24%, #000 8%, transparent 72%);
  mask-image: radial-gradient(80% 70% at 50% 24%, #000 8%, transparent 72%);
}
.login-page::after { background: radial-gradient(520px 340px at 50% 18%, var(--glow), transparent 70%); }
.login { display: grid; justify-items: center; gap: 6px; width: min(100%, 350px); text-align: center; }
.login-art {
  display: block; width: 128px; height: 128px; margin-bottom: 14px; border-radius: 50%;
  box-shadow: 0 0 0 6px rgb(255 236 210 / 7%), 0 0 0 1px rgb(255 236 210 / 22%), 0 24px 60px -12px rgb(226 156 52 / 50%);
}
.login h1 { font-family: var(--display); font-size: 46px; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
.tagline { margin-bottom: 22px; color: var(--band-ink-2); }
/* A soft shadow keeps the words clear of the feathers behind them. */
.login h1, .tagline { text-shadow: 0 1px 14px var(--band), 0 0 4px var(--band); }
.login-form {
  display: grid; gap: 6px; width: 100%; padding: 22px; text-align: left;
  background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: 0 24px 60px -20px rgb(0 0 0 / 60%);
  --focus: var(--focus-surface);
}
.login-form label { margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.login-form label:first-of-type { margin-top: 0; }
.login-form input[type="text"], .login-form input[type="password"] { width: 100%; padding: 10px 11px; border: 1px solid var(--axis); border-radius: 10px; background: var(--surface); }
.login-form button { margin-top: 16px; padding: 11px 12px; }
.form-error { padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); font-size: 14px; }
.login .langs { margin-top: 22px; }
.login .langs a { padding: 4px 12px; font-size: 13px; letter-spacing: 0; text-transform: none; }

/* ----- narrower screens -------------------------------------------------------- */

@media (max-width: 1100px) {
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-pages { grid-column: 1 / -1; }
}

@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile:last-child { grid-column: span 2; }
  .tiles-4 .tile:last-child { grid-column: auto; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .now-grid { grid-template-columns: minmax(0, 1fr); }
  .now-panels { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
}

@media (max-width: 760px) {
  .top { flex-wrap: wrap; padding: 12px 16px; }
  .tabs {
    order: 3; flex-basis: calc(100% + 32px); margin: 0 -16px; padding: 0 16px 2px;
    /* Fade at the right edge, so tabs cut off there read as scrollable. */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .head { padding: 14px 16px 0; }
  .band { padding-bottom: 76px; }
  main { margin-top: -52px; padding: 0 16px 32px; }
  .foot-inner { padding: 20px 16px 24px; }
  .foot-line { display: grid; }
  .foot-line > * + *::before { content: none; }
  .sign-out { margin-left: 0; }
  .who-name, .live-label, .top-link-label { display: none; }
  .visit, .visits.busiest .visit { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "who time toggle" "who main main" "who stats stats"; align-items: start; row-gap: 3px; }
  .visit-day { display: inline; font-size: inherit; }
  .visit-time { grid-area: time; align-self: center; font-size: 12.5px; }
  .visit-main { grid-area: main; }
  .visitor { grid-area: who; justify-self: start; }
  .visit-stats { grid-area: stats; justify-content: flex-start; }
  .visit-toggle, .visit-toggle-space { grid-area: toggle; margin: -4px -4px -4px 0; }
  .visit-steps { padding: 12px 12px 14px 10px; }
  .visit-steps .timeline li, .busiest .visit-steps .timeline li { grid-template-columns: 4.6em 18px minmax(0, 1fr); gap: 8px; }
  .visit-steps .timeline li::before, .busiest .visit-steps .timeline li::before { left: calc(4.6em + 8px + 8.5px); }
  .visits.compact .visit { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "time time" "main stats"; }
  .timeline li { grid-template-columns: 4.6em 18px minmax(0, 1fr); gap: 8px; }
  .timeline li::before { left: calc(4.6em + 8px + 8.5px); }
  .who { padding: 3px; }
  .top-link { padding: 6px; }
  .form-card { padding: 18px 16px 20px; }
  /* Like the sites' tabs: a row that scrolls sideways, faded at its edge. */
  .subnav {
    margin: 16px -16px 0; padding: 0 16px; overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a:focus-visible { outline-offset: -2px; }
  .tiles, .tiles.tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile:last-child { grid-column: 1 / -1; }
  .tiles-4 .tile:last-child { grid-column: auto; }
  .chart.minutes { grid-template-rows: 160px 22px; }
  .chart.stacks { grid-template-rows: 180px 22px; }
  .stack-legend { padding: 10px 16px 0; }
  .bars { gap: 2px; }
  .hit a { grid-template-columns: 4.4em 26px minmax(0, 1fr); gap: 10px; padding: 6px 8px; }
  .hit .animal { width: 26px; height: 26px; }
  .hits { padding: 0 6px 8px; }
  .now-status { padding: 10px 16px; }
  .event-head { padding: 16px 16px 14px; }
  .event-head h2 { font-size: 22px; }
  .events-howto { padding: 4px 16px 18px; }
  /* Room for the names; an event's own page has its conversion. */
  .events-list .share { display: none; }
  .tile { padding: 14px 16px 16px; }
  .tile-value { font-size: 30px; }
  .chart-head { padding: 16px 16px 0; }
  .chart { grid-template-rows: 200px 22px; padding: 14px 14px 10px 10px; }
  .x-axis span:nth-child(even) { display: none; }
  .table-view > summary { padding: 11px 16px; }
  .panels { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .site-grid { gap: 16px; }
  .site-card { padding: 18px 18px 0; }
  .spark { width: calc(100% + 36px); margin: auto -18px 0; height: 80px; }
  .spark-quiet { margin: auto -18px 0; height: 80px; }
  .site-icon { width: 40px; height: 40px; }
  .site-icon .row-icon { border-radius: 10px; }
  .site-card-title { gap: 12px; }
  .theme-menu .menu-body { left: auto; right: 0; }
  .top-right { gap: 8px; }
  .quiet-hawk { width: 52px; height: 52px; }
  .chart.minutes.is-quiet { grid-template-rows: 240px 22px; }
  .figure-value { font-size: 46px; }
  .menu-body { right: auto; left: 0; max-width: calc(100vw - 32px); }
  .controls .menu:last-child .menu-body { left: auto; right: 0; }
  .menu-kicker { display: none; }
  /* The robot stays at the right edge; its menu opens leftwards. */
  .subnav-row { margin-top: 16px; }
  .subnav-row .subnav { margin: 0 0 0 -16px; padding: 0 0 0 16px; }
  .bots-menu .menu-body { left: auto; right: 0; }
  th, td { padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  main, .head, #content.htmx-request .head, #content.htmx-request main, .site-card, .bar, .minute-bar { transition: none; }
  .site-card:hover { transform: none; }
  .live-dot:not(.idle)::after, .hit.fresh a { animation: none; }
  #content.htmx-request::before { animation: none; transform: none; width: 100%; opacity: .7; }
}
