/* Huupa — design system. Flat, clean, light-first with dark toggle. */

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e5e8ee;
  --border-strong: #d3d8e2;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --accent: #008080;
  --accent-hover: #0a6f6f;
  --accent-soft: #e0f2f1;
  --accent-contrast: #ffffff;

  --ok: #16a34a;      --ok-soft: #e7f6ec;
  --warn: #d97706;    --warn-soft: #fdf1df;
  --bad: #dc2626;     --bad-soft: #fdeaea;
  --info: #2563eb;    --info-soft: #e8efff;
  --none: #cbd5e1;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  /* Elevation: flat surfaces use borders; --lift is for things that genuinely float. */
  --lift: 0 10px 30px rgba(15, 23, 42, 0.10);

  /* Type ramp — one job per step (refresh 2026-08-27). */
  --t-display: 22px;   --t-display-ls: -0.025em;
  --t-heading: 15px;   --t-heading-ls: -0.015em;
  --t-stat: 30px;      --t-stat-ls: -0.03em;
  --t-body: 13.5px;
  --t-meta: 12px;
  --t-micro: 10.5px;   --t-micro-ls: 0.05em;
  --sidebar-w: 240px;
  --topbar-h: 60px;
}

[data-theme="dark"] {
  --bg: #0b0f14;
  --surface: #111827;
  --surface-2: #172033;
  --border: #1f2937;
  --border-strong: #334155;
  --text: #e5e7eb;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-soft: rgba(20, 184, 166, 0.12);
  --accent-contrast: #04211d;
  --ok: #22c55e;      --ok-soft: rgba(34, 197, 94, 0.12);
  --warn: #f59e0b;    --warn-soft: rgba(245, 158, 11, 0.14);
  --bad: #ef4444;     --bad-soft: rgba(239, 68, 68, 0.14);
  --info: #60a5fa;    --info-soft: rgba(96, 165, 250, 0.14);
  --none: #334155;
  --shadow: none;
  --lift: 0 12px 34px rgba(0, 0, 0, 0.55);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 14px; height: 14px; }
svg.i.lg { width: 24px; height: 24px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.app > .sidebar { grid-column: 1; grid-row: 1; }
.app > .main { grid-column: 2; grid-row: 1; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 12px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 18px;
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--accent-contrast);
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
/* The nav is the scrollable region of the sidebar. Sidebar is a 100vh
   flex column with .brand pinned at top and .sidebar-foot pinned at
   bottom (margin-top:auto); giving .nav flex:1 + overflow-y:auto lets it
   grow into the middle and scroll internally when the list is longer
   than the viewport. Without this the whole sidebar overflows and the
   theme toggle + user chip + sign-out slide off the bottom, which is
   how the "Light mode" button vanished on shorter windows after we
   added Needs attention and WP updates. `min-height:0` is the CSS
   flexbox trick that lets a flex child shrink below its content size
   in the first place; without it, overflow-y is a no-op. */
.nav {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  /* Reserve scrollbar space so hovering does not shift labels; hide the
     track when the list fits so it does not read as "there is more". */
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.nav::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a.disabled { opacity: 0.45; pointer-events: none; }
.nav .section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); padding: 14px 10px 6px; font-weight: 600; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-size: 12px; color: var(--muted); overflow: hidden; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .sep { color: var(--muted-2); }
.topbar .spacer { flex: 1; }
.topbar .actions { display: flex; align-items: center; gap: 8px; }
.btn.hamburger { display: none; }
.scrim { display: none; }

.content { padding: 28px; max-width: 1240px; width: 100%; margin: 0 auto; }
.content > * + * { margin-top: 20px; }
/* An htmx-swapped wrapper is a single child of .content, so the rule above
   never reaches the blocks inside it and they render flush against each other.
   Any full-page partial target needs the same spacing its children would have
   had as direct children of .content. */
.content > [hx-get] > * + * { margin-top: 20px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-weight: 500; font-size: 13px; line-height: 1.2;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ---------- click feedback (Button FX)
   Every button that fires a request gets a visible "I heard you" response --
   spinner while in-flight, a brief green tick on success, a shake + red glow
   on failure. Wired globally in app.js: btnFxStart / btnFxSuccess / btnFxError.
   Opt out per-element with data-no-fx="1" (used by things that manage their
   own state -- e.g. htmx-swapped rows). Reduced-motion users get spinner +
   colour but not the wobble.
*/
.btn.is-loading { position: relative; pointer-events: none; opacity: 0.85; }
.btn.is-loading .fx-spin {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  vertical-align: -1px;
}
/* A brief green ring flash on success. Fades out over 900ms so the outcome
   badge that htmx-swaps into place next to the button is the persistent
   record; this is just the "yes, done" acknowledgement. */
.btn.fx-ok {
  animation: btn-fx-ok 900ms ease-out;
  box-shadow: 0 0 0 0 var(--ok);
}
@keyframes btn-fx-ok {
  0%   { box-shadow: 0 0 0 0 var(--ok); background-color: var(--ok-soft); }
  40%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); background-color: var(--ok-soft); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); background-color: initial; }
}
/* Failure: shake + red glow. Same 900ms window. */
.btn.fx-bad {
  animation: btn-fx-shake 380ms cubic-bezier(.36,.07,.19,.97), btn-fx-bad 900ms ease-out;
  transform: translate3d(0, 0, 0);
}
@keyframes btn-fx-bad {
  0%   { box-shadow: 0 0 0 0 var(--bad); background-color: var(--bad-soft); }
  40%  { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); background-color: var(--bad-soft); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); background-color: initial; }
}
@keyframes btn-fx-shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d( 2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d( 3px, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .btn.fx-ok, .btn.fx-bad { animation-name: none; }
  .btn.is-loading .fx-spin { animation: none; }
}

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-body { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: var(--t-heading); font-weight: 700; letter-spacing: var(--t-heading-ls); display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* ---------- stat tiles ---------- */
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-height: 104px;
  position: relative; overflow: hidden;
}
.tile .label {
  font-size: var(--t-micro); color: var(--muted); font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
  display: flex; align-items: center; gap: 7px;
}
.tile .value { font-size: var(--t-stat); font-weight: 700; letter-spacing: var(--t-stat-ls); line-height: 1; }
.tile .delta { font-size: var(--t-meta); color: var(--muted-2); }
/* State is carried by a stripe + the label, not colour on the number alone. */
.tile.ok    { box-shadow: inset 3px 0 0 var(--ok); }
.tile.warn  { box-shadow: inset 3px 0 0 var(--warn); }
.tile.bad   { box-shadow: inset 3px 0 0 var(--bad); }
.tile.accent{ box-shadow: inset 3px 0 0 var(--accent); }
.tile.ok .value,    .tile.ok .label    { color: var(--ok); }
.tile.warn .value,  .tile.warn .label  { color: var(--warn); }
.tile.bad .value,   .tile.bad .label   { color: var(--bad); }
.tile.accent .value,.tile.accent .label{ color: var(--accent); }
.tile .spark { position: absolute; right: 14px; bottom: 12px; opacity: 0.9; }

/* ---------- badges / dots / grades ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--muted); font-weight: 500; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--none); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.unknown { background: var(--none); }

.grade {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  font-weight: 800; font-size: 15px;
  background: var(--surface-2); color: var(--muted);
}
.grade.A { background: var(--ok-soft); color: var(--ok); }
.grade.B { background: #e6f4ea; color: #2f855a; }
.grade.C { background: var(--warn-soft); color: var(--warn); }
.grade.D { background: #fde8dc; color: #c2410c; }
.grade.F { background: var(--bad-soft); color: var(--bad); }

/* ---------- progress bars ---------- */
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.4s ease; }
.meter > span.warn { background: var(--warn); }
.meter > span.bad { background: var(--bad); }
.meter.thick { height: 8px; }

.vital { display: flex; flex-direction: column; gap: 6px; }
.vital .label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.vital .value { font-size: 16px; font-weight: 600; }
.vital .value small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; }

/* ---------- chips (services etc.) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
}
.chip.ok { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.chip.bad { border-color: transparent; background: var(--bad-soft); color: var(--bad); }
.chip .dot { width: 6px; height: 6px; box-shadow: none; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th {
  text-align: left; font-size: var(--t-micro); font-weight: 600; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: var(--t-micro-ls);
  padding: 9px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap;
}
/* No horizontal row-divider lines (JB's standing preference) — rows are told
   apart by hover, not a border on every <td>. Keep the <th> underline only. */
table.table td { padding: 11px 20px; border-bottom: none; vertical-align: middle; }
table.table tbody tr:hover td { background: var(--surface-2); }
table.table tr.rowlink { cursor: pointer; }
table.table td a.primary { color: var(--text); font-weight: 600; }
table.table td a.primary:hover { color: var(--accent); text-decoration: none; }
table.table .right { text-align: right; }
table.table .hide-sm { }

/* ---------- heat strip (uptime) ---------- */
.heat { display: inline-flex; gap: 2px; align-items: center; }
.heat span { width: 6px; height: 18px; border-radius: 2px; background: var(--none); opacity: 0.55; }
.heat span.ok { background: var(--ok); opacity: 0.8; }
.heat span.warn { background: var(--warn); opacity: 1; }
.heat span.bad { background: var(--bad); opacity: 1; }
.heat.lg span { width: 10px; height: 28px; border-radius: 3px; }
.heat span:hover { opacity: 1; outline: 1px solid var(--text); }

/* ---------- checks ---------- */
.checks { display: flex; flex-wrap: wrap; gap: 5px; }
.chk {
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px;
  background: var(--surface-2); color: var(--muted);
}
.chk.ok { background: var(--ok-soft); color: var(--ok); }
.chk.warn { background: var(--warn-soft); color: var(--warn); }
.chk.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- tabs ---------- */
/* A tab strip wraps instead of scrolling: a scrolling strip drew a horizontal
   AND a vertical scrollbar under the CRM tabs (JB, 2026-09-16). On a phone it
   scrolls sideways with the bar hidden. */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); }
@media (max-width: 700px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}
.tabs a {
  padding: 10px 11px; color: var(--muted); font-weight: 500; font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a.disabled { opacity: 0.4; pointer-events: none; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 14px; transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- service ladder rung number ---------- */
.rung {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-right: 2px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700; line-height: 1; flex: none;
}

/* ---------- reveal (show older / show more, inside a card) ---------- */
details.reveal > summary {
  cursor: pointer; list-style: none; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 5px 10px; border-radius: var(--radius-sm);
  font-size: var(--t-meta); font-weight: 500; color: var(--muted);
  border: 1px solid var(--border);
}
details.reveal > summary::-webkit-details-marker { display: none; }
details.reveal > summary:hover { background: var(--surface-2); color: var(--text-2); }
details.reveal > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.reveal[open] > summary .stage-chev { transform: rotate(90deg); }

/* ---------- collapsible stage card (migration domains) ---------- */
details.stage > summary {
  cursor: pointer; list-style: none; user-select: none;
  transition: background 0.12s;
}
details.stage > summary::-webkit-details-marker { display: none; }
details.stage > summary:hover { background: var(--surface-2); }
details.stage > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* A collapsed card keeps its bottom border only when open, so it reads as one row shut. */
details.stage:not([open]) > summary { border-bottom: none; }
.stage-chev { color: var(--muted); flex: none; transition: transform 0.15s ease; }
details.stage[open] > summary .stage-chev { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
  details.stage > summary, .stage-chev { transition: none; }
}

/* ---------- steps (state-machine progress: migrations, guided connect) ---------- */
.steps { display: flex; flex-wrap: wrap; gap: 6px; }
.step {
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.01em;
  padding: 4px 10px; border-radius: 999px; text-transform: capitalize;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
}
.step.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.step.current {
  background: var(--accent); color: var(--accent-contrast);
  border-color: transparent; font-weight: 600;
}

/* ---------- timeline (migration events; GC-1 guided connect) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li {
  position: relative; padding: 9px 0 9px 20px; font-size: 13.5px;
  border-left: 2px solid var(--border); margin-left: 5px;
}
.timeline li::before {
  content: ''; position: absolute; left: -5px; top: 15px;
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent); box-shadow: 0 0 0 3px var(--surface);
}
.timeline li:last-child { border-left-color: transparent; }

/* ---------- key/value ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

/* ---------- report cards ---------- */
.report {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; background: var(--surface);
}
.report .kind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.report .summary { font-size: 13.5px; font-weight: 500; }
.report .when { font-size: 11.5px; color: var(--muted-2); }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ico { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.empty h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.empty p { font-size: 13px; max-width: 360px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; display: flex; gap: 10px; align-items: center; min-width: 240px;
  animation: toast-in 0.2s ease-out;
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.bad { border-left: 3px solid var(--bad); }
.toast.warn { border-left: 3px solid var(--warn); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- modal ---------- */
dialog.modal { border: none; border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--text); max-width: 440px; width: calc(100% - 32px); box-shadow: var(--lift); }
dialog.modal::backdrop { background: rgba(15, 23, 42, 0.45); }
dialog.modal .modal-body { padding: 22px 24px 6px; }
dialog.modal h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
dialog.modal p { color: var(--muted); font-size: 13.5px; }
dialog.modal .modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; }

/* ---------- charts ---------- */
.chart { width: 100%; }
.chart-title { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.uplot .u-legend { font-size: 12px; color: var(--muted); }

/* ---------- jobs / code ---------- */
.job { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 16px; overflow: hidden; }
.job.running { border-color: var(--info); }
.job.failed { border-color: var(--bad); }
.job.ok { border-color: var(--ok); }
.job-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.job-head .spacer { flex: 1; }
pre.code {
  margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.55;
  background: #0b0f14; color: #d1d5db; white-space: pre-wrap; word-break: break-word;
  max-height: 360px; overflow: auto; border-top: 1px solid var(--border);
}
pre.code .err { color: #fca5a5; }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
details summary { cursor: pointer; color: var(--muted); }
details[open] summary { margin-bottom: 6px; }

/* ---------- skeleton ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- freshness pill ---------- */
.fresh { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.fresh { padding: 5px 11px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.fresh .pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-in-out infinite; }
.fresh.stale { background: var(--warn-soft); color: var(--warn); }
.fresh.stale .pulse { animation: none; }
/* A frozen dashboard should be visible at a glance — the dot stops when stale. */
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { .fresh .pulse { animation: none; } }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.login-card .brand { padding: 0 0 6px; justify-content: center; font-size: 18px; }
.login-card .lede { text-align: center; color: var(--muted); font-size: 13px; margin-top: -10px; }

/* ---------- page header row ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .app > .main { grid-column: 1; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); z-index: 40; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 0 0 40px rgba(0,0,0,0.2); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(15,23,42,0.35); z-index: 30; display: none; }
  .scrim.open { display: block; }
  .btn.hamburger { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  table.table th.hide-sm, table.table td.hide-sm { display: none; }
  table.table th, table.table td { padding-left: 14px; padding-right: 14px; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .tile .value { font-size: 24px; }
}

/* segmented control — mode pickers (connect form, etc.) */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px;
       background: var(--surface-2); border: 1px solid var(--border); }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
           border: 0; border-radius: 8px; background: transparent; cursor: pointer;
           font: inherit; font-size: 13px; font-weight: 500; color: var(--muted);
           transition: background .12s, color .12s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* remediation pages */
.sub-head { margin: 18px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em;
            text-transform: uppercase; color: var(--muted); }
.sub-head:first-child { margin-top: 0; }
ul.list { margin: 0; padding: 0; list-style: none; }
ul.list > li { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
ul.list > li:last-child { border-bottom: 0; }
.pre-sm { margin: 8px 0 0; padding: 9px 11px; border-radius: 8px; background: var(--surface-2);
          font-family: var(--mono); font-size: 11.5px; line-height: 1.6; overflow-x: auto;
          max-height: 220px; }
/* ---------- system status checklist (dashboard) ---------- */
.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.status-row { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--surface-2); font-size: 13.5px; }
.status-row:last-child { border-bottom: none; }
.status-row .dot { margin-top: 5px; }
.status-label { font-weight: 600; display: block; }
.status-detail { display: block; }
/* A fault reads from the row itself — it used to be repeated as a full-width
   alert below the list, which said nothing new and doubled the card's height. */
.status-row.warn .status-detail { color: var(--warn); }
.status-row.bad .status-detail { color: var(--bad); }
.status-row.bad .status-label { color: var(--bad); }

/* ---------- command palette (Ctrl+K smart search) ---------- */
.search-trigger {
  display: inline-flex; align-items: center; gap: 9px;
  min-width: 210px; padding: 7px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--muted); font-size: 13px; text-align: left;
  transition: border-color 0.12s, color 0.12s;
}
.search-trigger:hover { border-color: var(--accent); color: var(--text); }
.search-trigger .st-hint { flex: 1; }
.kbd {
  font-family: var(--mono); font-size: 10.5px; line-height: 1.4;
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted);
  white-space: nowrap;
}
dialog.palette { max-width: 560px; margin-top: 10vh; }
dialog.palette .palette-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted);
}
.palette-input.input { border: none; box-shadow: none; padding: 0; background: transparent; font-size: 15px; }
.palette-input.input:focus { border: none; box-shadow: none; outline: none; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.palette-group {
  font-size: var(--t-micro); font-weight: 600; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: var(--t-micro-ls);
  padding: 10px 10px 4px;
}
.palette-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text); font-size: 13.5px;
}
.palette-item:hover { text-decoration: none; }
.palette-item.active { background: var(--accent-soft); color: var(--accent); }
.palette-item .pi-sub {
  margin-left: auto; color: var(--muted-2); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%;
}
.palette-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  .search-trigger { min-width: 0; }
  .search-trigger .st-hint, .search-trigger .kbd { display: none; }
}

.row-actions { display: flex; gap: 8px; align-items: center; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px;
          border: 1px solid rgba(0,0,0,.12); }

/* ---- Traffic tab: per-table period tabs + pager ------------------------- */
/* Sub-tabs sit inside a card, under the card head, so they read as scoping
   that one table rather than the whole page like the top-level .tabs row. */
.sub-tabs { border-bottom: 1px solid var(--border); margin: -4px 0 10px; gap: 0; }
.sub-tabs a { padding: 6px 10px; font-size: 12px; }

.pager { display: flex; align-items: center; justify-content: space-between;
         gap: 12px; flex-wrap: wrap; padding: 10px 2px 2px; }
.pager .pages { display: flex; gap: 2px; align-items: center; }
.pager .pages a { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 6px;
                  display: inline-flex; align-items: center; justify-content: center;
                  font-size: 12px; color: var(--muted); border: 1px solid transparent; }
.pager .pages a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.pager .pages a.active { color: var(--accent); border-color: var(--border); font-weight: 600; }
.pager .pages a.disabled { opacity: .35; pointer-events: none; }
.pager .pages .gap { color: var(--muted); padding: 0 2px; font-size: 12px; }

/* Long URLs in the Top pages table — was an inline style on every cell. */
.ellipsis { display: block; max-width: 360px; overflow: hidden;
            text-overflow: ellipsis; white-space: nowrap; }

/* Wide tables that must FIT rather than scroll (SEO crawled pages, top-N).
   Default `.table` is auto-layout, so every column claims its max-content
   width: nine columns at 20px of side padding plus two 360px-capped URL cells
   overflowed a full-width card and produced a horizontal scrollbar on a
   1400px screen, with empty space still visible either side of the card.
   Fixed layout makes the widths declarative -- the th widths below are
   honoured, the unsized column absorbs the remainder, and text truncates
   instead of pushing. Column hiding still works: `display:none` on a th
   removes its column from the fixed layout, so the small-screen view
   redistributes rather than reserving gaps. */
table.table.table-fixed { table-layout: fixed; width: 100%; }
table.table.table-fixed th, table.table.table-fixed td { padding-left: 10px; padding-right: 10px; }
table.table.table-fixed td { overflow: hidden; }
/* Headers are `white-space: nowrap` globally, and a nowrap word still claims a
   minimum width even in a fixed layout -- "Clicks" and "STATUS" alone were
   enough to push the table a few pixels past its container in the 890-995px
   band and on phones. Clipping the header is the right trade: a truncated
   column label costs nothing next to a scrollbar on every row. */
table.table.table-fixed th { overflow: hidden; text-overflow: ellipsis; }
/* Inside a fixed table the cell already has a real width to truncate against,
   so the global 360px cap would only make the column narrower than its share. */
table.table.table-fixed .ellipsis { max-width: 100%; }
table.table.table-fixed .chips { gap: 4px; }
table.table.table-fixed .chip { padding: 2px 7px; font-size: 11px; }

/* Traffic tab: section header inside the tab -- smaller than card <h2>,
   used to separate the primary GA4 view from the reference GSC/CF detail. */
.section-h { font-size: 13px; font-weight: 600; text-transform: uppercase;
             letter-spacing: 0.04em; color: var(--muted); margin: 22px 0 10px;
             display: flex; align-items: center; gap: 6px; }

/* Traffic tab: country-flag glyph in the Countries table. Emoji, not an
   image asset -- degrades to blank when the code is missing (e.g. GA4
   "(not set)"). Fixed width so the country name column left-edge lines up. */
.flag { display: inline-block; width: 22px; margin-right: 6px; font-size: 15px;
        text-align: center; vertical-align: -1px; }

/* When sub-tabs sit inside a .card-head (per-section period tabs on the GA4
   Traffic tables), let them float to the right of the heading and drop the
   underline that only makes sense standalone. */
.card-head .sub-tabs { border: none; margin: 0; }

/* Sources table (Traffic tab): favicon per row, or a placeholder glyph for
   non-browsable sources ((direct), a form plugin name, an app id). Fixed
   size + inline-flex vertical centering so rows line up regardless of
   whether a given favicon loaded. */
.src-icon { width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px;
            border-radius: 3px; background: var(--surface-2); }
.src-icon-ph { display: inline-flex; width: 16px; height: 16px; margin-right: 8px;
               vertical-align: -3px; color: var(--muted); }
.src-icon-ph .i { width: 14px; height: 14px; }

/* ---- Site-wide WhatsApp support ---------------------------------------- */
/* pointer-events:none is load-bearing, not tidiness. The closed panel is
   visibility:hidden (NOT display:none) so it still occupies layout, making this
   container a ~350x332px invisible box at z-index 1200 over the bottom-right of
   the page. Without this it hit-tests like any other element and silently eats
   clicks on whatever sits under it. Re-enabled on the interactive children
   below. */
/* Sits above the toast stack (.toasts, bottom:20px) — both are bottom-right and
   the toggle (z-index 1200) otherwise covers update popups. ~80px clears a
   single toast; a rare multi-toast stack would want the toasts relocated. */
.wa-widget { position:fixed; right:clamp(14px,2vw,26px); bottom:clamp(80px,9vh,92px);
             z-index:1200; display:flex; flex-direction:column; align-items:flex-end; gap:12px;
             pointer-events:none;
             font-family:Inter,system-ui,sans-serif; }
.wa-toggle { pointer-events:auto; min-height:54px; padding:0 18px 0 14px; border:0; border-radius:999px;
             display:flex; align-items:center; gap:9px; color:#fff; background:#20b85a;
             box-shadow:0 12px 30px rgba(10,71,37,.28); font:700 14px/1 Inter,system-ui,sans-serif;
             cursor:pointer; transition:transform .18s ease,box-shadow .18s ease,background .18s ease; }
.wa-toggle:hover { transform:translateY(-2px); background:#18a94f; box-shadow:0 15px 34px rgba(10,71,37,.34); }
.wa-toggle:focus-visible,.wa-close:focus-visible,.wa-start:focus-visible { outline:3px solid color-mix(in srgb,#25d366 45%,white); outline-offset:3px; }
.wa-toggle svg { width:29px; height:29px; flex:none; }
.wa-panel { width:min(350px,calc(100vw - 28px)); overflow:hidden; border:1px solid color-mix(in srgb,var(--border) 85%,transparent);
            border-radius:20px; color:var(--text); background:var(--surface); box-shadow:0 22px 60px rgba(7,24,38,.24);
            opacity:0; visibility:hidden; transform:translateY(12px) scale(.97); transform-origin:bottom right;
            transition:opacity .18s ease,transform .18s ease,visibility .18s; pointer-events:none; }
.wa-widget.is-open .wa-panel { opacity:1; visibility:visible; transform:none; pointer-events:auto; }
.wa-panel-head { display:flex; align-items:center; gap:11px; padding:17px 16px; color:#f3fffa;
                 background:linear-gradient(135deg,#075e54,#087d68); }
.wa-avatar { width:40px; height:40px; border-radius:50%; display:grid; place-items:center; flex:none;
             color:#075e54; background:#dffbef; font-weight:800; }
.wa-panel-head div { min-width:0; flex:1; }
.wa-panel-head strong,.wa-panel-head span { display:block; }
.wa-panel-head strong { font-size:15px; }
.wa-panel-head span { margin-top:3px; color:rgba(255,255,255,.75); font-size:11px; }
.wa-close { width:34px; height:34px; border:0; border-radius:50%; color:#fff; background:transparent;
            font:300 25px/1 sans-serif; cursor:pointer; }
.wa-close:hover { background:rgba(255,255,255,.12); }
.wa-panel-body { padding:20px 16px 16px; background:linear-gradient(145deg,color-mix(in srgb,#e9f6ef 70%,var(--surface)),var(--surface)); }
.wa-message { max-width:260px; padding:12px 14px; border-radius:4px 14px 14px 14px; background:var(--surface);
              box-shadow:0 5px 16px rgba(15,44,29,.08); font-size:13px; line-height:1.5; }
.wa-response { display:block; margin:9px 2px 16px; color:var(--muted); font-size:11px; }
.wa-start { min-height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center; gap:9px;
            color:#fff; background:#20b85a; font-size:13px; font-weight:750; text-decoration:none; }
.wa-start:hover { color:#fff; background:#18a94f; text-decoration:none; }
.wa-start svg { width:22px; height:22px; }
@media(max-width:520px){
  .wa-widget { bottom:calc(72px + env(safe-area-inset-bottom,0px)); right:12px; }
  .wa-toggle { width:54px; padding:0; justify-content:center; }
  .wa-toggle span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
}
@media(prefers-reduced-motion:reduce){ .wa-toggle,.wa-panel { transition:none; } }

/* ---- Hosting control panel (SPanel-shaped): tool groups + info aside ------ */
/* One layout for both doors -- the operator's account page and the customer's
   /client/hosting. Tools are cards of icon tiles; the aside is the "General
   information" / "Resources" column. See services/hosting_panel.py. */
.cp { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; margin-top: 16px; }
.cp-main { min-width: 0; }
.cp-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.cp-head .cp-head-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cp-head .cp-head-tools .select { width: auto; max-width: 240px; }
.cp-info { display: flex; flex-direction: column; }
.cp-info > div { display: flex; flex-direction: column; gap: 4px; padding: 10px 20px; border-bottom: 1px solid var(--surface-2); }
.cp-info > div:last-child { border-bottom: none; }
.cp-info .label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.cp-info .value { font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cp-info .meter { margin-top: 4px; }
.tool-group { margin-bottom: 16px; }
.tool-group .card-head h2 { gap: 10px; }
.gicon { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; color: #fff; flex: none; }
.gicon.tone-accent { background: var(--accent); }
.gicon.tone-ok { background: var(--ok); }
.gicon.tone-warn { background: var(--warn); }
.gicon.tone-bad { background: var(--bad); }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; padding: 14px 20px 18px; }
a.tool { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text); transition: background .12s, border-color .12s; }
a.tool:hover { background: var(--surface-2); border-color: var(--border); text-decoration: none; }
a.tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a.tool .tool-ico { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; flex: none; color: var(--accent); background: var(--surface); }
a.tool.tone-ok .tool-ico { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
a.tool.tone-warn .tool-ico { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
a.tool.tone-bad .tool-ico, a.tool.danger .tool-ico { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
a.tool.tone-accent .tool-ico { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
a.tool .tool-ico .i { width: 20px; height: 20px; }
a.tool .tool-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
a.tool .tool-title { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
a.tool .tool-hint { font-size: 12px; color: var(--muted); line-height: 1.3; }
a.tool.disabled { opacity: 0.45; pointer-events: none; }
a.tool.danger .tool-title { color: var(--bad); }
/* Row menu on the accounts list -- native <details>, no JS. */
details.menu { position: relative; display: inline-block; }
/* .table-wrap scrolls horizontally, which also CLIPS an open menu on a short
   table (the list has two rows; the menu is nine). Lift the clip only while a
   menu is open, so the wrap keeps scrolling the rest of the time. */
.table-wrap:has(details.menu[open]) { overflow: visible; }
table.table td:has(details.menu[open]) { overflow: visible; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--lift); text-align: left; }
details.menu .menu-list form { display: block; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; white-space: nowrap; }
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item.danger { color: var(--bad); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
@media (max-width: 1024px) {
  .cp { grid-template-columns: 1fr; }
  .cp-aside { position: static; }
}

/* ---- CRM (2026-09-15) --------------------------------------------------- */
/* Network chip from the phone prefix -- display only, never routing. */
.contact-net { display:inline-flex; align-items:center; padding:1px 7px; border-radius:999px; font-size:11px;
               font-weight:600; letter-spacing:.02em; margin-left:6px; vertical-align:1px;
               border:1px solid var(--border); color:var(--text-2); background:var(--surface-2); }
.contact-net.mtn { background:#fff3c4; color:#7a5a00; border-color:transparent; }
.contact-net.telecel { background:#ffd9d9; color:#a11; border-color:transparent; }
.contact-net.at { background:#dbeafe; color:#1e40af; border-color:transparent; }
[data-theme="dark"] .contact-net.mtn { background:#4a3a00; color:#ffd866; }
[data-theme="dark"] .contact-net.telecel { background:#4a1a1a; color:#ff9a9a; }
[data-theme="dark"] .contact-net.at { background:#1a2a4a; color:#9ec5ff; }
/* Segment builder: one rule per row, field / operator / value. */
.rule-row { display:grid; grid-template-columns: 2fr 1fr 2fr; gap:8px; margin-bottom:8px; align-items:center; }
.rule-row .select, .rule-row .input { padding:7px 10px; font-size:13px; }
@media (max-width: 720px) { .rule-row { grid-template-columns: 1fr; } }

/* ---------- WordPress updates in place (static/wp-updates.js)
   A row's Update button walks queued -> updating -> updated / failed without a
   page reload. "Updated" is the persistent record, so it pops and stays; the
   row itself flashes green once. */
.wpu-btn { min-width: 92px; justify-content: center; }
.wpu-btn[disabled] { opacity: 1; }
.wpu-btn.wpu-queued { background: var(--surface-2); border-color: var(--border-strong); color: var(--muted); }
.wpu-btn.wpu-running { background: var(--info-soft); border-color: var(--info); color: var(--info); }
.wpu-btn.wpu-running .wpu-spin {
  display: inline-block; width: 11px; height: 11px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.wpu-btn.wpu-done {
  background: var(--ok-soft); border-color: var(--ok); color: var(--ok);
  pointer-events: none; animation: wpu-pop 520ms cubic-bezier(.2,1.6,.4,1);
}
.wpu-btn.wpu-done svg.wpu-tick path {
  stroke-dasharray: 24; stroke-dashoffset: 24;
  animation: wpu-draw 420ms 120ms ease-out forwards;
}
.wpu-btn.wpu-failed { background: var(--bad-soft); border-color: var(--bad); color: var(--bad);
  animation: btn-fx-shake 380ms cubic-bezier(.36,.07,.19,.97); }
tr.wpu-row-done > td { animation: wpu-flash 1600ms ease-out; }
.wpu-new { color: var(--ok); font-weight: 600; }
.wpu-err { color: var(--bad); font-size: var(--t-meta); margin-top: 2px; }
.wpu-bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wpu-bulk .check { display: inline-flex; gap: 6px; align-items: center; font-size: var(--t-meta); color: var(--muted); }
.wpu-progress { font-size: var(--t-meta); color: var(--muted); }
@keyframes wpu-pop { 0% { transform: scale(0.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes wpu-draw { to { stroke-dashoffset: 0; } }
@keyframes wpu-flash { 0% { background: var(--ok-soft); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .wpu-btn.wpu-done, .wpu-btn.wpu-failed, tr.wpu-row-done > td { animation: none; }
  .wpu-btn.wpu-done svg.wpu-tick path { animation: none; stroke-dashoffset: 0; }
  .wpu-btn.wpu-running .wpu-spin { animation: none; }
}
