/* Components. One block per macro in templates/components/. Specificity is kept flat
   (single classes, :where() for defaults) so section and component spacing never fight. */

/* Icons --------------------------------------------------------------------------------- */
.icon { flex: none; }

/* Wordmark ------------------------------------------------------------------------------ */
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.wordmark__text { font-family: var(--font-display); font-weight: 480; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1; }
.wordmark--dark { color: var(--paper); }
.wordmark:hover { color: inherit; }

/* Header -------------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--rule); }
.site-header__inner { display: flex; align-items: center; gap: var(--s-6); min-height: var(--header-h); }
.primary-nav ul { display: flex; gap: var(--s-1); list-style: none; padding: 0; }
.primary-nav a {
  display: inline-flex; align-items: center; height: 40px; padding-inline: var(--s-3);
  color: var(--blue); font-weight: 500; font-size: 15px; text-decoration: none; border-radius: var(--radius);
}
.primary-nav a:hover { color: var(--blue-deep); background: var(--mist); }
.primary-nav a[aria-current="page"] { color: var(--navy); box-shadow: inset 0 -2px 0 var(--blue); border-radius: 0; }
.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.signout { display: contents; }
.icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius);
  border: 1px solid transparent; background: transparent; color: var(--navy); list-style: none;
}
.icon-button:hover { background: var(--mist); color: var(--blue-deep); }
.icon-button::-webkit-details-marker { display: none; }
.nav-menu { position: relative; display: none; }
.nav-menu > summary { cursor: pointer; }
.nav-menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: var(--s-2);
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-raised);
}
.nav-menu__panel ul { list-style: none; padding: 0; }
.nav-menu__panel a { display: block; padding: 10px 12px; color: var(--navy); font-weight: 500; text-decoration: none; border-radius: var(--radius); }
.nav-menu__panel a:hover, .nav-menu__panel a[aria-current="page"] { background: var(--mist); }
@media (max-width: 860px) {
  .primary-nav { display: none; }
  .nav-menu { display: block; }
}

/* Sub-nav ------------------------------------------------------------------------------- */
.subnav { min-width: 0; background: var(--navy); color: var(--paper); }
.subnav__list {
  position: relative; display: flex; gap: var(--s-1); list-style: none; padding: 0; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.subnav__list::-webkit-scrollbar { display: none; }
.subnav__link {
  display: inline-flex; align-items: center; gap: var(--s-2); height: 48px; padding-inline: var(--s-4);
  color: rgba(255, 255, 255, .78); font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 -3px 0 transparent;
}
.subnav li:first-child .subnav__link { padding-left: 0; }
.subnav__link:hover { color: var(--paper); }
.subnav__link[aria-current="page"] { color: var(--paper); box-shadow: inset 0 -3px 0 var(--paper); }
.subnav__link:focus-visible { box-shadow: inset 0 0 0 2px var(--paper); border-radius: 0; }
.subnav__count {
  font-family: var(--font-mono); font-size: 11px; padding: 0 6px; border-radius: 2px;
  background: rgba(255, 255, 255, .14); color: var(--paper);
}

/* Page head and app shell --------------------------------------------------------------- */
.page-head { background: var(--bone); border-bottom: 1px solid var(--rule); }
.page-head__inner { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-5); padding-block: var(--s-7) var(--s-6); }
.page-head__text { max-width: 68ch; }
.page-head__text .eyebrow { margin-bottom: var(--s-2); }
.page-head__title { font-size: clamp(var(--t-27), 3.6vw, var(--t-36)); }
.page-head__lede { margin-top: var(--s-3); color: var(--slate); max-width: 64ch; }
.page-head__meta { margin-top: var(--s-3); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.app-content { padding-block: var(--s-6) var(--s-8); }
.app-block + .app-block { margin-top: var(--s-7); }
.app-footer { border-top: 1px solid var(--rule); color: var(--slate); font-size: var(--t-14); padding-block: var(--s-5); }
.block-head { margin-bottom: var(--s-4); }
.block-head__title { font-family: var(--font-text); font-weight: 600; font-size: var(--t-20); letter-spacing: 0; color: var(--navy); }
.block-head__count { font-family: var(--font-mono); font-size: var(--t-12); font-weight: 500; color: var(--slate); margin-left: var(--s-2); vertical-align: middle; }
.demo-hint { margin-top: var(--s-3); text-align: center; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); list-style: none; padding: 0; font-size: var(--t-14); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--slate); }
.breadcrumbs a { color: var(--slate); }

/* Demo ribbon --------------------------------------------------------------------------- */
.demo-ribbon { background: var(--bone); border-top: 3px solid var(--brass); border-bottom: 1px solid var(--rule); }
.demo-ribbon__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); padding-block: 10px; }
.demo-ribbon__tag {
  font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: var(--mono-tracking);
  text-transform: uppercase; color: var(--paper); background: var(--brass); padding: 3px 8px; border-radius: 2px;
}
.demo-ribbon__text { font-size: var(--t-14); color: var(--ink); }

/* Buttons ------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px;
  padding: 0 20px; border: 1px solid transparent; border-radius: var(--radius);
  font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: var(--mono-tracking);
  text-transform: uppercase; text-decoration: none; line-height: 1.2; white-space: nowrap; cursor: pointer;
  transition: background-color var(--fast) ease, color var(--fast) ease, border-color var(--fast) ease;
}
.btn--sm { min-height: 36px; padding: 0 14px; gap: 8px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--blue); color: var(--paper); }
.btn--primary:hover { background: var(--blue-deep); color: var(--paper); }
.btn--secondary { background: var(--paper); color: var(--navy); border-color: var(--navy); }
.btn--secondary:hover { background: var(--mist); color: var(--navy); }
.btn--on-blue { background: var(--paper); color: var(--blue); }
.btn--on-blue:hover { background: var(--mist); color: var(--blue-deep); }
.btn--destructive { background: var(--paper); color: var(--serious); border-color: var(--serious); }
.btn--destructive:hover { background: var(--serious); color: var(--paper); }
.btn--brass { background: var(--brass); color: var(--paper); }
.btn--brass:hover { background: #745A27; color: var(--paper); }
.btn--quiet { background: transparent; color: var(--blue); padding-inline: 10px; }
.btn--quiet:hover { background: var(--mist); color: var(--blue-deep); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.inline-form { display: inline-flex; }

.link-chevron { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 500; text-decoration: none; }
.link-chevron:hover { color: var(--blue-deep); text-decoration: underline; }
.link-chevron .icon { transition: transform var(--fast) var(--ease); }
.link-chevron:hover .icon { transform: translateX(3px); }

/* Forms --------------------------------------------------------------------------------- */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field__label { font-weight: 500; font-size: var(--t-14); color: var(--navy); }
.field__optional { font-weight: 400; color: var(--slate); }
.field__help { font-size: 13px; line-height: 1.45; color: var(--slate); }
.field__error { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--serious); font-weight: 500; }
.field__error .icon { margin-top: 1px; }
.input {
  width: 100%; min-height: 44px; padding: 10px 12px; background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); font-size: var(--t-16); line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.input::placeholder { color: #7A8496; }
.input:hover { border-color: var(--navy); }
.input:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 107, 203, .25); }
.field--error .input { border-color: var(--serious); }
.input--area { min-height: 88px; resize: vertical; }
.select-wrap { position: relative; }
.input--select { appearance: none; padding-right: 40px; }
.select-wrap__icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--navy); }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 4px 10px; align-items: start; }
.check__input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); }
.check__label { font-size: var(--t-16); }
.check .field__help { grid-column: 2; }
.radio-cards { border: 0; padding: 0; display: grid; gap: var(--s-2); min-width: 0; }
.radio-cards > legend { padding: 0; margin-bottom: var(--s-2); }
.radio-cards__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-3); }
.radio-card {
  position: relative; display: grid; gap: 2px; padding: 14px 16px 14px 44px; border: 1px solid var(--rule-strong);
  border-radius: var(--radius); cursor: pointer; background: var(--paper);
}
.radio-card input { position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; accent-color: var(--blue); }
.radio-card__title { font-weight: 600; color: var(--navy); }
.radio-card__text { font-size: var(--t-14); color: var(--slate); }
.radio-card:has(input:checked) { border-color: var(--blue); background: var(--mist); box-shadow: inset 0 0 0 1px var(--blue); }
.radio-card:has(input:focus-visible) { box-shadow: var(--focus); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-3); margin-bottom: var(--s-5); }
.filter-bar .field { min-width: 240px; }
.filter-bar .field__optional { display: none; }
.filter-bar__count { margin-left: auto; align-self: center; }

/* Chips --------------------------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 8px;
  border: 1px solid currentColor; border-radius: 2px; font-family: var(--font-mono); font-weight: 500;
  font-size: 11px; line-height: 1.4; letter-spacing: .06em; white-space: nowrap; text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.chip--source { color: var(--blue); border-color: #A9C9EC; background: var(--paper); letter-spacing: .02em; }
a.chip--source:hover { background: var(--mist); border-color: var(--blue); color: var(--blue-deep); }
.chip--static { color: var(--slate); border-color: var(--rule); }
.chip--status { text-transform: uppercase; letter-spacing: var(--mono-tracking); }
.chip__glyph { width: 6px; height: 6px; background: currentColor; flex: none; }
.chip--ok { color: var(--ok); }
.chip--ok .chip__glyph { border-radius: 50%; }
.chip--watch { color: var(--watch); }
.chip--watch .chip__glyph { transform: rotate(45deg); }
.chip--serious { color: var(--paper); background: var(--serious); border-color: var(--serious); }
.chip--serious .chip__glyph { clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 8px; height: 7px; }
.chip--info { color: var(--blue); }
.chip--info .chip__glyph { border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.chip--neutral { color: var(--slate); }
.chip--neutral .chip__glyph { display: none; }
.chip--label { min-width: 24px; justify-content: center; padding: 2px 6px; font-size: 12px; letter-spacing: 0; }
.chip--label-p { color: var(--navy); background: var(--mist); border-color: #A9C9EC; }
.chip--label-a { color: var(--brass); background: #F8F3E8; border-color: #D9C9A3; }
.chip--label-u { color: var(--slate); background: var(--paper); border-color: var(--rule-strong); border-style: dashed; }

/* Cards --------------------------------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
@media (max-width: 1000px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .card-grid { grid-template-columns: 1fr; } }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow-card); overflow: hidden; transition: box-shadow var(--fast) ease;
}
.card:has(.card__link-overlay):hover { box-shadow: var(--shadow-raised); }
.card__figure { padding: var(--s-5) var(--s-5) var(--s-4); background: var(--bone); border-bottom: 1px solid var(--rule); }
.card__figure-value { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--t-36); line-height: 1.05; letter-spacing: var(--display-tracking); color: var(--navy); margin-top: 6px; font-variant-numeric: lining-nums tabular-nums; }
.card__body { display: flex; flex-direction: column; flex: 1; gap: var(--s-2); padding: var(--s-5); }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.card__chips { --cluster: 6px; }
.card__title { font-family: var(--font-text); font-weight: 600; font-size: 18px; line-height: 1.35; letter-spacing: 0; color: var(--navy); text-wrap: pretty; }
.card__link-overlay { color: inherit; text-decoration: none; }
.card__link-overlay::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card__link-overlay:focus-visible { box-shadow: none; }
.card:has(.card__link-overlay:focus-visible) { box-shadow: var(--focus); }
.card__text { color: var(--slate); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__extra { position: relative; z-index: 2; }
.card__cta { margin-top: auto; padding-top: var(--s-2); }
.card:hover .card__cta { text-decoration: underline; }
.card__media { aspect-ratio: 16 / 9; }

/* Media with fallback ------------------------------------------------------------------- */
.media { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--navy), var(--blue)); }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--21x9 { aspect-ratio: 21 / 9; }
.media__fallback {
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 28px 100%,
    radial-gradient(120% 90% at 85% 10%, rgba(11, 107, 203, .9), transparent 60%),
    linear-gradient(150deg, var(--navy) 10%, var(--blue-deep) 60%, var(--blue));
}
.media__fallback::after {
  /* the brand mark drawn large: two offset sheets, one ledger line in brass */
  content: ""; position: absolute; right: 6%; bottom: 8%; width: min(46%, 360px); aspect-ratio: 1;
  background: url("../img/fallback-mark.svg") center / contain no-repeat;
}
.media__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media.is-missing .media__img { display: none; }

/* Landing hero -------------------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 45fr 55fr; min-height: min(640px, calc(100vh - var(--header-h))); }
.hero__panel { background: var(--blue); color: var(--paper); display: flex; align-items: center; }
.hero__copy {
  width: 100%; padding: var(--s-8) var(--s-6) var(--s-8) max(var(--gutter), calc((100vw - var(--container)) / 2));
  animation: hero-in var(--slow) var(--ease) both;
}
.hero__eyebrow { font-family: var(--font-mono); font-weight: 500; font-size: var(--t-12); letter-spacing: var(--mono-tracking); text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.hero__title { margin-top: var(--s-4); color: var(--paper); font-size: clamp(2.5rem, 4.6vw, var(--t-64)); line-height: 1.03; letter-spacing: -0.022em; }
.hero__text { margin-top: var(--s-5); font-size: 18px; line-height: 1.6; color: rgba(255, 255, 255, .92); max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-5); margin-top: var(--s-6); }
.hero__link { color: var(--paper); font-weight: 500; text-decoration: underline; text-underline-offset: .25em; }
.hero__link:hover { color: var(--paper); text-decoration-thickness: 2px; }
.hero__visual { position: relative; background: var(--mist); }
.hero__media { position: absolute; inset: 0; }
@keyframes hero-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__copy { max-width: none; padding: var(--s-7) var(--gutter) var(--s-8); }
  .hero__visual { aspect-ratio: 16 / 9; }
}

/* Hairline three-column row ------------------------------------------------------------- */
.hairline-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hairline-row__col { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-2) var(--s-6); }
.hairline-row__col:first-child { padding-left: 0; }
.hairline-row__col:last-child { padding-right: 0; }
.hairline-row__col + .hairline-row__col { border-left: 1px solid var(--rule); }
.hairline-row__icon { color: var(--blue); }
.hairline-row__title { font-size: var(--t-27); }
.hairline-row__text { color: var(--slate); }
.hairline-row .link-chevron { margin-top: auto; padding-top: var(--s-2); }
@media (max-width: 860px) {
  .hairline-row { grid-template-columns: 1fr; }
  .hairline-row__col { padding: var(--s-5) 0; }
  .hairline-row__col + .hairline-row__col { border-left: 0; border-top: 1px solid var(--rule); }
}

/* Tinted feature panel ------------------------------------------------------------------ */
.feature-panel {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s-7);
  padding: clamp(var(--s-5), 5vw, var(--s-7)); background: var(--mist); border-radius: var(--radius-panel);
}
.feature-panel__lead { display: flex; flex-direction: column; gap: var(--s-4); }
.feature-panel__body { color: var(--ink); }
.feature-panel__media { margin-top: var(--s-3); border-radius: var(--radius); }
.icon-rows { list-style: none; padding: 0; }
.icon-row { display: grid; grid-template-columns: 32px 1fr; gap: var(--s-4); padding-block: var(--s-5); border-top: 1px solid #C5D7EC; }
.icon-row:first-child { border-top: 0; padding-top: 0; }
.icon-row:last-child { padding-bottom: 0; }
.icon-row__badge { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: var(--paper); }
.icon-row__title { font-weight: 600; color: var(--navy); }
.icon-row__text { color: var(--slate); margin-top: 2px; }
@media (max-width: 860px) { .feature-panel { grid-template-columns: 1fr; gap: var(--s-6); } }

/* Step cards ---------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-4); list-style: none; padding: 0; counter-reset: step; }
.step { display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.step__media {
  position: relative; height: 128px; display: grid; place-items: center; border-radius: var(--radius) var(--radius) 0 0;
  color: var(--blue);
  background:
    linear-gradient(rgba(11, 107, 203, .08) 1px, transparent 1px) 0 0 / 100% 16px,
    var(--mist);
}
.step__glyph { opacity: .9; }
.step__tab {
  position: absolute; left: var(--s-5); bottom: 0; transform: translateY(50%);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius);
  background: var(--blue); color: var(--paper); font-family: var(--font-display); font-weight: 500;
  font-size: var(--t-20); line-height: 1; font-variant-numeric: lining-nums;
}
.step__body { display: flex; flex-direction: column; gap: var(--s-2); padding: calc(var(--s-5) + 20px) var(--s-5) var(--s-5); }
.step__body .mono-label { color: var(--brass); }
.step__title { font-family: var(--font-text); font-weight: 600; font-size: 17px; letter-spacing: 0; line-height: 1.35; }
.step__text { color: var(--slate); font-size: 15px; }
@media (max-width: 1080px) {
  .steps { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(240px, 34%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s-3); }
  .step { scroll-snap-align: start; }
}
@media (max-width: 560px) {
  .steps { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; gap: var(--s-5); }
  .step { flex-direction: row; }
  .step__media { flex: none; width: 76px; height: auto; border-radius: var(--radius) 0 0 var(--radius); }
  .step__glyph { width: 28px; height: 28px; }
  .step__tab { left: auto; right: 0; bottom: auto; top: var(--s-4); transform: translateX(50%); width: 32px; height: 32px; font-size: var(--t-16); }
  .step__body { padding: var(--s-4) var(--s-4) var(--s-4) calc(var(--s-4) + 16px); }
}

/* Stat tiles ---------------------------------------------------------------------------- */
.why { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-8); align-items: center; }
.why__text { display: flex; flex-direction: column; gap: var(--s-4); }
@media (max-width: 960px) { .why { grid-template-columns: 1fr; gap: var(--s-6); } }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.stat-tile { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-6); background: var(--paper); }
.stat-tile__figure { order: -1; font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(var(--t-36), 4vw, var(--t-48)); line-height: 1; letter-spacing: -0.02em; color: var(--navy); font-variant-numeric: lining-nums; }
.stat-tile__caption { font-family: var(--font-mono); font-weight: 500; font-size: 11.5px; line-height: 1.55; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.stat-tile__source { margin-top: auto; padding-top: var(--s-2); font-size: var(--t-12); color: var(--slate); }
.stat-tile__source a { color: var(--slate); }
@media (max-width: 560px) { .stat-tiles { grid-template-columns: 1fr; } .stat-tile { padding: var(--s-5); } }

/* Dark band ----------------------------------------------------------------------------- */
.dark-band { position: relative; isolation: isolate; color: var(--bone); overflow: hidden; }
.dark-band__media { position: absolute; inset: 0; z-index: -2; }
.dark-band__overlay { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11, 31, 77, .82), rgba(11, 31, 77, .9)); }
.dark-band__content { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-5); padding-block: clamp(var(--s-8), 10vw, 128px); }
.dark-band__title { color: var(--bone); font-size: clamp(var(--t-27), 4vw, var(--t-48)); max-width: 22ch; }
.dark-band__text { max-width: 56ch; color: rgba(246, 244, 239, .86); }

/* Footer -------------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid rgba(255, 255, 255, .08); background: var(--navy); color: rgba(255, 255, 255, .8); padding-block: var(--s-8) var(--s-6); font-size: 15px; }
.site-footer__grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: var(--s-6); }
.site-footer__brand p { margin-top: var(--s-4); max-width: 36ch; }
.site-footer__heading { font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: var(--mono-tracking); text-transform: uppercase; color: var(--muted-blue); margin-bottom: var(--s-3); }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: var(--s-2); }
.site-footer a { color: rgba(255, 255, 255, .8); text-decoration: none; }
.site-footer a:hover { color: var(--paper); text-decoration: underline; }
.site-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-5); margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid rgba(255, 255, 255, .15); font-size: var(--t-14); color: rgba(255, 255, 255, .7); }
@media (max-width: 860px) { .site-footer__grid { grid-template-columns: repeat(3, 1fr); } .site-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }

/* Tables / ledger ----------------------------------------------------------------------- */
.table-wrap { position: relative; overflow-x: auto; border-top: 1px solid var(--navy); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { box-shadow: var(--focus); }
.ledger { width: 100%; font-size: 15px; }
.ledger__caption { caption-side: top; text-align: left; padding: var(--s-3) 0; font-size: var(--t-14); color: var(--slate); }
.table-wrap:has(.ledger__caption) { border-top: 0; }
.table-wrap:has(.ledger__caption) thead th { border-top: 1px solid var(--navy); }
.ledger th, .ledger td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.ledger th:first-child, .ledger td:first-child { padding-left: 0; }
.ledger th:last-child, .ledger td:last-child { padding-right: 0; }
.ledger thead th {
  font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: var(--mono-tracking);
  text-transform: uppercase; color: var(--slate); white-space: nowrap; padding-block: 10px;
}
.ledger tbody th { font-weight: 500; color: var(--navy); min-width: 140px; }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.ledger tbody tr:hover { background: #FAFBFD; }
.ledger--compact th, .ledger--compact td { padding-block: 8px; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums lining-nums; }
.cell-title { display: block; }
.cell-sub { display: block; font-size: var(--t-12); color: var(--slate); font-weight: 400; }

/* Benchmarks page ----------------------------------------------------------------------- */
.bench-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); background: var(--bone); border-radius: var(--radius); }
.legend-item { --cluster: 8px; font-size: var(--t-14); color: var(--ink); }
.toc { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-block: var(--s-5) var(--s-2); }
.toc a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; font-size: var(--t-14); color: var(--navy); text-decoration: none; }
.toc a:hover { border-color: var(--blue); color: var(--blue); }
.toc__count { font-family: var(--font-mono); font-size: 11px; color: var(--slate); }
.bench-group { padding-top: var(--s-7); }
.bench-group__title { font-size: var(--t-27); margin-bottom: var(--s-4); }
.ledger--bench { table-layout: fixed; min-width: 880px; }
.ledger--bench .col-name { width: 32%; }
.ledger--bench .col-scope { width: 16%; }
.ledger--bench .col-value { width: 13%; }
.ledger--bench .col-label { width: 7%; }
.ledger--bench .col-source { width: 21%; }
.ledger--bench .col-actions { width: 11%; }
.bench-row__title { display: block; }
.bench-row__note { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--slate); line-height: 1.45; }
.scope-tag { display: inline-block; margin: 0 4px 4px 0; padding: 1px 8px; border-radius: 2px; background: var(--bone); font-size: 13px; color: var(--ink); white-space: nowrap; }
.bench-row__value { font-weight: 600; color: var(--navy); }
.bench-row__asof { display: block; font-weight: 400; font-size: var(--t-12); color: var(--slate); }
.bench-row__source { font-size: var(--t-14); overflow-wrap: anywhere; }
.bench-row__edited { display: block; margin-top: 6px; }
.bench-row__actions { white-space: nowrap; text-align: right; }
.bench-row.is-saved { animation: saved 1.6s ease; }
@keyframes saved { from { background: var(--ok-tint); } to { background: transparent; } }
.bench-row.is-editing td { background: var(--mist); padding: var(--s-5); }
.bench-row.is-editing:hover { background: transparent; }
.bench-edit { display: grid; gap: var(--s-4); }
.bench-edit__head { display: flex; justify-content: space-between; gap: var(--s-4); }
.bench-edit__title { font-weight: 600; color: var(--navy); }
.bench-edit__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 640px) { .bench-edit__grid { grid-template-columns: 1fr; } }
.bench-add > .cluster { margin-top: var(--s-6); }
.bench-add__values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 640px) { .bench-add__values { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  /* Benchmarks become stacked rows so the value is visible without sideways scrolling. */
  .ledger--bench { min-width: 0; table-layout: auto; }
  .ledger--bench colgroup { display: none; }
  .ledger--bench thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ledger--bench tbody { display: block; }
  .ledger--bench tr.bench-row:not(.is-editing) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name name" "scope value" "source label" "actions actions";
    gap: 8px 16px; padding-block: var(--s-4); border-bottom: 1px solid var(--rule);
  }
  .ledger--bench tr.bench-row > * { display: block; padding: 0; border: 0; }
  .ledger--bench .bench-row__name { grid-area: name; }
  .ledger--bench .bench-row__scope { grid-area: scope; }
  .ledger--bench .bench-row__value { grid-area: value; text-align: right; }
  .ledger--bench tr.bench-row > td:nth-child(4) { grid-area: label; justify-self: end; }
  .ledger--bench .bench-row__source { grid-area: source; }
  .ledger--bench .bench-row__actions { grid-area: actions; text-align: left; margin-left: -10px; }
  .ledger--bench tr.bench-row.is-editing { display: block; }
  .ledger--bench tr.bench-row.is-editing td { display: block; }
}

/* Settings layout ----------------------------------------------------------------------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-7); align-items: start; }
.settings-grid__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-7); min-width: 0; }
@media (max-width: 960px) { .settings-grid { grid-template-columns: 1fr; } }
.env-key { display: inline-flex; align-items: center; gap: 4px; margin: 0 8px 4px 0; font-size: var(--t-14); }
.ledger--sources { min-width: 680px; }
.env-key.is-present { color: var(--ok); }
.env-key.is-missing { color: var(--serious); }
.env-key code { color: var(--ink); }
.action-code { color: var(--navy); }
.audit-detail { max-width: 420px; }
.audit-detail code { display: block; font-size: 12px; color: var(--slate); overflow-wrap: anywhere; white-space: normal; }

/* Panels and definition lists ----------------------------------------------------------- */
.panel { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.panel__head { padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--rule); }
.panel__title { font-family: var(--font-text); font-weight: 600; font-size: 17px; letter-spacing: 0; margin-top: 2px; }
.panel__body { padding: var(--s-5); display: grid; gap: var(--s-4); }
.deflist { display: grid; }
.deflist__row { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: var(--s-3); padding-block: 10px; border-bottom: 1px solid var(--rule); font-size: var(--t-14); }
.deflist__row:first-child { padding-top: 0; }
.deflist__row:last-child { border-bottom: 0; padding-bottom: 0; }
.deflist dt { color: var(--slate); }
.deflist dd { color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Flags --------------------------------------------------------------------------------- */
.flag { display: grid; gap: var(--s-3); padding: var(--s-5); padding-left: calc(var(--s-5) + 3px); background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-card); position: relative; }
.flag::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: var(--radius) 0 0 var(--radius); background: var(--slate); }
.flag--serious::before { background: var(--serious); }
.flag--watch::before { background: var(--watch); }
.flag--info::before { background: var(--blue); }
.flag__head { display: grid; gap: var(--s-2); }
.flag__chips { --cluster: 10px; }
.flag__title { font-family: var(--font-text); font-weight: 600; font-size: 18px; letter-spacing: 0; line-height: 1.35; }
.flag__detail { color: var(--slate); max-width: var(--measure); }
.evidence { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.evidence__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(110px, auto); gap: var(--s-4); align-items: center; padding-block: 10px; border-bottom: 1px solid var(--rule); font-size: 15px; }
.evidence__value { font-weight: 600; color: var(--navy); text-align: right; }
.evidence__source { justify-self: end; }
.flag__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); padding-top: var(--s-1); }
@media (max-width: 560px) {
  .evidence__row { grid-template-columns: 1fr auto; }
  .evidence__source { grid-column: 1 / -1; justify-self: start; }
}

/* Stage rail ---------------------------------------------------------------------------- */
.stage-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(120px, 1fr); list-style: none; padding: 0; overflow-x: auto; }
.stage-rail__stage { position: relative; display: grid; gap: 4px; padding: 0 var(--s-3) var(--s-2) 0; }
.stage-rail__stage::before { content: ""; position: absolute; top: 11px; left: 24px; right: 0; height: 2px; background: var(--rule); }
.stage-rail__stage:last-child::before { display: none; }
.stage-rail__stage.is-done::before { background: var(--blue); }
.stage-rail__marker { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--rule-strong); background: var(--paper); color: var(--paper); margin-bottom: var(--s-2); }
.is-done .stage-rail__marker { background: var(--blue); border-color: var(--blue); }
.is-current .stage-rail__marker { border-color: var(--brass); box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 12px var(--brass); }
.stage-rail__label { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: var(--mono-tracking); text-transform: uppercase; color: var(--navy); }
.is-todo .stage-rail__label { color: var(--slate); }
.stage-rail__state { font-size: 13px; color: var(--slate); }
.is-current .stage-rail__state { color: var(--brass); font-weight: 500; }

/* Drift rail ---------------------------------------------------------------------------- */
.drift { padding: var(--s-6); background: var(--bone); border-radius: var(--radius-panel); }
.drift__metric { margin-bottom: var(--s-5); }
.drift__rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); list-style: none; padding: 0; position: relative; }
.drift__stage { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 44px; padding-right: var(--s-3); }
.drift__stage::before { content: ""; position: absolute; top: 15px; left: 0; right: 0; height: 2px; background: var(--navy); }
.drift__stage:first-child::before { left: 7px; }
.drift__stage:last-child::before { right: auto; width: 8px; }
.drift__stage.is-empty::before { background: repeating-linear-gradient(90deg, var(--rule-strong) 0 6px, transparent 6px 12px); }
.drift__dot { position: absolute; top: 9px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--navy); }
.drift__stage:not(.is-empty) .drift__dot { background: var(--brass); border-color: var(--brass); }
.drift__label { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: var(--mono-tracking); text-transform: uppercase; color: var(--slate); }
.drift__value { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(var(--t-27), 2.6vw, 2.5rem); line-height: 1; letter-spacing: -0.02em; color: var(--navy); font-variant-numeric: lining-nums tabular-nums; }
.drift__value--none { font-family: var(--font-text); font-size: var(--t-14); letter-spacing: 0; color: var(--slate); padding-block: 10px; }
.drift__delta { position: absolute; top: 4px; left: -50%; transform: translateX(-50%); z-index: 1; background: var(--bone); }
.drift__delta.chip--serious { background: var(--serious); }
.drift + .table-wrap, .drift + * { margin-top: var(--s-5); }
@media (max-width: 760px) {
  .drift { padding: var(--s-5); }
  .drift__rail { grid-auto-flow: row; }
  .drift__stage { padding: 0 0 var(--s-6) 32px; }
  .drift__stage::before { top: 0; bottom: 0; left: 6px; right: auto; width: 2px; height: auto; }
  .drift__stage:first-child::before { left: 6px; top: 8px; }
  .drift__stage:last-child::before { width: 2px; bottom: auto; height: 8px; }
  .drift__stage.is-empty::before { background: repeating-linear-gradient(180deg, var(--rule-strong) 0 6px, transparent 6px 12px); }
  .drift__dot { top: 2px; left: 0; }
  .drift__delta { position: static; transform: none; order: 10; }
}

/* Tabs ---------------------------------------------------------------------------------- */
.tabs { min-width: 0; border-bottom: 1px solid var(--rule); }
.tabs__list { position: relative; display: flex; gap: var(--s-5); list-style: none; padding: 0; overflow-x: auto; scrollbar-width: none; }
.tabs__tab { display: inline-flex; align-items: center; gap: var(--s-2); padding: 12px 0; color: var(--slate); font-weight: 500; text-decoration: none; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; }
.tabs__tab:hover { color: var(--navy); }
.tabs__tab[aria-current="page"] { color: var(--navy); box-shadow: inset 0 -2px 0 var(--blue); }
.tabs__count { font-family: var(--font-mono); font-size: 11px; padding: 0 6px; border-radius: 2px; background: var(--bone); color: var(--slate); }

/* Progress ------------------------------------------------------------------------------ */
.progress-steps { display: flex; flex-wrap: wrap; gap: var(--s-2) 0; list-style: none; padding: 0; }
.progress-steps__step { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-14); color: var(--slate); }
.progress-steps__step + .progress-steps__step::before { content: ""; width: 32px; height: 1px; background: var(--rule-strong); margin-inline: var(--s-3); }
.progress-steps__num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--rule-strong); font-family: var(--font-mono); font-size: 12px; font-weight: 500; background: var(--paper); }
.progress-steps__step.is-done { color: var(--navy); }
.progress-steps__step.is-done .progress-steps__num { background: var(--blue); border-color: var(--blue); color: var(--paper); }
.progress-steps__step.is-current { color: var(--navy); font-weight: 600; }
.progress-steps__step.is-current .progress-steps__num { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 4px var(--mist); }
.progress-steps__step.is-failed { color: var(--serious); font-weight: 600; }
.progress-steps__step.is-failed .progress-steps__num { background: var(--serious); border-color: var(--serious); color: var(--paper); }
.progress { display: grid; gap: 6px; max-width: 560px; }
.progress__bar { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 3px; background: var(--rule); overflow: hidden; }
.progress__bar::-webkit-progress-bar { background: var(--rule); }
.progress__bar::-webkit-progress-value { background: var(--blue); transition: width var(--fast) ease; }
.progress__bar::-moz-progress-bar { background: var(--blue); }
@media (max-width: 640px) {
  .progress-steps { flex-direction: column; gap: var(--s-3); }
  .progress-steps__step + .progress-steps__step::before { display: none; }
}

/* Dropzone ------------------------------------------------------------------------------ */
.dropzone { position: relative; display: grid; gap: var(--s-2); }
.dropzone__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone__label {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2); padding: var(--s-7) var(--s-5);
  text-align: center; background: var(--mist); border: 2px dashed #8EB4DE; border-radius: var(--radius-panel); cursor: pointer;
  transition: background-color var(--fast) ease, border-color var(--fast) ease;
}
.dropzone__label:hover, .dropzone.is-dragover .dropzone__label { background: #DCEBFA; border-color: var(--blue); }
.dropzone__input:focus-visible + .dropzone__label { box-shadow: var(--focus); }
.dropzone__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--paper); color: var(--blue); }
.dropzone__title { font-weight: 600; color: var(--navy); font-size: 17px; }
.dropzone__hint { color: var(--slate); }
.dropzone__choose { color: var(--blue); text-decoration: underline; }
.dropzone__files { list-style: none; padding: 0; display: grid; gap: 6px; font-size: var(--t-14); }
.dropzone__files li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 8px 12px; background: var(--bone); border-radius: var(--radius); }

/* Split pane ---------------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(320px, 5fr); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; min-height: 480px; }
.split__doc { background: var(--bone); border-right: 1px solid var(--rule); overflow: auto; max-height: calc(100vh - var(--header-h) - 48px); }
.split__panel { padding: var(--s-5); overflow: auto; max-height: calc(100vh - var(--header-h) - 48px); }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split__doc { border-right: 0; border-bottom: 1px solid var(--rule); max-height: none; }
  .split__panel { max-height: none; }
}
.page-view__bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: var(--s-2) var(--s-4); background: rgba(246, 244, 239, .95); border-bottom: 1px solid var(--rule); }
.page-view__sheet { margin: var(--s-5); padding: var(--s-6); background: var(--paper); box-shadow: var(--shadow-card); font-family: var(--font-mono); font-size: 13px; line-height: 2; min-height: 320px; }
.page-view__img { margin: var(--s-5) auto; background: var(--paper); box-shadow: var(--shadow-card); }
.quote-mark { background: rgba(138, 109, 51, .18); color: inherit; box-shadow: inset 0 -2px 0 var(--brass); padding: 0 2px; }

/* Alerts and toasts --------------------------------------------------------------------- */
.alert { display: grid; grid-template-columns: 20px 1fr; gap: var(--s-3); padding: var(--s-4); border-radius: var(--radius); border: 1px solid; font-size: 15px; }
.alert > .icon { margin-top: 2px; }
.alert__title { font-weight: 600; }
.alert__text, .alert__extra { margin-top: 2px; color: var(--ink); }
.alert ul { margin-top: 4px; padding-left: 1.2em; }
.alert--info { background: var(--mist); border-color: #B9D3EE; color: var(--navy); }
.alert--ok { background: var(--ok-tint); border-color: #B7D9C4; color: var(--ok); }
.alert--watch { background: var(--watch-tint); border-color: #E6C695; color: #7A4700; }
.alert--serious { background: var(--serious-tint); border-color: #E9B4B0; color: var(--serious); }
.toasts { position: fixed; right: var(--s-5); bottom: var(--s-5); z-index: 50; display: grid; gap: var(--s-2); width: min(420px, calc(100vw - 2 * var(--s-4))); }
.toasts--inline { position: static; width: min(420px, 100%); }
.toast {
  display: grid; grid-template-columns: 20px 1fr 28px; gap: var(--s-3); align-items: start; padding: 14px 14px 14px 16px;
  background: var(--navy); color: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-raised);
  border-left: 4px solid var(--ok); animation: toast-in 200ms var(--ease) both;
}
.toast--info { border-left-color: var(--muted-blue); }
.toast--watch { border-left-color: #E0A040; }
.toast--serious { border-left-color: #F08A82; }
.toast__icon { margin-top: 1px; }
.toast__text { font-size: 15px; }
.toast__close { display: grid; place-items: center; width: 28px; height: 28px; margin: -4px -4px 0 0; border: 0; border-radius: var(--radius); background: transparent; color: rgba(255, 255, 255, .8); }
.toast__close:hover { background: rgba(255, 255, 255, .12); color: var(--paper); }
.toast__close:focus-visible { box-shadow: 0 0 0 2px var(--paper); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .toasts { left: var(--s-4); right: var(--s-4); bottom: var(--s-4); width: auto; } }

/* Empty state --------------------------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-3); padding: var(--s-8) var(--s-5); background: var(--bone); border-radius: var(--radius); }
.empty--compact { padding: var(--s-6) var(--s-5); }
.empty__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--paper); color: var(--blue); box-shadow: 0 0 0 1px var(--rule); }
.empty__title { font-size: var(--t-27); }
.empty--compact .empty__title { font-size: var(--t-20); }
.empty__text { color: var(--slate); max-width: 52ch; }
.empty__actions { justify-content: center; margin-top: var(--s-2); }

/* Pagination ---------------------------------------------------------------------------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-5); }
.pagination__pages { display: flex; align-items: center; gap: 4px; list-style: none; padding: 0; }
.pagination__page { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: var(--radius); color: var(--navy); text-decoration: none; font-variant-numeric: tabular-nums; }
a.pagination__page:hover { background: var(--mist); }
.pagination__page[aria-current="page"] { background: var(--navy); color: var(--paper); }
.pagination__gap { color: var(--slate); padding-inline: 4px; }
.pagination__step { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); color: var(--navy); text-decoration: none; font-size: var(--t-14); font-weight: 500; }
a.pagination__step:hover { border-color: var(--navy); background: var(--mist); }
.pagination__step.is-disabled { opacity: .45; }
.pagination__summary { margin-left: auto; order: 5; font-size: var(--t-14); color: var(--slate); }
@media (max-width: 560px) { .pagination__pages { display: none; } .pagination__summary { margin: 0; order: 0; } }

/* Modal --------------------------------------------------------------------------------- */
.modal { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 24px 64px rgba(11, 31, 77, .3); color: var(--ink); }
.modal::backdrop { background: rgba(11, 31, 77, .55); }
.modal[open] { animation: toast-in 160ms var(--ease) both; }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-4) var(--s-4) var(--s-5); border-bottom: 1px solid var(--rule); }
.modal__title { font-size: var(--t-20); line-height: 1.3; }
.modal__body { padding: var(--s-5); display: grid; gap: var(--s-4); }

/* Auth ---------------------------------------------------------------------------------- */
.auth-page { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: var(--s-7) var(--gutter); background: var(--bone);
  background-image: linear-gradient(rgba(11, 31, 77, .045) 1px, transparent 1px); background-size: 100% 32px; }
.auth-card { width: min(440px, 100%); padding: clamp(var(--s-5), 5vw, var(--s-7)); background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-raised); display: grid; gap: var(--s-4); }
.auth-card__brand { margin-bottom: var(--s-2); }
.auth-card__title { font-size: var(--t-36); }
.auth-card__lede { color: var(--slate); margin-top: calc(-1 * var(--s-2)); }
.auth-card__form { --stack: var(--s-4); margin-top: var(--s-2); }
.auth-card__form .btn { margin-top: var(--s-5); }
.auth-card__note { display: flex; gap: var(--s-2); align-items: flex-start; font-size: 13px; color: var(--slate); padding-top: var(--s-4); border-top: 1px solid var(--rule); }
.auth-card__note .icon { margin-top: 2px; }
.auth .site-footer { display: none; }

/* Style guide --------------------------------------------------------------------------- */
.sg { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s-7); align-items: start; }
.sg__toc { position: sticky; top: calc(var(--header-h) + var(--s-5)); max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; }
.sg__toc ol { list-style: none; padding: 0; margin-top: var(--s-3); display: grid; gap: 2px; }
.sg__toc a { display: block; padding: 4px 10px; border-left: 2px solid var(--rule); color: var(--slate); text-decoration: none; font-size: var(--t-14); }
.sg__toc a:hover { color: var(--navy); border-left-color: var(--blue); }
.sg__section { padding-block: var(--s-6); border-top: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
.sg__section:first-child { padding-top: 0; border-top: 0; }
.sg__title { font-size: var(--t-27); }
.sg__code { margin: 0; padding: var(--s-3) var(--s-4); background: var(--bone); border-radius: var(--radius); font-family: var(--font-mono); font-size: 12px; line-height: 1.7; color: var(--slate); white-space: pre-wrap; overflow-wrap: anywhere; }
.sg__on-blue { padding: var(--s-5); background: var(--blue); border-radius: var(--radius); --cluster: var(--s-5); }
.sg__form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
.sg__form > .radio-cards, .sg__form > .check { grid-column: 1 / -1; }
.sg__subnav .subnav { border-radius: var(--radius); }
.sg__subnav .container { padding-inline: var(--s-5); }
.sg__section .dark-band { border-radius: var(--radius); }
.sg__section .demo-ribbon { border-radius: 0 0 var(--radius) var(--radius); }
.swatches { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s-4); }
.swatch { display: grid; gap: 2px; font-size: var(--t-14); }
.swatch__chip { height: 64px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px rgba(11, 31, 77, .12); margin-bottom: var(--s-2); }
.swatch__name { font-weight: 600; color: var(--navy); }
.swatch__hex { color: var(--slate); font-size: 12px; }
.swatch__use { color: var(--slate); font-size: 13px; }
.type-specimen { display: grid; gap: var(--s-4); }
.icon-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.icon-grid li { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-2); color: var(--navy); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.icon-grid code { font-size: 11px; color: var(--slate); }
@media (max-width: 960px) { .sg { grid-template-columns: minmax(0, 1fr); } .sg__toc { position: static; max-height: none; } .sg__toc ol { display: flex; flex-wrap: wrap; gap: 4px; } .sg__toc a { border: 1px solid var(--rule); border-radius: 999px; } }
@media (max-width: 640px) { .sg__form { grid-template-columns: 1fr; } }

/* HTMX swaps ---------------------------------------------------------------------------- */
.swap { transition: opacity var(--fast) ease; }
.swap.htmx-added { opacity: 0; }
.htmx-request .btn[type="submit"] { opacity: .7; }

/* Utilities (last, so they win over component display rules) ----------------------------- */
@media (max-width: 860px) { .hide-sm { display: none; } }
