/* GENERATED by tokens/build.ts from tokens/theme.ts — do not edit by hand.
 *
 * Light values on :root, dark values on [data-theme="dark"] and, before any
 * script sets data-theme, on prefers-color-scheme: dark. Accent-derived values
 * here are for the default accent; AppearanceProvider rewrites them inline
 * when the person picks another.
 */

:root {
  --font-sans: Rubik, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --base: 14px;
  --text-eyebrow: 10px;
  --text-micro: 11px;
  --text-label: 11.5px;
  --text-hint: 12.5px;
  --text-control: 13px;
  --text-body: 13.5px;
  --text-base: 14px;
  --text-title: 15px;
  --text-dialog: 17px;
  --text-page: 19px;
  --text-kpi: 30px;
  --radius-xs: 5px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-input: 9px;
  --radius-popover: 10px;
  --radius-lg: 14px;
  --radius-dialog: 16px;
  --radius-pill: 999px;
  --radius: var(--radius-md);
  --shadow-raised: 0 1px 2px rgb(0 0 0 / 8%);
  --shadow-popover: 0 8px 24px rgb(0 0 0 / 12%);
  --shadow-dialog: 0 24px 60px rgb(0 0 0 / 24%);
  --shadow-drawer: 0 18px 48px rgb(18 22 20 / 28%);
  --motion-fast: 110ms;
  --motion-base: 150ms;
  --motion-drawer: 160ms;
  --scrim: rgb(18 22 20 / 42%);
  --drawer-scrim: rgb(18 22 20 / 38%);
  --sidebar-width: 252px;
  --header-height: 66px;
  --dialog-width: 560px;
  --prose-max: 78ch;
  --panel: #FFFFFF;
  --bg: #FBFBF9;
  --bg2: #FAFAF7;
  --hair: #F0F0EB;
  --border: #E3E3DE;
  --text: #1A1D1A;
  --muted: #6B7168;
  --faint: #9AA097;
  --hover: #F5F6F3;
  --accent: #006437;
  --accent-hover: #00542E;
  --accent-soft: rgba(0, 100, 55, 0.08);
  --accent-text: #00512D;
  --accent-contrast: #FFFFFF;
  --accent-graph: #006437;
  --warn-bg: #FDF8EA;
  --warn-border: #F0DFB4;
  --warn-text: #6B520C;
  --bad-bg: #FCF1F1;
  --bad-border: #F0C9C9;
  --bad-text: #8E2C2C;
  --ok-bg: #EDF3EF;
  --ok-border: #CBE3D4;
  --ok-text: #1F6B3E;
  --bad-solid: #8E2C2C;
  --bad-solid-hover: #7A2424;
  --ok-solid: #4C8C5E;
  --warn-solid: #C8A64A;
  --gray-solid: #B9BEB6;
  --chip-ok-bg: #E9F3EC;
  --chip-ok-fg: #1F6B3E;
  --chip-warn-bg: #FDF3D8;
  --chip-warn-fg: #7A5C0A;
  --chip-bad-bg: #FBE9E9;
  --chip-bad-fg: #8E2C2C;
  --chip-info-bg: #ECF0F6;
  --chip-info-fg: #33507F;
  --chip-neutral-bg: #F0F0EB;
  --chip-neutral-fg: #5C6359;
  --chip-warm-bg: #FBEDE9;
  --chip-warm-fg: #8E4A2C;
  --chip-cool-bg: #F1ECF7;
  --chip-cool-fg: #5B3E8E;
  --severity-calm: #7E857A;
  --severity-notable: #8A6A12;
  --severity-alarming: #8E2C2C;
  --shade-1: #006437;
  --shade-2: #4C7F62;
  --shade-3: #7FA891;
  --shade-4: #B4CBBE;
  --shade-flat: #C4C8C0;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --panel: #1C2022;
  --bg: #141718;
  --bg2: #212628;
  --hair: #2A2F32;
  --border: #2C3134;
  --text: #E9EBE7;
  --muted: #98A099;
  --faint: #767E78;
  --hover: #232829;
  --accent: #006437;
  --accent-hover: #006437;
  --accent-soft: rgba(0, 100, 55, 0.2);
  --accent-text: #8CB9A5;
  --accent-contrast: #FFFFFF;
  --accent-graph: #6BA58B;
  --warn-bg: #2A2417;
  --warn-border: #4A3F22;
  --warn-text: #E3BB63;
  --bad-bg: #2A1C1C;
  --bad-border: #4C2E2E;
  --bad-text: #EC8C8C;
  --ok-bg: #1B2E23;
  --ok-border: #2A4536;
  --ok-text: #86CFA5;
  --bad-solid: #A63A3A;
  --bad-solid-hover: #B84646;
  --ok-solid: #5FA974;
  --warn-solid: #D9B458;
  --gray-solid: #8A918B;
  --chip-ok-bg: #1C3025;
  --chip-ok-fg: #8FD3AA;
  --chip-warn-bg: #302818;
  --chip-warn-fg: #E8C273;
  --chip-bad-bg: #301E1E;
  --chip-bad-fg: #EF9494;
  --chip-info-bg: #1D2634;
  --chip-info-fg: #9CBCEE;
  --chip-neutral-bg: #262B2C;
  --chip-neutral-fg: #B3BAB3;
  --chip-warm-bg: #31241E;
  --chip-warm-fg: #E8AC8B;
  --chip-cool-bg: #292236;
  --chip-cool-fg: #C4AAEC;
  --severity-calm: #98A099;
  --severity-notable: #D9B458;
  --severity-alarming: #E38080;
  --shade-1: #4FA97A;
  --shade-2: #6DB894;
  --shade-3: #8FB7A2;
  --shade-4: #A3B8AC;
  --shade-flat: #737B76;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --panel: #1C2022;
    --bg: #141718;
    --bg2: #212628;
    --hair: #2A2F32;
    --border: #2C3134;
    --text: #E9EBE7;
    --muted: #98A099;
    --faint: #767E78;
    --hover: #232829;
    --accent: #006437;
    --accent-hover: #006437;
    --accent-soft: rgba(0, 100, 55, 0.2);
    --accent-text: #8CB9A5;
    --accent-contrast: #FFFFFF;
    --accent-graph: #6BA58B;
    --warn-bg: #2A2417;
    --warn-border: #4A3F22;
    --warn-text: #E3BB63;
    --bad-bg: #2A1C1C;
    --bad-border: #4C2E2E;
    --bad-text: #EC8C8C;
    --ok-bg: #1B2E23;
    --ok-border: #2A4536;
    --ok-text: #86CFA5;
    --bad-solid: #A63A3A;
    --bad-solid-hover: #B84646;
    --ok-solid: #5FA974;
    --warn-solid: #D9B458;
    --gray-solid: #8A918B;
    --chip-ok-bg: #1C3025;
    --chip-ok-fg: #8FD3AA;
    --chip-warn-bg: #302818;
    --chip-warn-fg: #E8C273;
    --chip-bad-bg: #301E1E;
    --chip-bad-fg: #EF9494;
    --chip-info-bg: #1D2634;
    --chip-info-fg: #9CBCEE;
    --chip-neutral-bg: #262B2C;
    --chip-neutral-fg: #B3BAB3;
    --chip-warm-bg: #31241E;
    --chip-warm-fg: #E8AC8B;
    --chip-cool-bg: #292236;
    --chip-cool-fg: #C4AAEC;
    --severity-calm: #98A099;
    --severity-notable: #D9B458;
    --severity-alarming: #E38080;
    --shade-1: #4FA97A;
    --shade-2: #6DB894;
    --shade-3: #8FB7A2;
    --shade-4: #A3B8AC;
    --shade-flat: #737B76;
    color-scheme: dark;
  }
}

/* Base: reset, typography, focus, scrollbars.
 *
 * Import order: tokens.css → base.css → layout.css → components.css.
 * No CSS framework: the design is a small closed system, and translating it
 * into variables costs less than bending someone else's kit until it fits.
 */

* {
  box-sizing: border-box;
  scrollbar-color: var(--border) transparent;
  scrollbar-width: thin;
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--faint);
}

html,
body,
#root {
  height: 100%;
}

/* ⚠️ The document never scrolls. The app is the size of the window; the panes
   inside it (list, detail, sidebar, page body) scroll on their own. When the
   document scrolls, the whole app slides up and a strip of background shows —
   a symptom that does not point at the element that grew. Pages that ARE
   documents (legal text, public pages) opt out with `.document-page`. */
html,
body {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--base);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  letter-spacing: -0.01em;
}

.mono,
code,
kbd,
pre {
  font-family: var(--font-mono);
}

::placeholder {
  color: var(--faint);
}

a {
  color: var(--accent-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Focus is never removed, only restyled. People who work these screens with the
   keyboard all day are the reason the outline stays visible. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

select option,
select optgroup {
  background: var(--panel);
  color: var(--text);
}

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

/* A long public document inside an app whose document does not scroll. */
.document-page {
  height: 100dvh;
  overflow-y: auto;
}

/* The shell: sidebar + main column, page header, section tabs, page body,
 * grids, utilities, and the narrow (< 860px) layout.
 */

/* ── Frame ──────────────────────────────────────────────────────────────── */

.app {
  display: flex;
  /* `dvh`, not `vh`: on phones the browser bar comes and goes, and `vh` freezes
     at the taller height — the app becomes taller than the window. */
  height: 100dvh;
  background: var(--bg);
}
@supports not (height: 100dvh) {
  .app {
    height: 100vh;
  }
}
/* No `min-height` on the frame: it made the document scroll on short windows
   (laptop + bookmarks bar, split screen, 150% zoom). Each pane sets its own. */

.sidebar {
  flex: 0 1 var(--sidebar-width);
  min-width: 200px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 6px 18px;
}
.brand .mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-contrast);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
}
.brand .name {
  font-weight: 600;
  font-size: var(--text-title);
  letter-spacing: -0.01em;
}

.eyebrow {
  font-size: var(--text-eyebrow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

.nav-group {
  padding: 12px 8px 6px;
}

/* The middle of the sidebar scrolls; brand on top and the signed-in person at
   the bottom stay. The scrollbar is hidden (it would sit over the labels in a
   252px column) and a fade at the end says there is more. `mask`, not an
   overlay gradient: an overlay in the background colour is wrong in the other
   theme. */
.nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  margin: 0 -14px;
  padding: 0 14px 10px;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: inherit;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover {
  background: var(--hover);
  text-decoration: none;
}
.nav-item.on {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.nav-item .label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: var(--text-micro);
  font-weight: 600;
  display: grid;
  place-items: center;
}
/* The counter that informs rather than calls. Only one queue should interrupt
   someone — two loud numbers make both stop meaning urgency. */
.badge-count.soft {
  background: var(--hair);
  color: var(--muted);
}

.who {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Page ───────────────────────────────────────────────────────────────── */

.page-header {
  height: var(--header-height);
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.page-header h1 {
  margin: 0;
  font-size: var(--text-page);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.page-header .meta {
  font-size: var(--text-control);
  color: var(--muted);
}

/* A page's sections, on their own strip below the title. Rule across the app:
   **a pill filters a list; an underline switches section.** */
.tabs-bar {
  flex: none;
  display: flex;
  gap: 2px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar {
  display: none;
}
.tabs-bar a,
.tabs-bar button {
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  padding: 11px 12px 10px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  line-height: inherit;
}
.tabs-bar a:hover,
.tabs-bar button:hover {
  color: var(--text);
  border-bottom-color: var(--border);
  text-decoration: none;
}
.tabs-bar a.on,
.tabs-bar button.on {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
}

.page-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 26px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
/* Nothing inside a scrolling container may be squeezed — it scrolls precisely
   so it does not have to. Without this a child with `overflow: hidden` loses
   its automatic min-height and collapses to 2px, with no error to explain it. */
.page-body > * {
  flex-shrink: 0;
}

/* Master/detail: a list pane and a detail pane side by side. */
.split-view {
  flex: 1;
  min-height: 0;
  display: flex;
}
.split-view > .list-pane {
  flex: 0 1 356px;
  min-width: 244px;
  border-right: 1px solid var(--border);
  background: var(--panel);
  overflow-y: auto;
}
.split-view > .detail-pane {
  flex: 1 1 0;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── Grids ──────────────────────────────────────────────────────────────── */

/* Main column + margin. The aside has a floor and no ceiling; below the
   breakpoint they stack, main first. */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(268px, 0.8fr);
  gap: 16px;
  align-items: start;
}
@media (width < 1080px) {
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Two symmetric columns of fields (a form, not main + margin). */
.form-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (width < 700px) {
  .form-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Short fields side by side. */
.fields-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  align-items: start;
}

/* Auto-fit grids: they reflow with the window, no breakpoints written by hand. */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  align-items: start;
}
.cards-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 14px;
  align-items: stretch;
}
.cards-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  align-items: stretch;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 14px;
  align-items: start;
}
.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: start;
}
@media (width < 1100px) {
  .report-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Utilities ──────────────────────────────────────────────────────────── */

.stack {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
}
.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
}
.gap-4 {
  gap: 4px;
}
.gap-6 {
  gap: 6px;
}
.gap-8 {
  gap: 8px;
}
.gap-10 {
  gap: 10px;
}
.gap-12 {
  gap: 12px;
}
.gap-14 {
  gap: 14px;
}
.gap-18 {
  gap: 18px;
}
.pad-lg {
  padding: 20px 22px;
}
.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dim {
  color: var(--muted);
}
.rule {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}
/* Visible to a screen reader, not to the eye. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Narrow (< 860px): drawer + one pane at a time ─────────────────────────
 * Same breakpoint as `useNarrow()` (LAYOUT.narrow). They must agree, or a band
 * of widths shows neither the list nor the detail.
 */

.menu-toggle,
.back-button {
  display: none;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.menu-toggle:hover,
.back-button:hover {
  background: var(--hover);
}
.scrim {
  display: none;
}

@media (width < 860px) {
  .sidebar {
    position: fixed;
    z-index: 45;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(288px, 84vw);
    flex: none;
    /* Off-screen, not hidden: `display: none` kills the transition. */
    transform: translateX(-100%);
    transition: transform var(--motion-drawer) ease;
  }
  .menu-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-drawer);
  }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 44;
    background: var(--drawer-scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-drawer) ease;
  }
  .menu-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .menu-toggle,
  .back-button {
    display: grid;
  }

  .page-header {
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 14px;
  }
  .page-header h1 {
    font-size: var(--text-dialog);
  }
  .page-header .meta {
    order: 9;
    font-size: var(--text-hint);
  }
  .page-header .grow {
    flex: 0;
  }
  .page-header > .avatar {
    display: none;
  }
  .tabs-bar,
  .page-body {
    padding-left: 14px;
    padding-right: 14px;
  }
  .page-body {
    padding-top: 16px;
    padding-bottom: 28px;
    gap: 16px;
  }

  /* One pane at a time: the list fills the screen; `.with-detail` swaps it
     for the detail, and the back button brings it back. */
  .split-view > .list-pane {
    flex: 1 1 auto;
    min-width: 0;
    border-right: 0;
  }
  .split-view > .detail-pane {
    display: none;
  }
  .split-view.with-detail > .list-pane {
    display: none;
  }
  .split-view.with-detail > .detail-pane {
    display: flex;
  }

  /* Auto-fit grids whose single column is still wider than the phone. */
  .cards-2,
  .cards-3,
  .settings-grid,
  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-body .row > *,
  .page-body .stack > * {
    min-width: 0;
  }
  .page-body > * {
    max-width: 100%;
  }

}

/* Component styles. Every colour is a variable — see tokens/theme.ts.
 * A new literal hex here fails `no-hex.test.ts`.
 */

/* ── Avatar ─────────────────────────────────────────────────────────────── */

.avatar {
  border-radius: var(--radius-pill);
  background: var(--bg2);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: var(--text-micro);
  font-weight: 600;
  flex: none;
  width: 30px;
  height: 30px;
}
.avatar.accent {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.avatar.lg {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: var(--text-control);
  font-weight: 500;
  line-height: 1.2;
  padding: 9px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  background: var(--hover);
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
/* The main action of a screen or dialog. One per view. */
.btn.primary {
  font-weight: 600;
  padding: 9px 17px;
  border: 0;
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
/* Selected/emphasised but not the main action. */
.btn.soft {
  font-weight: 600;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}
/* No frame — for actions that must not compete (sign out, close). */
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
}
.btn.ghost:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}
.btn.ghost.bad {
  color: var(--bad-text);
}
.btn.ghost.ok {
  color: var(--ok-text);
}
/* "Remove" beside a normal button: same box, red ink.
   ⚠️ `:not(.ghost)` is required — `.btn.ghost` and `.btn.bad` have the same
   specificity, and without it every `ghost bad` gains a frame. */
.btn.bad:not(.ghost) {
  border-color: var(--bad-border);
  background: var(--bad-bg);
  color: var(--bad-text);
}
.btn.bad:not(.ghost):hover:not(:disabled) {
  border-color: var(--bad-text);
  background: var(--bad-bg);
}
/* Solid red: only the button that CONFIRMS a destructive action in a dialog. */
.btn.danger {
  font-weight: 600;
  border: 0;
  background: var(--bad-solid);
  color: var(--accent-contrast);
}
.btn.danger:hover:not(:disabled) {
  background: var(--bad-solid-hover);
}
.btn.lg {
  font-size: var(--text-body);
  padding: 10px 20px;
}
.btn.sm {
  font-size: var(--text-hint);
  padding: 7px 12px;
}

/* A button that reads as a link, where the action is not navigation. */
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-btn:hover {
  color: var(--accent);
}

/* ── Pills (filters) ────────────────────────────────────────────────────── */

.pill {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-control);
  font-weight: 500;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}
.pill:hover {
  background: var(--bg2);
}
.pill.on {
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-contrast);
}
.pill:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Tags and chips ─────────────────────────────────────────────────────── */

.tag {
  display: inline-block;
  white-space: nowrap;
  font-size: var(--text-label);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.tag.round {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: var(--text-micro);
}
.tag.ok { background: var(--chip-ok-bg); color: var(--chip-ok-fg); }
.tag.warn { background: var(--chip-warn-bg); color: var(--chip-warn-fg); }
.tag.bad { background: var(--chip-bad-bg); color: var(--chip-bad-fg); }
.tag.info { background: var(--chip-info-bg); color: var(--chip-info-fg); }
.tag.neutral { background: var(--chip-neutral-bg); color: var(--chip-neutral-fg); }
.tag.warm { background: var(--chip-warm-bg); color: var(--chip-warm-fg); }
.tag.cool { background: var(--chip-cool-bg); color: var(--chip-cool-fg); }

/* A person (or item) inside a card, with an optional avatar. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--panel);
  font-size: var(--text-control);
}
.chip.add {
  border-style: dashed;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 12px;
  font-family: inherit;
}
.chip.add:hover {
  background: var(--hover);
  color: var(--text);
}

/* Colour for a time-based severity. Always next to the number it colours. */
.severity {
  font-size: var(--text-label);
  font-weight: 500;
}
.severity.calm { color: var(--severity-calm); }
.severity.notable { color: var(--severity-notable); }
.severity.alarming { color: var(--severity-alarming); }

/* ── Cards ──────────────────────────────────────────────────────────────── */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.card > h2,
.card > h3 {
  margin: 0 0 10px;
  font-size: var(--text-title);
  font-weight: 600;
}
/* A card that opens something: cursor and highlight are what tell a click
   target from a block of text. */
.clickable {
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.clickable:hover {
  border-color: var(--accent);
  background: var(--hover);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat .value {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.stat .note,
.kpi .note {
  font-size: var(--text-hint);
  color: var(--muted);
  line-height: 1.4;
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 14px;
}
.kpi .value {
  font-size: var(--text-kpi);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.kpi .delta {
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
}
.kpi .delta.good { color: var(--chip-ok-fg); }
/* Amber, not red, for a bad trend: red is reserved for what already broke. */
.kpi .delta.bad { color: var(--warn-text); }

/* ── Charts (CSS-only) ──────────────────────────────────────────────────── */

/* The shape of the period, in low bars. No axis on purpose. */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
}
.spark span {
  flex: 1;
  min-width: 3px;
  border-radius: 2px;
  background: var(--hair);
}
.spark span:last-child {
  background: var(--accent-graph);
}

/* A thin track, not a thick saturated block. */
.meter {
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--hair);
  overflow: hidden;
}
.meter-fill {
  height: 7px;
  border-radius: var(--radius-pill);
  min-width: 2px;
  background: var(--accent-graph);
}

/* One bar for a whole that adds up (part-to-whole). */
.split-bar {
  display: flex;
  height: 12px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--hair);
}
.split-bar > span {
  min-width: 0;
}
.key {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

/* ── Table (CSS grid) ───────────────────────────────────────────────────── */

.table {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table .thead,
.table .trow {
  display: grid;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.table .thead {
  background: var(--bg2);
  font-size: var(--text-eyebrow);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.table .trow {
  padding: 14px 18px;
  font-size: var(--text-control);
}
.table .trow:last-child {
  border-bottom: 0;
}
.table .trow:hover {
  background: var(--bg2);
}
.table .trow.clickable {
  cursor: pointer;
}
.table .trow.active {
  background: var(--accent-soft);
}
.row-link {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}
.trow:hover .row-link {
  text-decoration: underline;
}

/* ── Form controls ──────────────────────────────────────────────────────── */

.input,
.textarea {
  width: 100%;
  font-family: inherit;
  font-size: var(--text-base);
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.input:focus,
.textarea:focus {
  border-color: var(--accent);
}
.input:disabled,
.textarea:disabled {
  background: var(--bg2);
  color: var(--muted);
  cursor: not-allowed;
}
.input[aria-invalid='true'],
.textarea[aria-invalid='true'] {
  border-color: var(--bad-text);
}
.textarea {
  resize: none;
  line-height: 1.45;
}

/* The select arrow is drawn with two gradient strips instead of an SVG data
   URL: a data URL carries its colour inside it and cannot take a variable, so
   the arrow would stay light-grey on a dark panel. */
select.input,
select.bare {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent calc(50% - 0.75px), var(--faint) calc(50% - 0.75px), var(--faint) calc(50% + 0.75px), transparent calc(50% + 0.75px)),
    linear-gradient(135deg, transparent calc(50% - 0.75px), var(--faint) calc(50% - 0.75px), var(--faint) calc(50% + 0.75px), transparent calc(50% + 0.75px));
  background-repeat: no-repeat;
  background-size: 5px 5px;
}
/* The arrow's room is part of the box — with `appearance: none` the browser no
   longer reserves it, and the longest option would run under the arrow. */
select.input {
  padding-right: 32px;
  background-position: right 19px center, right 14px center;
}
select.input:hover:not(:disabled) {
  border-color: var(--faint);
}
/* Two smaller sizes, never an inline padding: `sm` for a header filter row,
   `xs` for a control inside a table row. */
select.input.sm {
  font-size: var(--text-control);
  padding: 8px 30px 8px 11px;
  background-position: right 18px center, right 13px center;
}
select.input.xs {
  font-size: var(--text-hint);
  padding: 6px 27px 6px 9px;
  background-position: right 16px center, right 11px center;
}
select.bare {
  padding-right: 15px;
  background-position: right 5px center, right 0 center;
}
select.input option,
select.bare option {
  background: var(--panel);
  color: var(--text);
}

/* Where the browser supports `appearance: base-select`, the open list is drawn
   in the page and takes our variables. Where it does not, all of this is
   ignored and the native list shows — nothing depends on it. */
@supports (appearance: base-select) {
  select.input,
  select.input::picker(select),
  select.bare,
  select.bare::picker(select) {
    appearance: base-select;
  }
  select.input::picker-icon,
  select.bare::picker-icon {
    display: none;
  }
  select.input,
  select.bare {
    justify-content: flex-start;
    text-align: left;
  }
  select.input::picker(select),
  select.bare::picker(select) {
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-popover);
    background: var(--panel);
    box-shadow: var(--shadow-popover);
    max-height: 320px;
    overflow-y: auto;
    margin-top: 4px;
    min-width: anchor-size(width);
    opacity: 0;
    translate: 0 -3px;
    transition:
      opacity var(--motion-fast) ease,
      translate var(--motion-fast) ease,
      display var(--motion-fast) allow-discrete,
      overlay var(--motion-fast) allow-discrete;
  }
  select.input:open::picker(select),
  select.bare:open::picker(select) {
    opacity: 1;
    translate: 0 0;
  }
  @starting-style {
    select.input:open::picker(select),
    select.bare:open::picker(select) {
      opacity: 0;
      translate: 0 -3px;
    }
  }
  select.input option,
  select.bare option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: var(--text-control);
    line-height: 1.35;
    color: var(--text);
    background: transparent;
    cursor: pointer;
  }
  /* Hover AND focus: the list is navigated with arrow keys as much as with
     the pointer. */
  select.input option:hover,
  select.input option:focus,
  select.bare option:hover,
  select.bare option:focus {
    background: var(--hover);
    outline: none;
  }
  select.input option:checked,
  select.bare option:checked {
    font-weight: 500;
    color: var(--accent-text);
  }
  select.input option:disabled,
  select.bare option:disabled {
    color: var(--faint);
    cursor: not-allowed;
  }
  select.input option::checkmark,
  select.bare option::checkmark {
    content: '✓';
    order: -1;
    flex: none;
    width: 12px;
    font-size: var(--text-micro);
    line-height: 1;
    color: var(--accent);
  }
  select.input option:not(:checked)::checkmark,
  select.bare option:not(:checked)::checkmark {
    content: '';
  }
  @media (prefers-reduced-motion: reduce) {
    select.input::picker(select),
    select.bare::picker(select) {
      transition: none;
      translate: none;
    }
  }
}

/* The field is a <label> wrapping its control: label and input know each
   other without a hand-matched id. */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
label.field {
  cursor: default;
}
.field-label {
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.hint {
  font-size: var(--text-hint);
  color: var(--muted);
  line-height: 1.45;
}
/* The tone accentuates; the words still carry the message. */
.hint.warn { color: var(--warn-text); }
.hint.danger { color: var(--bad-text); }
.hint.ok { color: var(--ok-text); }

/* Search box: icon + bare input in a bordered row. */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--faint);
  min-width: 220px;
}
.search:focus-within {
  border-color: var(--accent);
}
.bare {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--text-control);
  color: var(--text);
}

/* Mutually exclusive options that fit on one line. */
.segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-popover);
  background: var(--bg2);
}
.segmented button,
.segmented a {
  flex: 1;
  text-align: center;
  font-family: inherit;
  font-size: var(--text-control);
  font-weight: 500;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
}
.segmented a:hover {
  color: var(--text);
}
.segmented button.on,
.segmented a.on {
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-raised);
}

/* A switch says "this is ON" (a state that keeps acting after the screen
   closes); a checkbox says "this is ticked". */
.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 23px;
  border-radius: var(--radius-pill);
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--border);
  transition: background var(--motion-base);
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: var(--radius-pill);
  background: var(--panel);
  box-shadow: 0 1px 2px rgb(0 0 0 / 18%);
  transition: transform var(--motion-base);
}
.switch.on {
  background: var(--accent);
}
.switch.on::after {
  transform: translateX(17px);
}
.switch:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-popover);
  background: var(--bg2);
}

/* A checkbox that is a whole decision: title + the sentence that explains it. */
.check-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}
.check-card .box {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--accent-contrast);
  display: grid;
  place-items: center;
  font-size: var(--text-micro);
}
.check-card .box.on {
  border-color: var(--accent);
  background: var(--accent);
}

/* ── Notices ────────────────────────────────────────────────────────────── */

/* ⚠️ The toast never eats clicks: it sits bottom-centre, which is exactly where
   the main action of a form tends to be. Only its button takes pointer events. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 40;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(560px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: var(--radius-popover);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: var(--text-body);
  box-shadow: var(--shadow-popover);
}
.toast .btn {
  pointer-events: auto;
}
.toast.problem {
  border-color: var(--bad-border);
  background: var(--bad-bg);
  color: var(--bad-text);
}

/* Prose notice. Deliberately NOT flex: a <strong> inside a sentence would
   become its own flex item and break the sentence into fragments. */
.banner {
  display: block;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg2);
  font-size: var(--text-control);
  color: var(--muted);
  line-height: 1.5;
  text-wrap: pretty;
  max-width: var(--prose-max);
}
/* Amber: "this will not work the way you expect". Red: "this is broken". */
.banner.warn {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}
.banner.bad {
  border-color: var(--bad-border);
  background: var(--bad-bg);
  color: var(--bad-text);
}
.banner.ok {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok-text);
}
.banner strong {
  color: inherit;
}

/* A screen the API cannot serve yet. A note, not an error: nothing is broken,
   the endpoint does not exist — and it is named. */
.not-yet {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 620px;
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg2);
}
.not-yet h2 {
  margin: 0;
  font-size: var(--text-title);
  font-weight: 600;
}
.not-yet p {
  margin: 0;
  font-size: var(--text-control);
  color: var(--muted);
  line-height: 1.55;
  text-wrap: pretty;
}
.not-yet code {
  font-size: var(--text-hint);
  color: var(--text);
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: 1.5;
}

/* What a section shows when it crashed (SectionBoundary). */
.boundary {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 24px;
}
.boundary pre {
  margin: 0;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--bad-text);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
}
.divider .line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider .text {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

/* ── Dialogs ────────────────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--scrim);
}
.dialog {
  width: min(var(--dialog-width), calc(100vw - 48px));
  max-width: 100%;
  /* Never touching top and bottom: a box that fills the screen stops reading
     as a box, and clicking outside — the way out — disappears. */
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-dialog);
  background: var(--panel);
  box-shadow: var(--shadow-dialog);
}
.dialog.wide {
  width: min(760px, calc(100vw - 64px));
}
.dialog.danger {
  border-color: var(--bad-border);
}
.dialog h2 {
  margin: 0;
  font-size: var(--text-dialog);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.dialog p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--muted);
  line-height: 1.5;
  text-wrap: pretty;
}
.dialog .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ── Sign-in ────────────────────────────────────────────────────────────── */

.login {
  /* `height`, not `min-height`: on a short window the card scrolls inside. */
  height: 100dvh;
  overflow-y: auto;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.login .box {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}
.login h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ── Appearance preview (settings) ──────────────────────────────────────── */

.accent-swatch {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.accent-swatch.on {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ── Narrow (< 860px) — components ──────────────────────────────────────────
 * Here and not in layout.css: layout.css is imported BEFORE this file, and a
 * narrow rule there loses to the base rule here (same specificity, later wins).
 */
@media (width < 860px) {
  /* Tables become cards: the grid columns go inert under flex. */
  .table .thead {
    display: none;
  }
  .table .trow {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding: 14px;
  }
  .table .trow > * {
    max-width: 100%;
  }

  .overlay {
    padding: 12px;
  }
  .dialog {
    width: 100%;
    max-height: 88dvh;
  }
  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
  }
}

/* What the demos app adds on top of dextra-frontend-kit: self-hosted fonts,
 * the brand-kit logo colours, the zero-JS drawer and a few page pieces.
 * Every interface colour is still a kit variable; the hex values below are the
 * brand-kit logo, which is brand, not interface.
 */

/* Fonts are served by this app (`/_dx/v1/…`): no font CDN on a client link. */
@font-face {
  font-family: Rubik;
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url(/_dx/v1/rubik-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Rubik;
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url(/_dx/v1/rubik-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/_dx/v1/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Brand-kit logo, recoloured per theme ─────────────────────────────────── */

:root {
  color-scheme: light;
  --logo-wm: #006437;
  --logo-tag: #888885;
  --logo-dot: #ce2b37;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --logo-wm: #ffffff;
  --logo-tag: #cde0d5;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --logo-wm: #ffffff;
    --logo-tag: #cde0d5;
  }
}
.dx-logo {
  width: 132px;
  height: auto;
  display: block;
}
.dx-wm { fill: var(--logo-wm); }
.dx-tag { fill: var(--logo-tag); }
.dx-dot { fill: var(--logo-dot); }

/* The sidebar mark is the Demos product icon (the Hub's), not the kit's
 * letter on accent: the icon brings its own tile, so no background. */
.brand img.mark {
  background: none;
  border-radius: 0;
  display: block;
}

/* ── Drawer without JavaScript ────────────────────────────────────────────
 * The kit opens the narrow-screen drawer from React (`.menu-open`). Here a
 * hidden checkbox holds the state: the header toggle and the scrim are its
 * labels, so the admin stays zero-JS.
 */
.menu-state {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
@media (width < 860px) {
  .app:has(.menu-state:checked) .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-drawer);
  }
  .app:has(.menu-state:checked) .scrim {
    opacity: 1;
    pointer-events: auto;
  }
}
.app:has(.menu-state:focus-visible) .menu-toggle {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Page pieces ───────────────────────────────────────────────────────── */

/* A <form> that is only a button (archive, sign out) must not break the row. */
.inline-form {
  display: inline-flex;
  margin: 0;
}
.who .who-name {
  min-width: 0;
  flex: 1;
}

/* The mockup list: one column string shared by header and rows. */
.cols-mockups {
  grid-template-columns: minmax(0, 1.5fr) minmax(170px, 0.7fr) minmax(0, 1.4fr);
}
.mockup-url {
  font-size: var(--text-hint);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.input.xs {
  font-size: var(--text-hint);
  padding: 6px 9px;
  border-radius: var(--radius);
  width: 150px;
}
.password-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
}

/* A form page: one card, a readable width. */
.form-card {
  width: min(680px, 100%);
}
.form-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.actions-row,
.form-card form.actions-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
/* The kit's .textarea sets its own font after .mono; HTML is code. */
.textarea.mono {
  font-family: var(--font-mono);
  font-size: var(--text-control);
}

/* Native file picker, dressed as the kit's input. */
.input[type='file'] {
  padding: 8px 10px;
  font-size: var(--text-control);
}
.input[type='file']::file-selector-button {
  font: inherit;
  font-weight: 500;
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

/* The card on the sign-in-style pages (gate, login, refusal, landing). */
.login .what {
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.4;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  background: var(--bg);
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.login .sub {
  margin: -8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
.login form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login .foot {
  margin: 0;
  font-size: var(--text-hint);
  color: var(--faint);
  text-align: center;
}
.login .dx-logo {
  margin-bottom: 6px;
}

/* ── A client's brand on the password gate ─────────────────────────────────
 * publicGate() sets --client-* inline from the brand the client published
 * (validated #rrggbb); here they replace the kit's accent and page background.
 * The card keeps the kit surface, so its text stays readable in light and dark.
 */
.login.client {
  --client-on-dark: #ffffff;
  --client-on-light: #141718;
  --accent: var(--client-primary);
  --accent-hover: color-mix(in srgb, var(--client-primary) 86%, black);
  --accent-contrast: var(--client-on-primary);
  background: var(--client-bg);
  color: var(--text);
}
.login.client .box {
  border-top: 4px solid var(--client-accent);
}
/* The logo sits on the client's primary colour: the studio asks for a light logo made for it
   (the same way it enters the video cards), and on the white card it would disappear. */
.client-logo {
  display: block;
  box-sizing: content-box;
  max-width: 200px;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--client-primary);
  margin-bottom: 6px;
}
.client-name {
  font-size: var(--text-dialog);
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  margin-bottom: 6px;
}
.client-powered {
  margin: -8px 0 0;
  font-size: var(--text-micro);
  color: var(--faint);
  text-align: center;
}
