/* SiteWatch dashboard.
   Dark is the default; [data-theme="light"] switches (public/theme.js applies
   the saved choice before first paint). Spacing is on an 8px grid. Status is
   always a word with a coloured dot, never colour alone. */

:root {
  --bg: #0B0F17;
  --sidebar: #0F1420;
  --card: #151B28;
  --card-2: #1A2131;
  --hover: #1C2435;
  --border: #232B3B;
  --border-strong: #2E384B;
  --text: #E6EAF2;
  --muted: #8A94A7;
  --faint: #5B6578;

  --brand: #6366F1;
  --brand-hover: #4F46E5;
  --brand-soft: rgba(99, 102, 241, 0.15);
  --brand-text: #A5B4FC;

  --ok: #22C55E;
  --warn: #F59E0B;
  --crit: #EF4444;
  --unknown: #64748B;
  /* Text on a tinted badge: lighter in dark mode, darker in light mode, for contrast. */
  --ok-text: #4ADE80;
  --warn-text: #FBBF24;
  --crit-text: #F87171;
  --unknown-text: #94A3B8;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: none;
  --shadow-pop: 0 16px 48px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border);
  --ease: 150ms ease;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sidebar-w: 240px;
  --topbar-h: 64px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F6F8FB;
  --sidebar: #FFFFFF;
  --card: #FFFFFF;
  --card-2: #F8FAFC;
  --hover: #F1F5F9;
  --border: #E4E8EF;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --muted: #64748B;
  --faint: #94A3B8;
  --brand-soft: rgba(99, 102, 241, 0.1);
  --brand-text: #4F46E5;
  --ok-text: #15803D;
  --warn-text: #B45309;
  --crit-text: #B91C1C;
  --unknown-text: #475569;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-pop: 0 20px 48px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px var(--border);
  color-scheme: light;
}

/* ------------------------------------------------------------------ base */

*, *::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.55 var(--font);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "cv11";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, pre, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--brand-text); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
code, pre { font-family: var(--mono); font-size: 0.92em; }
code { padding: 1px 5px; border-radius: 4px; background: var(--card-2); border: 1px solid var(--border); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 16px; background: var(--card); border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Theme-dependent icons: a sun in dark mode (switch to light), a moon in light mode. */
.when-light { display: none; }
:root[data-theme="light"] .when-light { display: block; }
:root[data-theme="light"] .when-dark { display: none; }

/* ------------------------------------------------------------- layout */

.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--ease); }
:root[data-nav="collapsed"] .layout { grid-template-columns: 72px minmax(0, 1fr); }
.main { min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px 32px 64px; display: grid; gap: 24px; align-content: start; outline: none; }

/* ---------------------------------------------------------- sidebar */

.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 20;
  display: flex; flex-direction: column; gap: 16px; padding: 16px 12px;
  background: var(--sidebar); border-right: 1px solid var(--border); overflow: hidden;
}
.sidebar__top { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 4px; }
.icon-btn.sidebar__close { display: none; } /* two classes: .icon-btn later in the file would win otherwise */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand__mark { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 9px; background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; box-shadow: 0 4px 14px -4px rgba(99, 102, 241, 0.7); }
.brand__mark .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.brand--large { font-size: 18px; }
.brand--large .brand__mark { width: 40px; height: 40px; border-radius: 11px; }
.brand--large .brand__mark .icon { width: 22px; height: 22px; }

.sidebar__nav { display: grid; gap: 2px; }
.sidebar__link {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 12px;
  border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--muted); font-size: 14px; font-weight: 500; text-align: left; white-space: nowrap;
  transition: background var(--ease), color var(--ease);
}
.sidebar__link:hover { background: var(--hover); color: var(--text); }
.sidebar__link[aria-current="page"] { background: var(--brand-soft); color: var(--text); }
.sidebar__link[aria-current="page"] .icon { color: var(--brand-text); }
.sidebar__link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.sidebar__link .nav-count { margin-left: auto; }
.sidebar__bottom { margin-top: auto; display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--border); }

.session { display: flex; align-items: center; gap: 12px; padding: 8px 8px; }
.session__avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; }
.session__text { display: grid; line-height: 1.3; min-width: 0; }
.session__text strong { font-size: 13px; font-weight: 600; }
.session__text span { font-size: 12px; color: var(--muted); }

/* Collapsed to icons (wide screens only). */
:root[data-nav="collapsed"] .sidebar { padding-inline: 12px; }
:root[data-nav="collapsed"] .sidebar__label,
:root[data-nav="collapsed"] .brand__name { display: none; }
:root[data-nav="collapsed"] .sidebar__link { justify-content: center; padding: 0; }
:root[data-nav="collapsed"] .sidebar__link .nav-count { position: absolute; top: 2px; right: 4px; margin: 0; }
:root[data-nav="collapsed"] .sidebar__collapse .icon { transform: rotate(180deg); }
:root[data-nav="collapsed"] .session { justify-content: center; padding-inline: 0; }
:root[data-nav="collapsed"] .sidebar__top { justify-content: center; }

.nav-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--warn); color: #0B0F17; font-size: 11px; font-weight: 700; line-height: 1;
}
.nav-count--crit { background: var(--crit); color: #fff; }
.scrim { display: none; }

/* ----------------------------------------------------------- top bar */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; min-height: var(--topbar-h); padding: 8px 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.icon-btn.topbar__menu { display: none; }
.topbar__title { flex: 1; min-width: 0; }
.topbar__title h1 { font-size: 18px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 12px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--faint); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.topbar__actions { display: flex; align-items: center; gap: 8px; }

.search { position: relative; width: min(300px, 28vw); }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 36px; padding: 0 12px 0 36px; font-size: 13.5px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.bell { position: relative; }
.bell__badge {
  position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px; border: 2px solid var(--bg);
  background: var(--crit); color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
}

/* ---------------------------------------------------------- controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--card); color: var(--text);
  font-size: 13.5px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow);
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
}
.btn:hover { background: var(--hover); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; }
.btn .icon { width: 16px; height: 16px; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn--danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn--danger:hover { background: #DC2626; color: #fff; }
.btn--ghost { background: none; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn--lg { height: 42px; padding: 0 18px; font-size: 14px; }
.btn--block { width: 100%; }

/* Loading state: a spinner replaces the icon. */
.btn .spinner { display: none; }
.btn.is-busy .spinner, .btn[aria-busy="true"] .spinner { display: inline-block; }
.btn.is-busy > .icon, .btn[aria-busy="true"] > .icon { display: none; }
.btn[aria-busy="true"]:not(:has(.spinner)) > .icon { display: inline-block; animation: spin 0.9s linear infinite; }
.spinner { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--muted);
  transition: background var(--ease), color var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn--sm { width: 30px; height: 30px; }
.icon-btn--sm .icon { width: 16px; height: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--card);
  color: var(--muted); font-size: 13px; font-weight: 500; transition: all var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip[aria-current="true"] { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 50%, transparent); color: var(--text); }
.chip__count { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--card-2); color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: center; }

.toggle-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--muted);
  font-size: 12.5px; font-weight: 500; transition: all var(--ease);
}
.toggle-chip .icon { width: 15px; height: 15px; }
.toggle-chip[aria-pressed="true"] { border-color: color-mix(in srgb, var(--brand) 50%, transparent); background: var(--brand-soft); color: var(--text); }
.toggle-chip .when-off, .toggle-chip[aria-pressed="false"] .when-on { display: none; }
.toggle-chip[aria-pressed="false"] .when-off { display: block; }

.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--border); }
.segmented button { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 13px; font-weight: 500; transition: all var(--ease); }
.segmented button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.segmented .icon { width: 16px; height: 16px; }

/* ------------------------------------------------------ status badges */

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1;
  background: color-mix(in srgb, var(--unknown) 15%, transparent); color: var(--unknown-text);
}
.badge__dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--unknown); }
.badge--ok, .badge--recovered, .badge--resolved { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok-text); }
.badge--ok .badge__dot, .badge--recovered .badge__dot, .badge--resolved .badge__dot, .badge__dot--ok { background: var(--ok); }
.badge--warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn-text); }
.badge--warn .badge__dot, .badge__dot--warn { background: var(--warn); }
.badge--crit { background: color-mix(in srgb, var(--crit) 15%, transparent); color: var(--crit-text); }
.badge--crit .badge__dot, .badge__dot--crit { background: var(--crit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--crit) 25%, transparent); }

.pill { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill--warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn-text); }
.pill--crit { background: color-mix(in srgb, var(--crit) 15%, transparent); color: var(--crit-text); }

/* -------------------------------------------------------------- cards */

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.card__head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card__head--plain { padding: 0 0 16px; border: 0; }
.card__head--filters { padding: 16px 24px; }
.card__body { padding: 16px 24px 24px; }
.card > h2 { font-size: 15px; font-weight: 600; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color var(--ease); }
.stat__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); }
.stat__icon .icon { width: 22px; height: 22px; }
.stat__value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat__label { margin-top: 4px; font-size: 13px; color: var(--muted); }
.stat--ok .stat__icon { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.stat--warn .stat__icon { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.stat--crit .stat__icon { background: color-mix(in srgb, var(--crit) 15%, transparent); color: var(--crit); }
.stat--warn.stat--has { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.stat--crit.stat--has { border-color: color-mix(in srgb, var(--crit) 45%, var(--border)); }
.stat--crit.stat--has .stat__value { color: var(--crit-text); }

/* -------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding-inline: 16px; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table th { padding-block: 10px; text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--card-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding-block: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table td[data-label="Site"] { white-space: normal; min-width: 140px; }
.table th.num, .table td.num { text-align: right; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--ease); }
.table tbody tr:hover { background: var(--hover); }
.row[data-href] { cursor: pointer; }
.row--crit td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.row--warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.table__actions { width: 1%; text-align: right; }
.table__none { padding: 24px; text-align: center; color: var(--muted); }
.site-cell { display: grid; gap: 1px; color: var(--text); }
.site-cell:hover { color: var(--text); }
.site-cell:hover .site-cell__name { text-decoration: underline; text-underline-offset: 3px; }
.site-cell__name { font-weight: 600; }
.site-cell__url { font-size: 12.5px; color: var(--muted); }
.checking { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-text); font-weight: 500; }
.checking .spinner { width: 12px; height: 12px; }

/* sparkline */
.spark { display: block; width: 96px; height: 28px; overflow: visible; color: var(--brand); }
.spark--large { width: 100%; height: 48px; margin-top: 8px; }
.spark__line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark__area { fill: currentColor; opacity: 0.12; }
.spark__dot { fill: currentColor; }
.trend--ok .spark { color: var(--ok); }
.trend--warn .spark { color: var(--warn); }
.trend--crit .spark { color: var(--crit); }

/* ------------------------------------------------------ recent alerts */

.recent { padding: 0; }
.recent .card__head { padding: 16px 20px; }
.recent .alert-list { padding: 12px; }
.recent__clear { display: flex; align-items: center; gap: 12px; padding: 20px; }
.card .recent__clear { padding: 4px 0; }
.recent__clear > .icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.recent__clear strong { display: block; font-weight: 600; }
.recent__clear span { color: var(--muted); font-size: 13px; }

.alert-list { display: grid; gap: 8px; }
.alert-item {
  position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 12px 12px 16px;
  border: 1px solid var(--border); border-left: 3px solid var(--unknown); border-radius: var(--radius-sm);
  background: var(--card); text-align: left; transition: background var(--ease), border-color var(--ease);
}
.alert-item:hover { background: var(--hover); }
.alert-item--crit { border-left-color: var(--crit); }
.alert-item--warn { border-left-color: var(--warn); }
.alert-item--recovered, .alert-item--resolved { border-left-color: var(--ok); }
.alert-item--reviewed { opacity: 0.75; }
.alert-item__icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--card-2); color: var(--muted); }
.alert-item__icon .icon { width: 16px; height: 16px; }
.alert-item--crit .alert-item__icon { background: color-mix(in srgb, var(--crit) 15%, transparent); color: var(--crit-text); }
.alert-item--warn .alert-item__icon { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn-text); }
.alert-item--recovered .alert-item__icon, .alert-item--resolved .alert-item__icon { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok-text); }
.alert-item__text { display: grid; gap: 2px; min-width: 0; }
.alert-item__title { font-size: 13.5px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.alert-item__meta { font-size: 12px; color: var(--muted); }
.alert-item__sev { font-weight: 600; }
.alert-item--crit .alert-item__sev { color: var(--crit-text); }
.alert-item--warn .alert-item__sev { color: var(--warn-text); }
.alert-item--recovered .alert-item__sev, .alert-item--resolved .alert-item__sev { color: var(--ok-text); }
.alert-list--page .alert-item { padding: 16px 16px 16px 20px; }
.alert-list--page .alert-item__title { font-size: 14px; }

/* ---------------------------------------------------------- site page */

.site-head {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.site-head::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--unknown); }
.site-head--ok::before { background: var(--ok); }
.site-head--warn::before { background: var(--warn); }
.site-head--crit::before { background: var(--crit); }
.site-head__main { display: grid; gap: 8px; min-width: 0; }
.site-head__title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.site-head__meta { display: flex; flex-wrap: wrap; gap: 4px 20px; color: var(--muted); font-size: 13px; }
.site-head__meta > * { display: inline-flex; align-items: center; gap: 6px; }
.site-head__meta .icon { width: 15px; height: 15px; }
.site-head__actions { display: flex; gap: 8px; }
.progress { position: absolute; inset: 0 0 auto 0; height: 2px; overflow: hidden; background: var(--brand-soft); }
.progress span { position: absolute; inset: 0; width: 35%; background: linear-gradient(90deg, transparent, var(--brand), transparent); animation: progress 1.2s ease-in-out infinite; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; margin-bottom: -1px; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; transition: color var(--ease), border-color var(--ease); }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--brand); }
.tabs a[aria-current] .icon { color: var(--brand-text); }
.tabs .icon { width: 16px; height: 16px; }
.tab-count { min-width: 20px; padding: 1px 6px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-align: center; }
.tab-count--crit { background: color-mix(in srgb, var(--crit) 15%, transparent); color: var(--crit-text); }
.tab-count--warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn-text); }
.tab-panel { display: grid; gap: 16px; position: relative; }
.tab-note { color: var(--muted); }
#board { display: grid; gap: 24px; }

.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 16px; }
.mini { padding: 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.mini__label { font-size: 12.5px; color: var(--muted); }
.mini__value { margin-top: 4px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.mini__value .muted { font-size: 16px; font-weight: 500; }
.mini__hint { margin-top: 2px; font-size: 12.5px; color: var(--muted); }

/* check cards */
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.checks--single { grid-template-columns: minmax(0, 1fr); }
.check { display: grid; gap: 8px; align-content: start; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color var(--ease); }
.check:hover { border-color: var(--border-strong); }
.check--crit { border-color: color-mix(in srgb, var(--crit) 40%, var(--border)); }
.check--warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.check__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.check__label { font-size: 14px; font-weight: 600; line-height: 1.4; }
.check__detail { font-size: 13px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.check--crit .check__detail, .check--warn .check__detail { color: var(--text); -webkit-line-clamp: 12; }
.check__meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); }
.check__meta .icon { width: 13px; height: 13px; }

.playbook { margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 13px; }
.playbook summary { cursor: pointer; width: max-content; color: var(--brand-text); font-weight: 600; }
.playbook > p { margin-top: 8px; color: var(--muted); }
.playbook .steps { margin-top: 8px; }

/* activity timeline */
.timeline { position: relative; display: grid; }
.timeline__day { padding: 16px 0 8px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.timeline__day:first-child { padding-top: 0; }
.event { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 4px 16px; align-items: start; padding: 12px 0; scroll-margin-top: 96px; }
.event::before { content: ""; position: absolute; left: 15.5px; top: 44px; bottom: -12px; width: 1px; background: var(--border); }
.event:last-child::before { display: none; }
.event__icon { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--border); color: var(--muted); }
.event__icon .icon { width: 15px; height: 15px; }
.event--crit .event__icon { background: color-mix(in srgb, var(--crit) 15%, var(--card)); border-color: color-mix(in srgb, var(--crit) 40%, transparent); color: var(--crit-text); }
.event--warn .event__icon { background: color-mix(in srgb, var(--warn) 15%, var(--card)); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn-text); }
.event--recovered .event__icon { background: color-mix(in srgb, var(--ok) 15%, var(--card)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok-text); }
.event__body { min-width: 0; padding-top: 4px; }
.event__head { display: flex; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; }
.event__title { font-weight: 600; overflow-wrap: anywhere; }
.event--info .event__title { font-weight: 500; }
.event__detail { margin-top: 4px; font-size: 13px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.event__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 4px; font-size: 12px; color: var(--faint); }
.event__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.event__meta .icon { width: 13px; height: 13px; }
.event--done { opacity: 0.7; }
.event:target { background: var(--brand-soft); border-radius: var(--radius-sm); box-shadow: 0 0 0 8px var(--brand-soft); }
.timeline--compact .event { padding: 8px 0; }
.timeline--compact .event::before { top: 40px; bottom: -8px; }

/* skeletons */
.skeleton { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--card-2) 25%, var(--hover) 50%, var(--card-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton--title { width: 55%; height: 16px; }
.skeleton--short { width: 40%; }
.check--skeleton { gap: 12px; min-height: 120px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Switching tabs: the panel shows shimmering placeholder blocks until the new content arrives. */
#board.is-switching .tab-panel > * { visibility: hidden; }
#board.is-switching .tab-panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 280px; border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent 25%, color-mix(in srgb, var(--hover) 70%, transparent) 50%, transparent 75%) 0 0 / 200% 100%,
    linear-gradient(var(--card-2), var(--card-2)) 0 0 / 32% 120px no-repeat,
    linear-gradient(var(--card-2), var(--card-2)) 50% 0 / 32% 120px no-repeat,
    linear-gradient(var(--card-2), var(--card-2)) 100% 0 / 32% 120px no-repeat,
    linear-gradient(var(--card-2), var(--card-2)) 0 150px / 100% 120px no-repeat;
  animation: shimmer 1.3s infinite;
}
#board.is-loading { cursor: progress; }
#board.is-loading .stat__value, #board.is-loading .mini__value { opacity: 0.6; transition: opacity var(--ease); }

/* ------------------------------------------------ alerts slide-over */

.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(400px, 100vw);
  display: flex; flex-direction: column; background: var(--sidebar); border-left: 1px solid var(--border); box-shadow: var(--shadow-pop);
  transform: translateX(100%); visibility: hidden; transition: transform 180ms ease, visibility 180ms;
}
.panel-open .panel { transform: none; visibility: visible; }
.panel-open .scrim--panel { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(5, 8, 14, 0.55); }
.panel__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 20px; }
.panel__head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 650; }
.panel__prefs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 16px; border-bottom: 1px solid var(--border); }
.panel__body { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 12px; align-content: start; }
.panel__sub { margin-top: 8px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.panel__more { text-align: center; font-size: 13px; }
.panel__all { padding: 16px; text-align: center; font-weight: 600; border-top: 1px solid var(--border); }
.panel .empty { border: 0; background: none; padding: 40px 16px; }

/* ---------------------------------------------------------- drawer */

.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(5, 8, 14, 0.6); opacity: 0; transition: opacity 160ms ease; }
.drawer__sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); overflow-y: auto;
  padding: 32px; background: var(--sidebar); border-left: 1px solid var(--border); box-shadow: var(--shadow-pop);
  transform: translateX(100%); transition: transform 180ms ease; outline: none;
}
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer.is-open .drawer__sheet { transform: none; }
.drawer__close { position: absolute; top: 20px; right: 20px; }
.detail { display: grid; gap: 24px; }
.detail__top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding-right: 48px; font-size: 13px; }
.detail__top a { font-weight: 600; color: var(--text); }
.detail h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.35; overflow-wrap: anywhere; }
.detail h3 { margin-bottom: 8px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.detail p { color: var(--muted); }
.detail__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.detail__actions p { display: inline-flex; align-items: center; gap: 6px; }
.evidence {
  padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: #070A10; color: #D7DEEA; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere;
}

.steps { counter-reset: step; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding-left: 36px; color: var(--text); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -1px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 700; }
.steps--compact { gap: 8px; }
.steps--compact li { padding-left: 30px; color: var(--muted); }
.steps--compact li::before { width: 20px; height: 20px; font-size: 11px; }

/* ------------------------------------------------------- pop-ups */

.toasts { position: fixed; top: 80px; right: 24px; z-index: 50; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast {
  position: relative; display: flex; padding: 16px 44px 16px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--warn); box-shadow: var(--shadow-pop);
  animation: toast-in 180ms ease-out; transition: opacity 160ms, transform 160ms;
}
.toast--crit { border-left-color: var(--crit); }
.toast.is-leaving { opacity: 0; transform: translateX(16px); }
.toast__body { display: grid; gap: 2px; min-width: 0; }
.toast__kind { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--warn-text); }
.toast__kind .badge__dot { background: var(--warn); }
.toast--crit .toast__kind { color: var(--crit-text); }
.toast--crit .toast__kind .badge__dot { background: var(--crit); }
.toast__site { font-weight: 600; }
.toast__title { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.toast__link { margin-top: 4px; font-size: 13px; font-weight: 600; }
.toast__close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 20px; line-height: 1; }
.toast__close:hover { background: var(--hover); color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------------------------------------------------- empty states */

.empty { display: grid; justify-items: center; gap: 8px; padding: 48px 24px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--card); }
.card .empty { border: 0; padding: 32px 16px; }
.empty__icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 8px; border-radius: 14px; }
.empty__icon .icon { width: 24px; height: 24px; }
.empty--ok .empty__icon { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.empty--neutral .empty__icon { background: var(--brand-soft); color: var(--brand-text); }
.empty h3 { font-size: 16px; font-weight: 650; }
.empty p { max-width: 52ch; color: var(--muted); }
.empty .btn { margin-top: 8px; }
.illustration { width: 200px; height: 140px; margin-bottom: 8px; }
.ill-soft { fill: var(--brand-soft); }
.ill-card { fill: var(--card); stroke: var(--border-strong); }
.ill-line { fill: var(--border-strong); }
.ill-line--faint { fill: var(--border); }
.ill-shield { fill: var(--brand); }
.ill-check { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ forms */

.form { display: grid; gap: 16px; max-width: 880px; }
.form-section { display: grid; gap: 16px; min-width: 0; }
.form-section legend { float: left; width: 100%; padding: 0; font-size: 15px; font-weight: 600; }
.form-section legend + .field__help { margin-top: -8px; }
.form-section__body { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form__actions { display: flex; align-items: center; gap: 8px; position: sticky; bottom: 0; padding: 16px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.req { color: var(--crit-text); }
.field input, .field textarea, .site-filter select {
  width: 100%; padding: 9px 12px; font-size: 14px;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color var(--ease), box-shadow var(--ease);
}
:root[data-theme="light"] .field input, :root[data-theme="light"] .field textarea, :root[data-theme="light"] .site-filter select { background: #fff; }
.field textarea { font-family: var(--mono); font-size: 13px; line-height: 1.6; resize: vertical; }
.field input:focus, .field textarea:focus, .site-filter select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field [aria-invalid="true"] { border-color: var(--crit); }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--crit) 25%, transparent); }
.field__help { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); max-width: 76ch; }
.check-list { display: grid; gap: 12px; }
.check-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.check-row__text { display: grid; gap: 2px; }
.stack { display: grid; gap: 12px; justify-items: start; }
.site-filter select { width: auto; min-width: 180px; height: 32px; padding: 0 10px; font-size: 13px; }

.notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.notice > .icon { margin-top: 1px; }
.notice ul { margin-top: 4px; padding-left: 18px; list-style: disc; }
.notice--info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.notice--info > .icon { color: var(--brand-text); }
.notice--ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.notice--ok > .icon { color: var(--ok); }
.notice--warn { background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn-text); }
.notice--error { background: color-mix(in srgb, var(--crit) 12%, transparent); border-color: color-mix(in srgb, var(--crit) 30%, transparent); color: var(--crit-text); }

.danger { display: grid; gap: 12px; max-width: 880px; border-color: color-mix(in srgb, var(--crit) 30%, var(--border)); }
.danger h2 { margin-top: 8px; font-size: 15px; font-weight: 600; }
.danger h2:first-child { margin-top: 0; }

/* key page */
.setup { display: grid; gap: 16px; max-width: 880px; counter-reset: setup; }
.setup > li { counter-increment: setup; position: relative; display: grid; gap: 8px; padding-left: 72px; }
.setup > li::before { content: counter(setup); position: absolute; left: 24px; top: 24px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; }
.setup h2 { font-size: 15px; font-weight: 600; }
.codebox { position: relative; margin-top: 8px; }
.codebox pre { padding: 16px 96px 16px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #070A10; color: #D7DEEA; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.codebox code { padding: 0; border: 0; background: none; color: inherit; }
.codebox__copy { position: absolute; top: 10px; right: 10px; }

/* changes: normal work by trusted people */
.badge--change { background: var(--brand-soft); color: var(--brand-text); }
.badge--change .badge__dot { background: var(--brand); }
.event--change .event__icon { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); color: var(--brand-text); }
.side-col { display: grid; gap: 24px; align-content: start; }
.change-list { display: grid; padding: 4px 20px 12px; }
.change { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.change:last-child { border-bottom: 0; }
.change__icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--brand-soft); color: var(--brand-text); }
.change__icon .icon { width: 15px; height: 15px; }
.change__body { min-width: 0; }
.change__title { font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.change__meta { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.recent__none { padding: 16px 20px 20px; font-size: 13px; }
.table--changes .table__wrap { white-space: normal; min-width: 220px; }
.change-what { display: inline-flex; align-items: flex-start; gap: 8px; }
.change-what .icon { width: 15px; height: 15px; margin-top: 3px; color: var(--brand-text); }
.who { display: flex; align-items: center; gap: 8px; color: var(--text) !important; }
.who .icon { width: 16px; height: 16px; color: var(--muted); }

/* activity in three columns: critical, warning, normal */
.activity__views { margin-right: 4px; }
.evcols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.evcol { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); border-top: 3px solid var(--muted); min-width: 0; }
.evcol--crit { border-top-color: var(--crit); }
.evcol--warn { border-top-color: var(--warn); }
.evcol--info { border-top-color: var(--brand); }
.evcol__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.evcol__count { font-weight: 700; font-size: 15px; }
.evcol__hint { width: 100%; font-size: 12px; color: var(--muted); }
.evcol__list { display: grid; gap: 8px; padding: 12px; max-height: 75vh; overflow-y: auto; }
.evcol__none { padding: 16px; font-size: 13px; }
.evcard { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); border-left: 3px solid var(--border-strong); background: var(--card-2); color: var(--text); transition: border-color var(--ease), background var(--ease); }
.evcard:hover { background: var(--hover); border-color: var(--border-strong); text-decoration: none; }
.evcard--crit { border-left-color: var(--crit); }
.evcard--warn { border-left-color: var(--warn); }
.evcard--info { border-left-color: var(--brand); }
.evcard--done { opacity: 0.7; }
.evcard__icon { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 7px; background: var(--card); color: var(--muted); }
.evcard--crit .evcard__icon { color: var(--crit-text); }
.evcard--warn .evcard__icon { color: var(--warn-text); }
.evcard--info .evcard__icon { color: var(--brand-text); }
.evcard__icon .icon { width: 14px; height: 14px; }
.evcard__body { display: grid; gap: 4px; min-width: 0; }
.evcard__title { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.evcard__files { display: grid; gap: 2px; font-size: 12px; }
.evcard__file { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.evcard__file code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.evcard__danger { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--crit-text); overflow-wrap: anywhere; }
.evcard__danger .icon { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.evcard__meta { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.diffcount { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.diffcount__add { color: var(--ok-text); }
.diffcount__del { color: var(--crit-text); }

/* one change: what, who, and every changed line */
.evdetail { display: grid; gap: 16px; border-top: 3px solid var(--border-strong); }
.evdetail--crit { border-top-color: var(--crit); }
.evdetail--warn { border-top-color: var(--warn); }
.evdetail--info { border-top-color: var(--brand); }
.evdetail__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.evdetail__title { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.section-title { margin: 24px 0 12px; font-size: 15px; font-weight: 600; }
.filechange { margin-bottom: 12px; padding: 0; overflow: hidden; }
.filechange__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; border-bottom: 1px solid var(--border); }
.filechange__head::-webkit-details-marker { display: none; }
.filechange__head::before { content: '▸'; color: var(--brand-text); }
.filechange[open] > .filechange__head::before { content: '▾'; }
.filechange__path { font-size: 13px; overflow-wrap: anywhere; }
.filechange__status { padding: 1px 8px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--muted); }
.filechange__status--added, .filechange__status--missing { color: var(--crit-text); border-color: color-mix(in srgb, var(--crit) 40%, transparent); }
.filechange__status--modified { color: var(--warn-text); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.filechange__status--unchanged { color: var(--ok-text); }
.filechange__compared, .filechange__note { padding: 8px 16px 0; font-size: 13px; }
.filechange__flags { display: grid; gap: 6px; padding: 10px 16px 0; font-size: 13px; }
.filechange__flags li { display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.filechange__flags .icon { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--warn-text); }
.filechange__flags--danger li { color: var(--crit-text); }
.filechange__flags--danger .icon { color: var(--crit-text); }
.diff { margin-top: 10px; overflow-x: auto; border-top: 1px solid var(--border); }
.diff__table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.diff__ln { width: 1%; padding: 0 8px; text-align: right; color: var(--muted); user-select: none; white-space: nowrap; border-right: 1px solid var(--border); vertical-align: top; }
.diff__code { padding: 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff__sign { display: inline-block; width: 1.2em; user-select: none; font-weight: 700; }
.diff__row--add { background: color-mix(in srgb, var(--ok) 13%, transparent); }
.diff__row--add .diff__sign { color: var(--ok-text); }
.diff__row--del { background: color-mix(in srgb, var(--crit) 12%, transparent); }
.diff__row--del .diff__sign { color: var(--crit-text); }
.diff__row--del .diff__code { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--crit) 50%, transparent); }
.diff__row--danger { background: color-mix(in srgb, var(--crit) 30%, transparent); box-shadow: inset 3px 0 0 var(--crit); }
.diff__row--note { box-shadow: inset 3px 0 0 var(--warn); }
.diff__hunk td { padding: 4px 12px; background: var(--card-2); color: var(--muted); font-size: 11.5px; border-top: 1px solid var(--border); }
.diff__more { padding: 8px 12px; font-size: 12px; }
.minichange { margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.minichange__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; padding: 8px 12px; background: var(--card-2); }
.minichange__head code { overflow-wrap: anywhere; font-size: 12.5px; }
.minichange__compared { padding: 6px 12px 0; font-size: 12px; }
.minichange__danger { display: flex; gap: 8px; align-items: flex-start; padding: 6px 12px 0; font-size: 12.5px; color: var(--crit-text) !important; overflow-wrap: anywhere; }
.minichange__danger .icon { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.minichange__danger code { display: block; margin-top: 2px; }
.minichange .diff { margin-top: 8px; }

/* pairing: connecting a site from WordPress */
.setup-status { margin-bottom: 16px; }
.setup-status__row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.setup-status__row h2 { font-size: 15px; font-weight: 600; }
.setup-status .conn { flex: 1; min-width: 260px; margin: 0; }
.pair-code { font-family: var(--mono); letter-spacing: 0.06em; }
.advanced { margin-top: 16px; }
.advanced summary { cursor: pointer; font-weight: 600; }
.advanced[open] summary { margin-bottom: 12px; }
.advanced > * + * { margin-top: 12px; }
.badge--pending { background: var(--brand-soft); color: var(--brand-text); }
.badge--pending .badge__dot { background: var(--brand); }
.pending-actions { display: inline-flex; gap: 6px; }

/* activity: every event, with filters. Info is grey; alerts keep their colours. */
.badge--info { background: var(--card-2); color: var(--muted); border: 1px solid var(--border); }
.badge--info .badge__dot { background: var(--muted); }
.activity__filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.activity__field { display: grid; gap: 4px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.activity__field select, .activity__field input {
  height: 32px; padding: 0 10px; min-width: 140px; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
:root[data-theme="light"] .activity__field select, :root[data-theme="light"] .activity__field input { background: #fff; }
.activity__field select:focus, .activity__field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.activity__search input { min-width: 220px; }
.activity__toggle { display: inline-flex; align-items: center; gap: 8px; height: 32px; font-size: 13px; color: var(--muted); cursor: pointer; }
.activity__toggle input { width: 16px; height: 16px; accent-color: var(--brand); }
.table--activity td { vertical-align: top; }
.table--activity .table__wrap { white-space: normal; min-width: 200px; }
.table--activity .activity__details { max-width: 420px; min-width: 240px; }
.activity__row--crit td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.activity__row--warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.activity__row:target { background: var(--brand-soft); }
.activity__detail { color: var(--muted); font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.activity__more summary { display: flex; gap: 8px; align-items: baseline; cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; overflow-wrap: anywhere; }
.activity__more summary::-webkit-details-marker { display: none; }
.activity__more summary::before { content: '▸'; flex: none; color: var(--brand-text); }
.activity__more[open] summary::before { content: '▾'; }
.activity__count { flex: none; padding: 0 6px; border-radius: 999px; background: var(--card-2); font-size: 11.5px; color: var(--muted); }
.activity__more .evidence { margin-top: 8px; max-height: 360px; overflow: auto; }
.activity__note { padding: 12px 24px 16px; font-size: 13px; }
.tag { display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 11px; font-weight: 600; }
.status { font-size: 13px; font-weight: 500; }
.status--open { color: var(--text); }
.status--resolved { color: var(--ok-text); }
.status--reviewed { color: var(--muted); }
.table--activity td[data-label="Status"] .btn { margin-left: 6px; }

/* agent connection */
.agent-link { display: inline-flex; }
.agent-link:hover .badge { filter: brightness(1.15); }
.download-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.conn-result { width: 100%; }
.conn { display: grid; gap: 6px; justify-items: start; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card-2); }
.conn--ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.conn--warn { border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.conn--crit { border-color: color-mix(in srgb, var(--crit) 35%, var(--border)); }
.conn__detail { font-size: 12.5px; color: var(--muted); }
.conn__fix { font-size: 13.5px; }
.setup-link { display: flex; align-items: center; gap: 16px; max-width: 880px; padding: 16px 20px; }
.setup-link > .icon { width: 36px; height: 36px; padding: 8px; flex: none; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); }
.setup-link > div { flex: 1; display: grid; }

/* settings */
.setting { display: grid; gap: 16px; justify-items: start; }
.setting__head { display: flex; align-items: flex-start; gap: 16px; width: 100%; }
.setting__head > div { flex: 1; }
.setting__head h2 { font-size: 15px; font-weight: 600; }
.setting__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin-bottom: 16px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin-top: 2px; font-weight: 600; }
.rules { display: grid; gap: 12px; }
.rules li { display: flex; align-items: baseline; gap: 12px; }
.rules .badge { flex: none; min-width: 92px; }
.rules span:last-child { color: var(--muted); }

/* ------------------------------------------------------------ login */

.auth { position: relative; min-height: 100vh; overflow: hidden; background: #0B0F17; }
:root[data-theme="light"] .auth { background: #F6F8FB; }
.auth__glow { position: absolute; inset: 0; pointer-events: none; }
.auth__glow::before, .auth__glow::after { content: ""; position: absolute; border-radius: 50%; filter: blur(80px); }
.auth__glow::before { width: 560px; height: 560px; left: 50%; top: 50%; transform: translate(-70%, -65%); background: rgba(99, 102, 241, 0.35); }
.auth__glow::after { width: 460px; height: 460px; left: 50%; top: 50%; transform: translate(-15%, -30%); background: rgba(168, 85, 247, 0.25); }
:root[data-theme="light"] .auth__glow::before { background: rgba(99, 102, 241, 0.2); }
:root[data-theme="light"] .auth__glow::after { background: rgba(168, 85, 247, 0.14); }
.auth__main { position: relative; min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 24px; padding: 24px; }
.auth-card {
  width: min(400px, calc(100vw - 32px)); display: grid; gap: 24px; padding: 32px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-pop);
}
.auth-card h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.auth-card h1 + p { margin-top: 4px; }
.auth-form { display: grid; gap: 16px; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }
.input-wrap__btn { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.input-wrap__btn:hover { color: var(--text); background: var(--hover); }
.input-wrap__btn .when-shown, .input-wrap__btn.is-shown .when-hidden { display: none; }
.input-wrap__btn.is-shown .when-shown { display: block; }
.auth .field input { height: 42px; }
.form-error { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--crit) 12%, transparent); color: var(--crit-text); font-size: 13px; font-weight: 500; }
.form-error .icon { width: 16px; height: 16px; }
.auth__foot { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.auth__foot .icon { width: 14px; height: 14px; }

/* ------------------------------------------------------ responsive */

@media (max-width: 1100px) {
  .evcols { grid-template-columns: minmax(0, 1fr); }
  .evcol__list { max-height: none; }
}

@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mini--wide { grid-column: 1 / -1; }
}

/* Tablet and phone: the sidebar slides out from the menu button. */
@media (max-width: 900px) {
  .layout, :root[data-nav="collapsed"] .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px; height: auto; z-index: 35;
    transform: translateX(-100%); visibility: hidden; transition: transform 180ms ease, visibility 180ms; box-shadow: var(--shadow-pop);
  }
  .nav-open .sidebar { transform: none; visibility: visible; }
  .nav-open .scrim--nav { display: block; position: fixed; inset: 0; z-index: 34; background: rgba(5, 8, 14, 0.55); }
  .icon-btn.sidebar__close { display: inline-grid; }
  .sidebar__link.sidebar__collapse { display: none; }
  /* The collapsed setting only applies to the wide layout. */
  :root[data-nav="collapsed"] .sidebar__label, :root[data-nav="collapsed"] .brand__name { display: revert; }
  :root[data-nav="collapsed"] .sidebar__link { justify-content: flex-start; padding: 0 12px; }
  :root[data-nav="collapsed"] .sidebar__top { justify-content: space-between; }
  :root[data-nav="collapsed"] .session { justify-content: flex-start; padding-inline: 8px; }
  :root[data-nav="collapsed"] .sidebar__link .nav-count { position: static; margin-left: auto; }
  .icon-btn.topbar__menu { display: inline-grid; }
  .topbar { padding: 8px 16px; gap: 12px; }
  .content { padding: 24px 16px 56px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat--alerts { grid-column: 1 / -1; }
  .split--even { grid-template-columns: minmax(0, 1fr); }
  .form-row { grid-template-columns: minmax(0, 1fr); }
}

/* Phone: search drops under the title, buttons become icons, tables become cards. */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .search { order: 3; width: 100%; }
  .topbar__actions .btn .btn__label, .site-head__actions .btn .btn__label { display: none; }
  .topbar__actions .btn, .site-head__actions .btn { width: 36px; padding: 0; }
  .stat { padding: 16px; gap: 12px; }
  .stat__icon { width: 36px; height: 36px; }
  .stat__value { font-size: 22px; }
  .mini-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .card__head, .card__head--filters { padding: 12px 16px; }
  .card__body { padding: 12px 16px 16px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td, .table td:first-child, .table td:last-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .table td.num { text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
  .table td[data-label="Site"] { display: block; text-align: left; padding-bottom: 8px; }
  .table td[data-label="Site"]::before, .table__actions::before { display: none; }
  .table__actions { width: auto; }
  .row--crit td:first-child, .row--warn td:first-child { box-shadow: none; }
  .row--crit { box-shadow: inset 3px 0 0 var(--crit); }
  .row--warn { box-shadow: inset 3px 0 0 var(--warn); }
  .site-head { padding: 16px; }
  .site-head h2 { font-size: 19px; }
  .event { grid-template-columns: 32px minmax(0, 1fr); }
  .event > .btn { grid-column: 2; justify-self: start; }
  .drawer__sheet { padding: 24px 16px; }
  .toasts { top: 12px; right: 12px; left: 12px; width: auto; }
  .setup > li { padding: 64px 16px 16px; }
  .setup > li::before { left: 16px; top: 16px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .rules li { flex-direction: column; gap: 4px; }
  .activity__field, .activity__search { width: 100%; }
  .activity__field select, .activity__field input, .activity__search input { width: 100%; min-width: 0; }
  .table--activity td[data-label="Event"], .table--activity td[data-label="Details"] { display: block; text-align: left; max-width: none; min-width: 0; }
  .table--activity td[data-label="Event"]::before, .table--activity td[data-label="Details"]::before { display: block; margin-bottom: 4px; }
  .activity__row--crit, .activity__row--warn { box-shadow: inset 3px 0 0 var(--crit); }
  .activity__row--warn { box-shadow: inset 3px 0 0 var(--warn); }
  .activity__row--crit td:first-child, .activity__row--warn td:first-child { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------ 2.0: accounts and workspaces */

.brand__logo { width: 32px; height: 32px; flex: none; border-radius: 9px; object-fit: contain; background: var(--card-2); }
.brand__mark--text { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.switcher { display: grid; gap: 4px; padding: 0 12px 12px; }
.switcher__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.switcher select { width: 100%; }
html[data-nav="collapsed"] .switcher { display: none; }
a.session { color: var(--text); border-radius: 10px; text-decoration: none; }
a.session:hover { background: var(--brand-soft); color: var(--text); }
.sidebar__powered { margin: 0 8px 4px; font-size: 11px; color: var(--muted); }
.auth__link { margin: 4px 0 0; text-align: center; font-size: 13px; }
.tag--warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--text); }

.notes { display: grid; gap: 12px; }
.notes h2 { display: inline-flex; align-items: center; gap: 8px; }
.notes__form { display: grid; gap: 8px; justify-items: start; }
.notes__form textarea { width: 100%; }
.notes__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.note { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 8%, transparent); border-left: 3px solid var(--warn); }
.note__body { margin: 0 0 4px; white-space: pre-wrap; }
.note__meta { margin: 0; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note__delete { display: inline; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }

.plain-alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plain-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--muted) 6%, transparent); }
.plain-alert > div { display: grid; gap: 4px; min-width: 0; }
.plain-alert--crit { border-left: 3px solid var(--crit); }
.plain-alert--warn { border-left: 3px solid var(--warn); }
.plain-alert--ok { border-left: 3px solid var(--ok); }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }

.person { display: inline-flex; align-items: center; gap: 10px; }
.person > span:last-child { display: grid; line-height: 1.3; }
.person .muted { font-size: 12px; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form--wide { display: flex; }
.inline-form--wide input:not([type="hidden"]) { flex: 1 1 220px; }
.row--sub td { background: color-mix(in srgb, var(--muted) 4%, transparent); }
.check-list--sites { max-height: 260px; overflow: auto; }
.notice-card { border: 1px solid var(--brand-text); }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-preview { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: var(--card-2); }

.share-page { min-height: 100vh; }
.share { max-width: 960px; margin: 0 auto; padding: 32px 16px 48px; display: grid; gap: 16px; }
.share__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.share__head h1 { margin: 0; }
.share__head p { margin: 4px 0 0; }
.share__checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.share__checks li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.share__foot { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 12.5px; }
.share__foot .icon { width: 14px; height: 14px; }

/* ------------------------------------------------------- team and clients */

.hero-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: center; background: linear-gradient(135deg, var(--brand-soft), transparent 70%), var(--card); }
.hero-card--stack { grid-template-columns: 1fr; }
.hero-card__text h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.hero-card__text p { margin: 0; }
.hero-card__form { display: grid; gap: 6px; }
.hero-card__form label { font-weight: 600; font-size: 13px; }
.input-row { display: flex; gap: 8px; flex-wrap: wrap; }
.input-row input { flex: 1 1 220px; min-width: 0; }
.field__label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.subhead { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.add-person { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.add-person label { font-weight: 600; font-size: 13px; }

.person-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.person-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card-2); }
.person-card__avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; font-weight: 700; font-size: 13px; }
.person-card__main { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.person-card__name { margin: 0; font-weight: 600; }
.person-card__email { margin: 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.person-card__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.person-card__sites summary { cursor: pointer; font-size: 12.5px; color: var(--brand-text); }
.person-card__sites form { margin-top: 10px; }
.pill-role { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 600; }

.pending { margin-top: 16px; }
.pending__title { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.pending__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pending__list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--muted) 7%, transparent); font-size: 13px; }
.pending__list li > span { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pending__list .icon { width: 14px; height: 14px; }

.client-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.client-card { display: grid; gap: 12px; height: 100%; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.client-card:hover { border-color: var(--brand); color: var(--text); transform: translateY(-1px); }
.client-card__top { display: flex; gap: 12px; align-items: center; }
.client-card__top > span:last-child { display: grid; }
.client-card__logo { width: 44px; height: 44px; flex: none; border-radius: 12px; object-fit: contain; background: var(--card-2); }
.client-card__logo--text { display: grid; place-items: center; background: linear-gradient(135deg, #0EA5E9, #6366F1); color: #fff; font-weight: 700; }
.client-card__name { font-size: 15px; }
.client-card__sites { display: flex; flex-wrap: wrap; gap: 6px; }
.client-card__open { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-text); font-size: 13px; font-weight: 600; }
.client-card__open .icon { width: 14px; height: 14px; }
.chip-site { padding: 2px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--border); font-size: 12px; }
.chip-site--own { border-style: dashed; }
.tag--client { background: color-mix(in srgb, #0EA5E9 18%, transparent); color: var(--text); }
.tag--shared { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--text); }

@media (max-width: 760px) {
  .hero-card { grid-template-columns: 1fr; }
  .person-card { flex-wrap: wrap; }
  .person-card__actions { width: 100%; justify-content: flex-start; }
}

.expiry { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.expiry select { width: auto; }

/* ---------------------------------------------- other platforms (Wix ...) */
.platform-form .steps { margin: 8px 0 12px; }
.wix-fields summary { cursor: pointer; font-weight: 600; margin: 4px 0 8px; }
.wix-result { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.wix-result li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.wix-result .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.wix-result__ok .icon { color: var(--ok); }
.wix-result__no .icon { color: var(--warn); }

/* ------------------------------------------- the read-only share page: every screen */
.share { width: 100%; box-sizing: border-box; }
.share .stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.share .stat { min-width: 0; }
.share .stat > div { min-width: 0; }
.share .stat__value { font-size: clamp(22px, 3.2vw, 28px); white-space: nowrap; }
.share .stat__label { overflow-wrap: anywhere; }
.share .card { min-width: 0; }
.share .trend { width: 100%; }
.share .spark--large { width: 100%; height: clamp(90px, 18vw, 160px); }
.share .plain-alert > div { flex: 1; min-width: 0; }
.share .plain-alert .badge { flex: none; }
.share .evidence { width: 100%; box-sizing: border-box; white-space: pre-wrap; overflow-wrap: anywhere; }
.share .playbook summary { width: auto; }
.share .share__checks li { align-items: flex-start; }
.share .share__checks li > span { min-width: 0; overflow-wrap: anywhere; }
.share__head h1 { font-size: clamp(22px, 5vw, 32px); overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .share { padding: 20px 14px 36px; gap: 12px; }
  .share .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .share .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .share .stat__icon { width: 36px; height: 36px; border-radius: 10px; }
  .share .plain-alert { flex-direction: column; gap: 8px; padding: 12px; }
  .share .card { padding: 16px; }
}
@media (max-width: 360px) {
  .share .stats { grid-template-columns: 1fr; }
}
