/* ThatMgmt UI library CSS.
   Generated from kit/UI-KIT.md by scripts/extract_css.py.
   Do not edit by hand: fix the UK-*.md section and re-run. */

/* from: Design Tokens: ThatMgmt UI Kit */
:root,
[data-theme="light"] {
  --color-background: #ffffff;
  --color-surface: #f2f2f0;
  --color-text: #0a0a0a;
  --color-text-secondary: #5f5f5f;
  --color-border: #c9c9c5;
  --color-border-strong: #0a0a0a;
  --color-inverse-background: #0a0a0a;
  --color-inverse-text: #ffffff;

  --font-display: "Archivo", "Helvetica Neue", sans-serif; /* guide role: Display 720 */
  --font-heading: "Archivo", "Helvetica Neue", sans-serif; /* guide role: Heading 650 */
  --font-body: "Archivo", "Helvetica Neue", sans-serif; /* guide role: Body 400 */
  --font-label: "JetBrains Mono", ui-monospace, monospace; /* guide role: Label 500 */

  --font-weight-display: 720; /* guide role: Display 720 */
  --font-weight-heading: 650; /* guide role: Heading 650 */
  --font-weight-body: 400; /* guide role: Body 400 */
  --font-weight-label: 500; /* guide role: Label 500 */

  --text-display-lg-size: 48px; /* kit size */
  --text-display-lg-leading: 1.10; /* kit size */
  --text-display-size: 36px; /* kit size */
  --text-display-leading: 1.15; /* kit size */
  --text-h1-size: 28px; /* kit size */
  --text-h1-leading: 1.20; /* kit size */
  --text-h2-size: 22px; /* kit size */
  --text-h2-leading: 1.30; /* kit size */
  --text-h3-size: 18px; /* kit size */
  --text-h3-leading: 1.40; /* kit size */
  --text-body-lg-size: 18px; /* kit size */
  --text-body-lg-leading: 1.60; /* kit size */
  --text-body-size: 16px; /* kit size */
  --text-body-leading: 1.60; /* kit size */
  --text-body-sm-size: 14px; /* kit size */
  --text-body-sm-leading: 1.50; /* kit size */
  --text-caption-size: 12px; /* kit size */
  --text-caption-leading: 1.40; /* kit size */
  --text-code-size: 13px; /* kit size */
  --text-code-leading: 1.50; /* kit size */

  --state-disabled-opacity: 0.5; /* kit decision */
  --state-active-opacity: 0.8; /* kit decision */

  --focus-outline-width: 2px; /* kit decision */
  --focus-outline-offset: 2px; /* kit decision */

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 96px;

  --layout-max: 1360px; /* guide value */
  --layout-pad: clamp(20px, 4vw, 56px); /* guide value */
  --layout-narrow-max: 480px; /* kit decision */

  --radius: 0;
  --elevation-border: 1px;

  --z-base: 0;
  --z-raised: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;

  --motion-instant: 0ms;
  --motion-fade: 160ms;
  --motion-ease: ease-out; /* the single easing for entrances */
  --motion-slide: 240ms;
}

[data-theme="dark"] {
  --color-background: #0a0a0a;
  --color-surface: #171717;
  --color-text: #f7f7f5;
  --color-text-secondary: #a9a9a5;
  --color-border: #41413f;
  --color-border-strong: #f7f7f5;
  --color-inverse-background: #ffffff;
  --color-inverse-text: #0a0a0a;
}

/* from: Buttons */
/* Buttons. Colors, type roles, spacing, and motion come from UK-001.
   All other values are kit decisions. */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;               /* md size */
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: 0;
  background: var(--color-text);
  color: var(--color-background);
  font-weight: var(--font-weight-heading);
  font-size: var(--text-h3-size);  /* h3 step */
  line-height: var(--text-h3-leading);
  font-family: var(--font-body);
  white-space: nowrap;            /* label never wraps */
  cursor: pointer;
  /* No transition: hover, press, and focus resolve at
     --motion-instant (UK-001, principle 3). The loading pulse is a
     keyframe animation, not a transition. */
}
.btn:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.btn:active {
  opacity: var(--state-active-opacity);
}
/* Disabled: the label text never dims. --color-text-secondary at full
   opacity measures 6.39:1 (light) and 8.40:1 (dark) per UK-009.
   The secondary color, the flat surface fill, and the not-allowed
   cursor carry the disabled affordance. Opacity never dims text. */
.btn:disabled,
.btn[aria-disabled="true"] {
  color: var(--color-text-secondary);
  border-color: var(--color-border);
  background: var(--color-surface);
  cursor: not-allowed;
}
.btn--sm {
  min-height: 44px;
  padding: 0 var(--space-3);
  font-weight: var(--font-weight-body);
  font-size: var(--text-body-sm-size); /* body-sm step */
  line-height: var(--text-body-sm-leading);
}
.btn--lg { min-height: 56px; }
.btn--block { width: 100%; max-width: var(--layout-narrow-max); }
.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn--secondary:hover {
  background: var(--color-background);
  border-color: var(--color-border-strong);
}
.btn--quiet {
  background: transparent;
  color: var(--color-text);
  border-color: transparent;
}
.btn--quiet:hover { color: var(--color-text-secondary); }
/* Loading: the label keeps its space, the indicator overlays center.
   The button is not clickable while loading and exposes aria-busy. */
.btn[data-loading="true"] {
  cursor: progress;
  pointer-events: none;
}
.btn[data-loading="true"] .btn__label { visibility: hidden; }
.btn__indicator {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}
.btn__indicator span {
  width: 8px;                     /* --space-2 */
  height: 8px;
  background: currentColor;
  animation: btn-indicator-pulse var(--motion-fade) linear infinite alternate;
}
@keyframes btn-indicator-pulse { from { opacity: 0.25; } to { opacity: 1; } }

/* from: Form Inputs */
/* Form inputs. Colors, type steps, spacing, and motion come from
   UK-001. State treatment comes from UK-002. All other values are
   kit decisions. */
.field {
  display: grid;
  gap: var(--space-2);
  max-width: var(--layout-narrow-max);
}
.field-label {
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-leading);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
}
.field-label .required {
  color: var(--color-text-secondary);
}
.field-input,
.field-textarea,
.field-select {
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-weight: var(--font-weight-body);
  font-size: var(--text-body-size); /* body step */
  line-height: var(--text-body-leading);
  font-family: var(--font-body);
}
.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--color-text-secondary);
}
.field-textarea {
  min-height: 112px;
  padding: var(--space-3);
  resize: vertical;
}
.field-select {
  appearance: none;               /* kit decision: custom chevron */
  width: 100%;                    /* fills the wrapper so the chevron stays attached */
  padding-right: 40px;
}
/* Select wrapper: positioning context for the chevron. The chevron
   is a UK-010 icon (chevron-down, 12px), drawn with a 1px stroke in
   --color-text-secondary via currentColor so it follows the theme.
   Empty generated content never enters the accessibility tree. */
.field-select-wrap {
  position: relative;
  display: block;
  color: var(--color-text-secondary);
}
.field-select-wrap::after {
  content: "";
  position: absolute;
  right: var(--space-3);
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%230a0a0a' stroke-width='1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%230a0a0a' stroke-width='1'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
.field-select-wrap:has(.field-select:disabled)::after {
  opacity: var(--state-disabled-opacity);
}
.field-help,
.field-error {
  font-weight: var(--font-weight-body);
  font-size: var(--text-body-sm-size); /* body-sm step */
  line-height: var(--text-body-sm-leading);
  font-family: var(--font-body);
  color: var(--color-text-secondary);
}
.field-input:hover:not(:disabled),
.field-textarea:hover:not(:disabled),
.field-select:hover:not(:disabled) {
  background: var(--color-surface);
  border-color: var(--color-text-secondary);
  /* No transition: hover resolves at --motion-instant
     (UK-001, principle 3). */
}
.field-input:focus-visible,
.field-textarea:focus-visible,
.field-select:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.field-input:active:not(:disabled),
.field-textarea:active:not(:disabled),
.field-select:active:not(:disabled) {
  opacity: var(--state-active-opacity);
}
.field-input:disabled,
.field-textarea:disabled,
.field-select:disabled {
  color: var(--color-text-secondary); /* full opacity: 6.39:1 light, 8.40:1 dark */
  border-color: var(--color-border);
  background: var(--color-surface);
  cursor: not-allowed;
}
.field--error .field-input,
.field--error .field-textarea,
.field--error .field-select {
  border-color: var(--color-border-strong);
}
.choice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  font-weight: var(--font-weight-body);
  font-size: var(--text-body-size);
  line-height: var(--text-body-leading);
  font-family: var(--font-body);
  color: var(--color-text);
  cursor: pointer;
  position: relative;
}
/* Native input: invisible, focusable, form-capable. The box span
   draws the visual. Checked state needs no JavaScript. */
.choice-input {
  position: absolute;
  left: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.choice-box {
  box-sizing: border-box;
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-background);
}
.choice-input:focus-visible + .choice-box {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.choice-input:checked + .choice-box {
  background: var(--color-border-strong);
  border-color: var(--color-border-strong);
}
.choice-input:checked + .choice-box::after {
  content: "";
  position: absolute;
  left: var(--space-1);
  top: 5px;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--color-background);
  border-bottom: 2px solid var(--color-background);
  transform: rotate(-45deg);
}
.choice-input[type="radio"]:checked + .choice-box::after {
  left: 6px;
  top: 6px;
  width: 8px;
  height: 8px;
  background: var(--color-border-strong);
  border: 0;
  transform: none;
}
/* Disabled choice: only the box and track chrome dim. The label text
   stays --color-text-secondary at full opacity (6.39:1 light,
   8.40:1 dark, UK-009). Opacity never dims text. */
.choice--disabled {
  color: var(--color-text-secondary);
  cursor: not-allowed;
}
.choice--disabled .choice-box,
.choice--disabled .switch-track {
  opacity: var(--state-disabled-opacity);
}
/* Switch: a button with role="switch". Kit JavaScript toggles
   aria-checked and .switch--on together. */
.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font: inherit;
  color: var(--color-text);
  cursor: pointer;
}
.switch:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.choice--error .choice-box,
.choice--error .switch-track {
  border-color: var(--color-border-strong);
}
.switch-track {
  box-sizing: border-box;
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
}
.switch-track:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.switch-thumb {
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-background);
  position: absolute;
  top: 1px;                       /* centered vertically */
  left: 2px;                      /* 2px inside the track edge */
}
.switch--on .switch-track {
  background: var(--color-border-strong);
  border-color: var(--color-border-strong);
}
.switch--on .switch-thumb {
  left: 20px;                     /* 2px inside the far edge; travel 18px */
  background: var(--color-surface);
  border-color: var(--color-border-strong);
}

/* from: Navigation */
/* Navigation. Colors, type steps, spacing, z-index, and motion come
   from UK-001. State treatment comes from UK-002. All other values
   are kit decisions. */
.nav-item {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-body);
  font-size: var(--text-body-sm-size); /* body-sm step */
  line-height: var(--text-body-sm-leading);
  font-family: var(--font-body);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  /* No transition: hover and press resolve at --motion-instant
     (UK-001, principle 3). Panels use --motion-slide. */
}
.nav-item:hover {
  background: var(--color-surface);
  color: var(--color-text);
}
.nav-item:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.nav-item:active {
  opacity: var(--state-active-opacity);
}
.nav-item[aria-disabled="true"] {
  color: var(--color-text-secondary); /* full opacity: 6.39:1 light, 8.40:1 dark */
  cursor: not-allowed;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between; /* wordmark left, links and menu right */
  height: var(--space-9);
  padding: 0 var(--layout-pad);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-background);
}
.topbar-link[aria-current="page"] {
  background: var(--color-text);
  color: var(--color-background);
}
.topbar-menu-btn {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.topbar-menu-panel {
  position: absolute;
  top: var(--space-9);
  right: 0;
  z-index: var(--z-dropdown);
  min-width: 240px;
  border: 1px solid var(--color-border);
  border-top: 0;                  /* the top bar bottom border owns this edge */
  background: var(--color-surface);
  transform-origin: top right;   /* anchored to the menu button that opens it */
  transform: translateY(-4px);   /* kit decision: offset */
  opacity: 0;
  visibility: hidden;
  transition:
    transform var(--motion-slide) var(--motion-ease),
    opacity var(--motion-fade) var(--motion-ease),
    visibility var(--motion-instant) var(--motion-fade); /* duration 0, delay = fade: hides after the fade */
}
.topbar-menu-panel[data-open="true"] {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition:
    transform var(--motion-slide) var(--motion-ease),
    opacity var(--motion-fade) var(--motion-ease),
    visibility var(--motion-instant); /* duration 0, no delay: shows at once */
}
/* Top bar links sit in a group with the spec gap between them. */
.topbar-links {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Menu items fill the panel width and stack. */
.topbar-menu-panel .nav-item {
  display: flex;
  width: 100%;
}
.section-nav {
  position: sticky;
  top: var(--space-9);
  z-index: var(--z-sticky);
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--color-border);
  background: var(--color-background);
}
.section-nav .nav-item {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  border-left: 3px solid transparent;
  border-top: 1px solid var(--color-border); /* shared divider */
}
.section-nav-list > li:first-child .nav-item {
  border-top: 0;                  /* the boundary above belongs to the disclosure or the top bar */
}
.section-nav .nav-item[aria-current="page"] {
  border-left-color: var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: var(--font-weight-heading);
}
/* Section nav disclosure (below 640px): one control opens the item
   list. The list slides open with --motion-slide and
   var(--motion-ease), toggled by data-open="true". */
.section-nav-disclosure {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-leading);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.section-nav-list {
  list-style: none;               /* the list draws no bullets */
  margin: 0;
  padding: 0;
  transform: translateY(-4px);   /* kit decision: offset */
  opacity: 0;
  visibility: hidden;
  transition:
    transform var(--motion-slide) var(--motion-ease),
    opacity var(--motion-fade) var(--motion-ease),
    visibility var(--motion-instant) var(--motion-fade); /* duration 0, delay = fade: hides after the fade */
}
.section-nav-list[data-open="true"] {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition:
    transform var(--motion-slide) var(--motion-ease),
    opacity var(--motion-fade) var(--motion-ease),
    visibility var(--motion-instant); /* duration 0, no delay: shows at once */
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}
.tab {
  flex-shrink: 0;
  min-width: var(--space-10);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;            /* the active bar overlays the container border */
  background: transparent;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-body);
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-leading);
  font-family: var(--font-body);
  white-space: nowrap;
  cursor: pointer;
}
.tab:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.tab[aria-selected="true"] {
  border-bottom-color: var(--color-border-strong);
  color: var(--color-text);
  font-weight: var(--font-weight-heading);
}
.breadcrumbs {
  display: flex;
  align-items: center;
  min-height: 44px;
  list-style: none;               /* the list draws no numbers */
  margin: 0;
  padding: 0;
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-leading);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.breadcrumbs .separator {
  margin: 0 var(--space-2);
  color: var(--color-border);
}
/* Breadcrumb links follow the shared rules: secondary text at rest,
   primary text on hover, no underline, instant per UK-001. */
.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-text-secondary);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--color-text); }
.breadcrumbs a:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.breadcrumbs [aria-current="page"] {
  color: var(--color-text);
  font-weight: var(--font-weight-heading);
}
.pagination {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto; /* never wraps; scrolls at narrow widths like tabs */
}
.page-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  cursor: pointer;
}
.page-btn:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.page-btn[aria-current="page"] {
  background: var(--color-inverse-background);
  color: var(--color-inverse-text);
}
.page-btn[aria-disabled="true"] {
  color: var(--color-text-secondary); /* full opacity: 6.39:1 light, 8.40:1 dark */
  cursor: not-allowed;
}
.page-btn:disabled {
  color: var(--color-text-secondary); /* native disabled: same treatment */
  cursor: not-allowed;
}
/* Tab panels: labelled by their tab, padded from the tab row. */
.tabs-panel {
  padding-top: var(--space-5);
}
/* Responsive wiring. The collapse behaviors in the summary table
   need these hooks; without them the controls never swap. */
/* Top bar menu: hidden at desktop, links hidden below 900px. */
.topbar-menu-btn { display: none; }
@media (max-width: 900px) {
  .topbar .topbar-link { display: none; }
  .topbar-menu-btn { display: inline-flex; align-items: center; }
}
/* Section nav disclosure: inline list above 640px, disclosure below. */
@media (min-width: 641px) {
  .section-nav-disclosure { display: none; }
  .section-nav-list {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
}
@media (max-width: 640px) {
  /* Closed list takes no space; open list slides in. The base
     visibility transition cannot collapse layout space, so the
     disclosure uses display here. */
  .section-nav-list { display: none; }
  .section-nav-list[data-open="true"] {
    display: block;
    animation: nav-list-enter var(--motion-slide) var(--motion-ease);
  }
}
@keyframes nav-list-enter {
  from { transform: translateY(-4px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
/* Breadcrumb collapse: only the last two crumbs show below 640px. */
@media (max-width: 640px) {
  .breadcrumbs li:not(:nth-last-child(-n+2)) { display: none; }
}
/* Pagination compact: number buttons hide below 480px. */
@media (max-width: 480px) {
  .page-btn--num { display: none; }
}

/* from: Feedback and status */
/* Feedback and status. Colors, type steps, spacing, radius, z-index,
   and motion come from UK-001. State treatment comes from UK-002.
   All other values are kit decisions. */

/* Severity: an explicit text label plus border weight and position.
   Never color coded. The label is mandatory; the border is
   redundant. */
.severity-label {
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-leading);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Badge: non-interactive. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 24px;               /* --space-5 */
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-text);
}
.badge--disabled {
  color: var(--color-text-secondary); /* full opacity: 6.39:1 light, 8.40:1 dark */
}

/* Alert: persistent, in-flow. */
.alert {
  box-sizing: border-box;
  display: grid;
  gap: var(--space-3);
  min-height: 48px;               /* --space-8 */
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-text);
  /* No transition: the alert appears at --motion-instant (UK-001,
     principle 3). The dismiss control hover is instant too. */
}
.alert-dismiss {
  justify-self: start;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.alert-dismiss:hover { background: var(--color-background); }
.alert-dismiss:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.alert-dismiss:active { opacity: var(--state-active-opacity); }
.alert-dismiss:disabled {
  color: var(--color-text-secondary); /* full opacity: 6.39:1 light, 8.40:1 dark */
  cursor: not-allowed;
}

/* Toast: transient, inverse block. */
.toast {
  box-sizing: border-box;
  display: grid;
  gap: var(--space-3);
  max-width: var(--layout-narrow-max);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-inverse-background);
  color: var(--color-inverse-text);
  z-index: var(--z-toast);
}
.toast-message {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.toast-close {
  justify-self: start;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 0;
  background: transparent;
  color: var(--color-inverse-text);
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.toast-close:hover { opacity: var(--state-active-opacity); }
.toast-close:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-inverse-text);
  outline-offset: var(--focus-outline-offset); /* visible on inverse blocks */
}
.toast-close:active { opacity: var(--state-active-opacity); }
/* Toast stack: created by kit JavaScript, one per placement.
   Newest toast sits at the viewport edge, earlier toasts inward. */
.toast-stack {
  position: fixed;
  z-index: var(--z-toast);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: var(--space-2);             /* 8px between toasts */
  width: min(var(--layout-narrow-max), calc(100vw - 48px));
}
.toast-stack[data-placement="top"] { top: var(--space-5); }
.toast-stack[data-placement="bottom"] { bottom: var(--space-5); }

/* Toast entrance and exit. Entrance slides from the placement edge
   with --motion-slide and var(--motion-ease); exit fades with
   --motion-fade. One placement per screen, carried on
   data-placement; data-leaving="true" runs the exit. */
.toast[data-placement="top"] { animation: toast-enter-top var(--motion-slide) var(--motion-ease); }
.toast[data-placement="bottom"] { animation: toast-enter-bottom var(--motion-slide) var(--motion-ease); }
.toast[data-leaving="true"] { animation: toast-leaving var(--motion-fade) var(--motion-ease); }
@keyframes toast-enter-top { from { transform: translateY(-12px); opacity: 0; } }
@keyframes toast-enter-bottom { from { transform: translateY(12px); opacity: 0; } }
@keyframes toast-leaving { to { opacity: 0; } }

/* Severity edges: apply after the component border. Each replaces
   the baseline border on the severity edge. */
.severity-info { border-left: 1px solid var(--color-border-strong); }
.severity-success { border-top: 1px solid var(--color-border-strong); }
.severity-warning { border-left: 3px solid var(--color-border-strong); }
.severity-error { border-top: 3px solid var(--color-border-strong); }
/* On inverse blocks the severity border takes the inverse text color. */
.toast.severity-info { border-left-color: var(--color-inverse-text); }
.toast.severity-success { border-top-color: var(--color-inverse-text); }
.toast.severity-warning { border-left-color: var(--color-inverse-text); }
.toast.severity-error { border-top-color: var(--color-inverse-text); }

/* Progress: determinate fill uses transform, never width animation.
   Indeterminate is a repeating strip that moves with transform. */
.progress-label {
  display: block;
  margin: 0 0 var(--space-2);
  text-align: end;
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-leading);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}
.progress-track {
  box-sizing: border-box;
  height: 8px;                    /* --space-2 */
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--color-text);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform var(--motion-fade) var(--motion-ease); /* the single easing, UK-001 */
}
.progress-strip {
  display: flex;
  gap: var(--space-2);
  width: max-content;
  animation: progress-travel calc(4 * var(--motion-slide)) linear infinite; /* 4 x --motion-slide */
}
.progress-strip span {
  flex-shrink: 0;
  width: 16px;                    /* --space-4 */
  height: 6px;
  background: var(--color-text);
}
.progress-strip span:nth-child(3n+1) { opacity: 1; }
.progress-strip span:nth-child(3n+2) { opacity: 0.5; }
.progress-strip span:nth-child(3n+3) { opacity: 0.25; }
@keyframes progress-travel {
  from { transform: translateX(-72px); } /* one 3-block unit: 3 x (16 + 8) */
  to { transform: translateX(0); }
}

/* Skeleton: solid shape blocks, opacity pulse only. */
.skeleton {
  border-radius: 0;
  background: var(--color-border);
  animation: skeleton-pulse calc(4 * var(--motion-fade)) ease-in-out infinite; /* 4 x --motion-fade */
}
.skeleton-title { height: 18px; width: 60%; }  /* h3 step */
.skeleton-text { height: 14px; width: 100%; }  /* body-sm step */
.skeleton-text--short { width: 70%; }
.skeleton-caption { height: 12px; width: 40%; } /* caption step */
.skeleton-image { height: 96px; width: 100%; }  /* --space-10 */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Empty state: title, one sentence, one optional generic action. */
.empty {
  box-sizing: border-box;
  max-width: var(--layout-narrow-max);
  margin: 0 auto;
  padding: var(--space-9) var(--space-5);
  text-align: center;
}
.empty-title {
  margin: 0 0 var(--space-3);
  font-weight: var(--font-weight-heading);
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-leading);
  font-family: var(--font-body);
  color: var(--color-text);
}
.empty-sentence {
  margin: 0 0 var(--space-3);
  font-weight: var(--font-weight-body);
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-leading);
  font-family: var(--font-body);
  color: var(--color-text-secondary);
}

/* from: Data display */
/* Data display. Colors, type steps, spacing, radius, z-index, and
   motion come from UK-001. State treatment comes from UK-002. All
   other values are kit decisions. */

/* Table: bottom borders only, one divider per boundary. */
.data-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-border);
  background: var(--color-background);
}
.data-table th {
  padding: var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--color-border-strong);
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-leading);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.data-table td {
  padding: var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  font-weight: var(--font-weight-body);
  font-size: var(--text-body-size); /* body step */
  line-height: var(--text-body-leading);
  font-family: var(--font-body);
  color: var(--color-text);
}
.data-table th.text,
.data-table td.text { min-width: 96px; }  /* --space-10 */
.data-table th.num,
.data-table td.num { min-width: 64px; }   /* --space-9 */
.data-table tr:last-child td {
  border-bottom: 0;               /* container border closes the bottom */
}
.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data-table tbody tr:hover td {
  background: var(--color-surface);
  /* No transition: hover resolves at --motion-instant
     (UK-001, principle 3). */
}
.data-table tr[aria-selected="true"] td:first-child {
  box-shadow: inset 3px 0 0 var(--color-border-strong);
}
.row-selected-marker {
  margin-left: var(--space-2);
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-leading);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}
/* Row action "More" menu: the UK-004 disclosure pattern in a table
   cell. The cell is the positioning context; the menu opens below
   the control with the same slide and fade, toggled by
   data-open="true" (kit JavaScript). */
.row-actions { position: relative; }
.row-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: var(--z-dropdown);
  min-width: 200px;
  border: 1px solid var(--color-border);
  border-top: 0;                  /* the cell bottom border owns this edge */
  background: var(--color-surface);
  transform: translateY(-4px);   /* kit decision: offset */
  opacity: 0;
  visibility: hidden;
  transition:
    transform var(--motion-slide) var(--motion-ease),
    opacity var(--motion-fade) var(--motion-ease),
    visibility var(--motion-instant) var(--motion-fade); /* duration 0, delay = fade: hides after the fade */
}
.row-menu[data-open="true"] {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition:
    transform var(--motion-slide) var(--motion-ease),
    opacity var(--motion-fade) var(--motion-ease),
    visibility var(--motion-instant); /* duration 0, no delay: shows at once */
}
.row-menu .nav-item {
  display: flex;
  width: 100%;
}

/* Sortable header: the button fills the whole cell, so the full
   cell is the 44px hit area. Negative margins absorb the th
   padding; the button re-applies it to keep label alignment. */
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 44px;
  margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-3));
  padding: var(--space-4) var(--space-3);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  cursor: pointer;
}
.sort-btn:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.sort-btn:active { opacity: var(--state-active-opacity); }
/* Current sort marker: a strong 1px rule under the label text.
   aria-sort lives on the th (valid on columnheader), never on
   the button. */
th[aria-sort="ascending"] .sort-btn .sort-label,
th[aria-sort="descending"] .sort-btn .sort-label {
  border-bottom: 1px solid var(--color-border-strong);
}
/* Sort glyph: real text in an aria-hidden span, never generated
   content, so assistive technology never sees it. The direction is
   exposed through aria-sort on the th. */
.sort-btn .sort-glyph {
  font: inherit;
  color: inherit;
}

/* Card: flat, one divider per section boundary. */
.card {
  box-sizing: border-box;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-text);
}
.card-section + .card-section {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
}
/* Interactive card: one large control. No hover fill change. */
.card--interactive { cursor: pointer; }
.card--interactive:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong);
  outline-offset: var(--focus-outline-offset);
}
.card--interactive:active { opacity: var(--state-active-opacity); }
.card--interactive[aria-disabled="true"] {
  color: var(--color-text-secondary); /* full opacity: 6.39:1 light, 8.40:1 dark */
  cursor: not-allowed;
}

/* Definition list: fixed term column on wide screens. */
.dl-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.dl-row:last-child { margin-bottom: 0; }
.dl-term {
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-leading);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  white-space: nowrap;            /* terms never wrap */
  overflow: hidden;
  text-overflow: ellipsis;
}
.dl-value {
  min-width: 0;                   /* keep long values inside the grid */
  overflow-wrap: break-word;      /* values wrap freely */
  font-weight: var(--font-weight-body);
  font-size: var(--text-body-size); /* body step */
  line-height: var(--text-body-leading);
  font-family: var(--font-body);
  color: var(--color-text);
}
.dl-value.num { text-align: right; }
@media (max-width: 640px) {
  .dl-row { grid-template-columns: 1fr; gap: 4px; } /* --space-1 */
}

/* Responsive table: horizontal scroll, sticky first column. */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-border);
}
.table-scroll .data-table { border: 0; min-width: 100%; }
/* Sticky first column. Layering: the corner cell sits above the
   header row, the header row above the sticky column, the column
   above scrolling cells. Equal z-index would let scrolled cells
   paint over the pinned layers in DOM order, so each layer steps
   up from --z-raised. */
.table-scroll .data-table th:first-child,
.table-scroll .data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: var(--z-raised);
  background: var(--color-background);
  border-right: 1px solid var(--color-border);
}
.table-scroll .data-table tbody tr:hover td:first-child {
  background: var(--color-surface); /* pinned cell follows the row hover */
}
/* Stacked rows: tables with data-labels on every cell may stack at
   3 columns or fewer below 640px. The label renders from the
   data-label attribute; no JavaScript is needed. */
@media (max-width: 640px) {
  .data-table--stacked thead { display: none; }
  .data-table--stacked,
  .data-table--stacked tbody,
  .data-table--stacked tr,
  .data-table--stacked td { display: block; }
  .data-table--stacked tr {
    border-top: 1px solid var(--color-border);
  }
  .data-table--stacked tr:first-child { border-top: 0; }
  .data-table--stacked td {
    border: 0;
    padding: var(--space-2) var(--space-4);
  }
  .data-table--stacked td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-label);
    font-size: var(--text-caption-size);
    line-height: var(--text-caption-leading);
    font-weight: var(--font-weight-label);
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-bottom: 4px;             /* --space-1 */
  }
  .data-table--stacked td.num { text-align: left; }
}

/* Sticky header for long tables: opt in with .data-table--sticky.
   The header sits one layer above the sticky column; the corner
   cell (both sticky) sits one above that. */
.data-table--sticky thead th {
  position: sticky;
  top: 0;
  z-index: calc(var(--z-raised) + 1);
  background: var(--color-background);
}
.table-scroll .data-table--sticky thead th:first-child {
  z-index: calc(var(--z-raised) + 2);
}

/* from: Layout system */
/* Layout system. The two layout values come from the brand guide.
   The spacing scale and the z-index scale come from UK-001. All
   other values are kit decisions. */

/* Page container: capped at 1360px, side padding from the guide. */
.layout-container {
  box-sizing: border-box;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 var(--layout-pad);
}

/* Narrow prose: readable line length for long text. */
.layout-prose {
  max-width: 720px;
}

/* Grid: 12 columns wide, 6 columns narrow. */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-5);
  row-gap: var(--space-5);
}
.span-12 { grid-column: span 12; }
.span-9 { grid-column: span 9; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
@media (max-width: 640px) {
  .layout-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .span-12, .span-9, .span-8,
  .span-6, .span-4, .span-3 {
    grid-column: span 6;         /* every pattern stacks full width */
  }
}

/* Sections: rhythm from the spacing scale. */
.layout-section {
  margin-bottom: var(--space-9);
}
.layout-section:last-child {
  margin-bottom: 0;
}
.layout-subsection {
  margin-bottom: var(--space-6);
}
.layout-subsection:last-child {
  margin-bottom: 0;
}

/* Divider: 1px solid, one per boundary, never two together. */
.divider {
  height: 0;
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-5) 0;       /* clear space on each side */
}
/* A divider takes the place of the section gap: the facing section
   margin drops so the gap is never applied twice. */
.layout-section:has(+ .divider) { margin-bottom: 0; }

/* from: Responsive behavior */
/* Responsive behavior. Colors, type steps, spacing, radius, z-index,
   and motion come from UK-001. The 44px touch target rule comes from
   UK-002. All other values are kit decisions. */

/* Normative breakpoint edges. Media queries use max-width at the
   edge value, the house convention from UK-004, UK-006, UK-007. */
@media (max-width: 1024px) { /* below: section nav collapses (UK-004) */ }
@media (max-width: 900px) { /* below: top bar collapses (UK-004) */ }
@media (max-width: 640px) { /* below: tabs, tables, breadcrumbs, grid collapse (UK-004, UK-006, UK-007) */ }
@media (max-width: 480px) { /* below: pagination compacts (UK-004) */ }

/* Text wrapping: content that may wrap breaks inside long words. */
.wrap {
  white-space: normal;
  overflow-wrap: break-word;      /* kit decision */
}

/* Text wrapping: labels, nav items, table headers, buttons, and
   slash-separated headers never wrap. They truncate with ellipsis. */
.nowrap,
.field-label,
.nav-item,
.data-table th,
.btn,
.slash-header {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Touch targets: 44px minimum, 8px separation between targets. */
.target {
  min-height: 44px;               /* UK-002 touch target rule */
  min-width: 44px;
}
.target-group > * + * {
  margin-left: var(--space-2);
  margin-top: var(--space-2);
}

/* Scroll to top: hidden by default, shown only on upward scroll. */
.scroll-top {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font: var(--font-weight-body) var(--text-body-size)/1 var(--font-body);
  z-index: calc(var(--z-toast) - 1); /* below toasts: a visible toast paints over the control */
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);    /* kit decision: offset */
  transition:
    opacity var(--motion-fade) var(--motion-ease),
    transform var(--motion-slide) var(--motion-ease),
    visibility var(--motion-instant) var(--motion-fade); /* duration 0, delay = fade: hides after the fade */
  pointer-events: none;
}
.scroll-top[data-visible="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity var(--motion-fade) var(--motion-ease),
    transform var(--motion-slide) var(--motion-ease),
    visibility var(--motion-instant); /* duration 0, no delay: shows at once */
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .scroll-top,
  .scroll-top[data-visible="true"] {
    transition: none;
    transform: none;
  }
}

/* from: Accessibility contract */
/* Accessibility contract. Tokens come from UK-001. The focus-visible
   treatment comes from UK-002. All other values are kit decisions. */

/* Visible focus on every focused control. */
:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-border-strong); /* UK-002 treatment */
  outline-offset: var(--focus-outline-offset);                         /* UK-002 treatment */
}

/* Selection: inverse, theme-aware. Selected text reads as a solid
   block of the theme's ink on the theme's paper. */
::selection {
  background: var(--color-text);
  color: var(--color-background);
}

/* Skip link: first tab stop, hidden until focused. */
.skip-link {
  position: fixed;
  top: calc(-1 * var(--space-10));                       /* --space-10, kit decision */
  left: var(--space-2);
  z-index: var(--z-tooltip);        /* always on top */
  display: inline-flex;
  align-items: center;
  min-height: 44px;                 /* UK-002 touch target rule */
  padding: 0 var(--space-4);
  border-radius: 0;
  background: var(--color-text);
  color: var(--color-background);
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-leading);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.skip-link:focus-visible {
  top: var(--space-2);
}

/* Reduced motion: every animation resolves to instant. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: var(--motion-instant) !important;
    animation-delay: var(--motion-instant) !important;
    transition-duration: var(--motion-instant) !important;
    transition-delay: var(--motion-instant) !important;
    scroll-behavior: auto !important;     /* kit decision */
  }
}

/* from: Iconography */
/* Iconography. The grid and sizes are kit decisions. Colors come
   from UK-001. */
:root {
  --icon-size: 16px;                /* kit decision: default */
  --icon-size-small: 12px;          /* kit decision */
  --icon-size-large: 24px;          /* kit decision: reserved */
  --icon-stroke: 1px;               /* kit decision */
  --icon-clear: 2px;                /* kit decision: minimum clear space */
  --icon-label-gap: var(--space-2);  /* 8px, UK-002 */
}
.icon {
  width: var(--icon-size);
  height: var(--icon-size);
  stroke: currentColor;             /* inherits the label text color */
  stroke-width: var(--icon-stroke);
  stroke-linecap: square;
  stroke-linejoin: miter;           /* square joins, no rounded corners */
  fill: none;
}

/* from: Dashboard layout and bento modularity */
/* Dashboard shell and bento cells. All values are kit decisions
   unless they reference a UK-001, UK-004, UK-007, or UK-008 rule. */

.dash-shell {
  min-height: 100vh;
  background: var(--color-background);
  color: var(--color-text);
}

/* Top bar: 64px, sticky, one bottom border. */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: 64px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--layout-pad);
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
}

/* Shell body: rail plus main. */
.dash-body {
  display: flex;
  align-items: flex-start;
}

/* Shell slot for the UK-004 section nav. The slot owns flex
   sizing only; the nav component owns its sticky offset, borders,
   items, and disclosure behavior. */
.dash-nav {
  flex: 0 0 240px;
  min-width: 0;
}

/* Main: the UK-007 container. */
.dash-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--layout-max);
  padding: var(--space-6) var(--layout-pad) var(--space-9);
}

/* At 1024px and below the nav slot goes full width in flow
   (UK-008, UK-004). */
@media (max-width: 1024px) {
  .dash-body { display: block; }
  .dash-nav { flex: none; }
}

/* Page title row: h1 left, actions right, wraps on narrow screens. */
.dash-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: 0 0 var(--space-6);
}
.dash-title-row h1 { margin: 0; }

/* Bento: the UK-007 grid. The grid owns gaps; cells own borders. */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-5);
}
.bento-span-12 { grid-column: span 12; }
.bento-span-8  { grid-column: span 8; }
.bento-span-6  { grid-column: span 6; }
.bento-span-4  { grid-column: span 4; }
.bento-span-3  { grid-column: span 3; }

/* Cell: one border, square corners, 24px padding. */
.bento-cell {
  box-sizing: border-box;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0;
  padding: var(--space-5);
}
.bento-cell__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 0 0 var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.bento-cell__title { margin: 0; }
.bento-cell__body { flex: 1 1 auto; min-width: 0; }
.bento-cell__footer {
  margin: var(--space-4) 0 0;
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--color-border);
}

/* At 640px and below every cell takes the single column (UK-008).
   Nothing animates; the reflow is instant. */
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .bento-span-12,
  .bento-span-8,
  .bento-span-6,
  .bento-span-4,
  .bento-span-3 { grid-column: auto; }
}

/* from: Overlays */
/* Overlays: dialog, drawer, tooltip. All values are kit decisions
   unless they reference a UK-001, UK-002, UK-007, UK-008, UK-009,
   or UK-010 rule. */

/* Backdrop: shared by dialog and drawer. */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(10, 10, 10, 0.5);
  animation: overlay-fade var(--motion-fade) var(--motion-ease);
}

/* Dialog panel: centered, capped, bordered. */
.dialog {
  position: fixed;
  z-index: var(--z-modal);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  width: calc(100vw - 32px);
  max-width: 520px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: var(--color-background);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: 0;
  padding: var(--space-6);
  animation: overlay-fade var(--motion-fade) var(--motion-ease);
}
.dialog--narrow { max-width: 400px; }
.dialog--wide { max-width: 720px; }

.dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 0 0 var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.dialog__title { margin: 0; }
.dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--color-border);
}

/* Drawer: right-edge dialog. Same contract, different geometry. */
.drawer {
  position: fixed;
  z-index: var(--z-modal);
  top: 0;
  right: 0;
  box-sizing: border-box;
  width: min(360px, 90vw);
  height: 100vh;
  overflow-y: auto;
  background: var(--color-background);
  color: var(--color-text);
  border-left: 1px solid var(--color-border-strong);
  padding: var(--space-6);
  animation: drawer-enter var(--motion-slide) var(--motion-ease),
             overlay-fade var(--motion-fade) var(--motion-ease);
}

/* Tooltip: inverse caption above the trigger. */
.tooltip-trigger { position: relative; }
.tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: var(--z-tooltip);
  max-width: 240px;
  padding: var(--space-2) var(--space-3);
  background: var(--color-inverse-background);
  color: var(--color-inverse-text);
  font-family: var(--font-label);
  font-size: var(--text-caption-size);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}
.tooltip-trigger:hover .tooltip,
.tooltip-trigger:focus-visible .tooltip,
.tooltip-trigger:focus-within .tooltip {
  opacity: 1;
  transition: opacity var(--motion-fade) var(--motion-ease);
}

@keyframes overlay-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes drawer-enter {
  from { transform: translateX(16px); }
  to { transform: translateX(0); }
}
