/* Terrahutton Status. Light theme follows Vault (vault.terrahutton.io),
   dark theme the terrahutton.io navy. Both share the Terrahutton orange. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --line: #e7eaef;
  --line-strong: #d9dee5;
  --text: #0b1b2c;
  --muted: #5b6878;
  --faint: #96a0ad;
  --accent: #ff6230;
  --accent-ink: #e24e1b;
  --accent-soft: #fff1ec;
  --ok: #15a34a;
  --warn: #ea6a20;
  --bad: #dc2f2f;
  --busy: #2a6fe8;
  --off: #c3cad3;
  --code: #3b4d61;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, 0.1);
  --topbar: rgba(255, 255, 255, 0.92);
  --overlay: rgba(255, 255, 255, 0.9);
  --show-light: block;
  --show-dark: none;
  --radius: 12px;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  color-scheme: light;

  /* Fixed brand colors, also used by the login page. */
  --navy: #091b2c;
  --orange: #ff6230;
  --red: #ff5a5f;
  --green: #4fd67a;
}

/* Dark mode, chosen with the toggle. Light is the default. */
:root[data-theme='dark'] {
  --bg: #091b2c;
  --surface: #0e2336;
  --surface-2: #132c43;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: #a3acb6;
  --faint: #6f7b87;
  --accent-ink: #ff7a4d;
  --accent-soft: rgba(255, 98, 48, 0.12);
  --ok: #4fd67a;
  --warn: #ff7a4d;
  --bad: #ff5a5f;
  --busy: #4da3ff;
  --off: rgba(255, 255, 255, 0.22);
  --code: #c9d6ea;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.4);
  --topbar: rgba(9, 27, 44, 0.88);
  --overlay: rgba(14, 35, 54, 0.92);
  --show-light: none;
  --show-dark: block;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}
a { color: inherit; }
code { font-family: var(--mono); font-size: 12px; color: var(--code); }

.wrap { max-width: 1400px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 1400px; margin: 16px auto 0; }

.btn {
  font: 600 13px var(--sans);
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: progress; }
:is(.btn, .icon-btn, .tab, .chip, input, select, summary, a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--topbar);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
  padding: 0 32px;
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 26px; width: auto; }
.brand-light { display: var(--show-light); }
.brand-dark { display: var(--show-dark); }
.tabs { display: flex; gap: 24px; align-self: stretch; }
.tab {
  position: relative;
  font: 500 14px var(--sans);
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected='true'] { color: var(--text); font-weight: 600; }
.tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.topbar-meta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.updated { color: var(--faint); font-size: 12px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-moon { display: var(--show-light); }
.icon-sun { display: var(--show-dark); }
.icon-btn .icon-moon { fill: currentColor; stroke: none; }
.who-am-i button {
  font: 500 13px var(--sans);
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.who-am-i button:hover { color: var(--accent-ink); }

.notice {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  box-shadow: var(--shadow);
  width: calc(100% - 64px);
}
.notice.error { border-left-color: var(--bad); color: var(--text); }

/* ---------- Page header ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 32px 0 20px;
}
.page-head h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.015em; }
.page-head .sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 8px; }
.search, #sort {
  font: 400 13px var(--sans);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
}
.search { width: 280px; max-width: 100%; }
.search::placeholder { color: var(--faint); }
#sort { cursor: pointer; }

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.stat:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.stat .num {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat .num small { font-size: 15px; color: var(--faint); font-weight: 500; }
.stat .cap { color: var(--muted); font-size: 13px; margin-top: 6px; }
.stat.ok .num .dot { background: var(--ok); align-self: center; }
.stat.bad .num { color: var(--bad); }
.stat.warn .num { color: var(--warn); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 13px var(--sans);
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed='true'] { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.chip .n { color: var(--faint); font-weight: 500; }
.chip[aria-pressed='true'] .n { color: inherit; opacity: 0.7; }
.empty { color: var(--muted); }

/* ---------- Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  align-items: stretch;
  gap: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; }
.card-head .name { color: var(--muted); font-size: 13px; font-weight: 500; text-align: right; }

/* Every logo sits in the same frame, so the space to the card edge is the same for all. */
.logo-frame {
  display: flex;
  align-items: center;
  width: 170px;
  height: 40px;
  flex: none;
}
.logo-frame img { max-width: 100%; max-height: 100%; object-fit: contain; object-position: left center; }
.logo-frame.initials {
  width: 40px;
  border-radius: 10px;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font: 600 14px var(--sans);
  color: var(--muted);
}
.logo-row { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; }

.project { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.card > .project:last-child { flex: 1; }
.card > .project:last-child .card-foot { margin-top: auto; }
.project + .project { margin-top: 12px; }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.variant { display: flex; align-items: center; gap: 8px; min-width: 0; }
.variant-name { font-weight: 600; font-size: 13px; }
.variant .repo { font: 400 12px var(--mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.variant .branch {
  flex: none;
  font: 500 11px var(--mono);
  color: var(--busy);
  background: color-mix(in srgb, var(--busy) 10%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
}
.project-top .when { flex: none; color: var(--faint); font-size: 12px; }
.open-site {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 500 12px var(--sans);
  color: var(--muted);
  text-decoration: none;
}
.open-site:hover { color: var(--accent-ink); }
.change {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }

/* Pipeline: the stages of a project, each with a colored state. */
.pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 8px;
}
.stage {
  --c: var(--off);
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
}
.stage.is-ok { --c: var(--ok); }
.stage.is-warn { --c: var(--warn); }
.stage.is-bad { --c: var(--bad); }
.stage.is-busy { --c: var(--busy); }
.stage-head { display: flex; align-items: center; gap: 6px; }
.stage-node {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent);
  flex: none;
}
.stage.is-off .stage-node { background: transparent; box-shadow: inset 0 0 0 1.5px var(--off); }
.stage.is-busy .stage-node, .stage.is-bad .stage-node { animation: stage-pulse 1.6s ease-in-out infinite; }
@keyframes stage-pulse {
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 0%, transparent); }
}
.stage-label { font: 600 10px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.stage-value { font: 600 14px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.stage.is-warn .stage-value { color: var(--warn); }
.stage.is-bad .stage-value { color: var(--bad); }
.stage.is-off .stage-value { color: var(--faint); font-weight: 500; }
.stage-value small { font: 400 11px var(--mono); color: var(--muted); }
.stage-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-meta code { font-size: 11px; color: var(--faint); }

.missing summary { list-style: none; cursor: pointer; font-size: 12px; color: var(--muted); }
.missing summary::-webkit-details-marker { display: none; }
.missing summary::before { content: '▸ '; color: var(--faint); }
.missing[open] summary::before { content: '▾ '; }
.missing summary:hover { color: var(--accent-ink); }
.missing ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.missing li { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.missing li time { color: var(--faint); font: 400 11px var(--mono); white-space: nowrap; }
.missing li.more { color: var(--faint); font-style: italic; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: 12px; }
.usage-slot:empty { display: none; }
.icon { width: 12px; height: 12px; fill: currentColor; flex: none; }
.usage {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ok) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--ok) 22%, transparent);
}
.usage-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex: none;
  color: #fff;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
}
.usage-icon .icon { width: 14px; height: 14px; }
.usage-text { display: grid; min-width: 0; line-height: 1.3; }
.usage-label { font: 600 10px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ok); }
.usage-when { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; }
.usage-place { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usage-count {
  margin-left: auto;
  flex: none;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.usage-count strong { display: block; font-size: 16px; color: var(--text); font-weight: 600; }
.usage.none { background: var(--surface-2); border-color: var(--line); color: var(--faint); font-size: 12px; }
.usage.none .usage-icon { background: var(--off); box-shadow: none; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-left: auto; }
.links a { color: var(--muted); text-decoration: none; font-weight: 500; }
.links a:hover { color: var(--accent-ink); }
.tag {
  font: 600 10px var(--sans);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 8px;
}
.badge {
  font: 600 11px var(--sans);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
  background: var(--surface-2);
}
.badge.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }

/* ---------- Activity ---------- */
.side {
  position: sticky;
  top: 84px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-title { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 8px 1fr; gap: 2px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.activity li:first-child { border-top: 0; }
.activity li .dot { margin-top: 6px; background: var(--off); }
.activity li.success .dot { background: var(--ok); }
.activity li.failed .dot { background: var(--bad); }
.activity li.building .dot { background: var(--busy); }
.activity .who { font-weight: 600; font-size: 13px; }
.activity .who span { color: var(--faint); font-weight: 500; }
.activity .what { grid-column: 2; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.activity .when { grid-column: 2; color: var(--faint); font-size: 12px; }

.footer {
  display: flex;
  justify-content: space-between;
  padding-top: 40px;
  padding-bottom: 32px;
  color: var(--faint);
  font-size: 12px;
}

/* ---------- Globe view ---------- */
.globe-view {
  position: relative;
  height: calc(100vh - 65px);
  height: calc(100dvh - 65px);
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(circle at 58% 48%, rgba(64, 132, 230, 0.22), transparent 38%),
    radial-gradient(ellipse at 80% 110%, rgba(255, 98, 48, 0.12), transparent 50%),
    radial-gradient(ellipse at 50% 50%, #0b1d33 0%, #050d18 55%, #01040a 100%);
}
.globe-stage { position: absolute; inset: 0; }
.globe-stage canvas { display: block; touch-action: none; }
.globe-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  bottom: 20px;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--overlay);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.legend { display: flex; flex-direction: column; gap: 4px; }
.legend .chip { display: flex; text-align: left; border-radius: 8px; }
.legend .chip .n { margin-left: auto; }
.site-list { overflow-y: auto; margin: 0 -8px; }
.site-item {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 2px 10px;
  width: 100%;
  padding: 8px;
  text-align: left;
  color: inherit;
  font: inherit;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.site-item:hover, .site-item.active { background: var(--surface-2); }
.site-item .dot { margin-top: 6px; }
.site-item .who { font-weight: 600; font-size: 13px; }
.site-item .where { grid-column: 2; color: var(--faint); font-size: 12px; }
.site-card {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 380px;
  max-height: calc(100% - 40px);
  overflow-y: auto;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 12px;
}
.site-card .close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.site-card .close:hover { color: var(--text); }
/* Grid items default to their content's width; let long repo names and URLs shrink instead. */
.site-card > * { min-width: 0; }
.site-card { gap: 10px; }
/* Keep the card short: the full change lists are on the Web tab. */
.site-card .missing { display: none; }
.site-card .status-label { font: 600 11px var(--sans); letter-spacing: 0.05em; text-transform: uppercase; margin: 0; }
.site-card h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; padding-right: 28px; }
.site-card .sub { color: var(--muted); font-size: 13px; margin: -6px 0 0; }
.site-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; font-size: 13px; }
.site-card dt { color: var(--faint); }
.site-card dd { margin: 0; }
.site-card .reasons { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.site-card .site-section { margin: 8px 0 0; font: 600 11px var(--sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.site-card .project { border-top: 0; padding-top: 0; }
.globe-hint { position: absolute; bottom: 52px; right: 24px; margin: 0; color: rgba(255, 255, 255, 0.45); font-size: 12px; pointer-events: none; }
.globe-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: rgba(255, 255, 255, 0.6); pointer-events: none; }
.globe-legend-key {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(1, 6, 12, 0.55);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  pointer-events: none;
}
.globe-legend-key span { display: inline-flex; align-items: center; gap: 6px; }
.globe-legend-key i { width: 10px; height: 10px; border-radius: 50%; }
.globe-legend-key .k-day { background: linear-gradient(135deg, #7ec3ff, #2a6fe8); }
.globe-legend-key .k-night { background: #0b1220; box-shadow: inset 0 0 0 1px rgba(255, 210, 140, 0.8); }
.globe-legend-key .k-cloud { background: #e9eef5; }
.globe-tooltip {
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(6, 14, 26, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.globe-tooltip span:last-child { grid-column: 2; color: rgba(255, 255, 255, 0.6); font-size: 12px; }

/* ---------- Loading skeleton ---------- */
.skeleton { min-height: 220px; gap: 14px; }
.skeleton div {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}
.skeleton div:first-child { height: 32px; width: 45%; }
.skeleton div:last-child { width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; }
}
/* No double-tap zoom on controls (it leaves phones zoomed in). */
button, a, select, label { touch-action: manipulation; }
@media (max-width: 720px) {
  /* iOS zooms in on form fields with text under 16px, and stays zoomed. */
  input, select, textarea, .search, #sort, #a-client { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .topbar-inner { padding: 0 16px; gap: 16px; }
  .tabs { gap: 16px; }
  .brand img { height: 22px; }
  .updated, .who-am-i { display: none; }
  .notice { width: calc(100% - 32px); }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat .num { font-size: 26px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card, .layout > * { min-width: 0; }
  .search { width: 100%; }
  .page-actions { width: 100%; }
  .logo-frame { width: 140px; height: 34px; }
  .globe-view { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .globe-stage { position: relative; inset: auto; height: 60vh; }
  .globe-panel { position: static; width: auto; margin: 16px; }
  .site-list { max-height: 50vh; }
  /* Phones: the card sits under the globe (not over it), at full length with no inner scrollbar. */
  .globe-stage { order: 0; }
  .site-card { position: relative; order: 1; inset: auto; width: auto; max-height: none; overflow: visible; margin: 12px 16px 0; }
  .globe-panel { order: 2; }
  .globe-legend-key { position: static; order: 3; transform: none; align-self: center; flex-wrap: wrap; justify-content: center; margin: 0 16px 12px; }
  .globe-credit { order: 4; }
  .globe-hint { display: none; }
  .globe-loading { height: 60vh; bottom: auto; }
}
@media (max-width: 560px) {
  .topbar-inner { flex-wrap: wrap; height: auto; row-gap: 0; padding-top: 10px; }
  .tabs { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 0 16px; height: 42px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar, .a-sections::-webkit-scrollbar { display: none; }
  .tab { flex: none; }
}
@media (max-width: 480px) {
  .topbar-meta .btn { padding: 7px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 110%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    var(--bg);
}

/* A CSS globe: the earth texture slides sideways inside a circle, with shading on top. */
.login-globe {
  --size: min(96vmin, 900px);
  --globe-opacity: 0.16;
  --globe-filter: blur(2px) grayscale(1) contrast(0.9);
  --globe-shade: var(--bg);
  position: fixed;
  z-index: -1;
  width: var(--size);
  height: var(--size);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%);
  border-radius: 50%;
  filter: var(--globe-filter);
  opacity: var(--globe-opacity);
}
:root[data-theme='dark'] .login-globe {
  --globe-opacity: 0.6;
  --globe-filter: blur(2px) saturate(0.85);
  box-shadow: 0 0 140px 20px rgba(255, 98, 48, 0.14);
}
.login-globe-surface {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: url('earth.png') 0 0 / auto 100% repeat-x;
  animation: globe-spin 90s linear infinite;
}
.login-globe::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 34% 30%,
    transparent 30%,
    color-mix(in srgb, var(--globe-shade) 55%, transparent) 62%,
    var(--globe-shade) 74%
  );
}
@keyframes globe-spin {
  to { background-position: calc(var(--size) * -2) 0; }
}
.ping {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  width: 10px;
  height: 10px;
  margin: -5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.ping::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: ping 4s ease-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.9; }
  70%, 100% { transform: scale(6); opacity: 0; }
}

.login-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
}
.login-top img { height: 26px; width: auto; }
.login-top .brand-light { display: var(--show-light); }
.login-top .brand-dark { display: var(--show-dark); }

.login { display: grid; grid-template-columns: minmax(0, 400px); justify-content: center; align-items: center; padding: 16px; }
.login-card {
  display: grid;
  gap: 10px;
  padding: 32px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.35s, transform 0.35s;
}
.login-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 12px var(--sans);
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
}
.login-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.login-card h1 { margin: 6px 0 0; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.login-help { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.login-card label { font-size: 13px; font-weight: 500; color: var(--text); }
.password-row { position: relative; }
.password-row input {
  width: 100%;
  font: 400 15px var(--sans);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 64px 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.password-row input::placeholder { color: var(--faint); letter-spacing: 0.1em; }
.password-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.show-pw {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font: 500 12px var(--sans);
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
}
.show-pw:hover { color: var(--text); background: var(--surface-2); }
.btn-block { width: 100%; margin-top: 6px; padding: 12px 20px; font-size: 14px; border-radius: 10px; }
.login-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bad) 10%, transparent);
  color: var(--bad);
  font-size: 13px;
}
.shake { animation: shake 0.4s; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.signing-in .login-card { opacity: 0; transform: scale(0.97); }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

.login-marquee { min-width: 0; padding: 0 0 28px; display: grid; gap: 14px; justify-items: center; }
.login-marquee-title { margin: 0; font: 600 11px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.marquee {
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 56px;
  width: max-content;
  padding-right: 56px;
  animation: marquee 60s linear infinite;
}
.marquee-track .logo-frame { width: 150px; height: 36px; justify-content: center; }
.marquee-track .logo-frame img { object-position: center; opacity: 0.85; }
@keyframes marquee {
  to { transform: translateX(-50%); }
}

@media (max-width: 720px) {
  .login-top { padding: 18px 16px; }
  .login-card { padding: 24px; }
  .login-card h1 { font-size: 24px; }
  .marquee-track { gap: 36px; padding-right: 36px; }
  .marquee-track .logo-frame { width: 120px; height: 30px; }
}

/* Small mono section labels and the orange accent, used on the login page. */
.label { margin: 0; font: 500 12px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--orange); }
.accent { color: var(--orange); }

/* Clients with several web variants: a full-width card with the variants side by side. */
.card.multi { grid-column: 1 / -1; }
.variants { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 0 28px; }
.variants .project { height: 100%; }
.variants .project .card-foot { margin-top: auto; }
.variants .project + .project { margin-top: 0; }

.globe-credit {
  position: absolute;
  right: 24px;
  bottom: 14px;
  margin: 0;
  max-width: 360px;
  text-align: right;
  color: rgba(255, 255, 255, 0.35);
  font-size: 10px;
  line-height: 1.4;
}
.globe-credit a { color: rgba(255, 255, 255, 0.55); }
@media (max-width: 720px) { .globe-credit { position: static; padding: 0 16px 16px; max-width: none; color: var(--faint); } .globe-credit a { color: var(--muted); } }

/* The big unfold button. */
.unfold-btn {
  /* Bottom center of the globe, above the day/night key. */
  position: absolute;
  bottom: 62px;
  left: 50%;
  translate: -50% 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 10px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  font: 700 14px var(--sans);
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, #ff6230, #ff3d7f 55%, #ff6230);
  background-size: 200% 100%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset, 0 8px 28px rgba(255, 74, 90, 0.45), 0 0 60px rgba(255, 98, 48, 0.25);
  overflow: hidden;
  isolation: isolate;
  animation: unfold-gradient 6s ease-in-out infinite;
  transition: transform 0.2s, box-shadow 0.2s;
}
.unfold-btn::after {
  /* A light sweep across the button every few seconds. */
  content: '';
  position: absolute;
  inset: -40% auto -40% -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg);
  animation: unfold-shine 3.8s ease-in-out infinite;
  z-index: -1;
}
.unfold-btn:hover { transform: translateY(-1px) scale(1.03); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 12px 36px rgba(255, 74, 90, 0.55), 0 0 80px rgba(255, 98, 48, 0.35); }
.unfold-btn:active { transform: scale(0.97); }
.unfold-btn.pop { animation: unfold-gradient 6s ease-in-out infinite, unfold-pop 0.5s ease-out; }
.unfold-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}
.unfold-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; }
.unfold-btn .to-globe { display: none; }
.unfold-btn[aria-pressed='true'] .to-map { display: none; }
.unfold-btn[aria-pressed='true'] .to-globe { display: block; }
@keyframes unfold-gradient { 50% { background-position: 100% 0; } }
@keyframes unfold-shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes unfold-pop { 40% { transform: scale(1.12); } }
.globe-view.is-flat .globe-hint { visibility: hidden; }
@media (max-width: 720px) {
  /* Inside the bottom-right of the globe, not over the list below it. */
  .unfold-btn { top: calc(60vh - 52px); bottom: auto; left: auto; right: 12px; translate: none; padding: 8px 14px 8px 8px; font-size: 13px; }
}

.globe-style {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(1, 6, 12, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.globe-style button {
  font: 600 12px var(--sans);
  color: rgba(255, 255, 255, 0.7);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.globe-style button:hover { color: #fff; }
.globe-style button[aria-pressed='true'] { color: #0b1b2c; background: #fff; }
.globe-style-sep { width: 1px; margin: 5px 4px; background: rgba(255, 255, 255, 0.2); }
#clouds-toggle, #daynight-toggle { display: inline-flex; align-items: center; gap: 6px; }
#clouds-toggle .icon, #daynight-toggle .icon { width: 13px; height: 13px; }
@media (max-width: 720px) { .globe-style { top: 12px; } }

/* ---------- Analytics ---------- */
.a-filters {
  position: sticky;
  top: 72px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  margin-bottom: 18px;
  background: var(--topbar);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#a-client {
  font: 500 13px var(--sans);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 10px;
  min-width: 200px;
}
.a-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 9px; }
.a-seg button {
  font: 500 13px var(--sans);
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 7px;
  padding: 5px 12px;
  cursor: pointer;
}
.a-seg button:hover { color: var(--text); }
.a-seg button[aria-pressed='true'] { color: var(--text); background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.a-demo {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 500;
}
.a-scope { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 18px; }
.a-scope img { height: 30px; width: auto; max-width: 140px; }
.a-scope button { margin-left: auto; font: 500 13px var(--sans); color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.a-scope button:hover { color: var(--text); }
.a-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.a-kpi { display: grid; gap: 2px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.a-kpi-label { font: 600 11px var(--sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.a-kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.a-kpi-hint { font-size: 12px; color: var(--muted); }
.a-card { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.a-card + .a-grid, .a-kpis + .a-card { margin-bottom: 16px; }
.a-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.a-card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.a-hint { font-size: 12px; color: var(--faint); }
.a-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.a-legend i { width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.a-legend i.web, .a-bar-web { background: var(--busy); fill: var(--busy); }
.a-legend i.app, .a-bar-app { background: var(--accent); fill: var(--accent); }
.a-chart { width: 100%; height: auto; display: block; }
.a-chart-wrap { position: relative; }
.a-col-hit { fill: transparent; }
.a-col.is-active .a-col-hit { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.a-tip { position: absolute; top: 0; z-index: 2; display: grid; gap: 4px; min-width: 130px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 12px; color: var(--muted); pointer-events: none; }
.a-tip[hidden] { display: none; }
.a-tip-date { font-weight: 600; color: var(--text); }
.a-tip-row { display: flex; align-items: center; gap: 6px; }
.a-tip-row i { width: 8px; height: 8px; border-radius: 2px; }
.a-tip-row i.web { background: var(--busy); }
.a-tip-row i.app { background: var(--accent); }
.a-tip-row strong { margin-left: auto; padding-left: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.a-tip-total { padding-top: 4px; border-top: 1px solid var(--line); }
.a-gridline { stroke: var(--line); stroke-width: 1; }
.a-axis { font: 400 11px var(--sans); fill: var(--faint); }
.a-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.a-span { grid-column: 1 / -1; }
.a-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.a-bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 4px; }
.a-bar-label > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-bar-num { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.a-bar-num small { color: var(--faint); font-weight: 500; margin-left: 4px; }
.a-bar-track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.a-bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #ffb36b)); }
.a-idx { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 6px; background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--muted); }
.a-muted { color: var(--faint); }
.a-foot { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.a-empty { margin: 0; color: var(--faint); font-size: 13px; }
.a-table-wrap { overflow-x: auto; }
.a-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.a-table th { text-align: left; font: 600 11px var(--sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.a-table td { padding: 10px; border-bottom: 1px solid var(--line); }
.a-table tr:last-child td { border-bottom: 0; }
.a-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.a-table tbody tr { cursor: pointer; }
.a-table tbody tr:hover, .a-table tbody tr.is-selected { background: var(--surface-2); }
.a-client { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.a-client img { width: 64px; height: 22px; object-fit: contain; object-position: left center; }
.a-feed { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 8px 20px; }
.a-feed li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.a-feed-main { display: grid; min-width: 0; font-size: 13px; }
.a-feed-main span { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-feed-side { margin-left: auto; display: grid; text-align: right; font-size: 13px; flex: none; }
.a-feed-side span { color: var(--faint); font-size: 12px; }
.a-tag { flex: none; font: 600 10px var(--sans); letter-spacing: 0.05em; text-transform: uppercase; border-radius: 999px; padding: 3px 8px; }
.a-tag.web { color: var(--busy); background: color-mix(in srgb, var(--busy) 12%, transparent); }
.a-tag.app { color: var(--accent-ink); background: var(--accent-soft); }
.a-loading { min-height: 240px; display: grid; place-items: center; color: var(--muted); }
.a-empty-state h3 { margin: 0 0 6px; }
.a-empty-state p { margin: 0; color: var(--muted); }
@media (max-width: 1000px) {
  .a-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .a-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .a-filters { position: static; display: grid; gap: 8px; padding: 8px; }
  #a-client { width: 100%; min-width: 0; padding: 9px 10px; font-size: 16px; }
  .a-seg { display: flex; }
  .a-seg button { flex: 1; padding: 7px 6px; white-space: nowrap; }
  .a-sections { overflow-x: auto; scrollbar-width: none; }
  .a-sections button { flex: none; padding: 10px 12px; }
  .a-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .a-kpis > .a-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .a-kpi { padding: 12px 14px; }
  .a-kpi-value { font-size: 22px; }
  .a-card { padding: 16px; }
  .a-card + .a-grid, .a-kpis + .a-card { margin-bottom: 12px; }
  .a-grid { gap: 12px; }
  .a-card-head { flex-wrap: wrap; row-gap: 4px; }
  /* Clients table: keep client, sessions and last used; visitors and active time are in the KPIs. */
  .a-table { min-width: 0; }
  .a-table:not(.a-static) th:nth-child(3), .a-table:not(.a-static) td:nth-child(3),
  .a-table:not(.a-static) th:nth-child(4), .a-table:not(.a-static) td:nth-child(4) { display: none; }
  .a-table th, .a-table td { padding-left: 6px; padding-right: 6px; }
  .a-client { gap: 8px; }
  .a-client img { width: 40px; }
  .a-table:not(.a-static) td:last-child { white-space: nowrap; }
  .a-page strong { max-width: 58vw; }
  .a-scope { font-size: 16px; flex-wrap: wrap; }
}

/* Analytics sections: Clients (PostHog) and Terrahutton.io (Google Analytics). */
.a-sections { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.a-sections button {
  position: relative;
  font: 600 14px var(--sans);
  color: var(--muted);
  background: none;
  border: 0;
  padding: 10px 14px;
  cursor: pointer;
}
.a-sections button small { font-weight: 500; color: var(--faint); margin-left: 4px; font-size: 11px; }
.a-sections button:hover { color: var(--text); }
.a-sections button[aria-selected='true'] { color: var(--text); }
.a-sections button[aria-selected='true']::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.a-kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.a-live { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.a-live strong { color: var(--text); font-size: 16px; }
.a-live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); animation: a-live 1.8s ease-out infinite; }
@keyframes a-live { 70%, 100% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--ok) 0%, transparent); } }
.a-legend i.users { background: var(--accent); }
.a-legend i.views { background: var(--busy); }
.a-area { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.a-line-users { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.a-line-views { fill: none; stroke: var(--busy); stroke-width: 1.8; stroke-dasharray: 4 4; stroke-linejoin: round; }
.a-hit { fill: transparent; }
.a-hit:hover { fill: color-mix(in srgb, var(--accent) 25%, transparent); }
.a-static tbody tr { cursor: default; }
.a-page { display: grid; min-width: 0; }
.a-page strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px; }
.a-page code { font-size: 11px; color: var(--faint); }
@media (max-width: 1000px) { .a-kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .a-kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Client report (/c/<slug>) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.report-top { position: sticky; top: 0; z-index: 10; background: var(--topbar); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.report-top-inner { max-width: 1200px; margin: 0 auto; height: 60px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; }
.report-signout { font: 500 13px var(--sans); color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.report-signout:hover { color: var(--text); border-color: var(--line-strong); }
.report-wrap { max-width: 1200px; margin: 0 auto; padding: 28px 32px 48px; }
.report-loading { color: var(--muted); text-align: center; margin: 20vh 0; }
.report-head { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.report-logo { height: 46px; width: auto; max-width: 240px; object-fit: contain; }
.report-head h1 { margin: 0; font-size: 24px; }
.report-head-text { padding-left: 20px; border-left: 1px solid var(--line); }
.report-head-text h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.report-head-text .sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.report-map-card { margin-bottom: 16px; }
.report-map { position: relative; border-radius: 10px; overflow: hidden; background: #aad3df; min-height: 160px; }
.report-map-svg { display: block; width: 100%; height: auto; }
:root[data-theme='dark'] .report-map-svg image { filter: brightness(0.62) saturate(0.8); }
/* The sea color of the map image (dimmed the same way in dark mode), for views past the poles. */
:root[data-theme='dark'] .report-map { background: #6e8288; }
.report-dot { stroke: #fff; stroke-width: 1.5px; vector-effect: non-scaling-stroke; fill-opacity: 0.72; cursor: pointer; transition: fill-opacity 0.15s; }
.report-dot.web { fill: var(--busy); }
.report-dot.app { fill: var(--accent); }
.report-dot:hover, .report-dot:focus-visible { fill-opacity: 0.95; outline: none; }
.report-dot.is-selected { fill-opacity: 1; stroke: var(--text); stroke-width: 3px; }
.report-map-hint { position: absolute; left: 12px; bottom: 10px; margin: 0; padding: 4px 10px; border-radius: 999px; background: rgba(1, 6, 12, 0.55); color: #fff; font-size: 12px; pointer-events: none; }
.report-detail { position: absolute; top: 12px; right: 12px; width: 240px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); display: grid; gap: 6px; }
.report-detail .a-tag { justify-self: start; }
.report-detail h3 { margin: 2px 0 0; font-size: 16px; padding-right: 26px; }
.report-detail .sub { margin: -4px 0 4px; color: var(--muted); font-size: 13px; }
.report-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.report-detail dt { color: var(--faint); }
.report-detail dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.report-detail .close { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.report-subhead { margin: 0 0 10px; }
.report-slides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.report-slides-switch { display: none; }
.report-note { margin: 20px 0 0; color: var(--faint); font-size: 12px; text-align: center; }
.report-login { max-width: 420px; margin: 12vh auto 0; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.report-login-logo { height: 48px; width: auto; max-width: 260px; object-fit: contain; margin-bottom: 12px; }
.report-login h1 { margin: 0 0 6px; font-size: 22px; }
.report-login .sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.report-login form { display: grid; gap: 10px; }
.report-login input { font: 400 16px var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; }
.report-login input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.report-login .btn { justify-content: center; padding: 10px; }
.report-error { min-height: 18px; margin: 10px 0 0; color: var(--bad); font-size: 13px; }
@media (max-width: 720px) {
  .report-top-inner { padding: 0 16px; height: 54px; }
  .report-wrap { padding: 20px 16px 40px; }
  .report-head { gap: 14px; }
  .report-logo { height: 36px; max-width: 160px; }
  .report-head-text { padding-left: 14px; }
  .report-head-text h2 { font-size: 17px; }
  /* On phones the details sit under the map instead of over it. */
  .report-detail { position: relative; top: auto; right: auto; width: auto; border-radius: 0; border-width: 1px 0 0; box-shadow: none; }
  .report-login { margin-top: 6vh; padding: 24px; }
  /* Phones: one slide list at a time, picked with the Web / App switch. */
  .report-slides { grid-template-columns: minmax(0, 1fr); }
  .report-slides-switch { display: flex; }
  .report-slides .report-subhead { display: none; }
  .report-slides[data-tab='web'] [data-kind='app'], .report-slides[data-tab='app'] [data-kind='web'] { display: none; }
}

/* ---------- Conferences ---------- */
.cf-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cf-bar .chips { margin-bottom: 0; }
.cf-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.cf-filters select {
  font: 400 13px var(--sans);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.cf-legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font: 400 12px var(--sans); }
.cf-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--off); }
.cf-dot.ok { background: var(--ok); }
.cf-dot.warn { background: var(--busy); }
.cf-month {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 10px;
  font: 500 11.5px var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.cf-month::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.cf-ev {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 18px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cf-ev.soon { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.cf-date { border-right: 1px solid var(--line); padding-right: 14px; }
.cf-day { font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.cf-mon { margin-top: 5px; font: 400 10.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cf-in { margin-top: 8px; font: 500 11px var(--mono); color: var(--accent-ink); }
.cf-conf { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.cf-conf a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.cf-conf a:hover { color: var(--accent-ink); }
.cf-meta { margin: 3px 0 10px; font: 400 11.5px var(--mono); color: var(--muted); }
.cf-rows { display: flex; flex-direction: column; }
.cf-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(0, 2fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.cf-client { font-weight: 500; }
.cf-slot { color: var(--muted); font-size: 13px; }
.cf-fmt {
  margin-right: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  font: 500 10px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.cf-right { display: flex; gap: 10px; align-items: baseline; white-space: nowrap; }
.cf-st { font: 500 11px var(--mono); color: var(--muted); }
.cf-st.ok { color: var(--ok); }
.cf-st.warn { color: var(--busy); }
.cf-src { font: 400 11px var(--mono); color: var(--muted); text-decoration: none; }
.cf-src:hover { color: var(--accent-ink); }
.cf-empty { padding: 16px 0; }
.cf-past { margin-top: 30px; }
.cf-past summary { cursor: pointer; font: 500 11.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cf-past[open] summary { color: var(--text); }
.cf-note { margin-top: 30px; font: 400 11px var(--mono); color: var(--faint); line-height: 1.7; }
@media (max-width: 640px) {
  .cf-ev { grid-template-columns: 1fr; gap: 10px; }
  .cf-date { display: flex; gap: 12px; align-items: baseline; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
  .cf-mon, .cf-in { margin: 0; }
  .cf-row { grid-template-columns: 1fr; gap: 4px; }
  .cf-right { white-space: normal; }
}

/* Embedded on / linked from the client's website */
.site-mark { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; background: var(--surface-2); color: var(--text); min-width: 0; }
.site-mark .site-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; flex: none; color: var(--muted); background: var(--surface); }
.site-mark .site-icon .icon { width: 14px; height: 14px; fill: currentColor; }
.site-mark .site-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-mark .site-text a { color: inherit; font-weight: 600; text-decoration: none; }
.site-mark .site-text a:hover { text-decoration: underline; }
.site-mark .site-other { font-size: 11px; color: var(--muted); }
.site-mark .site-count { flex: none; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.site-mark.is-embedded .site-icon { color: var(--ok); }
.site-mark.is-linked .site-icon { color: var(--accent); }
.site-mark.none { color: var(--muted); background: none; padding: 2px 10px; font-size: 12px; }
.site-mark.none .site-icon { background: none; width: 16px; height: 16px; }

/* How heavy the site is for a phone (download, memory, which iPhone runs it). */
.weight { --c: var(--muted); display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; background: var(--surface-2); color: var(--text); min-width: 0; cursor: help; }
.weight.is-ok { --c: var(--ok); }
.weight.is-warn { --c: var(--warn); }
.weight.is-bad { --c: var(--bad); }
.weight-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; flex: none; color: var(--c); background: var(--surface); }
.weight-icon .icon { width: 14px; height: 14px; fill: none; }
.weight-text { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.weight-label { font-weight: 600; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weight-nums { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.weight-nums span { white-space: nowrap; }
.weight-devices { display: flex; gap: 4px; flex: none; }
.weight-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.weight-dot.is-ok { background: var(--ok); }
.weight-dot.is-warn { background: var(--warn); }
.weight-dot.is-bad { background: var(--bad); }

/* Crashes: a filter set apart from the others, calm when nothing crashed and loud when a site did. */
.chip-crash { margin-left: auto; font-weight: 600; }
.chip-crash .icon { width: 14px; height: 14px; fill: currentColor; }
.chip-crash.is-calm { color: var(--busy); background: color-mix(in srgb, var(--busy) 9%, var(--surface)); border-color: color-mix(in srgb, var(--busy) 22%, transparent); cursor: default; }
.chip-crash.is-calm .icon { fill: none; }
.chip-crash.is-alarm { color: #fff; background: var(--bad); border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.chip-crash.is-alarm:hover { color: #fff; border-color: var(--bad); filter: brightness(1.06); }
.chip-crash.is-alarm[aria-pressed='true'] { color: #fff; background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 40%, transparent); }

/* A big warning on a card whose 3D view crashed. */
.crash-warning { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; padding: 12px 14px; border-radius: 10px; color: #fff; background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent); cursor: help; }
.crash-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.crash-icon .icon { width: 20px; height: 20px; fill: #fff; }
.crash-text { display: grid; gap: 2px; min-width: 0; line-height: 1.35; }
.crash-text strong { font-size: 15px; }
.crash-text span { font-size: 12.5px; opacity: 0.92; }

.weight-issues { margin-left: 4px; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
