/* Control room styles. Light and dark follow the operating system. */

/* Cognitive's visual identity (cognitiveadv.com): DM Sans, black chrome, the magenta-violet gradient, round corners.
   Text colours keep WCAG AA contrast: magenta #c4139f carries white text in light mode, pink #fa54c0 black text in dark. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('vendor/fonts/DMSans-latin.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --brand-gradient: linear-gradient(90deg, #fe5fb1, #fa52c3 21%, #ee35f3 48%, #e76af6 74%, #f7c6ef);
  --brand-pink: #fa54c0;
  --brand-magenta: #e927c2;
  --brand-plum: #740067;
  --chrome: #000000;
  --chrome-text: #ffffff;
  --chrome-muted: #bbc7d3;
  --chrome-hover: rgb(255 255 255 / 0.10);
  --bg: #f3f5f8;
  --bg-glow: rgb(233 39 194 / 0.10);
  --surface: #ffffff;
  --surface-2: #f1f4f7;
  --surface-3: #e3eaf0;
  --glass: rgb(255 255 255 / 0.78);
  --text: #0b0b0f;
  --muted: #5c6672;
  --border: #e2e7ee;
  --border-strong: #cdd5df;
  --primary: #c4139f;
  --primary-2: #8f1dbf;
  --primary-soft: rgb(233 39 194 / 0.10);
  --primary-text: #ffffff;
  --focus: #e927c2;
  --ring: 0 0 0 4px rgb(233 39 194 / 0.22);
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --warn: #93370d;
  --warn-bg: #fffaeb;
  --amber: #f79009;
  --error: #c01048;
  --error-bg: #fff1f3;
  --info: #1d55b3;
  --info-bg: #eef4ff;
  --soon: #8f1dbf;
  --soon-bg: #f8f0ff;
  --add-bg: #e3fbea;
  --del-bg: #ffe8eb;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-xs: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-sm: 0 1px 3px rgb(16 24 40 / 0.06), 0 1px 2px rgb(16 24 40 / 0.04);
  --shadow-md: 0 8px 20px -6px rgb(16 24 40 / 0.12), 0 2px 6px -2px rgb(16 24 40 / 0.05);
  --shadow-lg: 0 24px 48px -12px rgb(16 24 40 / 0.25), 0 4px 10px -4px rgb(16 24 40 / 0.08);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-glow: rgb(233 39 194 / 0.16);
    --surface: #111114;
    --surface-2: #19191e;
    --surface-3: #24242b;
    --glass: rgb(17 17 20 / 0.78);
    --chrome: #0b0b0e;
    --chrome-hover: rgb(255 255 255 / 0.08);
    --text: #f5f5f7;
    --muted: #a5afbb;
    --border: #26262e;
    --border-strong: #363640;
    --primary: #fa54c0;
    --primary-2: #c084fc;
    --primary-soft: rgb(250 84 192 / 0.14);
    --primary-text: #000000;
    --focus: #fa54c0;
    --ring: 0 0 0 4px rgb(250 84 192 / 0.28);
    --ok: #6ce9a6;
    --ok-bg: #0b2a1c;
    --warn: #fec84b;
    --warn-bg: #2c1f06;
    --amber: #fdb022;
    --error: #ff8fa3;
    --error-bg: #34101a;
    --info: #a4bcfd;
    --info-bg: #141c3d;
    --soon: #e0a6ff;
    --soon-bg: #26143a;
    --add-bg: #0f3321;
    --del-bg: #3d1420;
    --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.45);
    --shadow-md: 0 8px 20px -6px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 24px 48px -12px rgb(0 0 0 / 0.75);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 420px at 50% -120px, var(--bg-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: 2rem; letter-spacing: -0.045em; }
h2 { font-size: 1.15rem; letter-spacing: -0.025em; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75em; }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.88em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.wrap { overflow-wrap: anywhere; }
.lead { color: var(--muted); max-width: 70ch; }
.big { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.03em; margin: 0; font-variant-numeric: tabular-nums; }
.text-error { color: var(--error); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
::selection { background: var(--primary-soft); }

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

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Frame: Cognitive's floating black bar */
.topbar {
  position: sticky; top: 12px; z-index: 25;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  margin: 12px auto 0; width: min(1184px, calc(100% - 24px)); padding: 8px 10px 8px 22px; min-height: 60px;
  background: var(--chrome); color: var(--chrome-text); border-radius: 24px;
  box-shadow: 0 12px 30px -12px rgb(0 0 0 / 0.45), inset 0 0 0 1px rgb(255 255 255 / 0.06);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--chrome-text); text-decoration: none; white-space: nowrap; }
.wordmark { height: 24px; width: auto; display: block; flex: none; }
.brand-product {
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.01em; padding: 3px 10px; border-radius: 999px;
  border: 1px solid rgb(250 84 192 / 0.45); background: rgb(250 84 192 / 0.08);
}
.brand-product > span { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar nav { display: flex; gap: 2px; flex-wrap: wrap; }
.topbar nav a {
  padding: 7px 14px; border-radius: 999px; color: var(--chrome-muted); text-decoration: none; font-weight: 700; font-size: 0.93rem;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.topbar nav a:hover { background: var(--chrome-hover); color: var(--chrome-text); }
.topbar nav a[aria-current='page'] { background: rgb(255 255 255 / 0.14); color: var(--chrome-text); }
.topbar :focus-visible { outline-color: var(--brand-pink); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-user .muted { color: var(--chrome-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .btn { background: transparent; color: var(--chrome-text); border-color: rgb(255 255 255 / 0.22); box-shadow: none; }
.topbar .btn:hover:not(:disabled) { background: var(--chrome-hover); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 700; color: #fff; text-transform: uppercase;
  color: #fff; background: var(--brand-gradient);
}
.search-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 6px 4px 14px; border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.16); background: rgb(255 255 255 / 0.06); color: var(--chrome-muted); font: inherit;
  font-size: 0.88rem; font-weight: 700; cursor: pointer; transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.search-btn:hover { border-color: rgb(255 255 255 / 0.32); color: var(--chrome-text); background: var(--chrome-hover); }
.search-btn .kbd { background: rgb(255 255 255 / 0.10); border-color: rgb(255 255 255 / 0.16); box-shadow: none; color: var(--chrome-muted); }
.search-btn svg { width: 15px; height: 15px; }
kbd, .kbd {
  font: 600 0.72rem/1 var(--mono); padding: 4px 6px; border-radius: 6px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border); box-shadow: inset 0 -1px 0 var(--border);
}
.page { max-width: 1200px; margin: 0 auto; padding: 32px 24px 96px; }
.page > * { animation: rise 0.28s var(--ease) both; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.crumbs { margin: 0 0 6px; color: var(--muted); font-size: 0.88rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.site-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* The other workspaces of the site (views/workspaces.js, OtherWorkspaces): a quiet link to the workspace list. */
.site-status .ws-others { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.site-status .ws-others:hover { color: var(--text); }
.tabs {
  display: flex; gap: 2px; overflow-x: auto; margin: 10px 0 22px; padding: 4px; width: fit-content; max-width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 9px; white-space: nowrap;
  color: var(--muted); text-decoration: none; font-weight: 550; font-size: 0.93rem;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current='page'] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-body > * { animation: rise 0.25s var(--ease) both; }

/* Cards and layout */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; min-width: 0; box-shadow: var(--shadow-xs);
}
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.card-actions { display: flex; gap: 8px; }
.grid-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-cards .card { margin: 0; }
.grid-2 { display: grid; gap: 0 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-3 { display: grid; gap: 0 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: start; }
.grid-2 > *, .grid-3 > * { min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-add { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-bottom: 12px; }
.inline-add .field { margin-bottom: 0; flex: 1 1 200px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 0.93rem; font-weight: 700; padding: 7px 15px; min-height: 38px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; box-shadow: var(--shadow-xs);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.08s var(--ease), filter 0.15s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-small { padding: 3px 10px; min-height: 30px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-primary, .btn-publish {
  background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 700;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18), 0 6px 16px -6px color-mix(in srgb, var(--primary) 70%, transparent);
}
.btn-primary:hover:not(:disabled), .btn-publish:hover:not(:disabled) { background: var(--primary); filter: brightness(1.1) saturate(1.05); }
.btn-danger { background: var(--error); border-color: var(--error); color: var(--surface); }
.btn-danger:hover:not(:disabled) { background: var(--error); filter: brightness(1.08); }
.btn-danger-quiet { color: var(--error); }
.btn-danger-quiet:hover:not(:disabled) { background: var(--error-bg); border-color: color-mix(in srgb, var(--error) 35%, transparent); }
.btn[aria-pressed='true'] { background: var(--surface-3); border-color: var(--border-strong); box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.08); }
.segmented { display: inline-flex; gap: 4px; }

/* Forms */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.field { margin-bottom: 16px; min-width: 0; }
.field > label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
input:not([type='checkbox']), select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 38px;
  box-shadow: var(--shadow-xs); transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input:not([type='checkbox']):hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--muted)); }
input:not([type='checkbox']):focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: var(--ring); }
textarea { resize: vertical; }
input.mono, textarea.mono { font-family: var(--mono); font-size: 0.86rem; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.field-check { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: start; }
.field-check input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--primary); }
.field-check > label, .field-check .label-inline > label { font-weight: 550; margin: 0; }
.label-inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field-check .hint, .field-check .field-errors { grid-column: 2; }
.hint { color: var(--muted); font-size: 0.84rem; margin: 6px 0 0; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--error); }
.field-errors { color: var(--error); font-size: 0.86rem; margin: 6px 0 0; padding-left: 18px; }
fieldset.subfield { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px 0; margin: 0 0 16px; min-width: 0; background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
fieldset.subfield > legend { font-weight: 600; padding: 0 6px; }
fieldset.subfield .field-errors { margin-bottom: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 0 18px; }
.checks .field { margin-bottom: 8px; }

/* Notices and badges */
.notice {
  position: relative; border-radius: var(--radius); padding: 12px 16px 12px 18px; margin: 0 0 16px;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent); overflow: hidden;
}
.notice::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: currentColor; opacity: 0.8; }
.notice > :last-child { margin-bottom: 0; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice li + li { margin-top: 2px; }
.notice-title { font-weight: 650; margin: 0 0 2px; }
.notice-info { background: var(--info-bg); color: var(--info); }
.notice-ok { background: var(--ok-bg); color: var(--ok); }
.notice-warn { background: var(--warn-bg); color: var(--warn); }
.notice-error { background: var(--error-bg); color: var(--error); }
.notice-soon { background: var(--soon-bg); color: var(--soon); }
.notice .btn { color: var(--text); }
.notice details > summary { color: inherit; font-weight: 600; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 650;
  line-height: 1.5; background: var(--surface-2); color: var(--muted); white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--border);
}
.badge-ok, .badge-warn, .badge-error, .badge-info, .badge-soon { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-soon { background: var(--soon-bg); color: var(--soon); }
.badge-ok::before, .badge-soon::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.site-status .badge-ok::before { animation: pulse 2s ease-in-out infinite; box-shadow: 0 0 0 0 currentColor; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
/* Server-side parts that launch later: shown, read-only, with a dashed edge. */
.is-soon { border-style: dashed; }
.tabs .tab-soon { margin-left: 6px; padding: 0 7px; font-size: 0.68rem; }
.tabs .tab-soon::before { display: none; }
.setup-steps li.soon .setup-mark { border-style: dashed; border-color: var(--soon); color: var(--soon); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.alerts { padding-left: 0; list-style: none; }

/* Code */
pre.code {
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.5; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 6px 0 10px;
  overflow: auto; max-height: 60vh; white-space: pre; max-width: 100%;
}
.diff span { display: block; padding: 0 6px; margin: 0 -6px; border-radius: 4px; }
.diff .diff-add { background: var(--add-bg); }
.diff .diff-del { background: var(--del-bg); }
.diff .diff-fold { color: var(--muted); font-style: italic; }
.diff-add-key { color: var(--ok); }
.diff-del-key { color: var(--error); }
details > summary { cursor: pointer; color: var(--primary); font-weight: 550; }
.copy { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Tables: rows become cards on narrow screens */
.table {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow-xs);
}
.card .table { border: 0; box-shadow: none; border-radius: 0; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th {
  font-size: 0.74rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); padding-top: 10px; padding-bottom: 10px;
}
.table tbody tr { transition: background-color 0.12s var(--ease); }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td > a:first-child { font-weight: 650; text-decoration: none; }
.table td > a:first-child:hover { text-decoration: underline; }
.table.num td { font-variant-numeric: tabular-nums; }
.table details pre.code { max-width: min(560px, 80vw); }

@media (max-width: 760px) {
  .table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { border-bottom: 1px solid var(--border); padding: 6px 0; }
  .table.stack tbody tr:last-child { border-bottom: 0; }
  .table.stack td { border: 0; padding: 4px 12px; display: grid; grid-template-columns: 38% 1fr; gap: 8px; min-width: 0; }
  .table.stack td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: 0.85rem; }
  .table.stack td > * { min-width: 0; }
  .table details pre.code { max-width: 100%; }
}

/* Container editor */
.editor-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.editor-head p { margin: 0; }
.sources { list-style: none; padding: 0; margin: 0 0 12px; }
.source { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px 0; margin-bottom: 10px; background: var(--surface); }
.source-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.source-head h3 { margin: 0; }
.tags { list-style: none; padding: 0; margin: 0; }
.tags > li {
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.tags > li:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.tags > li.open { border-color: var(--primary); box-shadow: var(--ring); }
.tag-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; }
.tag-summary { min-width: 0; overflow-wrap: anywhere; }
.tag-summary .mono { color: var(--muted); font-size: 0.8rem; margin-left: 4px; }
.tag-editor, .var-editor { border-top: 1px solid var(--border); padding: 14px 14px 0; animation: fade 0.2s var(--ease); }
.macros { margin: -6px 0 14px; }
.macros ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.macros li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.actionbar {
  position: sticky; bottom: 16px; z-index: 6; margin-top: 12px; padding: 10px 12px;
  background: var(--glass); border: 1px solid var(--border); border-radius: 16px;
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  box-shadow: var(--shadow-lg);
}
.blockers { color: var(--muted); margin: 8px 0 0; padding-left: 18px; font-size: 0.88rem; }

/* What publishing changes (the publish dialog) */
.changes { list-style: none; margin: 4px 0 14px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.changes li { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; font-size: 0.92rem; }
.changes li + li { border-top: 1px solid var(--border); }
.change-mark { flex: none; width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; font: 700 0.8rem/1 var(--mono); transform: translateY(3px); }
.change-add .change-mark { background: var(--add-bg); color: var(--ok); }
.change-del .change-mark { background: var(--del-bg); color: var(--error); }
.change-mod .change-mark { background: var(--info-bg); color: var(--info); }
.suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 8px; font-size: 0.86rem; }

/* Dialogs */
.dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  border: 1px solid var(--border); border-radius: 18px; padding: 24px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
}
.dialog[open] { animation: pop 0.22s var(--ease); }
.dialog-wide { width: min(960px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgb(10 12 20 / 0.42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dialog[open]::backdrop { animation: fade 0.2s ease; }
.dialog > h2 { font-size: 1.2rem; }
.dialog .actions { justify-content: flex-end; margin-top: 20px; }
.dialog-body > :last-child { margin-bottom: 0; }

/* Command palette (Cmd/Ctrl+K) */
.palette {
  width: min(620px, calc(100vw - 32px)); max-height: min(520px, calc(100vh - 120px)); margin: 12vh auto auto; padding: 0;
  border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgb(0 0 0 / 0.02); overflow: hidden; display: flex; flex-direction: column;
}
.palette:not([open]) { display: none; }
.palette[open] { animation: pop 0.18s var(--ease); }
.palette::backdrop { background: rgb(10 12 20 / 0.35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.palette-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.palette input.palette-input {
  border: 0; box-shadow: none; padding: 4px 0; min-height: 32px; font-size: 1.05rem; background: transparent;
}
.palette input.palette-input:focus-visible { box-shadow: none; outline: none; }
.palette-list { list-style: none; margin: 0; padding: 8px; overflow: auto; }
.palette-group { padding: 10px 10px 4px; font-size: 0.72rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.palette-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--text);
}
.palette-item[aria-selected='true'] { background: var(--primary-soft); }
.palette-item[aria-selected='true'] .palette-icon { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.palette-icon {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 0.8rem; font-weight: 700;
}
.palette-icon svg { width: 15px; height: 15px; }
.palette-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.palette-text small { color: var(--muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 28px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.78rem; background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.palette-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* Sign in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin:has(> .signin-hero) { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); place-items: stretch; padding: 0; }
.signin-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 44px 52px; color: #fff;
  background:
    radial-gradient(700px 420px at 15% 115%, rgb(233 39 194 / 0.55), transparent 62%),
    radial-gradient(600px 380px at 95% 100%, rgb(238 53 243 / 0.35), transparent 60%),
    radial-gradient(500px 300px at 85% 0%, rgb(116 0 103 / 0.55), transparent 65%),
    #000;
}
.signin-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.18;
  background-image: linear-gradient(rgb(255 255 255 / 0.08) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 0.08) 1px, transparent 1px);
  background-size: 36px 36px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.signin-hero > * { position: relative; z-index: 1; }
.signin-hero .brand { color: #fff; }
.signin-hero .wordmark { height: 30px; }
.signin-hero h2 { font-size: clamp(2.2rem, 4vw, 3.6rem); line-height: 1.02; letter-spacing: -0.05em; font-weight: 700; margin: 0 0 18px; max-width: 14ch; }
.signin-hero h2 em { font-style: normal; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.signin-hero p { color: var(--chrome-muted); max-width: 46ch; margin: 0; font-weight: 500; }
.signin-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.signin-points li { display: flex; gap: 12px; align-items: flex-start; color: #fff; font-size: 0.95rem; font-weight: 500; }
.signin-points li::before {
  content: '✓'; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 800;
  color: #fff; background: var(--brand-gradient);
}
.signin-foot { font-size: 0.8rem; color: rgb(187 199 211 / 0.75); }
.signin-panel { display: grid; place-items: center; padding: 32px 16px; }
.signin-card { width: min(420px, 100%); padding: 32px; box-shadow: var(--shadow-md); animation: rise 0.35s var(--ease) both; }
.brand-mark { font-weight: 700; color: var(--primary); margin-bottom: 6px; font-size: 0.88rem; letter-spacing: 0.01em; }
.signin-card h1 { margin-bottom: 8px; font-size: 1.6rem; }
.signin-alt { margin: 16px 0 0; }
.row-between { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.code-input {
  font-family: var(--mono); font-size: 1.75rem; letter-spacing: 0.5em; text-align: center; padding: 10px 8px;
  width: 100%; font-variant-numeric: tabular-nums;
}
.link-button { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 550; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-button:disabled { color: var(--muted); text-decoration: none; cursor: default; }
@media (max-width: 860px) {
  .signin:has(> .signin-hero) { grid-template-columns: 1fr; }
  .signin-hero { display: none; }
}

/* Help: the "?" next to labels and titles */
.label-row { display: flex; align-items: center; gap: 6px; }
.label-row > label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0; }
.field > .label-row { margin-bottom: 6px; }
.help { position: relative; display: inline-flex; vertical-align: middle; }
.help-btn {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  font: 700 11px/1 var(--font); padding: 0; cursor: help; display: inline-grid; place-items: center;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.help-btn:hover, .help-btn[aria-expanded="true"] { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.help-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.help-pop {
  position: absolute; top: calc(100% + 8px); left: -8px; z-index: 30; width: max-content; max-width: min(320px, calc(100vw - 32px));
  background: #000; color: #f5f5f7; padding: 10px 12px; border-radius: 12px; font-size: 0.86rem; font-weight: 400;
  line-height: 1.5; box-shadow: var(--shadow-lg); white-space: normal; text-align: left; letter-spacing: 0;
  border: 1px solid rgb(255 255 255 / 0.08); animation: fade 0.15s var(--ease); /* opacity only: ui.js shifts it with transform */
}
.help-pop code { background: rgb(255 255 255 / 0.12); color: inherit; padding: 0 4px; border-radius: 4px; }
.help-pop a { color: var(--brand-pink); }
h2 .help, h3 .help { margin-left: 4px; }

/* Flow: browser → tags → hub → DSPs */
.flow { list-style: none; margin: 6px 0 16px; padding: 0; display: flex; align-items: stretch; }
.flow-step { flex: 1 1 0; min-width: 0; display: flex; }
.flow-node {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
  overflow-wrap: anywhere; box-shadow: var(--shadow-xs); transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.flow-node::before { content: ''; position: absolute; inset: -1px -1px auto -1px; height: 3px; border-radius: var(--radius) var(--radius) 0 0; background: var(--border); }
a.flow-node:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.flow-ok::before { background: var(--brand-gradient); }
.flow-warn::before { background: var(--amber); }
.flow-error::before { background: var(--error); }
.flow-idle::before { background: var(--border-strong); }
.flow-idle { border-style: dashed; }
.flow-title { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.flow-line { font-size: 0.85rem; color: var(--muted); }
.flow-note { font-size: 0.8rem; font-weight: 600; margin-top: 2px; }
.flow-arrow { flex: 0 0 84px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; padding: 0 6px; color: var(--muted); }
.flow-arrow span { font-size: 0.72rem; line-height: 1.2; text-align: center; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.flow-arrow svg { width: 100%; height: 12px; }
.flow-arrow svg path:first-child { stroke: currentColor; stroke-width: 2; fill: none; stroke-dasharray: 4 4; animation: dash 1.2s linear infinite; }
.flow-arrow svg path:last-child { fill: currentColor; }
@keyframes dash { to { stroke-dashoffset: -8; } }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.dot-warn { background: var(--amber); } .dot-error { background: var(--error); } .dot-idle { background: var(--border-strong); }
@media (max-width: 900px) {
  .flow { flex-direction: column; }
  .flow-arrow { flex: 0 0 44px; flex-direction: row-reverse; justify-content: center; gap: 8px; }
  .flow-arrow svg { width: 40px; transform: rotate(90deg); }
}

/* Setup guide on a site's Overview */
.setup .card-head { align-items: baseline; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 4px 0 16px; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--brand-gradient); transition: width 0.6s var(--ease); }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px 16px; }
.setup-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; min-width: 0; }
.setup-steps p { margin: 2px 0 0; overflow-wrap: anywhere; }
.setup-steps a { text-decoration: none; }
.setup-steps a:hover strong { text-decoration: underline; }
.setup-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.8rem;
  border: 2px solid var(--border); color: var(--muted); }
.setup-steps li.done .setup-mark { background: var(--ok); border-color: var(--ok); color: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 15%, transparent); }
.setup-steps li.done a strong { color: var(--text); }
.setup-steps li.todo .setup-mark { border-color: var(--primary); color: var(--primary); }
.setup-done { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--muted); }
.setup-done .setup-mark { background: var(--ok); border-color: var(--ok); color: var(--surface); }

/* DSP cards */
.dsp-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.dsp-grid .card { margin: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease); }
.dsp-grid .card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dsp-card .card-head { align-items: center; }
.dsp-card .card-head h2 { margin: 0; }
.dsp-card > .actions { margin-top: auto; padding-top: 10px; }
.dsp-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--strip, var(--border-strong)); }
.dsp-ready { --strip: var(--ok); }
.dsp-missing { --strip: var(--amber); }
.dsp-disabled, .dsp-soon { --strip: var(--border-strong); }
.dsp-card.is-soon { --strip: var(--brand-gradient); } /* before server-side launches, no DSP reads as ready */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 6px 0 8px; font-size: 0.9rem; }
.facts dt { color: var(--muted); display: flex; align-items: center; gap: 4px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 550; }
.dsp-form { margin-top: 12px; }

/* Tag examples, the request preview, empty states */
.examples { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.example-card {
  width: 100%; height: 100%; text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 14px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); font: inherit;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.example-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.example-card > span { color: var(--muted); font-size: 0.9rem; }
.example-card .example-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 0.8rem; }
.example-card code { font-size: 0.75rem; overflow-wrap: anywhere; color: var(--muted); }
.url-preview { margin: -6px 0 14px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 0.85rem; overflow-wrap: anywhere; }
.url-preview code { display: block; margin-top: 4px; }
.source-about { margin: -4px 0 10px; }
.empty { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 24px; text-align: center; background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
.empty p { margin: 0 0 10px; }

.try-result { margin: -6px 0 12px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 0.9rem; overflow-wrap: anywhere; }
.try-yes { background: var(--ok-bg); color: var(--ok); }
.try-no { background: var(--warn-bg); color: var(--warn); }

/* Loading */
[aria-busy='true'].muted { display: inline-flex; align-items: center; gap: 10px; }
[aria-busy='true'].muted::before {
  content: ''; width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--border-strong); border-top-color: var(--primary); animation: spin 0.7s linear infinite;
}

/* Guide */
.plain-list { margin: 0; padding-left: 20px; }
.plain-list li + li { margin-top: 6px; }
.guide-steps { margin: 0; padding-left: 24px; }
.guide-steps > li { padding: 4px 0 12px; }
.guide-steps > li::marker { color: var(--primary); font-weight: 700; }
.guide-steps > li + li { border-top: 1px solid var(--border); padding-top: 12px; }
.guide-steps h3 { margin: 0 0 2px; font-size: 1rem; }
.guide-steps p { margin: 4px 0; }
.example { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.9rem; overflow-wrap: anywhere; }
.example-label { font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 6px; }
.glossary { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 8px 18px; margin: 0; }
.glossary dt { font-weight: 600; }
.glossary dd { margin: 0; color: var(--muted); }
@media (max-width: 600px) { .glossary { grid-template-columns: 1fr; gap: 2px; } .glossary dd { margin-bottom: 8px; } }

/* Members */
.explain { margin: 0 0 16px; }
.explain > summary { margin-bottom: 8px; }
.role-list { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.role-list dt { font-weight: 600; }
.role-list dd { margin: 0; color: var(--muted); }
.inline-select { min-height: 30px; padding: 2px 6px; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn + .btn { margin-left: 6px; }
.invite { border-color: var(--ok); }
pre.wrap-pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Toasts */
.toaster { position: fixed; bottom: 20px; right: 20px; left: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; z-index: 40; }
.toast {
  display: flex; align-items: center; gap: 10px; background: #000; color: #fff; padding: 11px 16px 11px 12px; border-radius: 16px;
  max-width: 420px; box-shadow: var(--shadow-lg); border: 1px solid rgb(255 255 255 / 0.08); font-weight: 550;
  animation: slide-in 0.28s var(--ease) both;
}
.toast::before {
  content: '✓'; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 800; color: #fff; background: var(--brand-gradient);
}

@media (max-width: 600px) {
  .page { padding: 18px 16px 80px; }
  .topbar { padding: 10px 12px 10px 16px; border-radius: 20px; top: 8px; margin-top: 8px; width: calc(100% - 16px); }
  .topbar-user { margin-left: 0; width: 100%; justify-content: space-between; }
  .search-btn .kbd { display: none; }
  .brand-product { display: none; }
  .card { padding: 16px; }
  h1 { font-size: 1.4rem; }
  .actionbar { position: static; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabs { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Container editor, GTM parity (7 Nov 2026): section nav, tag toolbar and folders, variables, conditions. */
.section-nav { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 6px;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border);
  border-radius: 999px; box-shadow: var(--shadow-sm); width: fit-content; max-width: 100%; }
.section-nav a { padding: 6px 12px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 550; font-size: 0.9rem; }
.section-nav a:hover { background: var(--primary-soft); }
.count { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
  font-size: 0.78rem; font-weight: 600; text-align: center; }
.tag-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto; gap: 8px; align-items: center; margin: 0 0 12px; }
.tag-toolbar select { width: auto; }
@media (max-width: 720px) { .tag-toolbar { grid-template-columns: 1fr 1fr; } .tag-toolbar input { grid-column: 1 / -1; } }
.tag-group + .tag-group { margin-top: 14px; }
.folder-head { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; margin: 6px 0 8px; color: var(--muted); }
.tag-notes { margin: 4px 0 0; white-space: pre-line; }
.subhead { font-size: 1rem; margin: 18px 0 8px; }
.add-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin-top: 12px; }
.add-row .field { margin: 0; }
.condition { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1.2fr) auto; gap: 8px;
  align-items: center; margin: 0 0 8px; }
@media (max-width: 720px) { .condition { grid-template-columns: 1fr 1fr; } }
fieldset.subfield > .btn { margin-bottom: 12px; }
table.lookup td { padding: 4px 6px 4px 0; }
table.lookup input { min-height: 34px; }

/* Members, clients and access (7 Nov 2026): one row per person with access chips, the members toolbar, sites by client. */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 4px 2px 10px; min-height: 30px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: 0.88rem;
}
.chip-all { background: var(--primary-soft); }
.chip-client { background: color-mix(in srgb, var(--info-bg) 70%, var(--surface)); }
.chip-scope { font-weight: 600; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip-sep { color: var(--muted); }
.chip-role { color: var(--muted); padding-right: 6px; }
.chip .inline-select { width: auto; flex: none; min-height: 24px; padding: 0 4px; border-radius: 999px; font-size: 0.85rem; }
.chip-remove {
  border: 0; background: transparent; color: var(--muted); border-radius: 50%; width: 24px; height: 24px; line-height: 1;
  font-size: 1rem; cursor: pointer;
}
.chip-remove:hover, .chip-remove:focus-visible { background: var(--error-bg); color: var(--error); }
.toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr); gap: 0 12px; }
@media (max-width: 720px) { .toolbar { grid-template-columns: 1fr; } }
.people .actions-cell { white-space: normal; }
.people .actions-cell .btn { margin: 0 6px 6px 0; }
.people .actions-cell .btn + .btn { margin-left: 0; }
.scope-list { margin-top: 12px; }
.client-group { margin-bottom: 22px; }
.client-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; }
.client-head h2 { margin: 0; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chips-row .btn[aria-pressed='true'] { background: var(--primary-soft); border-color: var(--primary); }

/* Environments and Health (8 Nov 2026): environment cards on a site's Environments tab; the Health page's tiles and site list. */
.env-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0 12px; }
.env-toolbar h2 { margin: 0; }
.env-empty p { max-width: 70ch; margin-left: auto; margin-right: auto; }
.env-grid { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.env-card { margin: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.env-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--brand-gradient); }
.env-card .card-head h3 { margin: 0; overflow-wrap: anywhere; }
.env-card pre.code { margin-top: 0; }
.env-actions { margin-top: auto; padding-top: 12px; }

.tiles { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-xs); min-width: 0; position: relative; overflow: hidden;
}
.tile::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--border); }
.tile-label { color: var(--muted); font-size: 0.8rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; }
.tile-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-value .badge { font-size: 0.8rem; letter-spacing: 0; }
.tile-problem::before { background: var(--error); }
.tile-problem .tile-value { color: var(--error); }
.tile-attention::before { background: var(--amber); }
.tile-attention .tile-value { color: var(--warn); }
.health-filter { margin: 0 0 18px; }
.health-filter .btn[aria-pressed='true'] { background: var(--primary-soft); border-color: var(--primary); }
.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.health-site {
  position: relative; padding: 14px 18px 12px 20px; border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-xs); min-width: 0; overflow: hidden;
}
.health-site::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ok); }
.health-problem::before { background: var(--error); }
.health-attention::before { background: var(--amber); }
.health-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; margin-bottom: 6px; }
.health-head h3 { margin: 0; overflow-wrap: anywhere; }
.health-head h3 a { text-decoration: none; }
.health-head h3 a:hover { text-decoration: underline; }
.issues { list-style: none; margin: 0 0 8px; padding: 0; font-size: 0.92rem; }
.issue { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
.issue::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); transform: translateY(-1px); }
.issue-problem::before { background: var(--error); }
.issue-attention::before { background: var(--amber); }
.issue-info { color: var(--muted); }
.health-facts { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; font-size: 0.86rem; }
.health-facts > div { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.health-facts dt { color: var(--muted); }
.health-facts dd { margin: 0; font-weight: 600; }

/* Workspaces (8 Nov 2026): the switcher under the site's name, the behind notice, the update dialog's Mine / Live choices,
   and the changes summary in the action bar. */
.workspace-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 14px; padding: 8px 12px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs);
}
.workspace-pick { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.workspace-pick label { font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.workspace-pick select { width: auto; min-width: 0; max-width: min(380px, 100%); min-height: 34px; padding: 4px 10px; }
.workspace-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; flex: 1 1 160px; }
.workspace-bar > .actions { margin-left: auto; }
.workspace-error { flex-basis: 100%; }
.behind .actions { margin-top: 8px; }
.conflict-choice { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 12px; }
.radio { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 0.92rem; }
.radio input[type='radio'] {
  width: 18px; height: 18px; min-height: 0; padding: 0; margin: 2px 0 0; flex: none; border-radius: 50%; box-shadow: none;
  accent-color: var(--primary);
}
.ws-changes { margin-top: 8px; font-size: 0.9rem; }
.ws-changes > summary { font-size: 0.88rem; }
.ws-changes .changes { max-height: 40vh; overflow: auto; margin: 4px 0 0; }
