/*
 * Centipod brand stylesheet. Source: Centipod Brand Bible.
 * Sites load this file from the Centipod CDN, never from a local copy (Brand Bible 8.10). It is one of four
 * sibling folders of the kit: css/, js/, fonts/ and logo/, so the fonts below resolve at ../fonts/.
 *
 * Contents: 1 fonts  2 tokens (System by default, Light and Dark on request)  3 base  4 layout  5 components  6 utilities
 * The theme follows the visitor's own appearance (Brand Bible 2.1): with no <html data-theme>, the dark tokens apply
 * under prefers-color-scheme: dark; <html data-theme="light"> or "dark" is the visitor's choice and always wins.
 * Every dark block below is therefore written twice: once for data-theme="dark", once for the System case.
 */

/* 1 ---------------------------------------------------------------------------------------- fonts */
@font-face { font-family: "Albert Sans"; src: url("../fonts/albert-sans.woff2") format("woff2");
  font-weight: 500 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Code Pro"; src: url("../fonts/source-code-pro.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap; }

/* 2 --------------------------------------------------------------------------------------- tokens */
/* A brand layer may set (Brand Bible 8.10): the action, mark, focus, block, status and spinner colours, the three
   fonts, and, as one set, the ground: base, surface, ink, ink-2, ink-3, line, --cp-icon-ground and --busy-scrim. Each is
   defined below for light, dark and System, so a brand that sets any of them writes all three conditions. */
:root {
  /* colour, as RGB channels so they work with alpha: rgb(var(--color-ink) / 40%) */
  --color-base: 255 255 255;          /* #FFFFFF */
  --color-surface: 248 250 252;       /* #F8FAFC */
  --color-ink: 15 33 51;              /* #0F2133 Harbour Midnight */
  --color-ink-2: 71 85 105;           /* #475569 */
  --color-ink-3: 100 116 139;         /* #64748B */
  --color-line: 226 232 240;          /* #E2E8F0 */
  --color-block: 15 33 51;            /* #0F2133 */
  --color-on-block: 248 250 252;      /* #F8FAFC */
  --color-action: 194 77 0;           /* #C24D00 Burnt Orange */
  --color-action-hover: 169 67 0;     /* #A94300 */
  --color-action-pressed: 143 57 0;   /* #8F3900 */
  --color-on-action: 255 255 255;     /* #FFFFFF */
  --color-mark: 194 77 0;             /* #C24D00 */
  --color-focus: var(--color-ink);    /* the line of an active or tabbed-to control (6.1). Brand-owned: see the brand layer, 8.10 */
  --color-error: 163 18 58;           /* #A3123A */
  --color-error-tint: 251 241 243;    /* #FBF1F3 */
  --color-success: 30 107 69;         /* #1E6B45 */
  --color-success-tint: 241 247 243;  /* #F1F7F3 */
  --color-warning: 122 82 0;          /* #7A5200 */
  --color-warning-tint: 251 246 234;  /* #FBF6EA */

  /* type */
  --font-heading: "Albert Sans", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-code: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* space: a 4 px grid */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-24: 96px; --space-32: 128px;

  /* shape */
  --radius-sm: 2px;
  --radius-md: 4px;
  --hairline: 1px;
  --measure: 68ch;
  --container: 1280px;

  /* icons: the ground behind hatching knock-outs */
  --cp-icon-ground: #FFFFFF;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --color-base: 15 33 51;             /* #0F2133 */
  --color-surface: 18 41 63;          /* #12293F */
  --color-ink: 248 250 252;           /* #F8FAFC */
  --color-ink-2: 172 191 210;         /* #ACBFD2 */
  --color-ink-3: 138 155 176;         /* #8A9BB0 */
  --color-line: 30 58 87;             /* #1E3A57 */
  --color-block: 248 250 252;
  --color-on-block: 15 33 51;
  --color-error: 240 138 160;         /* #F08AA0 */
  --color-success: 124 200 160;       /* #7CC8A0 */
  --color-warning: 227 178 90;        /* #E3B25A */
  --color-error-tint: 18 41 63;
  --color-success-tint: 18 41 63;
  --color-warning-tint: 18 41 63;
  --cp-icon-ground: #0F2133;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme]) {
  --color-base: 15 33 51;             /* #0F2133 */
  --color-surface: 18 41 63;          /* #12293F */
  --color-ink: 248 250 252;           /* #F8FAFC */
  --color-ink-2: 172 191 210;         /* #ACBFD2 */
  --color-ink-3: 138 155 176;         /* #8A9BB0 */
  --color-line: 30 58 87;             /* #1E3A57 */
  --color-block: 248 250 252;
  --color-on-block: 15 33 51;
  --color-error: 240 138 160;         /* #F08AA0 */
  --color-success: 124 200 160;       /* #7CC8A0 */
  --color-warning: 227 178 90;        /* #E3B25A */
  --color-error-tint: 18 41 63;
  --color-success-tint: 18 41 63;
  --color-warning-tint: 18 41 63;
  --cp-icon-ground: #0F2133;
  color-scheme: dark;
}
}

/* 3 ----------------------------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* the hidden attribute always wins (Brand Bible 8.2) */

html {
  background: rgb(var(--color-base));
  color: rgb(var(--color-ink));
  font-family: var(--font-body);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}
body { margin: 0; font-size: 1rem; line-height: 1.5; }

/* Vertical distances (Brand Bible §3.6): title to standfirst 24 px, H2 to text 16 px, H3 to text 12 px. */
h1, h2, h3, .cp-display {
  font-family: var(--font-heading); font-weight: 700; color: rgb(var(--color-ink));
  margin: 0 0 var(--space-6); text-wrap: balance;
}
.cp-display { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.07; letter-spacing: -0.025em; font-weight: 800; }
h1 { font-size: clamp(1.875rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 1.75rem); line-height: 1.21; letter-spacing: -0.015em; margin-top: var(--space-12); margin-bottom: var(--space-4); }
h3 { font-size: 1.25rem; line-height: 1.4; letter-spacing: -0.01em; margin-top: var(--space-8); margin-bottom: var(--space-3); }
/* A row of tags above a title, 24 px clear of it; a row of actions below text, 24 px clear of it. */
.cp-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-6); padding: 0; list-style: none; }
/* A label above a title keeps 24 px too (margins collapse to the larger value). */
.cp-label + h1, .cp-label + .cp-display, .cp-label + h2 { margin-top: var(--space-6); }
.cp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-6); }
p { margin: 0 0 var(--space-6); max-width: var(--measure); }
.cp-lead { font-size: 1.125rem; line-height: 1.56; }
small, .cp-small { font-size: 0.875rem; line-height: 1.43; color: rgb(var(--color-ink-2)); }

a { color: inherit; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: rgb(var(--color-ink-2)); }

code, kbd, pre, .cp-code { font-family: var(--font-code); font-size: 0.875rem; }
pre { background: rgb(var(--color-surface)); border: var(--hairline) solid rgb(var(--color-line));
  border-radius: var(--radius-sm); padding: var(--space-4); overflow-x: auto; line-height: 1.43; }

hr { border: 0; border-top: var(--hairline) solid rgb(var(--color-line)); margin: var(--space-12) 0; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }

/* Focus (Brand Bible 6.1): a thin line in the brand's focus colour, 2 px clear of the control. Never a heavy ring. */
:focus-visible { outline: var(--hairline) solid rgb(var(--color-focus)); outline-offset: 2px; }
::selection { background: rgb(var(--color-ink) / 15%); }

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

/* 4 --------------------------------------------------------------------------------------- layout */
.cp-container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 768px) { .cp-container { padding: 0 var(--space-8); } }
@media (min-width: 1024px) { .cp-container { padding: 0 var(--space-12); } }

/* The 8 + 4 split with the Mondrian axis. Below 1024 px: one column with an axis on the left. */
.cp-split { border-left: var(--hairline) solid rgb(var(--color-ink)); padding-left: var(--space-4); }
.cp-split > .cp-rail { margin-top: var(--space-8); border-top: var(--hairline) solid rgb(var(--color-line)); padding-top: var(--space-4); }
@media (min-width: 1024px) {
  .cp-split { border-left: 0; padding-left: 0; display: grid; grid-template-columns: 2fr 1fr; }
  .cp-split > .cp-main { padding-right: var(--space-6); }
  .cp-split > .cp-rail { margin-top: 0; border-top: 0; padding-top: 0; padding-left: var(--space-6);
    border-left: var(--hairline) solid rgb(var(--color-line)); }
}
.cp-section { border-top: var(--hairline) solid rgb(var(--color-line)); padding: var(--space-12) 0; }
@media (min-width: 1024px) { .cp-section { padding: var(--space-16) 0; } }
.cp-block { background: rgb(var(--color-block)); color: rgb(var(--color-on-block)); padding: var(--space-8); }
.cp-block :is(h1, h2, h3) { color: rgb(var(--color-on-block)); }
.cp-surface { background: rgb(var(--color-surface)); }

/* 5 ----------------------------------------------------------------------------------- components */
/* Label: Inter 600 capitals, 12 px, tracked */
.cp-label { font-family: var(--font-body); font-size: 0.75rem; line-height: 1rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: rgb(var(--color-ink-2)); }

p.cp-label { margin-bottom: var(--space-2); }

/* Buttons */
.cp-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-sm); border: var(--hairline) solid transparent;
  font: 600 0.875rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color 150ms, color 150ms; }
.cp-button--sm { height: 32px; padding: 0 var(--space-3); }
.cp-button--lg { height: 48px; padding: 0 var(--space-6); }
.cp-button--primary { background: rgb(var(--color-action)); color: rgb(var(--color-on-action)); }
.cp-button--primary:hover { background: rgb(var(--color-action-hover)); color: rgb(var(--color-on-action)); }
.cp-button--primary:active { background: rgb(var(--color-action-pressed)); }
.cp-button--secondary { background: transparent; color: rgb(var(--color-ink)); border-color: rgb(var(--color-ink)); }
.cp-button--secondary:hover { background: rgb(var(--color-surface)); color: rgb(var(--color-ink)); }
.cp-button--quiet { background: none; color: rgb(var(--color-ink)); padding: 0; height: auto;
  text-decoration: underline; text-underline-offset: 4px; }
.cp-button:disabled, .cp-button[aria-disabled="true"] { background: rgb(var(--color-surface)); color: rgb(var(--color-ink-3));
  border-color: rgb(var(--color-line)); pointer-events: none; }  /* the surface fill, not opacity (6.1) */

/* Fields */
.cp-field-label { display: block; margin-bottom: var(--space-2); }
.cp-input, .cp-select, .cp-textarea { display: block; width: 100%; min-height: 40px; padding: var(--space-2) var(--space-3);
  border: var(--hairline) solid rgb(var(--color-ink-3)); border-radius: var(--radius-sm);
  background: rgb(var(--color-base)); color: rgb(var(--color-ink)); font: 400 1rem/1.5 var(--font-body); }
.cp-input, .cp-select { height: 40px; padding-top: 0; padding-bottom: 0; }  /* exactly 40 px, not 42 (6.1) */
.cp-input[type="search"] { -webkit-appearance: none; appearance: none; }
.cp-input[type="search"]::-webkit-search-cancel-button, .cp-input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.cp-input::placeholder, .cp-textarea::placeholder { color: rgb(var(--color-ink-3)); }
/* A field has a thin line. Activated (clicked into, typing) the line turns slightly thicker: 2 px in the brand's focus
   colour, the extra pixel drawn inward so nothing moves. Reached with Tab (js/focus.js sets data-input="keyboard"):
   only the thin line, in the same colour. No ring, no outline (Brand Bible 6.1). */
.cp-input:focus, .cp-select:focus, .cp-textarea:focus {
  outline: none; border-color: rgb(var(--color-focus)); box-shadow: inset 0 0 0 1px rgb(var(--color-focus)); }
:root[data-input="keyboard"] .cp-input:focus-visible, :root[data-input="keyboard"] .cp-select:focus-visible,
:root[data-input="keyboard"] .cp-textarea:focus-visible { box-shadow: none; }
.cp-input:disabled, .cp-select:disabled, .cp-textarea:disabled { background: rgb(var(--color-surface));
  border-color: rgb(var(--color-line)); color: rgb(var(--color-ink-3)); }
.cp-input[aria-invalid="true"], .cp-textarea[aria-invalid="true"],
.cp-input[aria-invalid="true"]:focus, .cp-textarea[aria-invalid="true"]:focus {
  border-color: rgb(var(--color-error)); box-shadow: inset 0 0 0 1px rgb(var(--color-error)); }
.cp-help { margin-top: var(--space-1); font-size: 0.875rem; color: rgb(var(--color-ink-2)); }
.cp-error { margin-top: var(--space-1); font-size: 0.875rem; font-weight: 500; color: rgb(var(--color-error)); }

/* Steady navigation and tabs: the active state never moves the layout (Brand Bible 6.7) */
.cp-nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-12); list-style: none; margin: 0; padding: 0; }  /* 48 px between items (§6.7) */
.cp-nav a { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; color: rgb(var(--color-ink-2)); }
.cp-nav a::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; }  /* the reserved dot slot: a round dot */
.cp-nav a[aria-current="page"] { color: rgb(var(--color-ink)); font-weight: 600; }
.cp-nav a[aria-current="page"]::before { background: rgb(var(--color-mark)); }
.cp-steady-label { display: inline-flex; flex-direction: column; align-items: flex-start; }
.cp-steady-label::after { content: attr(data-label); content: attr(data-label) / "";
  font-weight: 600; height: 0; overflow: hidden; visibility: hidden; user-select: none; pointer-events: none; }
.cp-tabs { display: flex; gap: var(--space-6); border-bottom: var(--hairline) solid rgb(var(--color-line)); }
.cp-tabs [role="tab"] { padding: var(--space-3) 0; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: none; color: rgb(var(--color-ink-2)); font: 400 1rem var(--font-body); cursor: pointer; }
.cp-tabs [role="tab"][aria-selected="true"] { color: rgb(var(--color-ink)); font-weight: 600; border-bottom-color: rgb(var(--color-mark)); }

/* Switch (Brand Bible §6.5): <button role="switch" aria-checked> with a visible label that never changes.
   Off: 1 px ink-3 border, ink-3 knob left. On: ink border, ink knob right. Dark mode uses it (§6.12). */
.cp-switch { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 24px; padding: 0;
  border: 0; background: none; color: rgb(var(--color-ink)); font: inherit; cursor: pointer; }
.cp-switch__track { position: relative; flex: none; box-sizing: border-box; width: 40px; height: 24px;
  border: var(--hairline) solid rgb(var(--color-ink-3)); border-radius: var(--radius-sm); }
.cp-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: var(--radius-sm); background: rgb(var(--color-ink-3)); transition: left 120ms ease; }
.cp-switch[aria-checked="true"] .cp-switch__track { border-color: rgb(var(--color-ink)); }
.cp-switch[aria-checked="true"] .cp-switch__track::after { left: 19px; background: rgb(var(--color-ink)); }

/* Tags and status */
/* Text with a tag or status label under it: always 8 px apart (Brand Bible §6.6). */
.cp-stack { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.cp-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-2);
  border: var(--hairline) solid rgb(var(--color-ink-3)); border-radius: var(--radius-sm); }
.cp-status { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2);
  white-space: nowrap;
  border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 600; }
.cp-status--success { background: rgb(var(--color-success-tint)); color: rgb(var(--color-success)); }
.cp-status--warning { background: rgb(var(--color-warning-tint)); color: rgb(var(--color-warning)); }
.cp-status--error { background: rgb(var(--color-error-tint)); color: rgb(var(--color-error)); }

/* Notices: a 2 px rule, the tint as ground, icon plus text */
.cp-notice { border-left: 2px solid rgb(var(--color-ink)); background: rgb(var(--color-surface));
  padding: var(--space-3) var(--space-4); margin: var(--space-4) 0; }
.cp-notice--success { border-color: rgb(var(--color-success)); background: rgb(var(--color-success-tint)); }
.cp-notice--warning { border-color: rgb(var(--color-warning)); background: rgb(var(--color-warning-tint)); }
.cp-notice--error { border-color: rgb(var(--color-error)); background: rgb(var(--color-error-tint)); }
.cp-notice > strong { display: block; }

/* Data table */
/* No outer border and no vertical lines. The header row is bold with a thick (2 px) line under it; every other row has a
   thin (1 px) line (Brand Bible 6.10). */
.cp-table { border: 0; }
.cp-table th, .cp-table td { border-left: 0; border-right: 0; }
.cp-table thead th, .cp-table tr:first-child > th { font-weight: 700; }
.cp-table th { text-align: left; padding: var(--space-2) var(--space-3) var(--space-2) 0;
  border-bottom: 2px solid rgb(var(--color-ink)); }
.cp-table td { padding: var(--space-3) var(--space-3) var(--space-3) 0; border-bottom: var(--hairline) solid rgb(var(--color-line)); vertical-align: top; }
.cp-table td.cp-num, .cp-table th.cp-num { text-align: right; }

/* Icons: inline SVG inherits the text colour */
.cp-icon { display: inline-block; width: 48px; height: 48px; color: rgb(var(--color-ink)); }
.cp-icon svg { width: 100%; height: 100%; }

/* Theme switch: two segments, the filled one is active */
.cp-theme-switch { display: inline-flex; height: 32px; border: var(--hairline) solid rgb(var(--color-ink)); border-radius: var(--radius-sm); }
.cp-theme-switch button { border: 0; background: none; color: rgb(var(--color-ink)); padding: 0 var(--space-3);
  font: 600 0.875rem var(--font-body); cursor: pointer; }
.cp-theme-switch button[aria-pressed="true"] { background: rgb(var(--color-ink)); color: rgb(var(--color-base)); }
@media (max-width: 480px) { .cp-theme-switch button { font-size: 0.8125rem; } }  /* 13 px on a phone (6.12) */

/* Spacing components (Brand Bible 3.6): the distances live here, so a brand page gets them by using the class and writes
   none of its own. Text to its actions 24 px, actions side by side 16 px, a label to its field 8 px, field to field 24 px,
   card padding 24 px. A button or link next to a button, outside a .cp-actions row, keeps the 16 px too. */
:where(.cp-button) + :where(.cp-button, a:not(.cp-button)) { margin-inline-start: var(--space-4); }
.cp-actions > * + * { margin-inline-start: 0; }
.cp-flow > * { margin-block: 0; }
.cp-flow > * + * { margin-block-start: var(--space-6); }
.cp-flow > h2 + *, .cp-flow > .cp-lead + * { margin-block-start: var(--space-4); }
.cp-flow > h3 + * { margin-block-start: var(--space-3); }
.cp-card { padding: var(--space-6); border: var(--hairline) solid rgb(var(--color-line)); border-radius: var(--radius-sm);
  background: rgb(var(--color-base)); color: rgb(var(--color-ink)); }
.cp-card > :first-child { margin-top: 0; }
.cp-card > :last-child { margin-bottom: 0; }
.cp-card > * + .cp-actions, .cp-card > * + .cp-button { margin-top: var(--space-6); }
.cp-card > .cp-label { margin-bottom: var(--space-3); display: block; }
.cp-card--surface { background: rgb(var(--color-surface)); }
.cp-form { display: grid; gap: var(--space-6); }
.cp-field { display: block; min-width: 0; }
.cp-form > .cp-actions { margin-top: 0; }
.cp-field > .cp-help, .cp-field > .cp-error { display: block; }

/* The menu bar and the footer (Brand Bible 3.6, 6.7): at least 72 px high with a hairline under it and 16 px above and below
   its content; the footer has a hairline over it, 32 px above its text and 48 px below. */
.cp-header { border-bottom: var(--hairline) solid rgb(var(--color-line)); }
.cp-header > .cp-container { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6);
  min-height: 72px; padding-top: var(--space-4); padding-bottom: var(--space-4); }
.cp-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4);
  margin-top: var(--space-12); padding: var(--space-8) 0 var(--space-12); border-top: var(--hairline) solid rgb(var(--color-line)); }

/* Form elements (Brand Bible 6.1, 6.5, 6.11): every native control has a kit rule, so nothing is drawn by the browser.
   The action colour marks what is chosen (orange by default, the brand's own colour in a brand layer). The lines are the
   field lines: 1 px ink-3 at rest; the chosen state fills with the action colour. Focus: a 1 px line 2 px clear of the
   control, in the focus colour, never a ring. Pop-ups the browser draws itself (the time, month, week and date-and-time
   pickers) follow the theme through color-scheme. js/fields.js replaces the select, suggestion, date and colour pop-ups. */
.cp-input, .cp-select, .cp-textarea, .cp-file, .cp-color, .cp-range { color-scheme: light; }
:root[data-theme="dark"] :is(.cp-input, .cp-select, .cp-textarea, .cp-file, .cp-color, .cp-range) { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) :is(.cp-input, .cp-select, .cp-textarea, .cp-file, .cp-color, .cp-range) { color-scheme: dark; }
}

/* Checkbox and radio: 20 px, 1 px ink-3 line, the action colour when chosen. Radios stay round (6.5). */
.cp-option { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 24px; cursor: pointer; }
.cp-option:has(:disabled) { cursor: default; color: rgb(var(--color-ink-3)); }
.cp-check, .cp-radio { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 20px; height: 20px;
  margin: 0; border: var(--hairline) solid rgb(var(--color-ink-3)); background: rgb(var(--color-base)); cursor: pointer; }
.cp-check { border-radius: var(--radius-sm); }
.cp-radio { border-radius: 50%; }
.cp-check:hover, .cp-radio:hover { border-color: rgb(var(--color-ink)); }
.cp-check:checked, .cp-check:indeterminate, .cp-radio:checked { background: rgb(var(--color-action)); border-color: rgb(var(--color-action)); }
.cp-check:checked::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid rgb(var(--color-on-action)); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cp-check:indeterminate::after { content: ""; position: absolute; left: 4px; top: 8px; width: 10px; height: 2px;
  background: rgb(var(--color-on-action)); }
.cp-radio:checked::after { content: ""; position: absolute; left: 5px; top: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: rgb(var(--color-on-action)); }
.cp-check:checked:hover, .cp-check:indeterminate:hover, .cp-radio:checked:hover { background: rgb(var(--color-action-hover)); border-color: rgb(var(--color-action-hover)); }
.cp-check:disabled, .cp-radio:disabled { background: rgb(var(--color-surface)); border-color: rgb(var(--color-line)); cursor: default; }
.cp-check:disabled:checked, .cp-check:disabled:indeterminate, .cp-radio:disabled:checked { background: rgb(var(--color-ink-3)); border-color: rgb(var(--color-ink-3)); }
.cp-check[aria-invalid="true"], .cp-radio[aria-invalid="true"] { border-color: rgb(var(--color-error)); }

/* Range: a thin line, the action colour up to the thumb, a square thumb. */
.cp-range { appearance: none; -webkit-appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; }
.cp-range::-webkit-slider-runnable-track { height: 2px; background: rgb(var(--color-ink-3)); }
.cp-range::-moz-range-track { height: 2px; background: rgb(var(--color-ink-3)); }
.cp-range::-moz-range-progress { height: 2px; background: rgb(var(--color-action)); }
.cp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -7px; border: 0;
  border-radius: var(--radius-sm); background: rgb(var(--color-action)); }
.cp-range::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: var(--radius-sm); background: rgb(var(--color-action)); }
.cp-range:disabled { cursor: default; }
.cp-range:disabled::-webkit-slider-thumb { background: rgb(var(--color-ink-3)); }
.cp-range:disabled::-moz-range-thumb { background: rgb(var(--color-ink-3)); }

/* Progress and meter: ink on a line-coloured track, 8 px high. Orange is for acting, so a bar is ink. */
.cp-progress, .cp-meter { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 8px; border: 0;
  border-radius: var(--radius-sm); background: rgb(var(--color-line)); color: rgb(var(--color-ink)); overflow: hidden; }
.cp-progress::-webkit-progress-bar, .cp-meter::-webkit-meter-bar { background: rgb(var(--color-line)); border: 0; border-radius: var(--radius-sm); }
.cp-progress::-webkit-progress-value { background: rgb(var(--color-ink)); }
.cp-progress::-moz-progress-bar { background: rgb(var(--color-ink)); }
.cp-meter::-webkit-meter-optimum-value, .cp-meter::-webkit-meter-suboptimum-value, .cp-meter::-webkit-meter-even-less-good-value { background: rgb(var(--color-ink)); }
.cp-meter::-moz-meter-bar { background: rgb(var(--color-ink)); }

/* File upload: the browser's own button becomes a kit secondary button; the file name follows in ink-2. */
.cp-file { display: block; width: 100%; min-height: 40px; padding: 0; border: 0; background: none; color: rgb(var(--color-ink-2));
  font: 400 0.875rem/1.5 var(--font-body); cursor: pointer; }
.cp-file::file-selector-button { height: 40px; margin: 0 var(--space-3) 0 0; padding: 0 var(--space-4); cursor: pointer;
  border: var(--hairline) solid rgb(var(--color-ink)); border-radius: var(--radius-sm); background: transparent;
  color: rgb(var(--color-ink)); font: 600 0.875rem/1 var(--font-body); }
.cp-file:hover::file-selector-button { background: rgb(var(--color-surface)); }
.cp-file:disabled { cursor: default; color: rgb(var(--color-ink-3)); }
.cp-file:disabled::file-selector-button { background: rgb(var(--color-surface)); color: rgb(var(--color-ink-3)); border-color: rgb(var(--color-line)); cursor: default; }

/* Colour: a 40 px swatch with a field line. js/fields.js adds the kit's own palette pop-up. */
.cp-color { appearance: none; -webkit-appearance: none; display: block; width: 56px; height: 40px; padding: 4px; cursor: pointer;
  border: var(--hairline) solid rgb(var(--color-ink-3)); border-radius: var(--radius-sm); background: rgb(var(--color-base)); }
.cp-color::-webkit-color-swatch-wrapper { padding: 0; }
.cp-color::-webkit-color-swatch { border: 0; border-radius: 1px; }
.cp-color::-moz-color-swatch { border: 0; border-radius: 1px; }
.cp-color:focus { outline: none; border-color: rgb(var(--color-focus)); box-shadow: inset 0 0 0 1px rgb(var(--color-focus)); }
:root[data-input="keyboard"] .cp-color:focus-visible { box-shadow: none; }

/* Grouping, output, details */
.cp-fieldset { margin: 0; padding: var(--space-4); border: var(--hairline) solid rgb(var(--color-line)); border-radius: var(--radius-sm); min-width: 0; }
.cp-fieldset > legend { padding: 0 var(--space-2); font-weight: 600; }
.cp-output { font-variant-numeric: tabular-nums; }
.cp-details { border: var(--hairline) solid rgb(var(--color-line)); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); }
.cp-details > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.cp-details > summary::-webkit-details-marker { display: none; }
.cp-details > summary::after { content: ""; flex: none; width: 8px; height: 8px; border: solid rgb(var(--color-ink)); border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px); transition: transform 150ms; }
.cp-details[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.cp-details[open] > summary { margin-bottom: var(--space-3); }

/* A list of choices that is not a native select: multiple selects without js/fields.js. */
.cp-select[multiple] { height: auto; padding: var(--space-1); }
.cp-select[multiple] option { padding: var(--space-2) var(--space-3); }
.cp-select[multiple] option:checked { background: rgb(var(--color-surface)); color: rgb(var(--color-ink)); font-weight: 600; }

/* Select, suggestions, date and colour pop-ups (js/fields.js): the trigger looks like a field; the pop-up is opaque with a
   1 px ink line and a 4 px radius, no shadow (6.9). */
.cp-sel { position: relative; display: block; width: 100%; }
.cp-sel > select, .cp-sel > input[type="date"], .cp-sel > input[type="color"] { position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }
.cp-sel__btn { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%; height: 40px;
  padding: 0 var(--space-3); border: var(--hairline) solid rgb(var(--color-ink-3)); border-radius: var(--radius-sm);
  background: rgb(var(--color-base)); color: rgb(var(--color-ink)); font: 400 1rem/1.5 var(--font-body); text-align: left; cursor: pointer; }
.cp-sel__btn:focus, .cp-sel__btn[aria-expanded="true"] { outline: none; border-color: rgb(var(--color-focus)); box-shadow: inset 0 0 0 1px rgb(var(--color-focus)); }
:root[data-input="keyboard"] .cp-sel__btn:focus-visible:not([aria-expanded="true"]) { box-shadow: none; }
.cp-sel__btn:disabled { background: rgb(var(--color-surface)); border-color: rgb(var(--color-line)); color: rgb(var(--color-ink-3)); cursor: default; }
.cp-sel__btn[aria-invalid="true"] { border-color: rgb(var(--color-error)); box-shadow: inset 0 0 0 1px rgb(var(--color-error)); }
.cp-sel__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sel__swatch + .cp-sel__value { flex: 1; }
.cp-sel__value--empty { color: rgb(var(--color-ink-3)); }
.cp-sel__icon { flex: none; width: 8px; height: 8px; border: solid rgb(var(--color-ink)); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); }
.cp-sel__btn[aria-expanded="true"] .cp-sel__icon { transform: rotate(-135deg) translateY(-2px); }
.cp-sel__cal, .cp-sel__swatch { flex: none; width: 16px; height: 16px; }
.cp-sel__swatch { border: var(--hairline) solid rgb(var(--color-ink-3)); border-radius: 1px; }
.cp-sel__pop { position: absolute; z-index: 60; left: 0; min-width: 100%; box-sizing: border-box; background: rgb(var(--color-base));
  color: rgb(var(--color-ink)); border: var(--hairline) solid rgb(var(--color-ink)); border-radius: var(--radius-md); margin-top: 2px; }
.cp-sel__pop--up { bottom: 100%; margin: 0 0 2px; }
.cp-sel__search { padding: var(--space-2); border-bottom: var(--hairline) solid rgb(var(--color-line)); }
.cp-sel__search .cp-input { height: 36px; }
.cp-sel__list { list-style: none; margin: 0; padding: var(--space-1) 0; max-height: 264px; overflow-y: auto; outline: none; }
.cp-sel__opt { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 40px;
  padding: var(--space-2) var(--space-3); cursor: pointer; }
.cp-sel__opt[data-active="true"] { background: rgb(var(--color-surface)); }
.cp-sel__opt[aria-selected="true"] { font-weight: 600; }
.cp-sel__opt[aria-disabled="true"] { color: rgb(var(--color-ink-3)); cursor: default; }
.cp-sel__opt[aria-selected="true"]::after { content: ""; flex: none; width: 5px; height: 10px; border: solid rgb(var(--color-action));
  border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.cp-sel__group { padding: var(--space-3) var(--space-3) var(--space-1); font: 600 0.75rem/1rem var(--font-body); letter-spacing: 0.06em;
  text-transform: uppercase; color: rgb(var(--color-ink-2)); }
.cp-sel__none { padding: var(--space-3); color: rgb(var(--color-ink-2)); }

/* Calendar */
.cp-cal { padding: var(--space-3); width: 300px; max-width: 100%; }
.cp-cal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.cp-cal__title { font-weight: 600; }
.cp-cal__nav { width: 32px; height: 32px; padding: 0; border: var(--hairline) solid rgb(var(--color-ink)); border-radius: var(--radius-sm);
  background: transparent; color: rgb(var(--color-ink)); font: 600 1rem/1 var(--font-body); cursor: pointer; }
.cp-cal__nav:hover { background: rgb(var(--color-surface)); }
.cp-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cp-cal__dow { text-align: center; font: 600 0.75rem/1.5rem var(--font-body); color: rgb(var(--color-ink-2)); }
.cp-cal__day { height: 36px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: rgb(var(--color-ink));
  font: 400 0.875rem/1 var(--font-body); cursor: pointer; font-variant-numeric: tabular-nums; }
.cp-cal__day:hover { background: rgb(var(--color-surface)); }
.cp-cal__day--out { color: rgb(var(--color-ink-3)); }
.cp-cal__day--today { box-shadow: inset 0 0 0 1px rgb(var(--color-ink-3)); }
.cp-cal__day[aria-selected="true"] { background: rgb(var(--color-action)); color: rgb(var(--color-on-action)); font-weight: 600; }
.cp-cal__day:disabled { color: rgb(var(--color-ink-3)); cursor: default; background: transparent; text-decoration: line-through; }
.cp-cal__foot { display: flex; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-2); }

/* Colour palette */
.cp-pal { padding: var(--space-3); width: 276px; max-width: 100%; }
.cp-pal__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-bottom: var(--space-3); }
.cp-pal__sw { aspect-ratio: 1; padding: 0; border: var(--hairline) solid rgb(var(--color-line)); border-radius: 1px; cursor: pointer; }
.cp-pal__sw[aria-selected="true"] { box-shadow: 0 0 0 2px rgb(var(--color-base)), 0 0 0 3px rgb(var(--color-ink)); }
.cp-pal__hex { display: flex; align-items: center; gap: var(--space-2); }
.cp-pal__hex .cp-input { font-family: var(--font-code); }

/* Busy layer and spinner (Brand Bible 6.13): shown by js/busy.js only after an action has taken one second.
   The scrim is the dialog backdrop (6.9); the tile is opaque; the spinner is a grey ring with a Logo Navy arc. */
:root {
  --busy-scrim: 15 33 51 / 40%;
  --spinner-ring: 203 213 225;       /* #CBD5E1 */
  --spinner-arc: 0 64 107;           /* #00406B Logo Navy */
}
:root[data-theme="dark"] {
  --busy-scrim: 15 33 51 / 64%;
  --spinner-ring: 74 103 133;        /* #4A6785 */
  --spinner-arc: 172 191 210;        /* #ACBFD2 */
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme]) {
  --busy-scrim: 15 33 51 / 64%;
  --spinner-ring: 74 103 133;        /* #4A6785 */
  --spinner-arc: 172 191 210;        /* #ACBFD2 */
}
}
.cp-busy { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgb(var(--busy-scrim)); cursor: progress; }
.cp-busy:focus { outline: none; }
.cp-busy__tile { display: grid; justify-items: center; gap: var(--space-3); min-width: 88px; min-height: 88px;
  padding: var(--space-4); background: rgb(var(--color-base)); color: rgb(var(--color-ink));
  border: var(--hairline) solid rgb(var(--color-ink)); border-radius: var(--radius-md); }
.cp-spinner { width: 56px; height: 56px; display: block; }
.cp-spinner__ring, .cp-spinner__arc { fill: none; stroke-width: 5; stroke-linecap: round; transform-origin: 32px 32px; }
.cp-spinner__ring { stroke: rgb(var(--spinner-ring)); animation: cp-spin 1.6s linear infinite; }
.cp-spinner__arc { stroke: rgb(var(--spinner-arc)); animation: cp-spin 1.1s linear infinite reverse; }
@keyframes cp-spin { to { transform: rotate(360deg); } }
.cp-busy__label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; }
.cp-busy__slow { margin: 0; max-width: 28ch; text-align: center; font-size: 0.875rem; line-height: 1.43;
  color: rgb(var(--color-ink-2)); }
.cp-busy__cancel { font: 600 0.875rem var(--font-body); color: rgb(var(--color-ink)); background: none; cursor: pointer;
  border: var(--hairline) solid rgb(var(--color-ink)); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-4); }
/* Reduced motion: the spinner stands still and the label is written out. */
@media (prefers-reduced-motion: reduce) {
  .cp-busy__label { position: static; width: auto; height: auto; margin: 0; clip: auto; font-size: 0.875rem; }
}

/* Not-found page (Brand Bible 6.14): the page's own tokens, so it reads in light and in dark. Used with .cp-split. */
.cp-notfound { padding-top: var(--space-12); padding-bottom: var(--space-16); }   /* not the shorthand: .cp-split keeps its left padding */
@media (min-width: 1024px) { .cp-notfound { padding-top: var(--space-24); padding-bottom: var(--space-24); } }
.cp-notfound h1 { margin: var(--space-6) 0; }
.cp-notfound .cp-lead { color: rgb(var(--color-ink-2)); max-width: var(--measure); }
.cp-notfound .cp-rail h2 { margin: 0 0 var(--space-3); font-size: 1.25rem; line-height: 1.4; }
.cp-notfound .cp-rail p { color: rgb(var(--color-ink-2)); font-size: 0.875rem; line-height: 1.43; }

/* 6 ------------------------------------------------------------------------------------ utilities */
.cp-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.cp-mark { display: inline-block; width: 6px; height: 6px; background: rgb(var(--color-mark)); }
.cp-measure { max-width: var(--measure); }
