/* SimAU components: plain and warm.
   Load after tokens.css. Every colour, space and radius is a token; nothing here
   redeclares a token's --name. Class names start with sa- so they never collide
   with page styles. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 30px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--font-sans); font-weight: 700; color: var(--text-primary); }
h1 { font-size: 32px; line-height: 40px; }
h2 { font-size: 26px; line-height: 34px; }
h3 { font-size: 22px; line-height: 30px; }
h4 { font-size: 18px; line-height: 28px; }
p { margin: 0; }

a { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-control); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }

code, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.sa-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Page and Section ---------- */
.sa-page { max-width: 72rem; margin: 0 auto; padding: var(--space-7) var(--space-6) var(--space-8); }
.sa-page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4) var(--space-5); margin-bottom: var(--space-6); }
.sa-page-header__text { min-width: 0; max-width: var(--content-measure); }
.sa-page-header__title { margin: 0; font-size: 32px; line-height: 40px; font-weight: 700; }
.sa-page-header__lede { margin-top: var(--space-2); color: var(--text-secondary); font-size: 20px; line-height: 32px; }

.sa-section {
  display: grid;
  grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
  gap: var(--space-4) var(--space-7);
  padding-block: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}
.sa-section--stacked { grid-template-columns: minmax(0, 1fr); }
.sa-section__head { min-width: 0; }
.sa-section__title { margin: 0; font-size: 22px; line-height: 30px; font-weight: 700; }
.sa-section__desc { margin-top: var(--space-2); color: var(--text-secondary); font-size: 16px; line-height: 26px; }
.sa-section__body { min-width: 0; display: flex; flex-direction: column; gap: var(--space-5); }

@media (max-width: 900px) {
  .sa-section { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .sa-page { padding: var(--space-5) var(--space-4) var(--space-7); }
  .sa-page-header__title { font-size: 26px; line-height: 34px; }
  .sa-page-header__lede { font-size: 18px; line-height: 30px; }
}

/* ---------- Button ---------- */
.sa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font: inherit; font-size: 18px; line-height: 24px; font-weight: 700;
  text-align: center; text-decoration: none;
  cursor: pointer;
}
.sa-btn--primary { background: var(--action); border-color: var(--action); color: var(--on-action); }
.sa-btn--primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.sa-btn--secondary { border-color: var(--border-control); }
.sa-btn--secondary:hover { background: var(--surface-muted); }
.sa-btn--quiet { color: var(--text-secondary); font-weight: 400; padding-inline: var(--space-3); }
.sa-btn--quiet:hover { color: var(--text-primary); background: var(--surface-muted); }
.sa-btn--danger { background: var(--danger-surface); border-color: var(--danger); color: var(--danger); }
.sa-btn--danger:hover { background: var(--surface-muted); }
.sa-btn:disabled,
.sa-btn[aria-disabled="true"] {
  background: transparent;
  border: 1px dashed var(--border-control);
  color: var(--text-muted);
  font-weight: 400;
  cursor: not-allowed;
}
.sa-btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.sa-btn-reason { color: var(--text-secondary); font-size: 16px; line-height: 26px; max-width: var(--content-measure); }

@media (max-width: 640px) {
  .sa-btn-row--stack-on-mobile { flex-direction: column; align-items: stretch; }
}

/* ---------- Field ---------- */
.sa-field { display: flex; flex-direction: column; gap: var(--space-2); max-width: 30rem; }
.sa-field__label { font-size: 16px; line-height: 24px; font-weight: 700; color: var(--text-primary); }
.sa-field__hint { color: var(--text-secondary); font-size: 16px; line-height: 26px; }
.sa-field__error { color: var(--danger); font-size: 16px; line-height: 26px; font-weight: 700; }
.sa-input {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  font: inherit; font-size: 18px; line-height: 28px;
}
.sa-input::placeholder { color: var(--text-muted); opacity: 1; }
.sa-input[aria-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.sa-input:disabled { background: transparent; border-style: dashed; color: var(--text-muted); cursor: not-allowed; }
.sa-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
textarea.sa-input { min-height: 7rem; resize: vertical; }

/* ---------- Status ---------- */
.sa-status {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 16px; line-height: 24px; font-weight: 700;
  white-space: nowrap;
}
.sa-status::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sa-status--ready, .sa-status--passed { background: var(--success-surface); color: var(--success); }
.sa-status--checking { background: var(--warning-surface); color: var(--warning); }
.sa-status--checking::before { background: transparent; border: 2px solid currentColor; width: 10px; height: 10px; }
.sa-status--failed { background: var(--danger-surface); color: var(--danger); }
.sa-status--failed::before { border-radius: 1px; transform: rotate(45deg); }
.sa-status--pending::before { background: transparent; border: 2px solid currentColor; width: 10px; height: 10px; }
.sa-status--unavailable { color: var(--text-muted); }
.sa-status--unavailable::before { width: 10px; height: 2px; border-radius: 1px; }

/* ---------- Notice ---------- */
.sa-notice {
  display: flex; flex-direction: column; gap: var(--space-1);
  max-width: var(--content-measure);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  color: var(--text-primary);
}
.sa-notice__title { margin: 0; font-size: 18px; line-height: 28px; font-weight: 700; }
.sa-notice__body { color: var(--text-primary); font-size: 16px; line-height: 26px; }
.sa-notice__actions { margin-top: var(--space-3); }
.sa-notice--info { background: var(--info-surface); }
.sa-notice--info .sa-notice__title { color: var(--info); }
.sa-notice--success { background: var(--success-surface); }
.sa-notice--success .sa-notice__title { color: var(--success); }
.sa-notice--warning { background: var(--warning-surface); }
.sa-notice--warning .sa-notice__title { color: var(--warning); }
.sa-notice--danger { background: var(--danger-surface); }
.sa-notice--danger .sa-notice__title { color: var(--danger); }

/* ---------- Top navigation ---------- */
.sa-topnav {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-base);
}
.sa-topnav__brand { margin-right: var(--space-3); color: var(--text-primary); font-size: 20px; line-height: 28px; font-weight: 700; text-decoration: none; }
.sa-topnav__brand.sa-wordmark { line-height: 1; padding-block: var(--space-2); }
.sa-topnav__links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: 0; padding: 0; list-style: none; }
.sa-topnav__link {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 18px; text-decoration: none;
}
.sa-topnav__link:hover { color: var(--text-primary); background: var(--surface-muted); }
.sa-topnav__link[aria-current="page"] { color: var(--text-primary); font-weight: 700; box-shadow: inset 0 -2px 0 var(--text-secondary); border-radius: 0; }
.sa-topnav__end { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); color: var(--text-muted); font-size: 16px; line-height: 24px; }

@media (max-width: 640px) {
  .sa-topnav { padding: var(--space-2) var(--space-4); }
  .sa-topnav > nav { order: 3; width: 100%; min-width: 0; }
  .sa-topnav__links { overflow-x: auto; flex-wrap: nowrap; }
}

/* ---------- Breadcrumbs ---------- */
.sa-crumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); margin: 0; padding: 0; list-style: none; font-size: 16px; line-height: 26px; color: var(--text-secondary); }
.sa-crumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--text-muted); }
.sa-crumbs a { color: var(--text-secondary); }
.sa-crumbs [aria-current="page"] { color: var(--text-primary); }

/* ---------- Section navigation (segmented) ---------- */
.sa-segnav {
  display: flex; gap: var(--space-1);
  width: max-content; max-width: 100%;
  padding: var(--space-1);
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}
.sa-segnav__link {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 18px; text-decoration: none; white-space: nowrap;
}
.sa-segnav__link:hover { color: var(--text-primary); }
.sa-segnav__link[aria-current="page"] { background: var(--surface-raised); color: var(--text-primary); font-weight: 700; }

/* ---------- Table ---------- */
.sa-table-wrap { max-width: 100%; overflow-x: auto; }
.sa-table { width: 100%; border-collapse: collapse; font-size: 18px; line-height: 28px; }
.sa-table caption { padding-bottom: var(--space-3); text-align: left; color: var(--text-secondary); font-size: 16px; line-height: 26px; }
.sa-table th, .sa-table td { padding: var(--space-4) var(--space-5) var(--space-4) 0; border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: top; }
.sa-table th { padding-block: var(--space-3); color: var(--text-secondary); font-size: 16px; line-height: 24px; font-weight: 700; }
.sa-table th:last-child, .sa-table td:last-child { padding-right: 0; }
.sa-table .sa-table__primary { min-width: 14rem; }
.sa-table .sa-table__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sa-table__sub { display: block; margin-top: var(--space-1); color: var(--text-secondary); font-size: 16px; line-height: 24px; }

@media (max-width: 640px) {
  .sa-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sa-table--stack tr { display: block; padding: var(--space-4) 0; border-bottom: 1px solid var(--border-subtle); }
  .sa-table--stack td { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-1) 0; border: 0; text-align: left; }
  .sa-table--stack td::before { content: attr(data-label); color: var(--text-secondary); font-size: 16px; }
  .sa-table--stack td.sa-table__primary { display: block; min-width: 0; padding-bottom: var(--space-2); }
  .sa-table--stack td.sa-table__primary::before { content: none; }
}

/* ---------- Check list ---------- */
.sa-checklist { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border-subtle); }
.sa-checklist__item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.sa-checklist__name { font-size: 18px; line-height: 28px; }
.sa-checklist__hint { flex-basis: 100%; color: var(--text-secondary); font-size: 16px; line-height: 26px; }

/* ---------- Steps ---------- */
.sa-steps { margin: 0; padding: 0; list-style: none; counter-reset: sa-step; }
.sa-step { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-4); padding-bottom: var(--space-6); }
.sa-step:last-child { padding-bottom: 0; }
.sa-step::before {
  counter-increment: sa-step;
  content: counter(sa-step);
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 2px solid var(--border-control);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 16px; font-weight: 700;
}
.sa-step::after { content: ""; position: absolute; left: 19px; top: 48px; bottom: var(--space-2); width: 2px; background: var(--border-subtle); }
.sa-step:last-child::after { display: none; }
.sa-step--done::before { content: "\2713"; border-color: var(--success); background: var(--success-surface); color: var(--success); }
.sa-step--current::before { border-color: var(--action); background: var(--action); color: var(--on-action); }
.sa-step__title { margin: 0; padding-top: 5px; font-size: 20px; line-height: 30px; font-weight: 700; }
.sa-step--upcoming .sa-step__title { color: var(--text-secondary); }
.sa-step__state { color: var(--text-secondary); font-size: 16px; line-height: 26px; }
.sa-step__body { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-4); }

/* ---------- Drawer ---------- */
.sa-drawer {
  display: flex; flex-direction: column;
  width: min(34rem, 100vw); max-width: 100vw;
  padding: 0;
  border: 0;
  background: var(--surface-raised);
  color: var(--text-primary);
}
dialog.sa-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100%; max-height: 100%; box-shadow: var(--shadow-overlay); }
dialog.sa-drawer:not([open]) { display: none; }
dialog.sa-drawer::backdrop { background: var(--scrim); }
.sa-drawer--inline { width: 100%; max-width: 34rem; border-radius: var(--radius-lg); }
.sa-drawer__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); padding: var(--space-6) var(--space-6) var(--space-4); }
.sa-drawer__title { margin: 0; font-size: 26px; line-height: 34px; font-weight: 700; }
.sa-drawer__desc { margin-top: var(--space-2); color: var(--text-secondary); font-size: 16px; line-height: 26px; }
.sa-drawer__body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-5); padding: 0 var(--space-6) var(--space-6); }
.sa-drawer__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-subtle); }

@media (max-width: 640px) {
  .sa-drawer__head { padding: var(--space-5) var(--space-4) var(--space-3); }
  .sa-drawer__body { padding: 0 var(--space-4) var(--space-5); }
  .sa-drawer__foot { padding: var(--space-3) var(--space-4); }
}

/* ---------- Empty state ---------- */
.sa-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); max-width: var(--content-measure); padding-block: var(--space-6); }
.sa-empty__title { margin: 0; font-size: 22px; line-height: 30px; font-weight: 700; }
.sa-empty__text { color: var(--text-secondary); }
.sa-empty__actions { margin-top: var(--space-2); }

/* ---------- Progress ---------- */
.sa-progress { display: flex; flex-direction: column; gap: var(--space-2); max-width: var(--content-measure); }
.sa-progress__label { color: var(--text-secondary); font-size: 16px; line-height: 26px; }
.sa-progress__track { height: 8px; overflow: hidden; border-radius: var(--radius-pill); background: var(--surface-muted); }
.sa-progress__bar { height: 100%; border-radius: inherit; background: var(--text-secondary); }
.sa-progress--indeterminate .sa-progress__bar { width: 35%; }

/* ---------- Wordmark ---------- */
/* A site's name in Black Ops One: plain letters in wordmark-ink, one green letter,
   one gold metal letter (brighter in dark), all struck with a lit top edge
   and a pressed bottom edge. Edges are in em so they scale with the size. */
.sa-wordmark {
  display: inline-flex; align-items: baseline;
  font-family: var(--font-display);
  font-size: 64px; line-height: 1; font-weight: 400;
  letter-spacing: 0; white-space: nowrap;
  text-decoration: none;
}
.sa-wordmark--sm { font-size: 28px; }
.sa-wordmark--lg { font-size: clamp(48px, 22vw, 120px); }
.sa-wordmark__ink {
  color: var(--wordmark-ink);
  text-shadow: -0.01em -0.01em 0 var(--wordmark-ink-hi), 0.018em 0.018em 0 var(--wordmark-ink-lo);
}
.sa-wordmark__green {
  color: var(--wordmark-green);
  text-shadow: -0.01em -0.01em 0 var(--wordmark-green-hi), 0.018em 0.022em 0 var(--wordmark-green-lo);
}
.sa-wordmark__metal {
  color: transparent;
  background-image: linear-gradient(168deg,
    var(--wordmark-metal-1) 0%, var(--wordmark-metal-2) 16%, var(--wordmark-metal-3) 34%, var(--wordmark-metal-4) 47%,
    var(--wordmark-metal-5) 58%, var(--wordmark-metal-6) 76%, var(--wordmark-metal-7) 90%, var(--wordmark-metal-8) 100%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(-0.01em -0.01em 0 var(--wordmark-metal-hi)) drop-shadow(0.018em 0.022em 0 var(--wordmark-metal-lo));
}
@media (forced-colors: active) {
  .sa-wordmark__ink, .sa-wordmark__green, .sa-wordmark__metal { color: CanvasText; background: none; text-shadow: none; filter: none; }
}
a.sa-wordmark:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: var(--radius-sm); }

/* ---------- Status: info tone (invited, informational) ---------- */
.sa-status--info { background: var(--info-surface); color: var(--info); }
.sa-status--info::before { border-radius: 1px; background: transparent; border: 2px solid currentColor; width: 10px; height: 10px; }

/* ---------- Soon badge: marks a feature that is not built yet ---------- */
.sa-soon {
  display: inline-flex; align-items: center;
  padding: 0 var(--space-2);
  border: 1px dashed var(--info);
  border-radius: var(--radius-pill);
  background: var(--info-surface);
  color: var(--info);
  font-size: 16px; line-height: 22px; font-weight: 700;
  letter-spacing: 0.01em; white-space: nowrap; vertical-align: middle;
}

/* ---------- Icons: 20px single-weight outline, in currentColor ---------- */
.sa-icon { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Top bar additions: live badge and account menu ---------- */
.sa-topnav__live {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: var(--space-2); padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--success-surface); color: var(--success);
  font-size: 16px; line-height: 22px; font-weight: 700;
}
.sa-topnav__live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.sa-menu { position: relative; }
.sa-menu > summary {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-3);
  border: 1px solid var(--border-control); border-radius: var(--radius-md);
  color: var(--text-primary); font-size: 16px; cursor: pointer; list-style: none;
}
.sa-menu > summary::-webkit-details-marker { display: none; }
.sa-menu > summary::after { content: ""; width: 7px; height: 7px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.sa-menu[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.sa-menu__panel {
  position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: 20;
  min-width: 17rem; padding: var(--space-2);
  background: var(--surface-raised); color: var(--text-primary);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
  display: flex; flex-direction: column; gap: var(--space-1);
}
.sa-menu__item { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--text-primary); font-size: 18px; text-decoration: none; background: none; border: 0; font-family: inherit; text-align: left; cursor: pointer; }
.sa-menu__item:hover { background: var(--surface-muted); }
.sa-menu__group { margin: 0; padding: var(--space-2) var(--space-3); border: 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.sa-menu__group legend { padding: 0; color: var(--text-secondary); font-size: 16px; line-height: 24px; font-weight: 700; }
.sa-menu__radio { display: flex; align-items: center; gap: var(--space-3); min-height: 40px; font-size: 18px; cursor: pointer; }
.sa-menu__radio input { width: 18px; height: 18px; accent-color: var(--text-secondary); margin: 0; }

/* ---------- Shell and sidebar (Live, Instructor) ---------- */
.sa-shell { display: grid; grid-template-columns: 19rem minmax(0, 1fr); align-items: start; min-height: 100%; }
.sa-shell__main { min-width: 0; }
.sa-sidebar {
  position: sticky; top: 0;
  display: flex; flex-direction: column; gap: var(--space-5);
  padding: var(--space-6) var(--space-5);
  border-right: 1px solid var(--border-subtle);
  min-height: 100vh;
}
.sa-sidebar__head { display: flex; flex-direction: column; gap: var(--space-1); padding-bottom: var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.sa-sidebar__eyebrow { color: var(--text-secondary); font-size: 16px; line-height: 24px; }
.sa-sidebar__title { margin: 0; font-size: 22px; line-height: 30px; font-weight: 700; }
.sa-sidebar__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); color: var(--text-primary); font-size: 16px; line-height: 26px; }
.sa-sidebar__time { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.sa-sidebar__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.sa-sidebar__link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 44px; padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 18px; text-decoration: none;
}
.sa-sidebar__link:hover { color: var(--text-primary); background: var(--surface-muted); }
.sa-sidebar__link[aria-current="page"], .sa-sidebar__link[aria-current="true"] { background: var(--surface-raised); color: var(--text-primary); font-weight: 700; }
.sa-sidebar__count { color: var(--text-secondary); font-size: 16px; font-weight: 400; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .sa-shell { grid-template-columns: minmax(0, 1fr); }
  .sa-sidebar {
    position: sticky; top: 0; z-index: 10; min-height: 0;
    gap: var(--space-3); padding: var(--space-3) var(--space-4);
    border-right: 0; border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-base);
  }
  .sa-sidebar__head { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--space-3); padding-bottom: 0; border-bottom: 0; }
  .sa-sidebar__eyebrow { display: none; }
  .sa-sidebar__title { font-size: 18px; line-height: 28px; }
  .sa-sidebar__meta .sa-sidebar__extra { display: none; }
  .sa-sidebar__nav ul { flex-direction: row; gap: var(--space-1); overflow-x: auto; padding: var(--space-1); border-radius: var(--radius-lg); background: var(--surface-muted); }
  .sa-sidebar__link { white-space: nowrap; min-height: 40px; }
  .sa-sidebar__count { display: none; }
}

/* ---------- Service button: a large tile linking to an outside service ---------- */
/* The logo dominates; the name sits under it; the description is behind the "i". */
.sa-svc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); gap: var(--space-4); }
.sa-svc { position: relative; }
.sa-svc__link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3);
  min-height: 12rem; height: 100%;
  padding: var(--space-6) var(--space-4) var(--space-5);
  border: 1px solid var(--border-control); border-radius: var(--radius-lg);
  color: var(--text-primary); text-decoration: none; text-align: center;
}
a.sa-svc__link:hover { background: var(--surface-muted); }
a.sa-svc__link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sa-svc__mark { flex: none; display: grid; place-items: center; width: 88px; height: 88px; color: var(--text-primary); }
.sa-svc__mark svg { width: 80px; height: 80px; fill: currentColor; }
.sa-svc__mark svg.sa-icon { width: 72px; height: 72px; fill: none; stroke-width: 1.25; }
.sa-svc__mark img { width: 80px; height: 80px; object-fit: contain; }
.sa-svc__mark--placeholder { border: 2px dashed var(--border-control); border-radius: var(--radius-md); color: var(--text-secondary); font-size: 26px; line-height: 1; font-weight: 700; letter-spacing: 0.02em; }
.sa-svc__name { font-size: 18px; line-height: 26px; font-weight: 700; }
.sa-svc__tag { padding: 0 var(--space-2); border-radius: var(--radius-pill); font-size: 16px; line-height: 22px; font-weight: 700; }
.sa-svc__info {
  position: absolute; top: var(--space-2); right: var(--space-2); z-index: 2;
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border-control); border-radius: 50%;
  background: var(--surface-base); color: var(--text-secondary);
  font-family: var(--font-sans); font-size: 17px; font-weight: 700; font-style: italic; line-height: 1;
  cursor: help;
}
.sa-svc__info::after { content: ""; position: absolute; inset: -6px; }
.sa-svc__info:hover, .sa-svc__info:focus-visible { color: var(--text-primary); border-color: var(--text-secondary); }
.sa-svc__info:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sa-svc__tip {
  position: absolute; top: calc(var(--space-2) + 40px); left: var(--space-2); right: var(--space-2); z-index: 5;
  display: none; padding: var(--space-3);
  background: var(--surface-raised); color: var(--text-primary);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
  font-size: 16px; line-height: 24px; text-align: left;
}
.sa-svc__info:hover + .sa-svc__tip, .sa-svc__info:focus + .sa-svc__tip { display: block; }
.sa-svc--recovery .sa-svc__link { border-style: dashed; border-color: var(--warning); background: var(--warning-surface); }
.sa-svc--recovery .sa-svc__tag { color: var(--warning); border: 1px solid var(--warning); }
.sa-svc__link[aria-disabled="true"] { border-style: dashed; border-color: var(--border-subtle); color: var(--text-muted); cursor: not-allowed; }
.sa-svc__link[aria-disabled="true"] .sa-svc__mark { color: var(--text-muted); opacity: 0.55; filter: grayscale(1); }
.sa-svc__link[aria-disabled="true"] .sa-svc__tag { color: var(--text-muted); background: var(--surface-muted); }

/* ---------- Theme-only content: a logo with separate light and dark versions ---------- */

/* ---------- Choice tile: pick a kind of training ---------- */
.sa-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--space-4); }
.sa-choice {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--border-control); border-radius: var(--radius-lg);
  color: var(--text-primary); text-decoration: none;
}
a.sa-choice:hover { background: var(--surface-muted); }
.sa-choice__title { margin: 0; font-size: 22px; line-height: 30px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sa-choice__text { color: var(--text-secondary); }
.sa-choice__meta { color: var(--text-secondary); font-size: 16px; line-height: 26px; }
.sa-choice__go { margin-top: var(--space-2); display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 700; }
.sa-choice--live { border: 2px solid var(--success); background: var(--success-surface); gap: var(--space-3); padding: var(--space-6); }
.sa-choice--live .sa-choice__text { color: var(--text-primary); }
.sa-choice[aria-disabled="true"] { border-style: dashed; color: var(--text-muted); }
.sa-choice[aria-disabled="true"] .sa-choice__text { color: var(--text-muted); }

/* ---------- Detail list ---------- */
.sa-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-5); margin: 0; }
.sa-dl dt { color: var(--text-secondary); font-size: 16px; line-height: 30px; }
.sa-dl dd { margin: 0; }

/* ---------- Motion: only when the person has not asked for less ---------- */
@media (prefers-reduced-motion: no-preference) {
  .sa-btn, .sa-topnav__link, .sa-segnav__link { transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease; }
  .sa-status--checking::before { animation: sa-breathe 1.6s ease-in-out infinite; }
  .sa-progress--indeterminate .sa-progress__bar { animation: sa-slide 1.8s ease-in-out infinite; }
  @keyframes sa-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
  @keyframes sa-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
}
@media (prefers-reduced-motion: reduce) {
  .sa-progress--indeterminate .sa-progress__bar { width: 100%; opacity: 0.5; }
}
