/* Inter 4.1 (SIL Open Font Licence 1.1, wwwroot/fonts/OFL.txt), served by the dashboard itself: the security policy
   allows no external host (docs/dashboard-look-standard-design.md, G2). Arabic text falls back to the system face. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/Inter-Bold.woff2") format("woff2"); }

/* The journey look's world (docs/dashboard-journey-look-plan.md, Task 3). Every colour is one light-dark(day, night)
   pair; <html data-theme> only picks the colour scheme (light by default, the navy night, or the system's), so there
   is one list of colours and a test checks every text colour on its background, day and night. */
:root {
  color-scheme: light;
  --bg: light-dark(#f3f5fb, #0d1430);
  --bg-2: light-dark(#e9eefc, #141c3f);
  --surface: light-dark(#ffffff, #151f45);
  --text: light-dark(#0f172e, #eef1ff);
  --muted: light-dark(#5a6680, #a6b0d6);
  --border: light-dark(#e4e8f2, #26315e);
  --accent: light-dark(#3657ff, #6d8bff);
  --accent-2: light-dark(#7c4dff, #a78bfa);
  --on-accent: light-dark(#ffffff, #0b1030);
  --accent-soft: light-dark(#eaeeff, #18225a);
  --ok: light-dark(#0b6e44, #4ade80);
  --ok-bg: light-dark(#e3f6ec, #0e3326);
  --warn: light-dark(#9a5600, #fbbf24);
  --warn-bg: light-dark(#fff2d9, #3a2a0c);
  --danger: light-dark(#b8322a, #fb7185);
  --danger-bg: light-dark(#fde8e6, #3d1630);
  --neutral: light-dark(#475569, #c7cff0);
  --neutral-bg: light-dark(#eef1f7, #1c2752);
  /* The sidebar: navy to indigo by day, deeper at night. */
  --side-1: light-dark(#172554, #0a1028);
  --side-2: light-dark(#2b1b6b, #1c1446);
  --side-text: light-dark(#ffffff, #eef1ff);
  --side-muted: light-dark(#c3cbf0, #a6b0d6);
  --side-warn: light-dark(#ffd166, #ffd166);
  --side-line: rgb(255 255 255 / 0.12);
  --side-glass: rgb(255 255 255 / 0.12);
  /* The journey line's empty track. */
  --track: light-dark(#e3e7f2, #2a3566);
  /* The journey lines: blue while setting up, warm when a step came back, green when live. */
  --line-progress: light-dark(#3657ff, #6d8bff);
  --line-attention: light-dark(#e0453a, #fb7185);
  --line-live: light-dark(#12a06b, #34d399);
  --shadow-ink: light-dark(rgb(30 45 110 / 0.08), rgb(0 0 0 / 0.35));
  --radius: 14px;
  --radius-control: 10px;
  --shadow: 0 1px 2px var(--shadow-ink), 0 6px 20px var(--shadow-ink);
  --shadow-control: 0 1px 2px var(--shadow-ink);
  /* Type scale (docs/dashboard-look-stage-design.md, section 1): the only font sizes. */
  --fs-title: 1.75rem; --fs-section: 1.25rem; --fs-sub: 1rem; --fs-body: 0.9375rem;
  --fs-dense: 0.875rem; --fs-label: 0.8125rem; --fs-small: 0.75rem;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --sidebar: 240px;
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="system"] { color-scheme: light dark; }

/* ---- Base ---- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Tahoma, system-ui, -apple-system, Roboto, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { font-family: "Inter", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif; line-height: 1.65; }
h1 { font-size: var(--fs-title); font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; margin: 0 0 var(--s4); }
h2 { font-size: var(--fs-section); font-weight: 600; margin: var(--s5) 0 var(--s3); }
h3 { font-weight: 600; }
/* Figures line up in tables and stat cards. */
table, .stat, .num { font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
/* Links inside running text keep an underline: colour alone does not mark them in dark mode. */
p a, li p a, .notice a, .hint a { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin-top: var(--s3); }
.field-error { color: var(--danger); font-size: var(--fs-label); }
.hint { color: var(--muted); font-size: var(--fs-label); margin: var(--s1) 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden-form { display: none; }

/* ---- Page frame: top bar, side menu (on the reading side through the grid's direction), content ---- */
body.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "side top" "side main";
  min-height: 100vh;
}
/* A soft light from the top of the page behind everything (the approved drawings' ground). */
body { background: radial-gradient(900px 420px at 70% -10%, var(--bg-2), transparent 70%) no-repeat, var(--bg); }
.topbar {
  grid-area: top;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s4);
  padding: var(--s2) var(--s4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
/* Glass: the strip lets the page show through, blurred, where the browser can draw it and the reader wants it.
   Its text stays readable: the strip mixes --surface with --bg, and text reaches 4.5:1 on both. */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .topbar { background: color-mix(in srgb, var(--surface) 72%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* With the side menu the brand heads the sidebar instead (on wide screens). */
body.app .topbar > .brand { display: none; }
body.app .topbar { justify-content: flex-end; }
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; color: var(--text); text-decoration: none; direction: ltr; }
.topbar-end { display: flex; align-items: center; gap: var(--s2) var(--s5); flex-wrap: wrap; min-width: 0; font-size: var(--fs-dense); }
/* The account links are quiet text behind a divider: they must not compete with the navigation. */
.account { gap: var(--s4); padding-inline-start: var(--s4); border-inline-start: 1px solid var(--border); }
.account a.link, .account button.link { margin: 0; color: var(--muted); font-size: var(--fs-label); }
.account a.link:hover, .account button.link:hover { color: var(--text); }
.switch button.link:first-of-type { margin-inline-start: 0; }
/* The language and theme choices as a small segmented control; the current language sits on a raised white segment. */
.switch { gap: 2px; padding: 2px; border-radius: var(--radius-control); background: var(--neutral-bg); }
.switch button.link { margin: 0; padding: 0.25rem 0.6rem; border-radius: var(--radius-control); color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.switch button.link:hover { color: var(--text); text-decoration: none; }
.switch button.link.current, .switch button.link[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-control); }
.user { display: inline-flex; align-items: center; gap: var(--s2); }
.avatar { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-label); font-weight: 600; }
.content { grid-area: main; width: 100%; max-width: 1100px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s6); }
body.plain .content { max-width: 960px; }
.content:focus { outline: none; }
.inline { display: flex; flex-wrap: wrap; align-items: center; margin: 0; }

/* The sidebar: the brand's one bold surface, navy to indigo with a soft violet glow, full height (Task 4). */
.sidebar {
  grid-area: side; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: var(--s4) var(--s3) var(--s5);
  color: var(--side-text);
  background: radial-gradient(320px 320px at 100% 0%, rgb(124 77 255 / 0.45), transparent 65%) no-repeat, linear-gradient(170deg, var(--side-1), var(--side-2));
}
.side-brand { margin: 0 var(--s2) var(--s5); color: var(--side-text); font-size: var(--fs-sub); }
.side-brand img { border-radius: 9px; box-shadow: 0 6px 16px rgb(79 107 255 / 0.45); }
.side-label { margin: var(--s5) var(--s3) var(--s2); font-size: var(--fs-small); font-weight: 600; color: var(--side-muted); letter-spacing: 0.06em; text-transform: uppercase; }
[dir="rtl"] .side-label { letter-spacing: 0; text-transform: none; font-size: var(--fs-small); }
.side-sub { list-style: none; margin: 0; padding: 0; }
/* Menu items: icon (or a site's dot), text, and an optional count pill on the end side. */
.side-link { display: flex; align-items: center; gap: 0.6rem; min-height: 2.25rem; padding: 0.4rem var(--s3); border-radius: var(--radius-control); color: var(--side-muted); font-size: var(--fs-dense); font-weight: 500; text-decoration: none; }
.side-link .icon { flex: none; color: var(--side-muted); }
.side-link:hover { background: rgb(255 255 255 / 0.07); color: var(--side-text); text-decoration: none; }
/* The current item: a pane of frosted glass on the navy. */
.side-link[aria-current="page"] { background: var(--side-glass); color: var(--side-text); font-weight: 600; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14); }
.side-link[aria-current="page"] .icon { color: var(--side-text); }
.sidebar :focus-visible { outline-color: var(--side-text); }
.side-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Site dot in the switcher: green published, grey not published yet, a hollow ring for a deactivated site. */
.site-dot { flex: none; width: 0.5rem; height: 0.5rem; margin: 0 0.3rem; border-radius: 50%; background: var(--side-muted); opacity: 0.55; }
.site-dot.published { background: #4ade80; opacity: 1; }
.site-dot.inactive { background: transparent; border: 1.5px solid var(--side-muted); opacity: 1; }
/* The new-cookies count in the menu: a blue pill pushed to the end side. */
.side-link .badge.count { margin-inline-start: auto; color: #4a3300; background: var(--side-warn); }
/* "2 not live" beside Sites: a short amber note on the end side. */
.side-note { margin-inline-start: auto; font-size: var(--fs-small); font-weight: 600; color: var(--side-warn); white-space: nowrap; }
/* The open site: its name and state open a switcher to another site; its four sections follow. */
.side-site { margin-top: var(--s4); padding: var(--s2); border-radius: var(--radius); background: rgb(255 255 255 / 0.06); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1); }
.site-switcher summary { display: flex; align-items: center; gap: var(--s2); min-height: 2.25rem; padding: 0.4rem var(--s3); border-radius: var(--radius-control); font-size: var(--fs-dense); font-weight: 600; cursor: pointer; list-style: none; }
.site-switcher summary::-webkit-details-marker { display: none; }
.site-switcher summary::after { content: ""; flex: none; width: 0.4rem; height: 0.4rem; margin-inline-start: var(--s1); border-inline-end: 1.5px solid var(--side-muted); border-block-end: 1.5px solid var(--side-muted); transform: rotate(45deg); }
.site-switcher[open] summary::after { transform: rotate(-135deg); }
.site-switcher summary:hover { background: rgb(255 255 255 / 0.07); }
.site-switcher summary .badge { margin-inline-start: auto; }
.site-switcher ul { list-style: none; margin: var(--s1) 0 var(--s2); padding: var(--s1) 0; background: rgb(0 0 0 / 0.18); border: 1px solid var(--side-line); border-radius: var(--radius-control); }
.site-switcher li a { display: flex; align-items: center; gap: var(--s2); padding: 0.4rem var(--s3); color: var(--side-text); font-size: var(--fs-dense); text-decoration: none; }
.site-switcher li a:hover { background: rgb(255 255 255 / 0.07); }
.side-group { margin-top: var(--s4); padding-top: var(--s2); border-top: 1px solid var(--side-line); }
.side-admin { margin-top: var(--s4); padding-top: var(--s2); border-top: 1px solid var(--side-line); }
.side-account { display: none; }
.switcher { position: relative; margin-bottom: var(--s2); }
.switcher summary { cursor: pointer; padding: 0.4rem var(--s3); border: 1px solid var(--side-line); border-radius: var(--radius-control); color: var(--side-text); }
.switcher ul { list-style: none; margin: var(--s1) 0 0; padding: var(--s1) 0; background: rgb(0 0 0 / 0.18); border: 1px solid var(--side-line); border-radius: var(--radius-control); }
.switcher li a { display: block; padding: 0.4rem var(--s3); color: var(--side-text); text-decoration: none; }
.switcher li a[aria-current="page"] { font-weight: 600; }

.skip { position: absolute; inset-inline-start: var(--s2); top: -4rem; z-index: 20; padding: var(--s2) var(--s3); background: var(--accent); color: var(--on-accent); border-radius: var(--radius-control); text-decoration: none; }
.skip:focus { top: var(--s2); }
.menu-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.menu-button { display: none; margin: 0; padding: 0.3rem var(--s3); border: 1px solid var(--border); border-radius: var(--radius-control); cursor: pointer; font-size: var(--fs-dense); }
.menu-toggle:focus-visible + .topbar .menu-button { outline: 2px solid var(--accent); outline-offset: 2px; }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0 0 var(--s2); padding: 0; font-size: var(--fs-label); color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--text); font-weight: 600; }
.subline { margin: var(--s1) 0 0; font-size: var(--fs-label); }
.arrow { display: inline-block; margin: 0 var(--s1); }
[dir="rtl"] .arrow { transform: scaleX(-1); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.page-head h1 { margin: 0; }
.page-head .button { flex: none; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.head-actions button { margin-top: 0; }
/* Tabs: text tabs with a 2px underline on the current one, sitting on the bar's hairline. */
.subnav { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); margin: 0 0 var(--s5); border-bottom: 1px solid var(--border); }
.subnav a { color: var(--muted); text-decoration: none; padding: var(--s2) 0 var(--s3); margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: var(--fs-dense); font-weight: 500; }
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.current { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
/* The Cookies page (docs/dashboard-organisation-design.md, section 2): summary with its actions, one section per category. */
.cookies-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s4); margin-bottom: var(--s2); }
.cookies-summary p { margin: 0; }
.cookies-summary .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.cookies-summary button { margin-top: 0; }
.cookies-new, .cookie-category { margin-bottom: var(--s6); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.section-head h2 { margin: 0; }
.category-settings, .add-category { margin-top: var(--s3); }
.category-settings summary, .add-category summary { cursor: pointer; color: var(--accent); font-size: var(--fs-dense); font-weight: 500; }
.category-settings[open], .add-category[open] { padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); }
.category-settings form + form { margin-top: var(--s3); }
.cookie-category td:first-child, .cookies-new td:nth-child(2) { overflow-wrap: anywhere; min-width: 9rem; }

/* ---- The journey (docs/dashboard-journey-look-plan.md, Task 5): each site is a line, its setup steps are stations.
   The rail and its fill sit behind five equal columns; the fill reaches the current station (class at-N). The line
   runs from the reading side because every offset is logical (inset-inline-start). ---- */
.journeys { margin-bottom: var(--s5); }
.journeys h2 { margin-top: 0; }
.journey-legend, .journey-row { display: grid; grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr); align-items: center; gap: var(--s4); }
.journey-legend { color: var(--muted); font-size: var(--fs-small); }
.journey-legend ol { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; list-style: none; text-align: center; }
.journey-row { padding: var(--s4) 0 var(--s5); border-top: 1px solid var(--border); }
.journey-legend + .journey-row { border-top: 0; }
.journey-site { display: grid; min-width: 0; }
.journey-site a { font-weight: 600; font-size: var(--fs-sub); overflow-wrap: anywhere; }
.journey-site bdi { font-size: var(--fs-label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.journey { --at: 0; position: relative; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; min-height: 3rem; margin: 0; padding: 0; list-style: none; color: var(--line-progress); }
.journey.tone-attention { color: var(--line-attention); }
.journey.tone-live { color: var(--line-live); }
.journey.at-1 { --at: 1; } .journey.at-2 { --at: 2; } .journey.at-3 { --at: 3; } .journey.at-4 { --at: 4; }
.journey::before, .journey::after { content: ""; position: absolute; top: 50%; height: 6px; margin-top: -3px; border-radius: 6px; inset-inline-start: 10%; }
.journey::before { width: 80%; background: var(--track); }
.journey::after { width: calc(var(--at) * 20%); background: currentColor; box-shadow: 0 0 14px color-mix(in srgb, currentColor 45%, transparent); }
.journey li { position: relative; z-index: 1; display: grid; justify-items: center; }
.journey .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 4px solid var(--track); }
.journey li.done .dot { background: currentColor; border-color: currentColor; }
.journey li.now .dot { width: 28px; height: 28px; background: var(--surface); border: 5px solid currentColor; box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 20%, transparent); }
.journey li.now.done .dot { background: var(--surface); }
/* Labels: the legend names every station once; under the line only the current one shows (the others stay for
   screen readers). The current label is the link to its work. */
.journey .label { position: absolute; top: calc(100% + 6px); white-space: nowrap; font-size: var(--fs-small); font-weight: 600; color: var(--text); }
.journey a.label { color: var(--accent); }
.journey li:not(.now) .label { width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.journey .flag { position: absolute; bottom: calc(100% + 6px); white-space: nowrap; padding: 1px 7px; border-radius: 6px; font-size: var(--fs-small); font-weight: 700; color: var(--warn); background: var(--warn-bg); }

/* The mini line in a table row: five short bars, filled up to the current station; labels for screen readers only. */
.journey.mini { display: inline-grid; grid-template-columns: repeat(5, 14px); gap: 4px; min-height: 0; }
.journey.mini::before, .journey.mini::after { display: none; }
.journey.mini .dot, .journey.mini li.now .dot { width: 14px; height: 6px; border: 0; border-radius: 3px; background: var(--track); box-shadow: none; }
.journey.mini li.done .dot, .journey.mini li.now .dot { background: currentColor; }
.journey.mini li.now:not(.done) .dot { opacity: 0.55; }
.journey.mini .label { width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* In the banner overview's status header: the line under the state, before the headline. */
.banner-status .journey { max-width: 36rem; margin: var(--s4) 0 var(--s6); }

@media (max-width: 599px) {
  .journey-legend { display: none; }
  .journey-row { grid-template-columns: minmax(0, 1fr); gap: var(--s6); padding-top: var(--s5); }
}

/* ---- Shared components (docs/dashboard-look-standard-design.md, section 2) ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s5);
  box-shadow: var(--shadow);
}
.card h2 { margin-top: 0; font-size: var(--fs-sub); }
.card > label:first-child { margin-top: 0; }
.card + .card, .notice + .card, .error + .card { margin-top: var(--s4); }
.card.narrow { max-width: 380px; margin: var(--s6) auto; }
.card.narrow-left, .narrow-form { max-width: 32rem; }

label { display: block; font-size: var(--fs-dense); font-weight: 500; margin: var(--s4) 0 var(--s1); }
input[type="text"], input[type="password"], input[type="url"], input[type="email"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 2.25rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-dense);
  font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
/* Focus ring: one accent line (border plus 1px) with a soft halo; together a 2px ring at more than 3:1. */
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); outline: none; }
textarea { resize: vertical; }
td select { width: auto; padding: 0.3rem 0.5rem; }
input.short { max-width: 8rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset[disabled] input, fieldset[disabled] textarea, fieldset[disabled] select { opacity: 0.75; }
.checks { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-top: var(--s2); }
label.check { display: flex; align-items: center; gap: 0.4rem; margin: var(--s1) 0; }
label.check input { width: auto; margin: 0; accent-color: var(--accent); }
p.label { font-size: var(--fs-dense); margin: var(--s3) 0 0; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0 var(--s4); }
form.row, .field-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s4); }
form.row label, .field-row label { margin: 0; flex: 1 1 12rem; }
/* A short choice (the release) stays short, with its button beside it. */
form.row label:has(select) { flex: 0 1 16rem; }
form.row button { margin-top: 0; }

/* Buttons: primary filled, secondary white with a border, link-style for quiet actions; 36px high. */
button, a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 2.25rem;
  margin-top: var(--s4);
  padding: 0.45rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--accent);
  background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font: inherit;
  font-size: var(--fs-dense);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: background-color 0.15s, border-color 0.15s, filter 0.15s;
}
a.button { margin-top: 0; }
button:hover, a.button:hover { filter: brightness(0.94); text-decoration: none; }
button.secondary, a.button.secondary { background: var(--surface); background-image: none; border-color: var(--border); color: var(--text); box-shadow: var(--shadow-control); }
button.secondary:hover, a.button.secondary:hover { filter: none; background: var(--bg); }
button.danger { background: var(--danger); background-image: none; border-color: var(--danger); color: var(--surface); box-shadow: var(--shadow-control); }
button.link {
  display: inline;
  min-height: 0;
  margin: 0;
  margin-inline-start: var(--s3);
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--accent);
  font-size: inherit;
  font-weight: 400;
}
button.link:hover { filter: none; text-decoration: underline; }
button.link.current { color: var(--text); font-weight: 600; cursor: default; text-decoration: none; }
a.link { margin-inline-start: var(--s3); color: var(--accent); text-decoration: none; }
.form-actions { display: flex; align-items: center; gap: var(--s4); margin-top: var(--s4); }
.form-actions button { margin-top: 0; }
/* Long forms (docs/dashboard-look-stage-design.md, section 2): sections on the page ground divided by a hairline,
   and the form's actions in a bar that stays at the bottom of the window while the form is in view. */
.form-section > h2 { margin-top: 0; }
/* Each form section is a panel of its own (the approved boards, Task 7). */
.form-section { padding: var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-section + .form-section { margin-top: var(--s4); }
.save-bar { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); margin-top: var(--s6); padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06); }
.save-bar button { margin: 0; }
.empty-line { margin: var(--s3) 0 var(--s5); }
/* A plain block of a page (an h2 and its content on the ground); sections follow each other at 32px. */
.page-section { margin-bottom: var(--s6); }
.page-section > h2:first-child { margin-top: 0; }
/* Empty states (docs/dashboard-look-stage-design.md, section 3): no card; a muted icon, what is missing, why, and
   one next step. A good empty state (nothing missing) takes the ok tint on its icon. */
.empty { display: flex; align-items: flex-start; gap: var(--s4); margin: var(--s4) 0 var(--s5); max-width: 40rem; }
.empty > .icon { flex: none; width: 24px; height: 24px; margin-top: 2px; color: var(--muted); }
.empty.ok > .icon { color: var(--ok); }
.empty-body > p { margin: 0 0 var(--s2); }
.empty-title { font-size: var(--fs-sub); font-weight: 600; }
.empty-body form, .empty-body .button { margin-top: var(--s2); }
.empty-body form button { margin: 0; }
@media (max-width: 599px) {
  .save-bar { margin-inline: calc(-1 * var(--s4)); border-radius: 0; border-inline: 0; }
  .save-bar button, .save-bar a.button { flex: 1 1 auto; }
}

/* Status pills: a dot plus a word on a tinted ground, never colour alone. The badge classes of every page keep
   their meaning (ok, review, fail, off) and take this look. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
  color: var(--neutral);
  background: var(--neutral-bg);
}
.badge::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 50%; background: currentColor; flex: none; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.review { color: var(--warn); background: var(--warn-bg); }
.badge.off { color: var(--neutral); background: var(--neutral-bg); }
.badge.fail { color: var(--danger); background: var(--danger-bg); }
.badge-line { margin: var(--s2) 0; }
/* The number of new cookies next to a site name (docs/cookie-discovery-part2-design.md). */
.badge.count { margin-inline-start: var(--s2); padding: 0 0.45rem; font-size: var(--fs-small); font-weight: 600; }
.badge.count::before { content: none; }
.schedule-form { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; }
.schedule-form label { margin: 0; }

/* Notices: a soft tinted panel with a thin border of its own colour all round (info, ok, warn, error). */
.notice {
  padding: var(--s3) var(--s4);
  border-radius: var(--radius-control);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  background: var(--accent-soft);
  color: var(--text);
  font-size: var(--fs-body);
}
.notice.ok { border-color: color-mix(in srgb, var(--ok) 25%, transparent); background: var(--ok-bg); }
.notice.error { border-color: color-mix(in srgb, var(--danger) 25%, transparent); background: var(--danger-bg); }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 25%, transparent); background: var(--warn-bg); color: var(--text); margin-top: var(--s3); }
.notice.warn p { margin: var(--s1) 0; }

/* position: relative keeps absolutely placed screen-reader labels inside the scrolling card (else they widen the page). */
.table-wrap { position: relative; padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table.wide { min-width: 52rem; }
td.nowrap { white-space: nowrap; }
td.purpose { min-width: 16rem; }
td.provider { min-width: 10rem; }
/* Tables: a light header band, 44px rows, hairline separators, figures on the end side. */
th, td { padding: 0.7rem 1rem; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
td { font-size: var(--fs-dense); }
th { font-size: var(--fs-label); color: var(--muted); font-weight: 500; background: var(--neutral-bg); white-space: nowrap; }
.card.table-wrap > table:first-child thead th:first-child { border-start-start-radius: calc(var(--radius) - 1px); }
.card.table-wrap > table:first-child thead th:last-child { border-start-end-radius: calc(var(--radius) - 1px); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--bg) 55%, transparent); }
td.num, th.num { text-align: end; }
/* The actions cell stays a table cell (a flex cell loses its row's separator); its links sit side by side. */
td.actions { text-align: end; white-space: nowrap; }
td.actions > * + * { margin-inline-start: var(--s3); }
td.actions form.inline { display: inline-flex; }
td.actions button.link { margin-inline-start: 0; }
tr.inactive td { color: var(--muted); }

pre.code { margin: var(--s2) 0; padding: var(--s3); overflow-x: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); font-size: var(--fs-label); text-align: left; }

/* Banner overview (docs/dashboard-organisation-design.md, section 2): the state first, without card chrome. */
.banner-status { margin: var(--s2) 0 var(--s6); }
.banner-status .badge-line { margin: 0 0 var(--s2); }
.status-headline { margin: 0 0 var(--s1); font-size: var(--fs-section); font-weight: 600; line-height: 1.35; }
.banner-status form.publish { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); margin-top: var(--s4); }
.banner-status form.publish button { margin-top: 0; }
.banner-status form.publish label.check { margin: 0; }
.banner-status .hint { margin-top: var(--s2); }
#versions { margin-bottom: var(--s6); }
#versions h2 { margin-top: 0; }
/* Installation: a disclosure, its code blocks with a Copy button at their right (the block is left to right, also in Arabic). */
details.install { margin-bottom: var(--s5); padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
details.install > summary { cursor: pointer; font-weight: 600; }
details.install[open] > summary { margin-bottom: var(--s3); }
details.install-more { margin-top: var(--s3); }
details.install-more > summary { cursor: pointer; color: var(--accent); font-size: var(--fs-dense); font-weight: 500; }
/* System page: the database backup (docs/backup-design.md). */
.backup-facts { padding: var(--s4) var(--s5); }
.backup-facts p { margin: var(--s1) 0; }
.backups h3 { margin: var(--s5) 0 var(--s2); }
/* System page: EF Core's design tools as one row (docs/system-page-tools-design.md). */
details.tool-names { margin-top: var(--s1); font-weight: 400; }
details.tool-names > summary { cursor: pointer; color: var(--accent); font-size: var(--fs-dense); font-weight: 500; }
details.tool-names ul { margin: var(--s1) 0 0; padding-inline-start: var(--s5); font-size: var(--fs-dense); }
.tool-note { margin: var(--s1) 0 0; font-size: var(--fs-dense); font-weight: 400; }
.code-block { position: relative; }
.code-block pre.code { padding-inline-end: 5.5rem; }
.code-block button.copy { position: absolute; inset-block-start: var(--s2); inset-inline-end: var(--s2); margin: 0; min-height: 2rem; padding: 0.25rem 0.75rem; font-size: var(--fs-label); }
.release-line { margin-top: 0; }
/* On phones the Copy button sits above the code instead of over it. */
@media (max-width: 599px) {
  .code-block pre.code { padding-inline-end: var(--s3); }
  .code-block button.copy { position: static; display: block; margin: var(--s2) 0 0 auto; }
}
/* A segmented switch (the language of the texts): a neutral track, the current item raised, like the top bar's. */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 0 0 var(--s4); padding: 2px; border-radius: var(--radius-control); background: var(--neutral-bg); }
.segmented a { padding: 0.35rem 0.85rem; border-radius: var(--radius-control); color: var(--muted); font-size: var(--fs-dense); font-weight: 500; text-decoration: none; }
.segmented a:hover { color: var(--text); }
.segmented a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-control); }
/* Settings: the release has its own Save, apart from the draft form above it. */
#release { margin-top: var(--s6); }
code.secret { display: inline-block; padding: var(--s2) var(--s3); font-size: var(--fs-sub); letter-spacing: 0.05em; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); user-select: all; }

/* ---- Page-specific rules ---- */
/* Title and facts above a full-width table (System & updates). */
.table-head { padding: var(--s4) var(--s5) var(--s1); }
.table-head h3 { margin: 0 0 var(--s1); font-size: var(--fs-sub); }
.table-head p { margin: 0 0 var(--s2); }
.advisory { margin-top: var(--s1); font-size: var(--fs-dense); white-space: nowrap; }
.findings { margin: var(--s2) 0 0; padding-inline-start: 1.25rem; }
.findings li + li { margin-top: 0.35rem; }
.scenario h2 { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
h3.category-id, h2.category-id { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-sub); margin: var(--s4) 0 0; }
.card h2.category-id { margin: 0; }
td.category-cell { font-family: ui-monospace, Consolas, monospace; }
meter { width: 8rem; vertical-align: middle; }

/* Appearance tab: settings and live preview side by side on wide screens, preview below on narrow ones. */
.appearance { display: grid; gap: var(--s4); margin-top: var(--s4); }
.appearance input[type=range] { width: 100%; accent-color: var(--accent); }
/* 1280px: the content beside the 240px menu is then wide enough for two columns. */
@media (min-width: 1280px) {
  .appearance { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
  .preview-card { position: sticky; top: var(--s4); }
}
.preview-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2); }
.preview-switch button.link:first-child { margin-inline-start: 0; }
/* The preview stays on white in dark mode: it shows the banner as a visitor sees it. */
.preview-card iframe { display: block; width: 100%; height: 560px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.color-row { display: flex; gap: var(--s2); align-items: center; }
.color-row input[type=color] { flex: none; width: 3rem; height: 2.4rem; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-control); background: none; }
.js .nojs-only { display: none; }
html:not(.js) .js-only { display: none; }

/* ---- Narrow screens: the menu opens over the content; the account links move into it ---- */
@media (max-width: 899px) {
  body.app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .menu-button { display: inline-block; }
  /* Brand at the start, Menu at the end (mirrored in Arabic); the language choice on its own line. */
  .topbar .brand { order: 1; }
  .topbar .menu-button { order: 2; margin-inline-start: auto; }
  .topbar .topbar-end { order: 3; flex-basis: 100%; }
  .topbar .account { display: none; }
  /* The phone top bar wears the sidebar colours and carries the brand; the sidebar opens beneath it. */
  /* Three short rows on a phone: it scrolls away with the page instead of taking a third of the screen. */
  .topbar, body.app .topbar { position: relative; justify-content: space-between; color: var(--side-text); border-bottom: 0; background: linear-gradient(170deg, var(--side-1), var(--side-2)); -webkit-backdrop-filter: none; backdrop-filter: none; }
  body.app .topbar > .brand { display: inline-flex; color: var(--side-text); }
  .side-brand { display: none; }
  .menu-button { color: var(--side-text); border-color: transparent; background: var(--side-glass); }
  .topbar .switch { background: rgb(255 255 255 / 0.08); }
  .topbar .switch button.link { color: var(--side-muted); }
  .topbar .switch button.link:hover { color: var(--side-text); }
  .topbar .switch button.link.current, .topbar .switch button.link[aria-pressed="true"] { background: var(--side-glass); color: var(--side-text); box-shadow: none; }
  .topbar :focus-visible { outline-color: var(--side-text); }
  .sidebar {
    display: none;
    position: fixed;
    inset-block: 3.2rem 0;
    height: auto;
    inset-inline-start: 0;
    width: min(85vw, 300px);
    z-index: 15;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  }
  .menu-toggle:checked ~ .sidebar { display: block; }
  .side-account { display: block; margin-top: var(--s4); padding: var(--s2) var(--s3) 0; border-top: 1px solid var(--side-line); }
  .side-account .muted, .side-account button.link, .side-account a.link { color: var(--side-text); }
  .side-account form { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
  .side-account button.link, .side-account a.link { margin-inline-start: 0; }
  .subnav { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; }
}
@media (max-width: 599px) {
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions button, .form-actions a.button { width: 100%; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* ---- Home pages (docs/dashboard-look-design.md, section 3; approved mock-up dist/preview/phase2-home.html) ---- */
.home-head { margin-bottom: var(--s5); }
.home-head h1 { margin: 0; }
.attention { padding: 0; overflow: hidden; }
.attention > h2 { margin: 0; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--s3); }
.attention > h2 .count { font-size: var(--fs-small); }
.attention ul { list-style: none; margin: 0; padding: 0; }
.attention li { display: grid; grid-template-columns: 8.5rem 1fr auto; align-items: center; gap: var(--s2) var(--s4); padding: var(--s3) var(--s5); border-top: 1px solid var(--border); }
.attention li:first-child { border-top: 0; }
.attention li > .badge { justify-self: start; }
.attention .what { min-width: 0; }
.attention .what b { display: block; font-weight: 600; }
.attention .what span { color: var(--muted); font-size: var(--fs-dense); }
.attention .go { white-space: nowrap; margin: 0; min-height: 2rem; padding: 0.3rem 0.75rem; font-size: var(--fs-label); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin: var(--s6) 0 var(--s3); }
.section-title h2 { margin: 0; }
.trend { display: block; width: min(120px, 100%); height: 36px; }
.trend-line { stroke: var(--accent); }
.trend-area { fill: var(--accent-soft); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: var(--s4) 0; display: grid; gap: var(--s3); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2rem 1fr; gap: var(--s3); align-items: start; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: var(--fs-dense); }
/* Overview and Sites (docs/dashboard-organisation-design.md, section 3): attention, first run, the sites table, one
   figures line. On phones each table row stacks: the name, then one labelled line per cell. */
.attention, .first-run { margin-bottom: var(--s5); }
.home-sites h2 { margin: 0 0 var(--s3); }
.sites-table .site-name a { font-weight: 600; }
.sites-table th, .sites-table td.num { text-align: start; }
.sites-table td .badge + .muted { margin-inline-start: var(--s2); font-size: var(--fs-label); }
/* The Overview's figure cards (the approved board 01). */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--s3); margin: 0 0 var(--s5); }
.kpi { display: grid; gap: var(--s1); padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi dt { color: var(--muted); font-size: var(--fs-label); }
.kpi dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s2); margin: 0; }
.kpi dd b { font-size: var(--fs-title); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .trend { flex-basis: 100%; width: 100%; height: 30px; }
.kpi.review dd b { color: var(--warn); }
.kpi.ok dd b { color: var(--ok); }
@media (max-width: 599px) {
  /* Three compact cards side by side, so the attention list still starts on the first screen. */
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
  .kpi { padding: var(--s3); }
  .kpi dd b { font-size: var(--fs-section); }
}
.figures { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s4); color: var(--muted); font-size: var(--fs-dense); }
.figures b { color: var(--text); }
.figures .trend { width: 96px; height: 24px; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s4); margin-bottom: var(--s4); }
.list-tools .search { display: flex; gap: var(--s2); flex: 1 1 18rem; max-width: 26rem; }
.list-tools .search input { margin: 0; }
.list-tools .search button { margin: 0; }
.list-tools .sort { display: flex; align-items: center; gap: var(--s3); font-size: var(--fs-dense); }
.list-tools .sort a.current { font-weight: 600; color: var(--text); text-decoration: none; }
.row-actions { text-align: end; width: 1%; }
.row-menu { position: relative; display: inline-block; }
.row-menu summary { list-style: none; cursor: pointer; padding: 0.2rem 0.6rem; border-radius: var(--radius-control); color: var(--muted); font-weight: 700; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu summary:hover, .row-menu[open] summary { background: var(--bg); color: var(--text); }
.row-menu .menu { position: absolute; inset-inline-end: 0; z-index: 5; min-width: 10rem; display: grid; gap: var(--s1); padding: var(--s2); text-align: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.row-menu .menu a, .row-menu .menu button { display: block; width: 100%; margin: 0; padding: 0.35rem var(--s2); text-align: start; font-size: var(--fs-dense); }
button.link.danger { color: var(--danger); }
/* Remove asks first (docs/dashboard-look-stage-design.md, section 5): the summary reads like the other row links;
   open, it shows the question and the red button. */
.confirm { display: inline-block; }
.confirm > summary { list-style: none; cursor: pointer; color: var(--accent); }
.confirm > summary::-webkit-details-marker { display: none; }
.confirm[open] > summary { color: var(--text); }
.confirm-body { margin-top: var(--s2); padding: var(--s3); max-width: 20rem; white-space: normal; text-align: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.confirm-body p { margin: 0 0 var(--s2); }
.confirm-body button { margin: 0; }
/* Scans (docs/dashboard-organisation-design.md, section 2): the last check with one primary action, discovery in
   one line with the schedule in a disclosure, the history, then how the check works. */
.scan-check, .scan-discovery { margin-bottom: var(--s5); }
.scan-check .lead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: 0 0 var(--s3); font-size: var(--fs-sub); font-weight: 600; }
.scan-check .lead a { font-size: var(--fs-dense); font-weight: 500; }
.check-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s3) var(--s4); }
.check-form button { margin: 0; }
.check-pages { flex: 1 1 20rem; }
.check-pages summary, .schedule summary, .how summary { cursor: pointer; color: var(--accent); font-size: var(--fs-dense); font-weight: 500; }
.check-pages textarea { margin-top: var(--s2); }
.scan-discovery { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); padding-top: var(--s4); border-top: 1px solid var(--border); }
.scan-discovery > p { margin: 0; flex: 1 1 18rem; }
.discover-form { display: flex; align-items: center; gap: var(--s2); }
.discover-form label { margin: 0; font-size: var(--fs-dense); color: var(--muted); }
.discover-form input, .discover-form button { margin: 0; }
.discover-form input.short { width: 5.5rem; }
.discover-form button { white-space: nowrap; }
.scan-discovery .schedule { flex-basis: 100%; }
.scan-discovery .schedule[open], .how[open] { padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); }
.how { margin-top: var(--s5); }
.how p { margin: var(--s2) 0 0; color: var(--muted); }
@media (max-width: 599px) {
  /* Stacked tables (docs/dashboard-look-stage-design.md, section 4): the title cell first, then one labelled line
     per cell, the actions last; the selection checkbox sits beside the title. */
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; }
  table.stack-table { min-width: 0; }
  .stack-table thead { display: none; }
  .stack-table tr { padding: var(--s3) var(--s4); border-top: 1px solid var(--border); }
  .stack-table tr:first-child { border-top: 0; }
  .stack-table td { padding: 0.15rem 0; border: 0; text-align: start; }
  .stack-table td[data-label]:empty { display: none; }
  .stack-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: var(--fs-label); }
  .stack-table td.stack-title { font-size: var(--fs-sub); font-weight: 600; padding-bottom: var(--s1); overflow-wrap: anywhere; }
  .stack-table td.stack-check, .stack-table td.stack-check + td.stack-title { display: inline-block; vertical-align: middle; }
  .stack-table td.stack-check { margin-inline-end: var(--s2); }
  .stack-table td.stack-actions { width: auto; text-align: start; padding-top: var(--s1); }
  .stack-table select { width: 100%; }
  .stack-table td.stack-empty { display: none; }
  .confirm-body button { min-height: 44px; }
  .stack-table td.stack-actions details.confirm[open] { display: block; width: 100%; }
  .stack-table td.stack-actions details.confirm[open] .confirm-body { max-width: none; box-shadow: none; }
  /* Filters wrap (short, with counts); 44px targets for row actions, disclosures and filters. */
  .subnav.filters { flex-wrap: wrap; overflow-x: visible; white-space: normal; }
  td a, td button.link, details > summary, .subnav a, .list-tools .sort a { min-height: 44px; display: inline-flex; align-items: center; }
  .grid3 { grid-template-columns: minmax(0, 1fr); }
  .list-tools .search { flex-basis: 100%; max-width: none; }
  .crumbs ol { overflow-wrap: anywhere; }
}
@media (max-width: 599px) {
  .attention li, .attention li:first-child { padding: var(--s3) var(--s4); }
}

/* ---- Every other page (docs/dashboard-journey-look-plan.md, Task 7, from the approved boards) ---- */
/* The page head is a glass panel holding the breadcrumb, the title, its line and the page's main action. */
.page-head { padding: var(--s4) var(--s5); margin-bottom: var(--s5); border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.page-head .crumbs ol { margin-bottom: var(--s1); }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .page-head { background: color-mix(in srgb, var(--surface) 70%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}
@media (prefers-reduced-transparency: reduce) {
  .page-head { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* Filters are chips; the current one is filled like a primary button. */
.subnav.filters { gap: var(--s2); border-bottom: 0; }
.subnav.filters a { margin: 0; padding: 0.35rem 0.85rem; border: 0; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }
.subnav.filters a:hover { color: var(--text); }
.subnav.filters a.current { color: var(--on-accent); background-image: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: none; }
/* The platform organisations table: one short bar per active site, in the journey tones (docs/dashboard-organisation-journey-design.md). */
.organisation-journey-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); }
.organisation-journey { display: inline-flex; gap: 4px; }
.organisation-journey i { display: block; width: 14px; height: 6px; border-radius: 3px; background: var(--line-progress); }
.organisation-journey i.live { background: var(--line-live); }
.organisation-journey i.attention { background: var(--line-attention); }
.organisation-journey-text { font-size: var(--fs-label); }
/* Cookies: the new finds and each category are panels; the table inside sits flat. */
.cookies-new, .cookie-category { padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.cookies-new { border-inline-start: 4px solid var(--warn); }
.cookies-new, .cookie-category { margin-bottom: var(--s5); }
.cookies-new > h2 { margin-top: 0; }
.cookies-new .card, .cookie-category .card { border: 0; border-radius: 0; box-shadow: none; margin-inline: calc(-1 * var(--s5)); }
.cookie-category .category-settings[open] { background: var(--bg); }
/* Attention items are cards in a grid with a coloured edge: red not live, amber to review, blue otherwise. */
.attention.card { padding: 0; overflow: visible; background: none; border: 0; box-shadow: none; }
.attention > h2 { padding: 0; border-bottom: 0; margin-bottom: var(--s3); }
.attention ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--s3); }
.attention li, .attention li:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s4); background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--line-progress); border-radius: var(--radius); box-shadow: var(--shadow); }
.attention li:has(.badge.off) { border-inline-start-color: var(--line-attention); }
.attention li:has(.badge.review), .attention li:has(.badge.fail) { border-inline-start-color: var(--warn); }
.attention li .go { margin-top: auto; }
/* Scans: the last check and discovery as two summary cards side by side. */
.scan-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.scan-summary > .scan-check, .scan-summary > .scan-discovery { margin: 0; padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.scan-summary > .scan-discovery { align-content: flex-start; }

/* "What to update?" on the System page (docs/phase-6-updates-guide-design.md): one panel per update, numbered
   steps, commands in code blocks that read left to right with their copy button on the right. */
.updates .update-guide { margin-top: var(--s3); padding: var(--s3) var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.update-guide summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-height: 2.5rem; font-weight: 600; cursor: pointer; }
.update-guide .ug-name { min-width: 0; overflow-wrap: anywhere; }
.update-guide .ug-ver, .update-guide .ug-end { color: var(--muted); font-size: var(--fs-dense); font-weight: 500; }
.update-guide[open] summary { margin-bottom: var(--s3); padding-bottom: var(--s3); border-bottom: 1px solid var(--border); }
.ug-members { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); margin: 0 0 var(--s3); padding: 0; list-style: none; }
.ug-members li { padding: 0.1rem 0.5rem; border-radius: var(--radius-control); background: var(--neutral-bg); color: var(--neutral); font-size: var(--fs-label); overflow-wrap: anywhere; }
.update-guide .notice p { margin: 0; }
.update-guide .notice p + p { margin-top: var(--s1); }
.ug-steps { list-style: none; counter-reset: step; display: grid; gap: var(--s4); margin: var(--s3) 0 var(--s2); padding: 0; }
.ug-steps li { counter-increment: step; display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); column-gap: var(--s3); align-items: start; }
.ug-steps li::before { content: counter(step); grid-row: span 4; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-label); font-weight: 700; }
.ug-steps li > a { overflow-wrap: anywhere; font-size: var(--fs-dense); }
.ug-steps .code-block { margin-top: var(--s2); direction: ltr; }
.ug-steps .code-block pre.code { white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }
.ug-steps .hint { margin-top: var(--s1); }
.update-shortcut { margin: var(--s3) 0 var(--s4); }
.update-shortcut > p { margin: 0; }
.update-shortcut .code-block { margin-top: var(--s2); direction: ltr; }
.update-shortcut pre.code { text-align: left; }
.how-link { margin-inline-start: var(--s2); font-size: var(--fs-label); white-space: nowrap; }

/* "Copy the appearance from another site" (docs/copy-appearance-design.md): a quiet link that opens a small panel. */
.copy-look { margin: 0 0 var(--s4); }
.copy-look > summary { cursor: pointer; color: var(--accent); font-size: var(--fs-dense); font-weight: 500; }
.copy-look-body { display: grid; gap: var(--s2); max-width: 34rem; margin-top: var(--s2); padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.copy-look-body label { font-weight: 500; }
.copy-look-body .hint { margin: 0; }
.copy-look-body button { justify-self: start; margin-top: var(--s1); }

/* ---- Motion (docs/dashboard-journey-look-plan.md, Task 6): calm and short. The lines fill station by station on
   load and the current station breathes; buttons lift a pixel on hover; page changes cross-fade with the header and
   the sidebar held in place. Readers who ask for reduced motion get none of it. ---- */
@keyframes journey-fill { from { width: 0; } }
@keyframes journey-pop { from { transform: scale(0.4); opacity: 0; } }
@keyframes journey-breathe { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, currentColor 8%, transparent); } }
.journey::after { animation: journey-fill 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.journey-row:nth-of-type(3) .journey::after { animation-delay: 0.15s; }
.journey-row:nth-of-type(4) .journey::after { animation-delay: 0.3s; }
.journey-row:nth-of-type(n+5) .journey::after { animation-delay: 0.45s; }
.journey .dot { animation: journey-pop 0.35s ease-out both; }
.journey li:nth-child(2) .dot { animation-delay: 0.1s; }
.journey li:nth-child(3) .dot { animation-delay: 0.3s; }
.journey li:nth-child(4) .dot { animation-delay: 0.5s; }
.journey li:nth-child(5) .dot { animation-delay: 0.7s; }
.journey li.now:not(.done) .dot { animation: journey-pop 0.35s ease-out both, journey-breathe 2.4s ease-in-out 1.2s infinite; }
.journey.mini::after, .journey.mini .dot, .journey.mini li.now:not(.done) .dot { animation: none; }
button:not(.link), a.button { transition: background-color 0.15s, border-color 0.15s, filter 0.15s, transform 0.2s, box-shadow 0.2s; }
button:not(.link):hover, a.button:hover { transform: translateY(-1px); }
button:not(.link):active, a.button:active { transform: none; }
.sidebar { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.25s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  button:not(.link):hover, a.button:hover { transform: none; }
}

/* Browser surfaces in the system's colours (selection, text cursor, scrollbars). */
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
input, textarea { caret-color: var(--accent); }
html { scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; scrollbar-width: thin; }

/* Two-step sign-in (docs/two-factor-design.md, drawings in .impeccable/mocks/mfa-2026-11-26/). */
input.code { width: 12rem; max-width: 100%; font-size: var(--fs-section); letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }
.small-link { margin: var(--s4) 0 0; font-size: var(--fs-dense); }
.two-factor > p:first-child { margin-top: 0; }
.two-factor .steps { margin: 0; gap: var(--s5); }
.two-factor .steps li > div > p { margin: var(--s1) 0 0; }
.qr-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s5); margin-top: var(--s3); }
.qr-row > div { flex: 1 1 14rem; min-width: 0; }
.qr-row p { margin: 0 0 var(--s1); }
svg.qr { width: 168px; height: 168px; flex: none; border: 1px solid var(--border); border-radius: var(--radius-control); }
.key, .recovery-codes { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-sub); letter-spacing: 0.05em; }
.key { overflow-wrap: anywhere; }
.code-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s2) var(--s3); margin-top: var(--s3); }
.code-form label { flex-basis: 100%; margin: 0; }
.code-form input.code, .code-form button { margin: 0; }
.code-form .error { flex-basis: 100%; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 12rem)); gap: var(--s2) var(--s6); margin: 0; padding: 0; list-style: none; }
@media (max-width: 599px) { .recovery-codes { grid-template-columns: minmax(0, 1fr); } }
