/* Design tokens and global styles for light-DOM pages. The shadow-DOM primitives
   (lk-button, lk-card, lk-badge, lk-dialog, lk-popover, lk-chart) read the same custom properties.

   Colors are OKLCH. Chrome colors (backgrounds, borders, the accent, focus rings, charts) all
   derive from ONE hue + chroma pair, so one choice yields matching light and dark variants:
   hue and chroma stay put and only the --l-* lightness values change per mode.
   --accent-h, --accent-c and --neutral are set on <html> by js/theme-init.js. The default,
   Graphite (chroma 0), is "neutral": near-black in light mode, near-white in dark mode. */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

/* Optional typefaces for Settings > Appearance. Self-hosted (nothing is fetched from a font service) and only
   downloaded by the browser when a page actually uses them. All are under the SIL Open Font License. */
@font-face { font-family: "Roboto"; src: url("/static/fonts/roboto-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/static/fonts/figtree-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Merriweather"; src: url("/static/fonts/merriweather-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-latin-400-normal.woff2") format("woff2"); font-weight: 100 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-latin-500-normal.woff2") format("woff2"); font-weight: 550 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-latin-600-normal.woff2") format("woff2"); font-weight: 650 699; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-latin-700-normal.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/static/fonts/lato-latin-400-normal.woff2") format("woff2"); font-weight: 100 500; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/static/fonts/lato-latin-700-normal.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 200 800; font-display: swap; }

:root {
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xs: 6px;
  --radius-pill: 999px;

  /* type scale: overline 11, meta 12, secondary and labels 13, body 14, titles 15, dialog title 18, page title 24 */
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-base: 14px; --fs-lg: 15px; --fs-xl: 18px; --fs-2xl: 24px;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700; /* bold only for uppercase overlines */
  /* control heights: default, compact, pill */
  --h-ctl: 38px; --h-sm: 32px; --h-xs: 24px;
  /* spacing scale (gaps; padding follows as pages are touched) */
  --space-0: 2px; --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;

  --accent-h: 264;
  --accent-c: 0;
  --neutral: 1;
  --tint: 1; /* how much accent chroma bleeds into backgrounds and borders; dark mode needs more */

  --l-bg: 0.985;
  --l-surface: 1;
  --l-border: 0.915;
  --l-border-strong: 0.85;
  --l-accent-base: 0.55;
  --l-accent-neutral: 0.1942; /* a gray accent renders near-black in light mode, near-white in dark */
  --l-accent: calc(var(--l-accent-base) + (var(--l-accent-neutral) - var(--l-accent-base)) * var(--neutral));
  --l-accent-bg: 0.955;
  --l-accent-border: 0.82;
  --l-tag-bg: 0.95;
  --l-tag-fg: 0.45;

  --bg: oklch(var(--l-bg) calc(var(--accent-c) * 0.045 * var(--tint)) var(--accent-h));
  --surface: oklch(var(--l-surface) calc(var(--accent-c) * 0.012 * var(--tint)) var(--accent-h));
  --card: var(--surface);
  --border: oklch(var(--l-border) calc(var(--accent-c) * 0.08 * var(--tint)) var(--accent-h));
  --border-strong: oklch(var(--l-border-strong) calc(var(--accent-c) * 0.11 * var(--tint)) var(--accent-h));
  --hover: color-mix(in oklab, var(--border) 45%, transparent);
  --accent: oklch(var(--l-accent) var(--accent-c) var(--accent-h));
  --accent-bg: oklch(var(--l-accent-bg) calc(var(--accent-c) * 0.22) var(--accent-h));
  --accent-border: oklch(var(--l-accent-border) calc(var(--accent-c) * 0.5) var(--accent-h));
  --accent-ring: color-mix(in oklab, var(--accent) 22%, transparent);
  --accent-text: oklch(1 0 0);
  --primary: var(--accent);
  --primary-soft: var(--accent-bg);
  --on-primary: var(--accent-text);

  --text: oklch(0.21 0.006 285);
  --text-dim: oklch(0.53 0.012 285);   /* secondary text: at least 4.5:1 on the page, on cards and on tinted fills (WCAG AA) */
  --text-faint: oklch(0.66 0.01 285);  /* not for text: icons, dots, strokes (3:1) */
  --muted: var(--text-dim);

  --red: oklch(0.55 0.2 25);
  --red-bg: oklch(0.965 0.025 25);
  --green: oklch(0.5 0.14 152);
  --green-bg: oklch(0.96 0.04 152);
  --amber: oklch(0.55 0.13 70);
  --amber-bg: oklch(0.97 0.05 90);
  --danger: var(--red);
  --danger-text: var(--red);
  --success-text: var(--green);
  --success-bg: var(--green-bg);

  --shadow: 0 1px 2px oklch(0.2 0.01 285 / 0.05), 0 1px 3px oklch(0.2 0.01 285 / 0.04);
  --shadow-lg: 0 20px 50px oklch(0.2 0.02 285 / 0.18), 0 4px 12px oklch(0.2 0.02 285 / 0.08);
  --focus: 0 0 0 3px var(--accent-ring);
  accent-color: var(--accent);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --tint: 2.2;
  --l-bg: 0.15;
  --l-surface: 0.2;
  --l-border: 0.29;
  --l-border-strong: 0.37;
  --l-accent-base: 0.72;
  --l-accent-neutral: 0.985;
  --l-accent-bg: 0.27;
  --l-accent-border: 0.45;
  --l-tag-bg: 0.3;
  --l-tag-fg: 0.82;
  --accent-text: oklch(0.16 calc(var(--accent-c) * 0.15) var(--accent-h));

  --text: oklch(0.97 0.003 285);
  --text-dim: oklch(0.68 0.012 285);
  --text-faint: oklch(0.52 0.012 285);

  --red: oklch(0.72 0.17 25);
  --red-bg: oklch(0.27 0.07 25);
  --green: oklch(0.76 0.16 152);
  --green-bg: oklch(0.26 0.06 152);
  --amber: oklch(0.8 0.14 80);
  --amber-bg: oklch(0.28 0.06 80);

  --shadow: 0 1px 2px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 20px 50px oklch(0 0 0 / 0.5), 0 4px 12px oklch(0 0 0 / 0.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  font-feature-settings: normal;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); letter-spacing: -0.025em; line-height: 1.25; }
h2 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
a { color: inherit; text-underline-offset: 3px; }
p a, .hint a, .alert a { color: var(--text); text-decoration-color: var(--border-strong); }
p a:hover, .hint a:hover, .alert a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-xs); }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--hover); padding: 1px var(--space-1); border-radius: var(--radius-xs); }
::selection { background: var(--accent-bg); }

.muted { color: var(--text-dim); }
.small { font-size: var(--fs-md); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: grid; gap: var(--space-4); }
.stack-sm { display: grid; gap: var(--space-2); }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.ti { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.ti.sm { width: 15px; height: 15px; }
.ti.lg { width: 24px; height: 24px; }

/* ---------- sidebar layout ---------- */
.skip-link { position: absolute; left: 8px; top: -48px; background: var(--surface); padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill); z-index: 60; }
.skip-link:focus { top: 8px; box-shadow: var(--shadow-lg); }

.app { display: grid; grid-template-columns: 64px minmax(0, 1fr); min-height: 100vh; }
.app.has-panel { grid-template-columns: 64px 240px minmax(0, 1fr); }

/* the rail: one icon per area of the product */
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
  padding: var(--space-4) 0 var(--space-3); background: var(--surface); border-right: 1px solid var(--border);
}
.rail-logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); margin-bottom: var(--space-1); }
.rail-logo img { display: block; }
.rail-word { display: none; }
.rail-nav, .rail-foot { display: grid; gap: var(--space-2); justify-items: center; }
.rail-foot { margin-top: auto; gap: var(--space-2); }
.rail-btn {
  all: unset; box-sizing: border-box; cursor: pointer; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius);
  color: var(--text-dim); transition: color 0.12s, background 0.12s;
}
.rail-btn:hover { color: var(--text); background: var(--hover); }
.rail-btn[aria-current="page"] { background: var(--accent-bg); color: var(--accent); }
.rail-btn:focus-visible, .rail-logo:focus-visible { box-shadow: var(--focus); }

/* the panel: pages of the current area */
.panel {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4) var(--space-3) var(--space-3); background: var(--surface); border-right: 1px solid var(--border);
}
.panel-title { padding: var(--space-2) var(--space-3) var(--space-1); font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.panel-foot { margin-top: auto; padding-top: var(--space-2); border-top: 1px solid var(--border); }
.nav-group { display: grid; gap: var(--space-0); }
.site-pick { position: relative; margin-bottom: var(--space-2); }
.site-pick select.input { width: 100%; font-weight: var(--fw-semibold); text-overflow: ellipsis; }

.logo { display: flex; align-items: center; border-radius: var(--radius-xs); padding: 0 var(--space-2); }
.logo img { display: block; height: 22px; width: auto; }
.logo .dark, .rail-word .dark { display: none; }
:root[data-theme="dark"] .logo .light, :root[data-theme="dark"] .rail-word .light { display: none; }
:root[data-theme="dark"] .logo .dark, :root[data-theme="dark"] .rail-word .dark { display: block; }

.nav { display: grid; gap: var(--space-0); }
.nav a {
  display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-3); min-height: var(--h-sm); border-radius: var(--radius);
  color: var(--text-dim); text-decoration: none; font-weight: var(--fw-medium); transition: color 0.12s, background 0.12s;
}
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a[aria-current="page"] { background: var(--accent-bg); color: var(--text); }
.nav a[aria-current="page"] .ti { color: var(--accent); }
.nav-label { margin: var(--space-3) var(--space-3) var(--space-1); font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: var(--fw-semibold); font-size: var(--fs-sm); background: var(--accent); color: var(--accent-text); flex-shrink: 0; }

.content { min-width: 0; }
.container { max-width: 1120px; margin: 0 auto; padding: var(--space-6) clamp(16px, 3vw, 36px) 96px; }
.page-header { margin-bottom: var(--space-5); display: grid; gap: var(--space-1); }
.page-header.row { display: flex; align-items: flex-end; }
.page-header p { color: var(--text-dim); }

.banner {
  display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap;
  padding: var(--space-2) clamp(16px, 3vw, 36px); background: var(--accent-bg); border-bottom: 1px solid var(--border);
}

.boot { min-height: 100vh; display: grid; place-items: center; color: var(--text-dim); }

/* Tablets and phones: the rail becomes a top bar and the panel a scrolling row of pages. */
@media (max-width: 899px) {
  .app, .app.has-panel { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: sticky; top: 0; z-index: 21; height: auto; flex-direction: row; align-items: center; gap: var(--space-2) var(--space-2); padding: var(--space-2) var(--space-3);
    border-right: 0; border-bottom: 1px solid var(--border);
    background: color-mix(in oklab, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .rail-logo { display: none; }
  .rail-word { display: block; margin-right: var(--space-1); }
  .rail-word img { height: 20px; }
  .rail-nav { display: flex; }
  .rail-foot { margin: 0 0 0 auto; display: flex; align-items: center; }
  .panel {
    position: sticky; top: 56px; z-index: 20; height: auto; overflow: visible; flex-direction: row; align-items: center; gap: var(--space-2) var(--space-2);
    padding: var(--space-2) var(--space-3); border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
  }
  .panel::-webkit-scrollbar { display: none; }
  .panel-title, .nav-label { display: none; }
  .site-pick { margin: 0; min-width: 180px; }
  .nav-group, .nav { display: flex; gap: var(--space-1); }
  .nav a { white-space: nowrap; padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill); }
  .panel-foot { margin: 0; padding: 0; border: 0; }
  .container { padding-top: var(--space-4); }
}

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-4); box-shadow: var(--shadow); }
.stat-card .stat-label { font-size: var(--fs-md); color: var(--text-dim); margin-bottom: var(--space-1); }
.stat-card .stat-value { font-size: 26px; font-weight: var(--fw-semibold); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.head-stats { display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: flex-end; }
.stat-card.compact { padding: var(--space-2) var(--space-4); min-width: 132px; box-shadow: none; }
.stat-card.compact .stat-label { margin-bottom: 0; }
.stat-card.compact .stat-value { font-size: 22px; }
.links-head { flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: flex-end; }
.stat-card .stat-sub { font-size: var(--fs-sm); color: var(--text-dim); margin-top: var(--space-0); }
.cards { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); grid-auto-flow: dense; }
.big { font-size: 26px; font-weight: var(--fw-semibold); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
.field { display: grid; gap: var(--space-2); align-content: start; }
.field > label, .field > .label { font-size: var(--fs-md); font-weight: var(--fw-medium); }
.input {
  width: 100%; height: var(--h-ctl); padding: 0 var(--space-3); border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.input::placeholder { color: var(--text-dim); }
.input:hover { border-color: var(--accent-border); }
.input:focus-visible { border-color: var(--accent); box-shadow: var(--focus); }
.input[readonly] { color: var(--text-dim); background: var(--hover); }
textarea.input { height: auto; min-height: 92px; padding: var(--space-2) var(--space-3); resize: vertical; font: 12.5px/1.5 ui-monospace, Menlo, monospace; }
select.input {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.hint { color: var(--text-dim); font-size: var(--fs-sm); }

.alert { padding: var(--space-2) var(--space-3); border-radius: var(--radius); border: 1px solid var(--border); font-size: var(--fs-md); display: flex; gap: var(--space-2); align-items: flex-start; }
.alert.error { border-color: color-mix(in oklab, var(--red) 35%, transparent); color: var(--red); background: var(--red-bg); }
.alert.ok { border-color: color-mix(in oklab, var(--green) 35%, transparent); color: var(--green); background: var(--green-bg); }
.alert.warn { border-color: color-mix(in oklab, var(--amber) 40%, transparent); color: var(--text); background: var(--amber-bg); }
.alert.warn svg { color: var(--amber); flex: none; }

.check { display: flex; gap: var(--space-2); align-items: center; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }

.segmented { display: inline-flex; padding: var(--space-1); gap: var(--space-0); background: color-mix(in oklab, var(--text) 4%, var(--surface)); border-radius: var(--radius-pill); position: relative; }
.segmented input, .swatches input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label {
  display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); cursor: pointer;
  font-weight: var(--fw-medium); color: var(--text-dim); transition: color 0.12s, background 0.12s;
}
.segmented label:hover { color: var(--text); }
.segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + label { box-shadow: var(--focus); }

.swatch:hover { transform: scale(1.1); }
input:checked + .swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px oklch(var(--sw-l) var(--sw-c) var(--sw-h)); }
input:focus-visible + .swatch { outline: 2px solid var(--text); outline-offset: 3px; }
.swatch-custom input[type="color"] { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--space-5) var(--space-4); }
.auth-box { width: 100%; max-width: 400px; display: grid; gap: var(--space-5); }
.auth-box .logo { justify-content: center; }
.auth-box .logo img { height: 28px; }
.auth-box h1 { text-align: center; font-size: var(--fs-2xl); }
.auth-box .card { padding: var(--space-5); }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) 28px; margin: 0; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; padding: var(--space-3) var(--space-3); background: var(--hover); border-radius: var(--radius); font-size: var(--fs-md); }
.meter { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.section-label { font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }

.icon-btn {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-grid; place-items: center;
  width: var(--h-sm); height: var(--h-sm); border-radius: var(--radius-sm); color: var(--text-dim);
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--accent-bg); color: var(--accent); }
.icon-btn:focus-visible { box-shadow: var(--focus); }
.icon-btn.danger:hover { background: var(--red-bg); color: var(--red); }
.icon-btn.sm { width: var(--h-xs); height: var(--h-xs); border-radius: var(--radius-xs); }
.icon-btn.accent { color: var(--accent); }

.chip {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill);
  background: var(--accent-bg); font-size: var(--fs-md); font-weight: var(--fw-medium); transition: background 0.12s;
}
.chip:hover { background: var(--border); }
.chip:focus-visible { box-shadow: var(--focus); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

/* ---------- tags (pastel chips; hue from the same OKLCH wheel as the accents) ---------- */
.tag {
  --th: 264; display: inline-flex; align-items: center; padding: var(--space-0) var(--space-2); border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.6; white-space: nowrap;
  background: oklch(var(--l-tag-bg) var(--tbg, 0.045) var(--th)); color: oklch(var(--l-tag-fg) var(--tfg, 0.16) var(--th));
}
.tag[data-color="violet"] { --th: var(--h-violet); } .tag[data-color="blue"] { --th: var(--h-blue); } .tag[data-color="sky"] { --th: var(--h-sky); } .tag[data-color="teal"] { --th: var(--h-teal); } .tag[data-color="green"] { --th: var(--h-green); } .tag[data-color="amber"] { --th: var(--h-amber); } .tag[data-color="orange"] { --th: var(--h-orange); } .tag[data-color="red"] { --th: var(--h-red); } .tag[data-color="pink"] { --th: var(--h-pink); } .tag[data-color="gray"] { --tbg: 0.008; --tfg: 0.012; --th: 285; }
.tags { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ---------- links page ---------- */
.create-card { padding: var(--space-4); margin-bottom: calc(var(--space-6) + var(--space-3)); } /* room between making a link and browsing them */
.create-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.25fr) minmax(0, 1fr) auto; gap: var(--space-2); align-items: start; }
@media (max-width: 860px) { .create-grid { grid-template-columns: 1fr 1fr; } .create-grid .url-field { grid-column: 1 / -1; } }
@media (max-width: 520px) { .create-grid { grid-template-columns: 1fr; } }

.toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--space-3); }
.toolbar .input { width: auto; min-width: 0; }
.search { position: relative; flex: 1 1 260px; }
.search .input { width: 100%; padding-left: 38px; border-radius: var(--radius-pill); }
.search .ti { position: absolute; left: 13px; top: 10px; color: var(--text-faint); pointer-events: none; }
.filter-row { margin-bottom: var(--space-3); }
.acct-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-4); max-width: 640px; }
@media (max-width: 560px) { .acct-fields { grid-template-columns: 1fr; } }
.tag-chips { display: flex; flex-wrap: wrap; gap: var(--space-3); padding-top: var(--space-2); }
.tag.tag-lg { font-size: var(--fs-base); padding: var(--space-1) var(--space-3); gap: var(--space-2); line-height: 1.7; }
.tm-chip { border: 0; font-family: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; }
.tm-chip:hover { filter: brightness(1.15); }
.tm-chip:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.tm-pencil { display: inline-flex; opacity: 0.65; }
.tm-chip:hover .tm-pencil { opacity: 1; }
.tm-edit { flex: 1 1 100%; display: grid; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--border-strong, var(--border)); border-radius: var(--radius-lg); background: var(--hover); }
.tm-edit-head { display: flex; align-items: center; gap: var(--space-2); }
.tm-edit-head .input { flex: 1; min-width: 0; }
.tm-colors { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag-btn { border: 0; font-family: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; transition: filter 0.1s, box-shadow 0.1s; }
.tag-btn:hover { filter: brightness(1.15); }
.tag-btn[aria-pressed="true"] { box-shadow: 0 0 0 2px oklch(var(--l-tag-fg) var(--tfg, 0.16) var(--th)); }
.tag-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.actions .ti { width: 20px; height: 20px; }
.filter-pills { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim);
  font-weight: var(--fw-semibold); padding: var(--space-3) var(--space-3); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: var(--space-3); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: var(--space-4); }
.table th:last-child, .table td:last-child { padding-right: var(--space-3); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--hover); }
.table .num { text-align: right; }
.table .sel { width: 40px; padding-right: 0; }
.th-sort { all: unset; cursor: pointer; display: inline-flex; gap: var(--space-1); align-items: center; }
.th-sort:hover { color: var(--text); }
.th-sort:focus-visible { box-shadow: var(--focus); border-radius: var(--radius-xs); }
.th-sort .ti { width: 13px; height: 13px; opacity: 0.45; }
.th-sort.active .ti { opacity: 1; color: var(--text); }
.th-sort .ti.th-ico { width: 16px; height: 16px; opacity: 1; color: var(--text-dim); }
.clicks-cell { font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); }

.link-cell { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.favicon {
  --fh: 264; width: 28px; height: 28px; border-radius: var(--radius-sm); flex-shrink: 0; display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: var(--fw-bold); text-transform: uppercase;
  background: oklch(var(--l-tag-bg) 0.05 var(--fh)); color: oklch(var(--l-tag-fg) 0.14 var(--fh));
  position: relative; overflow: hidden;
}
/* the real icon sits on top of the letter tile; if it fails to load it is removed and the tile shows through */
.favicon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: var(--space-1); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.link-text { min-width: 0; max-width: 100%; }
.table td.cell-main { max-width: 440px; }
.link-short { font-weight: var(--fw-semibold); font-size: var(--fs-base); display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }
.link-short a { text-decoration: none; }
.link-short a:hover { text-decoration: underline; }
.link-title { font-size: var(--fs-md); color: var(--text); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-dest { font-size: var(--fs-md); color: var(--text-dim); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-row { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-1); }
.actions { display: flex; gap: 0; justify-content: flex-end; }

.bulkbar { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); background: var(--accent-bg); border-radius: var(--radius); }
.pager { display: flex; gap: var(--space-2); align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-1); color: var(--text-dim); font-size: var(--fs-md); }
.pager .row { gap: var(--space-2); }
.empty { padding: 64px var(--space-5); text-align: center; display: grid; gap: var(--space-2); justify-items: center; color: var(--text-dim); }
.empty > .ti { width: 32px; height: 32px; color: var(--text-faint); margin-bottom: var(--space-1); }
.empty strong { color: var(--text); font-size: var(--fs-lg); }

/* Columns drop out as the screen narrows, and rows become cards on phones. */
/* the sidebar takes 248px, so the table has less room than the window suggests */
@media (max-width: 1299px) { .col-created { display: none; } }
@media (max-width: 1139px) { .col-tags { display: none; } }
@media (max-width: 1039px) { .link-dest { display: none; } }
@media (max-width: 639px) {
  .table thead { display: none; }
  .table, .table tbody { display: block; }
  .table tr { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "sel main" "sel meta" "sel tags" "sel actions"; padding: var(--space-3); border-bottom: 1px solid var(--border); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { display: block; padding: 0; border: 0; }
  .table td.sel { grid-area: sel; width: auto; padding-right: var(--space-3); padding-top: var(--space-1); }
  .table td.cell-main { grid-area: main; }
  .table td.num { grid-area: meta; text-align: left; padding-top: var(--space-1); color: var(--text-dim); font-weight: var(--fw-medium); }
  .table td.num::after { content: " clicks"; }
  .table td.col-tags { grid-area: tags; display: block; }
  .table td.col-tags .tags { margin-top: var(--space-2); }
  .table td.col-created { display: none; }
  .table td.cell-actions { grid-area: actions; margin: 6px 0 0 -6px; }
  .actions { justify-content: flex-start; }
}

/* ---------- link form ---------- */
.form-grid { display: grid; gap: var(--space-4); }
.form-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form-grid.two { grid-template-columns: 1fr; } }
details.adv > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-0);
  font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-dim); user-select: none;
}
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary .ti { width: 15px; height: 15px; transition: transform 0.15s; }
details.adv[open] > summary { color: var(--text); }
details.adv[open] > summary .ti { transform: rotate(90deg); }
details.adv > .form-grid { margin-top: var(--space-3); padding-top: var(--space-4); border-top: 1px dashed var(--border-strong); }
.tag-pick label { cursor: pointer; }
.tag-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tag-pick .tag { outline: 2px solid transparent; outline-offset: 1px; opacity: 0.7; transition: opacity 0.1s; }
.tag-pick input:checked + .tag { outline-color: currentColor; opacity: 1; }
.tag-pick input:focus-visible + .tag { box-shadow: var(--focus); }
.preview { padding: var(--space-2) var(--space-3); background: var(--bg); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font: 13px ui-monospace, Menlo, monospace; overflow-wrap: anywhere; color: var(--text-dim); }
.form-actions { display: flex; gap: var(--space-2); justify-content: flex-end; }
.row .input.grow { width: auto; flex: 1 1 160px; min-width: 0; }

/* ---------- statistics ---------- */
.bd { display: grid; gap: var(--space-0); }
.bd > [role="listitem"] { display: grid; }
.bd-row { all: unset; box-sizing: border-box; position: relative; display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-2); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; font-size: var(--fs-base); isolation: isolate; }
.bd-row::before { content: ""; position: absolute; z-index: -1; inset: 1.5px 0; width: var(--w); background: var(--accent-bg); border-radius: var(--radius-sm); } /* the bar sits behind the row's content */
.bd-row > * { position: relative; z-index: 1; }
.bd-row.static { cursor: default; }
button.bd-row:focus-visible { box-shadow: var(--focus); }
.bd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: var(--space-2); }
.bd-n { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: var(--space-2); z-index: 200; max-width: calc(100vw - 40px); }
.toast {
  display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-pill); font-weight: var(--fw-medium);
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); animation: toast-in 0.2s ease-out;
}
.toast.error { background: var(--red); color: oklch(1 0 0); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

@media (max-width: 719px) { .page-header.row { align-items: flex-start; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- tag manager ---------- */
.tag-swatch:hover { transform: scale(1.12); }
.tag-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px oklch(var(--l-accent-base) var(--tfg, 0.17) var(--th)); }
.tag-swatch:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.tag-swatch[data-color="violet"] { --th: var(--h-violet); } .tag-swatch[data-color="blue"] { --th: var(--h-blue); } .tag-swatch[data-color="sky"] { --th: var(--h-sky); } .tag-swatch[data-color="teal"] { --th: var(--h-teal); } .tag-swatch[data-color="green"] { --th: var(--h-green); } .tag-swatch[data-color="amber"] { --th: var(--h-amber); } .tag-swatch[data-color="orange"] { --th: var(--h-orange); } .tag-swatch[data-color="red"] { --th: var(--h-red); } .tag-swatch[data-color="pink"] { --th: var(--h-pink); } .tag-swatch[data-color="gray"] { --tbg: 0.008; --tfg: 0.012; --th: 285; }
.col-created { white-space: nowrap; }

/* ---------- import ---------- */
.dropzone {
  display: grid; gap: var(--space-2); justify-items: center; text-align: center; padding: 36px var(--space-4); cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-dim);
  transition: border-color 0.12s, background 0.12s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-bg); }
.dropzone:focus-within { box-shadow: var(--focus); border-color: var(--accent); }
.dropzone strong { color: var(--text); }
.dropzone .ti { color: var(--text-faint); margin-bottom: var(--space-1); }
ul.issues { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
ul.issues li { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); font-size: var(--fs-md); overflow-wrap: anywhere; }
ul.issues li:last-child { border-bottom: 0; }
ul.share-facts li { display: flex; gap: var(--space-3); align-items: flex-start; }
ul.share-facts .ti { flex: none; margin-top: 2px; color: var(--accent); }

 /* neutral, not the accent colour */
.mini-tabs button {
  all: unset; cursor: pointer; padding: var(--space-0) var(--space-3); border-radius: var(--radius-pill); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-dim);
  transition: color 0.12s, background 0.12s;
}
.mini-tabs button:hover { color: var(--text); }
.mini-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.mini-tabs button:focus-visible { box-shadow: var(--focus); }

/* ---------- website dashboard ---------- */
.skeleton { height: 30px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--hover), var(--border), var(--hover)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.dash-head { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; margin-bottom: var(--space-4); }
.dash-head .grow { flex: 1 1 0; }
.range-pick select { border-radius: var(--radius-pill); height: var(--h-ctl); }
.live-pill {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--surface); font-weight: var(--fw-semibold); box-shadow: var(--shadow);
}
.live-pill:hover { background: var(--accent-bg); border-color: var(--accent-border); }
.live-pill:focus-visible { box-shadow: var(--focus); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in oklab, var(--green) 50%, transparent); animation: pulse 2s infinite; }
.pulse.off { background: var(--text-faint); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.delta { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-sm); font-weight: var(--fw-semibold); padding: 1px var(--space-2) 1px var(--space-1); border-radius: var(--radius-pill); }
.delta .ti { width: 13px; height: 13px; }
.delta.good { background: var(--green-bg); color: var(--green); }
.delta.bad { background: var(--red-bg); color: var(--red); }
.delta.flat { background: var(--hover); color: var(--text-dim); }
.panels { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); grid-auto-flow: dense; margin-top: var(--space-4); }
.attribution { margin-top: var(--space-5); text-align: center; color: var(--text-dim); font-size: var(--fs-sm); }
.attribution a { color: var(--text-dim); }
.code { position: relative; }
.code pre { margin: 0; padding: var(--space-3) var(--space-4); padding-right: 52px; background: var(--hover); border-radius: var(--radius); font: 12.5px/1.6 ui-monospace, Menlo, monospace; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.code .icon-btn { position: absolute; right: 8px; top: 8px; }
.status-line { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius); background: var(--hover); font-weight: var(--fw-medium); }
.status-line.ok { background: var(--green-bg); color: var(--green); }
.site-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-4) var(--space-4); border-bottom: 1px solid var(--border); }
.site-row:last-child { border-bottom: 0; }
.site-row h2 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-0); max-height: 260px; overflow: auto; }
.feed li { display: flex; gap: var(--space-2); align-items: baseline; padding: var(--space-1) var(--space-1); font-size: var(--fs-md); }
.feed .when { color: var(--text-dim); min-width: 64px; font-variant-numeric: tabular-nums; }
.mini-tabs::-webkit-scrollbar { display: none; }

/* ---- team ---- */
.team { display: grid; }
.team-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 34px 34px; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.team-row.three { grid-template-columns: auto minmax(0, 1fr) auto 34px 34px 34px; }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-2); }
.rc-grid code { text-align: center; padding: var(--space-2) var(--space-3); font-size: var(--fs-base); letter-spacing: 0.04em; user-select: all; }
.team-row:last-child { border-bottom: 0; }
.team-row .who { display: grid; min-width: 0; }
.team-row .who > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.ghost { background: var(--border); color: var(--text-dim); }
.access-list { display: grid; border: 1px solid var(--border); border-radius: var(--radius); }
.access-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); }
.access-row:last-child { border-bottom: 0; }
.access-pick label { padding: var(--space-1) var(--space-3); white-space: nowrap; }
@media (max-width: 560px) { .access-row { grid-template-columns: 1fr; } .access-pick { display: grid; grid-template-columns: repeat(3, 1fr); } .access-pick label { justify-content: center; } }
.sv-list { display: grid; gap: var(--space-3); }
strong.warn { color: var(--amber); }
.sv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px var(--space-2); }
.sv-meta { grid-column: 1; padding-left: var(--space-2); }

/* ---- world map ---- */
.map svg { display: block; width: 100%; height: auto; }
.map .land { fill: color-mix(in oklab, var(--text) 13%, var(--surface)); stroke: var(--surface); stroke-width: 0.6; vector-effect: non-scaling-stroke; transition: opacity 0.1s; }
.map .land.hit { cursor: pointer; }
.map .land.hit:hover { stroke: var(--text); stroke-width: 1; }
.map-tip { position: absolute; transform: translate(12px, -110%); pointer-events: none; z-index: 2; white-space: nowrap; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); font-size: var(--fs-md);
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); }
lk-breakdown[wide] { grid-column: 1 / -1; }
.map svg { max-height: 420px; }

/* ---- sign-in divider ---- */
.or { display: flex; align-items: center; gap: var(--space-3); color: var(--text-dim); font-size: var(--fs-sm); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---- inline buttons that look like text ---- */
.linklike { all: unset; cursor: pointer; color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.linklike:hover { text-decoration-color: currentColor; }
.linklike:focus-visible { box-shadow: var(--focus); border-radius: 3px; }
th .linklike { text-decoration: none; display: inline-flex; align-items: center; gap: var(--space-1); }
.table.nowrap th, .table.nowrap td { white-space: nowrap; }

/* ---- goals ---- */
.goal-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) minmax(110px, 0.8fr) minmax(70px, 0.4fr) auto; gap: var(--space-4); align-items: center; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.goal-row:last-child { border-bottom: 0; }
.goal-row h2, .goal-row h3 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.goal-bar { height: 8px; border-radius: var(--radius-pill); background: var(--accent-bg); overflow: hidden; }
.goal-bar span { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--accent); }
.goal-num { display: grid; line-height: 1.3; }
@media (max-width: 760px) { .goal-row { grid-template-columns: 1fr auto; } .goal-bar { grid-column: 1 / -1; order: 5; } }

/* ---- funnels ---- */
.funnel { display: grid; gap: var(--space-1); }
.funnel-step { display: grid; gap: var(--space-2); }
.funnel-head { display: flex; align-items: center; gap: var(--space-2); }
.funnel-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-bg); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); flex-shrink: 0; }
.funnel-bar { height: 34px; border-radius: var(--radius); background: var(--accent-bg); overflow: hidden; }
.funnel-bar span { display: block; height: 100%; background: var(--accent); border-radius: var(--radius); transition: width 0.3s ease; }
.funnel-drop { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-0) 0 var(--space-0) 34px; font-size: var(--fs-md); color: var(--text-dim); }
.step-edit { display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius); }
.step-edit .funnel-n { margin-top: var(--space-1); }
@media (prefers-reduced-motion: reduce) { .funnel-bar span { transition: none; } }

/* ---- journeys ---- */
.journey svg { display: block; overflow: visible; }
.journey .jn.first { cursor: pointer; }
.journey .jl { fill: var(--text); font: 12px var(--font); pointer-events: none; }
.journey .jc { fill: var(--text-faint); }
.journey .jh { fill: var(--text-dim); font: 11px var(--font); text-transform: uppercase; letter-spacing: 0.05em; }

/* round flags, browser and system logos, site icons that lead a row */
.lead-img { width: 18px; height: 18px; flex-shrink: 0; object-fit: contain; }
.lead-img.flag { border-radius: 50%; box-shadow: 0 0 0 1px var(--border); }
.lead-img.brand { border-radius: var(--radius-xs); }

/* traffic by weekday and hour */
.tgrid { border-collapse: separate; border-spacing: 0; margin: 0 auto; }
.tgrid th { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-dim); padding: 0 var(--space-1) var(--space-1); text-align: center; }
.tdot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); transform: scale(var(--s)); vertical-align: middle; }
.tdot.zero { background: var(--border); transform: scale(0.4); opacity: 0.7; }

/* date-range picker */
.rp { position: relative; display: inline-block; }
.rp-trigger { display: inline-flex; align-items: center; gap: var(--space-2); height: var(--h-ctl); padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: var(--fw-medium); cursor: pointer; box-shadow: var(--shadow); }
.rp-trigger:hover { border-color: var(--border-strong, var(--text-dim)); }
.rp-trigger:focus-visible { outline: none; box-shadow: var(--focus); }
.rp-dates { color: var(--text-dim); font-weight: var(--fw-regular); }
.rp-panel { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; display: flex; max-width: calc(100vw - 32px); }
.rp-presets { list-style: none; margin: 0; padding: var(--space-2); border-right: 1px solid var(--border); min-width: 170px; display: grid; gap: var(--space-0); }
.rp-presets button { display: block; width: 100%; text-align: left; padding: var(--space-2) var(--space-2); border: 0; border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.rp-presets button:hover { background: var(--accent-bg); }
.rp-presets button.on { background: var(--accent-bg); color: var(--accent); font-weight: var(--fw-semibold); }
.rp-presets button:focus-visible, .rp-day:focus-visible { outline: none; box-shadow: var(--focus); }
.rp-cal { padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.rp-inputs { display: flex; gap: var(--space-3); }
.rp-inputs label { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-md); color: var(--text-dim); }
.rp-inputs .input { width: auto; height: var(--h-sm); }
.rp-months { display: flex; gap: var(--space-5); }
.rp-month { width: 252px; }
.rp-mhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.rp-grid { display: grid; grid-template-columns: repeat(7, 36px); row-gap: 2px; }
.rp-wd { font-size: var(--fs-xs); color: var(--text-dim); text-align: center; padding-bottom: var(--space-1); }
.rp-day { height: var(--h-sm); border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-md); cursor: pointer; border-radius: 0; }
.rp-day:hover:not(:disabled) { background: var(--accent-bg); border-radius: var(--radius-sm); }
.rp-day:disabled { color: var(--text-dim); opacity: 0.4; cursor: default; }
.rp-day.in { background: var(--accent-bg); }
.rp-day.today { font-weight: var(--fw-semibold); }
.rp-day.edge { background: var(--accent); color: var(--accent-text); border-radius: var(--radius-sm); }
.rp-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--border); }
@media (max-width: 760px) {
  .rp-panel { flex-direction: column; }
  .rp-presets { order: -1; border-right: 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; max-height: none; }
  .rp-presets li { flex: 0 0 auto; }
  .rp-presets button { white-space: nowrap; }
  .rp-months { flex-direction: column; gap: var(--space-3); }
  .rp-inputs { flex-wrap: wrap; }
}

/* filter dialog */
.count-pill { min-width: 20px; height: 20px; padding: 0 var(--space-1); border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); display: inline-grid; place-items: center; }
.fd { display: grid; grid-template-columns: 190px 1fr; gap: var(--space-4); min-height: 340px; }
.fd-fields { list-style: none; margin: 0; padding: 0 var(--space-3) 0 0; border-right: 1px solid var(--border); max-height: 380px; overflow-y: auto; }
.fd-fields button { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; padding: var(--space-2) var(--space-2); border: 0; border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.fd-fields button:hover { background: var(--accent-bg); }
.fd-fields button.on { background: var(--accent-bg); color: var(--accent); font-weight: var(--fw-semibold); }
.fd-fields button:focus-visible, .fd-opt:focus-visible { outline: none; box-shadow: var(--focus); }
.fd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.fd-values { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.fd-list { display: flex; flex-direction: column; gap: var(--space-0); max-height: 330px; overflow-y: auto; }
.fd-opt { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-2); border: 0; border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.fd-opt:hover { background: var(--accent-bg); }
.fd-opt.on { background: var(--accent-bg); color: var(--accent); font-weight: var(--fw-semibold); box-shadow: inset 0 0 0 1px var(--accent); }
.fd-segs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.fd-segs li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); }
@media (max-width: 640px) { .fd { grid-template-columns: 1fr; } .fd-fields { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 var(--space-2); display: flex; flex-wrap: wrap; max-height: none; } .fd-fields li { flex: 0 0 auto; } }
.lead-cell { display: inline-flex; align-items: center; gap: var(--space-2); }
.lead-img.tile { position: relative; display: inline-grid; place-items: center; border-radius: var(--radius-xs); background: oklch(0.9 0.05 var(--fh, 250)); color: oklch(0.4 0.1 var(--fh, 250)); font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; overflow: hidden; }
.lead-img.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.table.compact td { padding: var(--space-2) var(--space-3); } .table.compact th { padding-left: var(--space-3); padding-right: var(--space-3); }

.map-row { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-top: var(--space-4); align-items: start; }
@media (max-width: 900px) { .map-row { grid-template-columns: 1fr; } }

main[tabindex="-1"]:focus { outline: none; } /* focused only by the skip link or after a dialog closes: no ring around the whole page */
.bd-n { display: inline-flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.bd-n strong { text-align: right; }
.bd-n .muted { padding-left: var(--space-2); border-left: 1px solid var(--border-strong, var(--border)); min-width: 3.4em; line-height: 1.15; }

/* pagination */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-3); align-items: center; }
.pager .rows { justify-self: end; display: inline-flex; align-items: center; gap: var(--space-2); }
.pager .rows .input { width: auto; height: 32px; padding: 0 var(--space-5) 0 var(--space-2); }
.pages { display: inline-flex; gap: var(--space-1); align-items: center; }
.pg { min-width: var(--h-sm); height: var(--h-sm); padding: 0 var(--space-2); display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; font-size: var(--fs-md); cursor: pointer; font-variant-numeric: tabular-nums; }
.pg:hover:not(:disabled):not(.on) { background: var(--accent-bg); }
.pg.on { background: var(--accent); color: var(--accent-text); font-weight: var(--fw-semibold); }
.pg:disabled { opacity: 0.35; cursor: default; }
.pg:focus-visible { outline: none; box-shadow: var(--focus); }
.pg svg { margin: 0 -3px; }
@media (max-width: 640px) { .pager { grid-template-columns: 1fr; justify-items: center; } .pager .rows { justify-self: center; } }

/* compare page */
.vs { font-size: var(--fs-md); letter-spacing: 0.04em; color: var(--text-dim); }
.cmp-cols { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .cmp-cols { grid-template-columns: 1fr; } }
.cal { display: inline-flex; align-items: center; gap: var(--space-2); }

.group-by { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-md); color: var(--text-dim); }
.group-by .input { width: auto; height: 32px; padding: 0 var(--space-5) 0 var(--space-2); font-size: var(--fs-md); }

/* website switcher */
.ss { position: relative; }
.ss-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); height: var(--h-ctl); padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.ss-trigger:hover { border-color: var(--border-strong, var(--text-dim)); }
.ss-trigger:focus-visible, .ss-card:focus-visible { outline: none; box-shadow: var(--focus); }
.ss-name { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.ss-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-semibold); }
.ss-panel { position: fixed; z-index: 60; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 100px); overflow-y: auto; padding: var(--space-3); }
.ss-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 var(--space-0) var(--space-2); }
.ss-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.ss-panel.ss-wide { width: min(860px, calc(100vw - 32px)); }
.ss-grid.cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 899px) { .ss-grid.cols4 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.ss-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.ss-card:hover { background: var(--accent-bg); }
.ss-card.on { border-color: var(--text-faint); background: color-mix(in oklab, var(--text) 4%, var(--surface)); }
.ss-spark { display: block; width: 100%; height: 26px; }
.ss-spark.empty { border-bottom: 1px dashed var(--border); height: 22px; }
.ss-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); font-size: var(--fs-md); color: var(--text-dim); }
.ss-trend { display: inline-flex; align-items: center; gap: var(--space-1); }
.ss-trend.good { color: oklch(0.48 0.13 150); }
.ss-trend.bad { color: oklch(0.5 0.19 25); }
.ss-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--border); }
@media (max-width: 899px) { .ss-panel, .ss-panel.ss-wide { left: 16px !important; right: 16px; width: auto; } }

/* the public share page */
.share-head { display: flex; align-items: center; gap: var(--space-3); max-width: 1200px; margin: 0 auto; padding: var(--space-5) var(--space-5) 0; }
.share-head h1 { margin: 0; font-size: var(--fs-xl); line-height: 1.2; }
.share-head .grow { flex: 1; }
.badge-share { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--text-dim); font-size: var(--fs-md); }
.share-main { max-width: 1200px; margin: 0 auto; padding-top: var(--space-4); }
.share-foot { text-align: center; padding: var(--space-5) var(--space-4) 40px; }

.h-card { margin: 0; } /* a card title that is a heading for assistive tech but looks as before */
:root[data-theme="dark"] .ss-trend.good { color: oklch(0.8 0.15 150); }
:root[data-theme="dark"] .ss-trend.bad { color: oklch(0.78 0.15 25); }

/* Windows high-contrast mode drops shadows and fills: give focus a real outline and keep selected states visible */
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText !important; outline-offset: 2px; }
  .rp-day.edge, .fd-opt.on, .rp-presets button.on, .ss-card.on, .pg.on, .mini-tabs button[aria-pressed="true"] { outline: 2px solid Highlight; }
  .bd-row::before { border: 1px solid CanvasText; }
}
@media (max-width: 520px) { /* the top bar must fit a 320-375px phone without sideways scrolling */
  .rail { padding: var(--space-2) var(--space-2); gap: var(--space-2); }
  .rail-word { display: none; }
  .rail-logo { display: grid; }
  .rail-foot { gap: var(--space-1); }
}

/* headline numbers: icon and label, the number with its change beside it */
.kpis { gap: var(--space-3); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: var(--space-3) var(--space-4) var(--space-3); }
/* a headline card that picks what the chart shows */
.kpi-btn { display: block; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; position: relative; transition: border-color 0.15s, background 0.15s; }
.kpi-btn:hover { border-color: var(--border-strong); background: var(--hover); }
.kpi-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.kpi-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 1px var(--accent); }
.kpi-btn[aria-pressed="true"]:focus-visible { box-shadow: var(--shadow), 0 0 0 1px var(--accent), var(--focus); }
.kpi .label { color: var(--text-dim); display: flex; align-items: center; font-size: var(--fs-md); gap: var(--space-2); }
.kpi .label .ti { width: 15px; height: 15px; }
.kpi .value-row { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-1) 0 0; }
.kpi .delta { font-size: var(--fs-xs); padding: 0 var(--space-1) 0 var(--space-1); }
.fd-name { display: inline-flex; align-items: center; gap: var(--space-2); }
.fd-name .ti { color: var(--text-dim); }
.bd-search { margin: var(--space-1) 0 var(--space-3); height: var(--h-sm); }

/* ---------- the centred layout: one column of navigation with no chrome of its own, beside the page ---------- */
.side { display: contents; } /* phones: the rail and the panel are the top bars, as above */
.rail-who { display: none; }
/* the picture and the name lead to your profile */
a.avatar, a.rail-who { text-decoration: none; cursor: pointer; }
a.avatar { transition: box-shadow 0.15s; }
a.avatar:hover { box-shadow: 0 0 0 3px var(--border-strong); }
a.rail-who:hover { color: var(--text); }
a.avatar:focus-visible, a.rail-who:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 50%; }
a.rail-who:focus-visible { border-radius: var(--radius-sm); }
@media (min-width: 900px) {
  .app, .app.has-panel { grid-template-columns: 232px minmax(0, 1fr); gap: 0 44px; max-width: 1420px; margin: 0 auto; padding: 0 var(--space-5); }
  .side { display: flex; flex-direction: column; gap: var(--space-4); position: sticky; top: 0; height: 100vh; padding: var(--space-5) 0 var(--space-4); overflow-y: auto; scrollbar-width: thin; }
  .rail { display: contents; }
  .rail-logo { display: none; }
  .rail-word { display: block; order: 0; padding: 0 var(--space-1); margin: 0; }
  .rail-word img { height: 22px; width: auto; display: block; }
  /* the areas as a strip of tabs above the site switcher */
  .rail-nav { order: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-1); padding: var(--space-1); border-radius: var(--radius-pill); background: color-mix(in oklab, var(--text) 5%, transparent); }
  .rail-btn { width: auto; height: var(--h-sm); border-radius: var(--radius-pill); }
  .rail-btn:hover { background: color-mix(in oklab, var(--text) 6%, transparent); }
  .rail-btn[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
  .panel { order: 2; position: static; height: auto; overflow: visible; padding: 0; background: none; border: 0; flex: 1; }
  .panel-foot { border-top: 0; }
  .rail-foot { order: 3; margin-top: auto; display: flex; align-items: center; gap: var(--space-2); padding-top: var(--space-3); justify-items: initial; }
  .rail-foot .rail-btn { width: 34px; flex-shrink: 0; }
  .rail-foot .avatar { order: 0; } .rail-who { order: 1; } .rail-foot a.rail-btn { order: 2; } .rail-foot button.rail-btn { order: 3; }
  .rail-who { display: block; flex: 1; min-width: 0; font-size: var(--fs-md); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .container { max-width: none; padding: var(--space-5) 0 96px; }
  .nav a[aria-current="page"] { background: color-mix(in oklab, var(--text) 6%, transparent); }
}

/* tighter card heads, taller tabs, slightly smaller KPI numbers */
[slot="title-extra"].icon-btn.sm { width: 22px; height: 22px; margin: -3px 0; }
.mini-tabs button { white-space: nowrap; padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); }
.kpi .value { font-weight: var(--fw-semibold); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 0; line-height: 1.2; font-size: 22px; }

/* ranking cards: equal heights, and an arrange mode */
.dash-cards { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
.dash-cards .slot { min-width: 0; position: relative; grid-column: span 6; display: flex; flex-direction: column; }
.dash-cards .slot > lk-card, .dash-cards .slot > lk-breakdown { flex: 1; }
.dash-cards .slot.w12 { grid-column: span 12; }
.dash-cards .slot.w8 { grid-column: span 8; }
.dash-cards .slot.w4 { grid-column: span 4; }
@media (max-width: 1100px) { .dash-cards .slot.w6, .dash-cards .slot.w8, .dash-cards .slot.w4 { grid-column: span 12; } }
lk-breakdown { display: block; height: 100%; }
lk-breakdown > lk-card { height: 100%; box-sizing: border-box; }
.arrange-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--space-2) var(--space-2); margin-top: var(--space-5); min-height: 32px; text-align: center; }
.arrange-bar .muted { font-size: var(--fs-md); }

/* footer, changelog and credits */
.site-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-2) var(--space-2); margin-top: var(--space-4); padding-bottom: var(--space-5); color: var(--text-dim); font-size: var(--fs-md); }
.site-foot a, .site-foot .foot-link { color: var(--text-dim); text-decoration: none; }
.site-foot .foot-link { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.site-foot a:hover, .site-foot .foot-link:hover { color: var(--text); text-decoration: underline; }
.prose-log { max-height: min(60vh, 560px); overflow-y: auto; padding: var(--space-1) var(--space-5) var(--space-5); font-size: var(--fs-base); line-height: 1.55; }
.prose-log h3 { font-size: var(--fs-lg); margin: var(--space-4) 0 var(--space-1); }
.prose-log h4 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); margin: var(--space-3) 0 var(--space-1); }
.prose-log ul { margin: var(--space-1) 0 var(--space-2); padding-left: var(--space-4); }
.prose-log li { margin: var(--space-0) 0; }
.prose-log code { font-size: var(--fs-md); background: var(--surface-2, color-mix(in oklab, var(--text) 6%, var(--surface))); padding: 1px var(--space-1); border-radius: var(--radius-xs); }
.credit-list { list-style: none; padding: 0 !important; }
.credit-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.credit-list .lic { color: var(--text-dim); font-size: var(--fs-md); text-align: right; }
.credit-list .what { grid-column: 1 / -1; color: var(--text-dim); font-size: var(--fs-md); }

/* busiest times: a pale base circle per slot, tighter rows */
.tgrid th { padding-bottom: var(--space-1); }
.tgrid tbody th { text-align: right; font-weight: var(--fw-regular); padding: 0 var(--space-3) 0 0; white-space: nowrap; height: 19px; padding-right: var(--space-2); }
.tgrid td { text-align: center; padding: 0; height: 19px; width: 30px; }
.tcell { display: inline-block; position: relative; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; background: color-mix(in oklab, var(--text) 7%, var(--surface)); }
.tcell .tdot { position: absolute; inset: 0; width: auto; height: auto; transform: scale(var(--s)); opacity: var(--o); }
/* top countries under the map */
.map-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); grid-auto-flow: column; gap: var(--space-0) var(--space-4); margin: var(--space-3) 0 0; }
.map-top > [role="listitem"] { display: grid; }
.map-top.one { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
@media (max-width: 700px) { .map-top { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; } }

/* a small "i" with a tooltip, next to a card title */
.info-tip { position: relative; display: inline-grid; place-items: center; width: var(--h-xs); height: var(--h-xs); margin: -3px 0; border-radius: var(--radius-xs); color: var(--text-dim); cursor: help; }
.info-tip:hover, .info-tip:focus-visible { color: var(--text); background: color-mix(in oklab, var(--text) 6%, transparent); outline: none; }
.info-tip:focus-visible { box-shadow: var(--focus); }
.info-tip::after { content: attr(data-tip); position: absolute; z-index: 30; left: 50%; top: calc(100% + 8px); transform: translateX(-20%); width: max-content; max-width: 240px; padding: var(--space-2) var(--space-2); border-radius: var(--radius-sm);
  background: var(--tip-bg); color: var(--tip-fg); border: 1px solid var(--tip-border); font-size: var(--fs-md); font-weight: var(--fw-regular); line-height: 1.4; text-align: left; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity 0.1s; }
.info-tip:hover::after, .info-tip:focus-visible::after { opacity: 1; }
/* the small tooltip from js/tip.js (any element with data-tt), drawn in the top layer */
.tt { position: fixed; inset: auto; margin: 0; width: max-content; max-width: 240px; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); border: 1px solid var(--tip-border); background: var(--tip-bg); color: var(--tip-fg);
  font-size: var(--fs-md); line-height: 1.4; box-shadow: var(--shadow-lg); pointer-events: none; overflow: visible; }
[data-tt]:not(a, button) { cursor: default; } /* clickable things keep their pointer */
.lead-cell.icon-only { gap: 0; }
/* busiest times: our own tooltip, instant and following the pointer */
.tgrid-wrap { position: relative; }
.tgrid-tip { position: absolute; z-index: 20; transform: translate(12px, -120%); pointer-events: none; white-space: nowrap; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); font-size: var(--fs-md);
  background: var(--tip-bg); color: var(--tip-fg); border: 1px solid var(--tip-border); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: var(--space-2); }
.tgrid-tip .ti { opacity: 0.75; }
@media (min-width: 900px) { .rail-nav { justify-items: stretch; } }

/* latest activity: icon centred on the text, with room on both sides */
.feed li { align-items: center; }
.feed .what { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-0) var(--space-4); min-width: 0; }
.feed .where { display: inline-flex; align-items: center; gap: var(--space-2); }
.feed .where .lead-img { width: 16px; height: 16px; }
.kpi .muted strong { color: var(--text); font-weight: var(--fw-semibold); }

/* sidebar sections: more air between them, and a label that reads as a heading (darker than the items) */
.nav-label { margin: var(--space-5) var(--space-3) var(--space-1); color: color-mix(in oklab, var(--text) 80%, var(--surface)); letter-spacing: 0.06em; }
.nav-group:first-of-type .nav-label { margin-top: var(--space-4); }

.share-btn { display: inline-flex; align-items: center; gap: var(--space-2); height: var(--h-ctl); padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: var(--fw-medium); cursor: pointer; box-shadow: var(--shadow); }
.share-btn:hover { border-color: var(--border-strong, var(--text-dim)); }
.share-btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* the bars behind ranking rows: a soft wash of the accent colour, lighter in both themes and for every accent */
.bd-row::before { background: color-mix(in oklab, var(--accent) 9%, var(--surface)); }
:root[data-theme="dark"] .bd-row::before { background: color-mix(in oklab, var(--accent) 13%, var(--surface)); }
:root[data-theme="dark"] button.bd-row:hover::before { background: color-mix(in oklab, var(--accent) 22%, var(--surface)); }

/* "Manage websites" sits right under the last section, set apart by a subtle line */
@media (min-width: 900px) {
  .panel-foot { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border); }
}

/* the sidebar (and the website switcher that opens from it) must sit above the page content */
@media (min-width: 900px) { .side { z-index: 30; } .content { position: relative; z-index: 1; } }

/* Inter only: its alternate "1" and tail forms */
/* Fonts differ in the size of their letters at the same font size. font-size-adjust sets each font's lowercase height (relative to its
   own natural one, listed here as the font's x-height times the scale we want), so every font reads about as big as Inter does.
   x-heights measured: Lato .507, Roboto .528, Figtree .50, Manrope .54, the system font (SF Pro on a Mac) .508. Poppins (the default), Merriweather and Inter are left as they are.
   Poppins is also a step lighter: its weights are shifted down one step in the @font-face rules above. */
:root[data-font="lato"] { --fsa: 0.553; }
:root[data-font="roboto"] { --fsa: 0.566; }
:root[data-font="manrope"] { --fsa: 0.572; }
:root[data-font="system"] { --fsa: 0.569; }
:root[data-font="figtree"] { --fsa: 0.54; }
* { font-size-adjust: var(--fsa, none) !important; } /* not left to each rule's `font` shorthand, which would reset it */
code, pre, kbd, samp { --fsa: none; }
:root[data-font="inter"] body { font-feature-settings: "cv11", "ss03"; }

/* account card */
.acct-head { display: flex; align-items: center; gap: var(--space-4); }
.acct-head .avatar.lg { width: 44px; height: 44px; font-size: var(--fs-xl); }
.acct-name { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.acct-head p { margin: 0; }
.set-blocks { margin-top: var(--space-5); display: grid; }
.set-block { padding: var(--space-4) 0; border-top: 1px solid var(--border); display: grid; gap: var(--space-3); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.set-row h3 { margin: 0 0 var(--space-0); font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.set-row p { margin: 0; max-width: 56ch; }
.set-empty { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-3); border: 1px dashed var(--border-strong, var(--border)); border-radius: var(--radius); color: var(--text-dim); font-size: var(--fs-md); }

/* settings: small facts with icons, and rows of "name … control" */
.facts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.fact { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--hover); font-size: var(--fs-md); }
.fact .ti { color: var(--text-dim); }
.fact strong { font-weight: var(--fw-semibold); }
.pref-rows { display: grid; margin-top: var(--space-1); }
.pref-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.pref-row:first-child { border-top: 0; padding-top: var(--space-1); }
.pref-row > .label { font-size: var(--fs-base); font-weight: var(--fw-semibold); margin: 0; }
@media (max-width: 560px) { .pref-row { grid-template-columns: 1fr; } }
.check.top { align-items: flex-start; }

/* the comparison line: a darker shade of the accent in light mode, a lighter one in dark mode (so it stays visible) */
:root { --cmp-line: color-mix(in oklab, var(--accent) 60%, black); }
:root[data-theme="dark"] { --cmp-line: color-mix(in oklab, var(--accent) 65%, white); }

.create-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); align-items: start; }
@media (max-width: 520px) { .create-row { grid-template-columns: 1fr; } }

/* pictures */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-btn { all: unset; position: relative; cursor: pointer; border-radius: 50%; }
.avatar-btn:focus-visible { box-shadow: var(--focus); }
.avatar-btn .avatar-edit { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); }
.avatar-btn .avatar-edit .ti { width: 12px; height: 12px; }
.av-section h3 { margin: 0 0 var(--space-2); font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.av-strip { display: flex; gap: var(--space-2); overflow-x: auto; padding: var(--space-1) var(--space-0) var(--space-2); scroll-snap-type: x proximity; scrollbar-width: thin; }
.av-opt { all: unset; flex: 0 0 auto; width: 60px; height: 60px; border-radius: 50%; cursor: pointer; scroll-snap-align: start; overflow: hidden; border: 2px solid transparent; box-sizing: border-box; }
.av-opt img { width: 100%; height: 100%; display: block; }
.av-opt:hover { border-color: var(--border-strong, var(--text-dim)); }
.av-opt.on { border-color: var(--accent); }
.av-opt:focus-visible { box-shadow: var(--focus); }
.av-upload { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px dashed var(--border-strong, var(--border)); border-radius: var(--radius); cursor: pointer; font-weight: var(--fw-medium); }
.av-upload:hover { background: var(--hover); }
.av-upload:focus-within { box-shadow: var(--focus); }
.av-upload.busy { opacity: 0.6; pointer-events: none; }
.avatar-face { display: block; border-radius: 50%; }

.av-body { padding: var(--space-1) var(--space-5) var(--space-5); display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.av-section { min-width: 0; }
.av-letter { display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font-weight: var(--fw-semibold); font-size: 22px; }

/* colour pickers in the style of the tags: a pastel disc with a stronger dot in the middle, a ring when chosen */
.tag-swatch { all: unset; box-sizing: border-box; }
.swatch, .tag-swatch {
  --pick-bg: oklch(var(--l-tag-bg) var(--pick-bgc) var(--pick-h));
  --pick-fg: oklch(var(--l-tag-fg) var(--pick-fgc) var(--pick-h));
  position: relative; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: var(--pick-bg); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--pick-fg) 28%, transparent);
  transition: transform 0.12s, box-shadow 0.12s;
}
.swatch { --sw-h: 264; --sw-c: 0; --sw-neutral: 1; --sw-l: calc(var(--l-accent-base) + (var(--l-accent-neutral) - var(--l-accent-base)) * var(--sw-neutral)); --pick-h: var(--sw-h); --pick-bgc: calc(0.045 * (1 - var(--sw-neutral))); --pick-fgc: min(0.16, calc(var(--sw-c) * 0.8)); width: 30px; height: 30px; }
.tag-swatch { --th: 264; --pick-h: var(--th); --pick-bgc: var(--tbg, 0.045); --pick-fgc: var(--tfg, 0.16); width: 26px; height: 26px; }
.swatch:hover, .tag-swatch:hover { transform: scale(1.08); }
input:checked + .swatch, .tag-swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--pick-fg); background: var(--pick-bg); }
input:checked + .swatch::after, .tag-swatch[aria-pressed="true"]::after { transform: scale(1.3); }
.swatch-custom { overflow: hidden; background: conic-gradient(from 90deg, oklch(var(--l-tag-bg) 0.06 10), oklch(var(--l-tag-bg) 0.06 70), oklch(var(--l-tag-bg) 0.06 130), oklch(var(--l-tag-bg) 0.06 190), oklch(var(--l-tag-bg) 0.06 250), oklch(var(--l-tag-bg) 0.06 310), oklch(var(--l-tag-bg) 0.06 10)); }
.swatch-custom::after { background: conic-gradient(from 90deg, oklch(var(--l-tag-fg) 0.16 10), oklch(var(--l-tag-fg) 0.16 130), oklch(var(--l-tag-fg) 0.16 250), oklch(var(--l-tag-fg) 0.16 10)); }
.swatch-custom.active { background: var(--pick-bg); box-shadow: inset 0 0 0 2px var(--pick-fg); }
.swatch-custom.active::after { background: var(--pick-fg); transform: scale(1.3); }
.swatches { display: flex; flex-wrap: wrap; align-items: center; position: relative; gap: var(--space-2); }
.swatch::after, .tag-swatch::after { content: ""; width: 38%; height: 38%; border-radius: 50%; background: var(--pick-fg); transition: transform 0.12s; pointer-events: none; }

/* custom accent picker: a colour slider, an intensity slider and a hex box */
button.swatch { border: 0; padding: 0; margin: 0; font: inherit; box-sizing: border-box; width: var(--h-sm); height: var(--h-sm); appearance: none; -webkit-appearance: none; }
button.swatch:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.cp { display: grid; gap: var(--space-4); width: 250px; padding: var(--space-1) var(--space-0); }
.cp-row { display: grid; gap: var(--space-2); font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-dim); }
.cp-range { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: var(--radius-pill); margin: 0; cursor: pointer; border: 1px solid var(--border); }
.cp-hue { background: linear-gradient(90deg, oklch(0.75 0.14 0), oklch(0.78 0.14 60), oklch(0.8 0.15 110), oklch(0.78 0.14 160), oklch(0.78 0.12 210), oklch(0.72 0.14 260), oklch(0.7 0.16 310), oklch(0.75 0.14 360)); }
.cp-chroma { background: linear-gradient(90deg, oklch(0.7 0.02 var(--cp-h)), oklch(0.7 0.25 var(--cp-h))); }
.cp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--text); box-shadow: 0 1px 4px oklch(0 0 0 / 0.3); }
.cp-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--text); box-shadow: 0 1px 4px oklch(0 0 0 / 0.3); }
.cp-range:focus-visible { outline: none; box-shadow: var(--focus); }
.cp-hex { height: var(--h-sm); font-variant-numeric: tabular-nums; }
/* date range: the calendar on the left, the quick choices on the right */
@media (min-width: 761px) { .rp-presets { border-right: 0; border-left: 1px solid var(--border); } }
/* the picker lives inside .swatches, whose rule hides radio inputs: undo that for its own controls */
.swatches .cp input { position: static; opacity: 1; width: 100%; height: 14px; }
.swatches .cp input.cp-hex { height: var(--h-sm); }
/* the count inside a chosen chip keeps the chip's own text colour */
.chip[aria-pressed="true"] .muted, .chip[aria-pressed="true"] .count { color: inherit; opacity: 0.75; }

/* combobox: a text box with narrowing suggestions */
lk-combobox { display: block; }
.cb { position: relative; }
.cb-input { padding-right: 34px; }
.cb-input.has-lead { padding-left: 38px; }
.cb-lead { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: inline-flex; pointer-events: none; }
.cb-chev { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; display: inline-flex; }
.cb-list { position: fixed; z-index: 100; max-height: 260px; overflow-y: auto; padding: var(--space-1); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.cb-opt { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-2); border-radius: var(--radius); cursor: pointer; font-size: var(--fs-base); }
.cb-opt.on { background: var(--accent-bg); }
.cb-opt[aria-selected="true"] { font-weight: var(--fw-semibold); }

/* journeys: one lightness and chroma for every hue (light and dark) */
:root { --j-l: 0.68; --j-c: 0.15; }
:root[data-theme="dark"] { --j-l: 0.76; --j-c: 0.14; }
.howto h3 { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.howto p { margin: 0; } .howto { padding: var(--space-1) var(--space-5) var(--space-5); max-height: min(70vh, 640px); overflow-y: auto; }

/* ---- motion ---- */
/* sliding highlight (see slide.js): the container's ::before glides to the current item */
[data-slide]:not(.panel) { position: relative; }
@media (min-width: 900px) { .panel[data-slide] { position: relative; } } /* on phones the panel stays sticky: the highlight is off there */
[data-slide]::before {
  content: ""; position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; opacity: 0;
  width: var(--sw, 0); height: var(--sh, 0); transform: translate(var(--sx, 0), var(--sy, 0));
  border-radius: var(--slide-r, 8px); background: var(--slide-bg, var(--hover)); box-shadow: var(--slide-shadow, none);
}
[data-slide][data-slide-ready]::before { opacity: 1; }
[data-slide][data-slide-anim]::before { transition: transform 0.3s cubic-bezier(0.3, 0.8, 0.25, 1), width 0.3s cubic-bezier(0.3, 0.8, 0.25, 1), height 0.3s cubic-bezier(0.3, 0.8, 0.25, 1); }
[data-slide] :is(a, button) { position: relative; z-index: 1; }
[data-slide][data-slide-ready] [aria-current="page"], [data-slide][data-slide-ready] [aria-pressed="true"] { background: transparent !important; box-shadow: none !important; }
.mini-tabs { display: inline-flex; gap: var(--space-0); background: color-mix(in oklab, var(--text) 4%, var(--surface)); max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: var(--space-1); border-radius: var(--radius); --slide-bg: var(--surface); --slide-shadow: var(--shadow); --slide-r: 7px; }
.rail-nav { --slide-bg: var(--accent-bg); --slide-r: var(--radius); }
.panel { --slide-bg: var(--accent-bg); --slide-r: var(--radius); }
@media (min-width: 900px) {
  .rail-nav { --slide-bg: var(--surface); --slide-shadow: var(--shadow); --slide-r: 999px; }
  .panel { --slide-bg: color-mix(in oklab, var(--text) 6%, transparent); }
}
@media (max-width: 899px) { .panel[data-slide]::before { display: none; } .panel[data-slide][data-slide-ready] [aria-current="page"] { background: color-mix(in oklab, var(--text) 6%, transparent) !important; } }
/* a menu item answers a press */
.nav a, .rail-btn, .mini-tabs button, .step-tabs button { transition: transform 0.12s ease, color 0.12s, background 0.12s; }
.nav a:active, .rail-btn:active, .mini-tabs button:active, .step-tabs button:active { transform: scale(0.96); }
@media (prefers-reduced-motion: reduce) {
  [data-slide]::before { transition: none !important; }
  .nav a:active, .rail-btn:active, .mini-tabs button:active, .step-tabs button:active { transform: none; }
}

/* the breakdown bars grow in; the card search slides open; journeys fade in */
.bd-row::before { animation: bd-grow 0.7s cubic-bezier(0.2, 0.75, 0.25, 1) both; }
@keyframes bd-grow { from { width: 0; } }
.bd-search-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.26s cubic-bezier(0.3, 0.8, 0.25, 1); }
.bd-search-wrap.open { grid-template-rows: 1fr; }
.bd-search-wrap > div { overflow: hidden; min-height: 0; }
.bd-search-wrap .bd-search { margin: var(--space-1) var(--space-0) var(--space-3); width: calc(100% - 6px); }
.journey svg { animation: jfade 0.6s ease both; }
@keyframes jfade { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .bd-row::before, .journey svg { animation: none; } .bd-search-wrap { transition: none; } }

/* the same glide for the radio-style theme switch */
.segmented { --slide-bg: var(--surface); --slide-shadow: var(--shadow); --slide-r: 999px; }
[data-slide] label { position: relative; z-index: 1; }
[data-slide][data-slide-ready] input:checked + label { background: transparent !important; box-shadow: none !important; }

/* funnels: the list on the left (a quarter), the chosen funnel on the right */
.funnels-layout { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(0, 3fr); gap: var(--space-4); align-items: start; }
.funnel-list { padding: var(--space-2); display: grid; gap: var(--space-0); --slide-bg: var(--accent-bg); --slide-r: var(--radius); }
.fl-item { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 1px; padding: var(--space-2) var(--space-3); border-radius: var(--radius); }
.fl-item:hover { background: var(--hover); }
.fl-item:focus-visible { box-shadow: var(--focus); }
.fl-item[aria-pressed="true"] { background: var(--accent-bg); }
.fl-name { display: flex; align-items: center; gap: var(--space-2); font-weight: var(--fw-semibold); min-width: 0; overflow-wrap: anywhere; }
.fl-name .ti { color: var(--text-dim); flex-shrink: 0; }
.fl-meta { font-size: var(--fs-sm); color: var(--text-dim); padding-left: var(--space-5); }
@media (max-width: 800px) { .funnels-layout { grid-template-columns: 1fr; } .funnel-list { grid-auto-flow: column; overflow-x: auto; } .fl-item { white-space: nowrap; } }

/* the front page: every website as a card */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.home-card { background: var(--surface); text-align: left; min-height: 150px; padding: var(--space-4); gap: var(--space-2); box-shadow: var(--shadow); }
.home-card .ss-name { font-size: var(--fs-lg); }
.who-cell { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }

/* cohort retention matrix: the share that came back sets the strength of the accent behind the number */
table.cohorts { border-collapse: separate; border-spacing: 3px; }
table.cohorts th, table.cohorts td { padding: var(--space-2) var(--space-2); font-weight: var(--fw-regular); }
table.cohorts thead th { font-size: var(--fs-md); color: var(--text-dim); white-space: nowrap; }
table.cohorts tbody th { text-align: left; white-space: nowrap; font-weight: var(--fw-medium); }
table.cohorts td.cell { border-radius: var(--radius-xs); min-width: 56px; text-align: center; font-variant-numeric: tabular-nums;
  background: color-mix(in oklab, var(--accent) calc(var(--p) * 0.45%), var(--surface)); }
table.cohorts td.cell.none { background: none; }
.stack > lk-card { min-width: 0; max-width: 100%; }

/* removable chips (blocked countries) */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 0; padding: 0; }
.cc-chip { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-0) var(--space-1) var(--space-0) var(--space-2); border-radius: var(--radius-pill); background: var(--hover); font-size: var(--fs-md); }
.chip-x { all: unset; box-sizing: border-box; cursor: pointer; display: grid; place-items: center; width: var(--h-xs); height: var(--h-xs); border-radius: 50%; color: var(--text-dim); }
.chip-x:hover { background: var(--border); color: var(--text); }
.chip-x:focus-visible { box-shadow: var(--focus); }
.danger-rows { display: grid; gap: var(--space-4); margin-top: var(--space-1); }
.danger-rows .set-row + .set-row { padding-top: var(--space-4); border-top: 1px solid var(--border); }

/* ---------- chart palette: nine bright OKLCH colours for ranked lists (lighter in the dark theme) + tooltip colours ---------- */
:root {
  /* one categorical palette: nine hues and grey. Charts draw them bright (--c1…--c9, --c-other), tags as a pastel fill with a darker core */
  --h-violet: 285; --h-blue: 245; --h-sky: 215; --h-teal: 175; --h-green: 140; --h-amber: 98; --h-orange: 65; --h-red: 22; --h-pink: 355;
  --c1: oklch(0.7 0.14 var(--h-violet)); --c2: oklch(0.72 0.12 var(--h-blue)); --c3: oklch(0.76 0.13 var(--h-sky)); --c4: oklch(0.74 0.14 var(--h-teal)); --c5: oklch(0.77 0.16 var(--h-green));
  --c6: oklch(0.8 0.16 var(--h-amber)); --c7: oklch(0.76 0.16 var(--h-orange)); --c8: oklch(0.72 0.16 var(--h-red)); --c9: oklch(0.73 0.16 var(--h-pink));
  --c-other: oklch(0.82 0.008 285);
  --tip-bg: var(--text); --tip-fg: var(--surface); --tip-border: transparent;
}
:root[data-theme="dark"] {
  --c1: oklch(0.79 0.12 var(--h-violet)); --c2: oklch(0.79 0.11 var(--h-blue)); --c3: oklch(0.82 0.14 var(--h-sky)); --c4: oklch(0.8 0.15 var(--h-teal)); --c5: oklch(0.82 0.16 var(--h-green));
  --c6: oklch(0.8 0.16 var(--h-amber)); --c7: oklch(0.78 0.16 var(--h-orange)); --c8: oklch(0.75 0.15 var(--h-red)); --c9: oklch(0.77 0.15 var(--h-pink));
  --c-other: oklch(0.45 0.01 285);
  --tip-bg: oklch(0.3 0.008 285); --tip-fg: var(--text); --tip-border: oklch(0.42 0.01 285);
}

/* the filled bar above a ranked list */
.seg-bar { display: flex; gap: var(--space-0); height: 14px; margin: var(--space-0) 0 var(--space-3); border-radius: var(--radius-sm); overflow: hidden; }
.seg { min-width: 3px; background: var(--sc); transform-origin: left; animation: seg-in 0.6s cubic-bezier(0.2, 0.75, 0.25, 1) both; transition: opacity 0.15s, filter 0.15s; }
.seg:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); } .seg:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.seg.dim, .arc.dim { opacity: 0.35; }
@keyframes seg-in { from { transform: scaleX(0); opacity: 0; } }

/* the donut */
.donut { position: relative; width: 168px; max-width: 100%; aspect-ratio: 1; flex: none; container-type: inline-size; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.arc { fill: none; stroke-width: 15; transition: opacity 0.15s, stroke-width 0.15s; animation: donut-in 0.7s cubic-bezier(0.2, 0.75, 0.25, 1) both; }
.arc.on { stroke-width: 18; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; font-size: clamp(12px, 4.2cqw, 15px); line-height: 1.25; color: var(--text-dim); padding: 0 22%; }
.donut-center strong { display: block; font-size: clamp(20px, 11cqw, 34px); color: var(--text); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
@keyframes donut-in { from { opacity: 0; stroke-width: 6; } }

/* ranked list rows: a colour dot first, the row's wash takes the colour of its slice */
.bd-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rc, var(--c-other)); flex: none; }
button.bd-row:hover::before { background: color-mix(in oklab, var(--accent) 17%, var(--surface)); opacity: 1; }
:root[data-theme="dark"] button.bd-row:hover::before { background: color-mix(in oklab, var(--accent) 22%, var(--surface)); }
/* while a row and its slice are linked (hovering either), the row's wash takes the slice's colour */
.bd-row.hl::before, button.bd-row.hl:hover::before { background: color-mix(in oklab, var(--rc) 22%, var(--surface)); opacity: 1; }
:root[data-theme="dark"] .bd-row.hl::before, :root[data-theme="dark"] button.bd-row.hl:hover::before { background: color-mix(in oklab, var(--rc) 30%, var(--surface)); }

/* a long list shows ten values; "Show more" opens all of them in a scrolling area */
.bd-pager { display: flex; align-items: center; justify-content: center; gap: var(--space-3); margin-top: var(--space-3); font-size: var(--fs-md); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.bd-pager .icon-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }
/* every ranked card is the same height whatever its tab holds: ten rows, the pager's room and a description line; a donut above the list adds its own room */
.bd-body { min-height: calc(var(--bd-rows, 10) * 41.6px); align-content: start; }
.bd-body.bd-stack { min-height: calc(var(--bd-rows, 10) * 41.6px + 160px); } /* the donut (168px), the gap and ten rows */
.bd-sub { font-size: var(--fs-md); margin-left: var(--space-2); }
.bd-pager.ghost { visibility: hidden; }
.bd-variant.ghost { visibility: hidden; }
.bd-body .bd-empty { min-height: calc(var(--bd-rows, 10) * 41.6px - 28px); }
.bd-list { min-width: 0; }
/* a tab that fits its list to the card: the wrapper takes the free height, and the list inside is out of the flow so it never makes the card taller */
.bd-fit { flex: 1; min-height: calc(5 * 41.6px); position: relative; }
.bd-fit.bd-stack { min-height: calc(5 * 41.6px + 160px); }
.bd-fit.bd-side { min-height: 330px; }
.bd-fit > .bd-body { position: absolute; inset: 0; min-height: 0; overflow: hidden; }
.bd-body.bd-side { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--space-6); align-items: center; }
.bd-body.bd-side > .donut { width: 100%; justify-self: center; }
.bd-body.bd-stack { display: grid; justify-items: center; gap: var(--space-4); }
.bd-body.bd-stack > .bd-list { justify-self: stretch; width: 100%; }
@media (max-width: 700px) { .bd-body.bd-side { grid-template-columns: 1fr; justify-items: center; } .bd-body.bd-side > .donut { width: min(100%, 320px); } .bd-body.bd-side > .bd-list { justify-self: stretch; width: 100%; } }
/* the tooltip over the bar and the donut */
.chart-tip { position: fixed; z-index: 60; transform: translate(-50%, calc(-100% - 14px)); pointer-events: none; white-space: nowrap; padding: var(--space-2) var(--space-3); border-radius: 9px; font-size: var(--fs-md); line-height: 1.45;
  background: var(--tip-bg); color: var(--tip-fg); border: 1px solid var(--tip-border); box-shadow: var(--shadow-lg); }
.chart-tip .tip-name { display: flex; align-items: center; gap: var(--space-2); font-weight: var(--fw-semibold); }
.chart-tip .tip-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chart-tip .tip-n { opacity: 0.85; padding-left: var(--space-4); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .seg, .arc { animation: none; } }

/* arrange dialog: a miniature of the page */
.arr-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-2); }
.arr-block { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-2) var(--space-4) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: grab; min-width: 0; box-shadow: var(--shadow); transition: border-color 0.15s; }
.arr-block:hover { border-color: var(--accent-border); }
.arr-block.lifted { opacity: 0.4; }
.arr-name { font-weight: var(--fw-semibold); font-size: var(--fs-base); flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arr-moves { display: inline-flex; flex: none; }
.arr-moves .icon-btn { width: 20px; padding: 0; }
/* the width control: four little pictures of a width (a third, a half, two thirds, full), as a tab bar */
.arr-seg { flex: none; padding: var(--space-0); border-radius: var(--radius-sm); --slide-bg: var(--surface); --slide-shadow: var(--shadow); --slide-r: 6px; }
.arr-seg button { padding: var(--space-1) var(--space-1); border-radius: var(--radius-xs); display: grid; place-items: center; }
.bd-variant { display: flex; justify-content: flex-end; margin-bottom: var(--space-2); }
.bd-variant select { width: auto; min-width: 150px; height: 32px; padding-block: 0; font-size: var(--fs-md); cursor: pointer; }

/* a tab bar that dropped onto its own row spans the card; its tabs share the width and tighten up to fit */
lk-card[wrapped] .mini-tabs { gap: 1px; padding: var(--space-0); }
lk-card[wrapped] .mini-tabs button { flex: 1 1 0; min-width: 0; text-align: center; padding: var(--space-1) var(--space-0); letter-spacing: -0.01em; white-space: nowrap; }

.stack > .map-row { margin-top: 0; }

/* a website's own icon, with the globe standing in until (and unless) it loads */
.site-ico { position: relative; width: 20px; height: 20px; display: inline-grid; place-items: center; flex: none; }
.site-ico img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--radius-xs); object-fit: contain; opacity: 0; }
.site-ico.ok img { opacity: 1; }
.site-ico.ok .site-ico-fb { visibility: hidden; }
.sites-nav .fl-meta { padding-left: var(--space-5); }

/* the website's name with its icon, and a quiet link to its dashboard */
.site-head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.site-head .site-ico { width: 24px; height: 24px; }
.site-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.quiet-link { display: inline-flex; align-items: center; gap: var(--space-2); margin-left: var(--space-1); font-size: var(--fs-md); color: var(--text-dim); text-decoration: none; border-radius: var(--radius-xs); padding: var(--space-0) var(--space-1); }
.quiet-link:hover { color: var(--text); text-decoration: underline; }
.quiet-link:focus-visible { box-shadow: var(--focus); outline: none; }
.site-head + .stack-sm { margin-top: var(--space-3); }

/* tabs that have to squeeze to stay beside the title: tighter first, then smaller */
lk-card[compact] .mini-tabs { gap: 1px; padding: var(--space-0); }
lk-card[compact] .mini-tabs button { padding: var(--space-1) var(--space-2); letter-spacing: -0.01em; }
lk-card[tight] .mini-tabs { gap: 0; padding: var(--space-0); }
lk-card[tight] .mini-tabs button { padding: var(--space-1) var(--space-1); font-size: var(--fs-xs); letter-spacing: -0.015em; }

/* the Search Console guide */
.btn-link { display: inline-flex; align-items: center; gap: var(--space-1); font-weight: var(--fw-semibold); color: var(--accent-strong, var(--text)); text-decoration: underline; text-underline-offset: 3px; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-2); flex-wrap: wrap; }
.guide-dot { all: unset; box-sizing: border-box; cursor: pointer; width: var(--h-sm); height: var(--h-sm); border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-dim); background: var(--hover); transition: background 0.15s, color 0.15s; }
.guide-dot:hover { background: var(--border); }
.guide-dot.on { background: var(--accent); color: var(--accent-text); }
.guide-dot.done { background: var(--accent-bg); color: var(--text); }
.guide-dot:focus-visible { box-shadow: var(--focus); }
.guide-title { margin: var(--space-0) 0 0; font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -0.015em; }
.guide-list { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-2); line-height: 1.6; }
.guide-list li::marker { color: var(--text-dim); font-weight: var(--fw-semibold); }
.guide .status-line { font-weight: 450; align-items: flex-start; font-size: var(--fs-base); line-height: 1.55; }
.guide .status-line .ti { flex: none; margin-top: var(--space-0); }
.guide .status-line.warn { background: var(--red-bg); color: var(--text); }

/* iPad in portrait and other mid-size windows: the five headline numbers stay in one row, and the date pickers shed their dates */
@media (min-width: 900px) and (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: var(--space-2); }
  .kpi { padding: var(--space-2) var(--space-3) var(--space-3); }
  .kpi .label { font-size: var(--fs-xs); gap: var(--space-1); }
  .kpi .label .ti { width: 13px; height: 13px; }
  .kpi .value { font-size: var(--fs-xl); }
  .kpi .delta { font-size: var(--fs-xs); padding: 0 var(--space-1) 0 var(--space-0); }
  .kpi .muted.small, .kpi .muted { font-size: var(--fs-xs); }
  .rp-trigger { height: var(--h-sm); padding: 0 var(--space-3); gap: var(--space-2); font-size: var(--fs-md); }
  .rp-trigger .rp-dates { display: none; }
  .vs { font-size: var(--fs-sm); }
}

/* phones: the fifth headline number takes the whole row instead of sitting alone, and picker buttons keep to one line */
@media (max-width: 520px) {
  .kpis > :last-child:nth-child(odd) { grid-column: span 2; }
  .rp-trigger { white-space: nowrap; max-width: 100%; }
  .rp-trigger .rp-dates { display: none; }
}

/* iPad portrait, again: the link analytics numbers fit in one row, and the date picker opens as a column (presets on top, two months below) so it stays inside the page */
@media (min-width: 900px) and (max-width: 1180px) {
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: var(--space-2); }
  .stat-card { padding: var(--space-2) var(--space-3) var(--space-3); }
  .stat-card .stat-label { font-size: var(--fs-xs); }
  .stat-card .stat-value { font-size: var(--fs-xl); }
  .stat-card .stat-sub { font-size: var(--fs-xs); }
}
@media (max-width: 1180px) {
  .rp-panel { flex-direction: column; }
  .rp-presets { order: -1; border-right: 0; border-left: 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; max-height: none; min-width: 0; }
  .rp-presets li { flex: 0 0 auto; }
  .rp-presets button { white-space: nowrap; }
}
@media (min-width: 900px) { .content:has(.rp-panel) { z-index: 40; } } /* a calendar that is open sits above the sidebar, not under it */
.arr-grip { touch-action: none; cursor: grab; color: var(--text-faint); display: grid; place-items: center; width: 28px; height: 28px; margin-left: -6px; border-radius: var(--radius-xs); flex: none; } .arr-grip:active { cursor: grabbing; background: var(--hover); }

/* domain picker (Links panel) */
.dp-panel { width: min(340px, calc(100vw - 32px)); }
.dp-list { display: flex; flex-direction: column; gap: var(--space-1); }
.dp-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-2); border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.dp-row:hover { background: var(--accent-bg); }
.dp-row.on { border-color: var(--border); background: color-mix(in oklab, var(--text) 4%, var(--surface)); }
.dp-row:focus-visible { outline: none; box-shadow: var(--focus); }

/* settings: domains */
.dom-layout { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: var(--space-5); align-items: start; }
.dom-list { display: flex; flex-direction: column; gap: var(--space-1); }
.dom-item { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-0); padding: var(--space-2) var(--space-3); border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.dom-item:hover { background: var(--accent-bg); }
.dom-item[aria-selected="true"] { border-color: var(--border); background: color-mix(in oklab, var(--text) 4%, var(--surface)); }
.dom-item:focus-visible { outline: none; box-shadow: var(--focus); }
.dom-item .ss-name { max-width: 100%; }
.dom-detail { min-width: 0; padding-left: var(--space-5); border-left: 1px solid var(--border); }
.dom-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.dom-title { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.dom-title h3 { margin: 0; font-size: var(--fs-xl); overflow-wrap: anywhere; }
.steps { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-2); }
.verify { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); min-width: 0; }
.vrow { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--fs-base); min-width: 0; }
.vrow > span { min-width: 0; overflow-wrap: anywhere; }
.vrow svg { flex: none; margin-top: var(--space-0); }
.vrow.ok svg { color: oklch(0.48 0.13 150); }
.vrow.bad svg { color: oklch(0.5 0.19 25); }
:root[data-theme="dark"] .vrow.ok svg { color: oklch(0.8 0.15 150); }
:root[data-theme="dark"] .vrow.bad svg { color: oklch(0.78 0.15 25); }
@media (max-width: 760px) {
  .dom-layout { grid-template-columns: 1fr; }
  .dom-detail { padding-left: 0; border-left: 0; padding-top: var(--space-4); border-top: 1px solid var(--border); }
}

/* with several domains the keyword field starts with a domain dropdown, so the create row stays one line: address, domain / keyword, title, button */
.kw-combo { display: flex; align-items: center; height: 38px; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.kw-combo:hover { border-color: var(--accent-border); }
.kw-combo:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.kw-combo > span { color: var(--text-dim); }
.kw-combo select { all: unset; box-sizing: border-box; cursor: pointer; padding: 0 var(--space-1) 0 var(--space-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-semibold); }
.kw-combo input { all: unset; box-sizing: border-box; flex: 1; min-width: 0; padding: 0 var(--space-3) 0 var(--space-1); height: 100%; }
.kw-combo input::placeholder { color: var(--text-dim); }
.dom-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.dom-icon .lead-img { margin: 0; }

/* Websites and Links settings share one look: a single block, the list on the left and the selected item on the right */
.one-block { padding: var(--space-4) var(--space-5) var(--space-5); }
.one-block .dom-layout { grid-template-columns: minmax(180px, 250px) minmax(0, 1fr); }
.one-block .funnel-list { padding: 0; }
.one-block .dom-detail { padding-left: var(--space-5); }
.one-block .dom-detail.flush { padding-left: 0; }
.one-block lk-card { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.one-block .dom-detail > lk-card + lk-card { border-top: 1px solid var(--border); }
@media (max-width: 760px) { .one-block .dom-layout { grid-template-columns: 1fr; } .one-block .dom-detail { padding-left: 0; } .one-block .funnel-list { grid-auto-flow: column; overflow-x: auto; } }
.dom-side { display: grid; gap: var(--space-3); align-content: start; min-width: 0; }
.side-add { display: block; }
@media (max-width: 760px) { .dom-side { gap: var(--space-2); } }

/* a ranked card with nothing to rank: the message sits left-aligned in the middle of the card, with a link to fix it */
.bd-empty { flex: 1; min-height: 200px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: var(--space-2); }
.bd-empty p { margin: 0; max-width: 42ch; }
.bd-empty a { display: inline-flex; align-items: center; gap: var(--space-1); font-weight: var(--fw-semibold); color: var(--accent); }

/* Add domain: three short steps */
.how { display: grid; gap: var(--space-4); }
.how-step { display: grid; grid-template-columns: 28px 1fr; gap: var(--space-3); align-items: start; }
.how-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); font-weight: var(--fw-semibold); font-size: var(--fs-md); }
.how-body { display: grid; gap: var(--space-2); min-width: 0; }
.dns { display: grid; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: var(--space-0); }
.dns > div { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-2); align-items: center; padding: var(--space-2) var(--space-3); }
.dns > div + div { border-top: 1px solid var(--border); }
.dns-head { background: color-mix(in oklab, var(--text) 4%, var(--surface)); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); font-weight: var(--fw-semibold); }
.dns-val { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.how-tip { display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-2) var(--space-2); border-radius: var(--radius); background: var(--accent-bg); font-size: var(--fs-md); }
.how-tip svg { flex: none; margin-top: var(--space-0); color: var(--accent); }
.dns code { font-size: var(--fs-md); overflow-wrap: anywhere; justify-self: start; }

/* advanced options of a link: tight rows, UTM grouped in a box */
.adv-grid { display: grid; gap: var(--space-3); }
.adv-grid .input { height: var(--h-sm); font-size: var(--fs-base); }
.adv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1.5fr); gap: var(--space-3); align-items: start; }
.utm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-2) var(--space-2); }
.adv-opts .hint { margin-left: var(--space-5); }
@media (max-width: 720px) { .adv-row { grid-template-columns: 1fr 1fr; } .adv-row > :last-child { grid-column: 1 / -1; } .adv-opts { grid-template-columns: 1fr; } }

/* the date and time fields */
.dt { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.dt-date.empty { color: var(--text-dim); }
.dt-date span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-time { width: 68px; flex: none; text-align: center; font-variant-numeric: tabular-nums; padding: 0 var(--space-1); }
.dt-pop { position: fixed; z-index: 80; width: 280px; padding: var(--space-3); }
.dt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.dt-head strong { font-size: var(--fs-base); }
.dt-week, .dt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-0); text-align: center; }
.dt-week span { font-size: var(--fs-xs); color: var(--text-dim); padding: var(--space-1) 0; }
.dt-day { height: 32px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; font-size: var(--fs-md); cursor: pointer; }
.dt-day:hover:not(:disabled) { background: var(--accent-bg); }
.dt-day:disabled { color: var(--text-faint, var(--text-dim)); opacity: 0.4; cursor: default; }
.dt-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.dt-day[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.dt-day:focus-visible { outline: none; box-shadow: var(--focus); }
.dt-foot { display: flex; justify-content: space-between; margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }

/* the domain dropdown in the create row: a subtle arrow says it can be changed */
.kw-sel { position: relative; display: inline-flex; align-items: center; min-width: 0; max-width: 58%; }
.kw-sel select { max-width: 100%; }
.kw-sel .ti { position: absolute; right: 4px; width: 14px; height: 14px; color: var(--text-dim); pointer-events: none; }
.kw-combo:hover .kw-sel .ti, .kw-combo:focus-within .kw-sel .ti { color: var(--text); }

/* manage tags: one tidy line per tag, the colour in a small menu, the link count underneath */
.tag-count:hover { text-decoration: underline; }
.tag-count.none { color: var(--text-dim); cursor: default; }

/* a little more air in the advanced options, and the tag buttons beside the title */
.adv-grid { gap: var(--space-4); }
.adv-grid .field { gap: var(--space-1); align-content: start; }
.tag-new { height: 24px; padding: 0 var(--space-2); border: 1px solid var(--accent); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-md); outline: none; box-shadow: var(--focus); width: 190px; }

/* three areas (Tags, Access, UTM tags) with room around them */
.adv-grid { gap: var(--space-5); }
.tag-pick { display: flex; flex-wrap: wrap; margin-top: 0; gap: var(--space-2); }
.utm-grid, .adv-row { gap: var(--space-4) var(--space-4); }

/* advanced options, final: plain titled sections instead of boxes */
.adv-grid { gap: var(--space-4); }
details.adv > .adv-grid { border-top: 1px dashed var(--border-strong); margin-top: var(--space-3); padding-top: var(--space-4); }
.adv-title { display: flex; align-items: baseline; gap: var(--space-2); }
.adv-sec .utm-grid, .adv-sec .adv-row { gap: var(--space-2) var(--space-4); }
.adv-sec .preview { margin-top: var(--space-0); }

/* advanced options: clear titles over field labels */
.adv-title { align-items: center; gap: var(--space-3); min-height: 30px; }
.adv-title h4 { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.adv-grid .check, .adv-grid .check span { color: var(--text); font-size: var(--fs-base); font-weight: var(--fw-medium); }
.tag-pick input.tag-new { position: static; opacity: 1; width: 190px; height: 24px; }
.dt-date { display: inline-flex; gap: var(--space-2); width: auto; flex: 1 1 auto; min-width: 0; text-align: left; cursor: pointer; padding: 0 var(--space-3); align-items: center; line-height: 1; }
.dt-date .ti { width: 15px; height: 15px; flex: none; margin: 0; vertical-align: middle; }

/* Manage: a compact pill beside the Tags title; more air between the areas */
.adv-title { min-height: 24px; }
.adv-grid { gap: 28px; }
.adv-sec { display: grid; min-width: 0; gap: var(--space-2); }
.adv-opts { display: grid; grid-template-columns: 1fr 1fr; padding-top: var(--space-1); gap: var(--space-4) var(--space-5); }
.adv-opts .field { gap: var(--space-2); }

.tag-count { display: inline-flex; align-items: center; gap: var(--space-1); padding: 0; border: 0; background: none; font: inherit; font-size: var(--fs-md); color: var(--accent); cursor: pointer; justify-self: start; padding-left: var(--space-2); }
.tag-count lk-button { display: inline-block; }
.site-foot a:focus-visible, .site-foot .foot-link:focus-visible { box-shadow: var(--focus); border-radius: var(--radius-xs); }

/* one look for everything that floats (menus, calendars, pickers); each component only sets its size and position */
.rp-panel, .ss-panel, .dt-pop { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

/* roles of small text: overline (uppercase), label (above a field), meta (secondary line) */
.section-label, .nav-label { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); }
.hint, .stat-card .stat-label, .kpi .label { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--text-dim); }

/* empty states: centred text on the block they belong to */
.empty.sm { padding: var(--space-5) var(--space-4); }
.bd-empty { flex: 1; min-height: 200px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: var(--space-2); color: var(--text-dim); }
.empty p, .bd-empty p { margin: 0; max-width: 42ch; }

.dt-time-wrap { position: relative; flex: none; display: inline-flex; align-items: center; }
.dt-time-wrap .ti { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--text-dim); pointer-events: none; }
.dt-time-wrap .dt-time { width: 84px; padding: 0 var(--space-2) 0 var(--space-6); text-align: left; }

/* controls that reset everything (all: unset) must still measure their border: same height as the buttons beside them */
.live-pill, .share-btn, .rp-trigger, .ss-trigger { box-sizing: border-box; height: var(--h-ctl); }

/* filter dialog: several values per field (a tick box in front of each) */
.fd-opt { justify-content: flex-start; }
.fd-opt .bd-label { flex: 1; min-width: 0; }
.fd-check { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--border-strong); border-radius: var(--radius-xs); background: var(--surface); color: var(--accent-text); }
.fd-opt.on .fd-check { background: var(--accent); border-color: var(--accent); }
.fd-check .ti { width: 13px; height: 13px; }
.fd-dot:not(:empty) { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 var(--space-1); border-radius: var(--radius-pill); color: var(--accent-text); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }

.px-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); align-items: start; }
.adv-sec textarea.input { height: auto; padding: var(--space-2) var(--space-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-md); resize: vertical; }
.adv-sec .check.top { align-items: flex-start; }
@media (max-width: 720px) { .px-row { grid-template-columns: 1fr; } }
.adv-grid .check .hint, .adv-grid .check span.hint { color: var(--text-dim); font-size: var(--fs-sm); font-weight: var(--fw-regular); }
.px-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4) var(--space-5); align-items: start; }
@media (max-width: 720px) { .px-two { grid-template-columns: 1fr; } }

/* panels in the top layer: no UA centring, our own top/left */
.ss-panel[popover], .dt-pop[popover] { inset: auto; margin: 0; color: var(--text); }
.ss-panel[popover]:not(:popover-open), .dt-pop[popover]:not(:popover-open) { display: none; }

/* ---------- podcasts ---------- */
.pod-group { padding-top: var(--space-4); border-top: 1px solid var(--border); }
.pod-group:first-of-type { padding-top: 0; border-top: 0; }
.pod-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.pod-table th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); font-weight: var(--fw-semibold); padding: var(--space-2) var(--space-3) var(--space-2) 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pod-table td { padding: var(--space-2) var(--space-3) var(--space-2) 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pod-table tbody tr:last-child td { border-bottom: 0; }
.pod-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pod-table td:last-child, .pod-table th:last-child { padding-right: 0; }
.pod-actions { white-space: nowrap; text-align: right; }
.pod-url { max-width: 320px; overflow-wrap: anywhere; }
.pod-url code { font-size: var(--fs-sm); }
.pod-preview { max-height: 50vh; overflow: auto; }
.pod-apps input.input { min-width: 120px; }
.pod-apps td { vertical-align: top; }
.pod-apps lk-badge { margin-top: 6px; }
/* podcast settings: options with a switch on the left, action bars, and toolbars */
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 36px; height: 20px; margin: 0; border-radius: 999px; background: color-mix(in oklab, var(--text) 24%, transparent); cursor: pointer; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform 0.15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: none; box-shadow: var(--focus); }
.switch:disabled { opacity: 0.5; cursor: default; }
.pod-mode { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-2); }
.pod-mode-card { position: relative; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.pod-mode-card:hover { border-color: color-mix(in oklab, var(--text) 30%, var(--border)); }
.pod-mode-card.on { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 1px var(--accent); }
.pod-mode-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pod-mode-card:has(input:focus-visible) { box-shadow: var(--focus); }
.pod-mode-ic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--radius); background: var(--hover); color: var(--text-dim); }
.pod-mode-card.on .pod-mode-ic { background: var(--accent); color: var(--accent-text); }
.pod-mode-t { display: grid; gap: 2px; min-width: 0; }
.pod-panel { display: grid; gap: var(--space-3); padding-top: var(--space-2); }
.pod-panel > p { margin: 0; }
@media (max-width: 639px) { .pod-mode { grid-template-columns: 1fr; } }
.pod-opts { display: grid; margin-top: var(--space-2); }
.pod-opt { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--space-4); align-items: start; padding: var(--space-5) 0; border-top: 1px solid var(--border); }
.pod-opts > .pod-opt:first-child, .pod-group > .pod-opt:first-of-type { border-top: 0; }
.pod-opt > .switch { margin-top: 2px; }
.pod-opt.flush { border-top: 0; padding: var(--space-2) 0 0; }
.pod-serve { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-4); align-items: start; padding: var(--space-4); border: 1px solid var(--accent-border); border-radius: var(--radius-lg); background: var(--accent-bg); }
.pod-serve-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); background: var(--accent); color: var(--accent-text); }
.pod-serve .field { min-width: 0; }
.pod-serve label { font-weight: var(--fw-semibold); }
.pod-lead { display: grid; place-items: center; width: 36px; height: 20px; color: var(--text-dim); }
.pod-opt-body { display: grid; gap: 2px; min-width: 0; }
.pod-opt-body h3 { display: flex; align-items: center; gap: var(--space-1); margin: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.pod-opt-body p { margin: 0; }
.pod-opt-body > .pod-copy, .pod-opt-body > .kv, .pod-opt-body > .alert { margin-top: var(--space-1); }
.pod-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.pod-bar > .row { gap: var(--space-2); }
.pod-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }
.pod-tools { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }
.pod-tools .input { width: 200px; max-width: 100%; height: 32px; }
.pod-tools select.input { width: auto; padding-right: var(--space-6); }
.pod-eps .pod-toolbar { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.pod-copy { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-2) var(--space-3); background: var(--hover); border-radius: var(--radius); }
.pod-copy code { flex: 1 1 240px; overflow-wrap: anywhere; font-size: var(--fs-md); }
.pod-copy em { color: var(--text-dim); }
.ep-link { font-weight: var(--fw-semibold); text-decoration: none; color: var(--text); }
.ep-link:hover { text-decoration: underline; }
.ep-meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); align-items: center; }
.ep-meta span { display: inline-flex; align-items: center; gap: var(--space-1); }
.ep-meta .ti { width: 15px; height: 15px; }
.pod-eps .pager { padding: var(--space-3) 0 0; }
.pod-table td:first-child { min-width: 160px; }
.pod-table .num, .pod-table td.muted { white-space: nowrap; }
.pod-group .set-row { flex-wrap: nowrap; }
@media (max-width: 719px) { .pod-group .set-row { flex-wrap: wrap; } }
@media (max-width: 639px) { .pod-table .hide-sm { display: none; } }

/* Settings → Podcasts adapts to the room it has (the sidebar takes a quarter of a narrow window), not to the window */
lk-podcasts-settings { display: block; container: pods / inline-size; }
@container pods (max-width: 780px) {
  .one-block .dom-layout { grid-template-columns: 1fr; gap: var(--space-4); }
  .one-block .dom-detail { padding-left: 0; padding-top: var(--space-4); border-left: 0; border-top: 1px solid var(--border); }
  .one-block .dom-side { display: grid; gap: var(--space-2); }
  .one-block .dom-list { flex-direction: row; overflow-x: auto; padding-bottom: var(--space-1); }
  .one-block .dom-item { flex: none; min-width: 150px; }
  .pod-group .form-grid.two { grid-template-columns: 1fr; }
}
@container pods (max-width: 520px) {
  .pod-group .set-row { flex-wrap: wrap; }
  .pod-table th, .pod-table td { padding-right: var(--space-2); }
}

/* export menu of the podcast pages */
.exp-menu { position: relative; }
.exp-menu > summary { list-style: none; cursor: pointer; }
.exp-menu > summary::-webkit-details-marker { display: none; }
.exp-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px; display: grid; padding: var(--space-1); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg, 0 8px 24px oklch(0 0 0 / 0.18)); }
.exp-list a { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: var(--fs-md); }
.exp-list a:hover, .exp-list a:focus-visible { background: var(--accent-bg); outline: none; }

.share-main.container { padding-inline: clamp(16px, 3vw, 36px); }

/* the home page: Links, Pixels and Podcasts under the websites */
.home-areas { --cols: 3; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-5); }
.home-area { display: grid; align-content: start; gap: var(--space-3); padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.home-area-head { display: flex; align-items: center; gap: var(--space-2); color: var(--text); text-decoration: none; }
.home-area-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.home-area-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius); background: var(--hover); color: var(--text-dim); }
.home-area-go { margin-left: auto; color: var(--text-faint); }
.home-area-head:hover .home-area-go { color: var(--text); }
.home-area-stat { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.home-area-stat strong { font-size: var(--fs-2xl, 1.75rem); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; line-height: 1.1; }
.home-area-sub { margin: 0; }
.home-area-list { list-style: none; margin: 0; padding: 0; display: grid; }
.home-area-list li { border-top: 1px solid var(--border); }
.home-area-list a { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; color: var(--text); text-decoration: none; font-size: var(--fs-md); }
.home-area-list a:hover .home-area-name { text-decoration: underline; }
.home-area-name { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.home-area-name .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .home-areas { grid-template-columns: 1fr; } }

/* a podcast's cover, in place of the microphone */
.pod-cover { display: block; flex: none; border-radius: 5px; object-fit: cover; background: var(--hover); }
.pod-cover.sm { width: 18px; height: 18px; }
.pod-cover.md { width: 32px; height: 32px; border-radius: 8px; }
.home-area-list a > .muted { white-space: nowrap; }

/* Settings, General: the sections as four big on/off boxes */
.sec-grid { display: grid; grid-template-columns: repeat(4, 101px); gap: var(--space-3); justify-content: center; }
.sec-box { display: grid; justify-items: center; align-content: center; gap: var(--space-1); height: 101px; padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-lg); background: transparent; color: var(--text-faint); font: inherit; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.sec-box:hover:not(:disabled) { border-color: color-mix(in oklab, var(--text) 30%, var(--border)); }
.sec-box.on { background: var(--accent-bg); border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 1px var(--accent); }
.sec-box:disabled { cursor: default; }
.sec-box:focus-visible { outline: none; box-shadow: var(--focus); }
.sec-ic .ti { width: 36px; height: 36px; stroke-width: 1.6; }
.sec-name { font-weight: var(--fw-semibold); font-size: var(--fs-base); }
.sec-state { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.sec-box.on .sec-state { color: var(--accent); }
@media (max-width: 559px) { .sec-grid { grid-template-columns: repeat(2, 101px); } }
/* a whole home card is one link: the heading's link stretches over it, the rows stay clickable above it */
.home-area { position: relative; }
.home-area-head::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.home-area-list a, .home-area .lk-button, .home-area a lk-button { position: relative; z-index: 1; }
.home-area:hover { border-color: color-mix(in oklab, var(--text) 25%, var(--border)); }
