/* Sál North Design System — vanilla component classes.
   ==================================================================
   The canonical components in `components/` are React (JSX). Our sites are
   plain HTML served by staticserve.py with no build step, so this file ports
   the same components to plain CSS classes. Same tokens, same look — no React,
   no bundler.

   Link it AFTER styles.css:

     <link rel="stylesheet" href="/design-system/styles.css" />
     <link rel="stylesheet" href="/design-system/components.css" />

   Everything below is built only from tokens, so `data-theme="light"` inverts
   the whole set with no extra markup. Keep this file in sync with the JSX in
   `components/` — they are two renderings of one system.
   ================================================================== */

/* ---------- Layout helpers (the editorial page rhythm) ---------- */

.sal-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--space-6);
  box-sizing: border-box;
}
.sal-prose { max-width: var(--container-prose); }

/* Full section, breathing at the brand's generous vertical rhythm. */
.sal-section { padding-block: var(--space-9); }

/* The signature gold hairline that opens a section. */
.sal-section--ruled { border-top: 1px solid var(--rule-gold); }

/* Optional warm radial wash + film grain — make an ink page feel lit, not
   flat. Put .sal-atmosphere on a positioned wrapper; both layers are fixed,
   behind content, and never intercept clicks.

   Also the page shell every site shares: a full-height flex column so the
   footer pins to the bottom of the viewport even on short pages (main takes
   the slack). Used to be copy-pasted into each site's <style>; now it's here. */
.sal-atmosphere {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sal-atmosphere > main { flex: 1 0 auto; }
.sal-atmosphere::before,
.sal-atmosphere::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.sal-atmosphere::before { background: var(--atmosphere); }
.sal-atmosphere::after {
  background-image: var(--grain-image);
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
}
/* Content must sit above the two fixed layers. */
.sal-atmosphere > * { position: relative; z-index: var(--z-base); }

/* ---------- Brand ---------- */

/* The logo. "SÁL" in Cormorant, deep ember, lightly tracked.
   Weight 500 is not a stylistic choice — it is the weight the wordmark SVG
   was outlined from, so this renders the same letterforms as the file.

     <a class="sal-wordmark" href="/">SÁL</a>
     <a class="sal-wordmark" href="/">SÁL<i class="sal-wordmark__suffix">-test</i></a>

   The suffix names the surface you're on (-test, -huginn, -assets …) in the
   muted grey, so the mark itself stays the constant across every site.
   New identity: ink, Libre Franklin bold, tight — as the home page sets it.
   The logo itself is still open (design/logo-prompt.md). */
.sal-wordmark {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}
/* The same trap the button variants hit further down (see the note on
   .sal-btn--*:visited): the base palette's `a:visited` is element + pseudo-class,
   which out-specifies a single class — so on every page whose "/" the reader had
   already visited, the mark painted --accent instead of the deep logo orange
   reserved to it. It is invisible to getComputedStyle, which reports the
   unvisited colour for privacy, so it only shows up in a screenshot; and because
   the visited restyle races the first paint it showed up INTERMITTENTLY, which is
   what finally gave it away. Restate the colour at :visited specificity. */
.sal-wordmark:visited { color: var(--text-primary); }

.sal-wordmark--sm { font-size: 1.15rem; }
.sal-wordmark--lg { font-size: 2.3rem; }
.sal-wordmark--xl { font-size: 3.75rem; }

/* Lowercase, unitalicised despite the <i> — the tag is for brevity in markup.
   Jost, not Cormorant: the suffix names a surface, it is not part of the mark,
   so it switches to the UI face in quiet gold and light weight — but at the
   mark's own size, so the lockup reads as one word, not a mark with a footnote.
   The negative margin cancels the trailing letter-space Cormorant adds after
   the "L", so "-test" tucks against it. */
.sal-wordmark__suffix {
  margin-left: 0;
  font-family: var(--font-body);
  font-style: normal;
  font-weight: var(--fw-regular);
  letter-spacing: -0.01em;
  color: var(--text-muted);
}

/* Eyebrow / overline. `.eyebrow` itself lives in tokens/base.css; this is the
   roman-numeral lockup: <p class="eyebrow"><span class="num">I</span>Format</p> */

/* ---------- Actions ---------- */

/* display:inline-flex would otherwise defeat the hidden attribute —
   same guard the scrim has. */
.sal-btn[hidden] { display: none; }
.sal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  /* Fixed heights, as in the webapp-template: 36px (sm 32, lg 40), border
     included, so a button and a field side by side are the same height. */
  box-sizing: border-box;
  min-height: 36px;
  /* The webapp-template's Button: 36px tall, 16px each side (px-4), 14px
     type. An icon at the start gets 12px (has-[>svg]:px-3, see :has(> svg)
     below). Inside a menu or popover a button is the template's sm: 32px and
     12px (see «compact» below). */
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-normal);
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-sm); /* buttons are NEVER pill — chips only */
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  /* Colour is the slow, ambient half and keeps the brand's 350ms fade. The
     TRANSFORM is not ambient: it is the answer to a pointer-down, and at
     350ms/ease-standard the 1px nudge below arrived long after the finger did
     — the one place in the estate where "calm" reads as lag. Split out at
     --dur-press with a strong ease-out, so the press is felt on the way down
     and the release is just as quick. */
  transition:
    background var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    transform var(--dur-press) var(--ease-out);
}
.sal-btn:active { transform: translateY(1px); }
.sal-btn:disabled,
.sal-btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.sal-btn--sm { min-height: 36px; padding: 0 16px; font-size: var(--fs-body-sm); }
.sal-btn--lg { min-height: 36px; padding: 0 16px; font-size: var(--fs-body-sm); }
/* Compact: a button inside a menu or popover (the account menu, a row's
   «…», the calendar) is the template's sm — 32px, 12px each side — so it sits
   in the panel the way «Logg ut» does instead of filling it. */
:is(.sal-settings__menu, .sal-menu, .sal-cal, .sal-toast) .sal-btn { min-height: 32px; padding: 0 12px; }
/* ONE button size (August, 14 Nov 2026): small and large buttons beside
   default ones read as a mismatch («Lag rapport» bigger than «Ny runde»), so
   --sm and --lg are kept as names only and draw the default 36px button. */
/* An icon at the start: as far from the side as from the top and bottom. */
/* Icons in buttons are 16px (the webapp-template's size-4): one size, so the
   inset below holds for all of them. */
.sal-btn > svg { flex: none; width: 16px; height: 16px; }
.sal-btn:has(> svg) { padding-left: 12px; }   /* the template's has-[>svg]:px-3 */
/* …or at the end (an arrow after the words): mark the button --icon-end. */
.sal-btn.sal-btn--icon-end:has(> svg) { padding-left: 16px; padding-right: 12px; }
.sal-btn--block { width: 100%; }

/* One primary (ember) action per view. */
.sal-btn--primary {
  background: var(--accent);
  color: var(--text-on-ember);
  /* Flat, like the rest of the UI: no button casts a shadow. */
  box-shadow: none;
  /* The one call to action: one step bolder than a normal button (regular). */
  font-weight: var(--fw-medium);
}
.sal-btn--primary:hover { background: var(--accent-hover); color: var(--text-on-ember); }
.sal-btn--primary:active { background: var(--accent-active); }

.sal-btn--secondary {
  /* A NORMAL button (the webapp-template's outline variant): filled a step off
     the page, so it reads as a button without competing with the primary. */
  background: var(--control-bg);
  color: var(--text-primary);
  border-color: var(--border-soft);
}
.sal-btn--secondary:hover { background: var(--control-bg-hover); color: var(--text-primary); }

.sal-btn--gold {
  background: var(--gold-500);
  color: var(--text-on-gold);
}
.sal-btn--gold:hover { background: var(--gold-600); color: var(--text-on-gold); }

.sal-btn--ghost {
  /* A normal button. There are two looks, primary (ink) and normal (filled a
     step off the page, hairline edge); an outline-only third read as a
     different, lesser control beside them (August, 14 Nov 2026). The class
     stays because a hundred call sites name it. */
  background: var(--control-bg);
  color: var(--text-primary);
  border-color: var(--border-soft);
}
.sal-btn--ghost:hover { background: var(--control-bg-hover); color: var(--text-primary); }

/* Anchors styled as buttons: the base link palette's `a:visited` (element +
   pseudo-class) out-specifies a single variant class, which painted visited
   primary links ember-on-ember — text invisible until hover. Restate each
   variant's text color at .class:visited specificity so <a> and <button>
   render identically. */
.sal-btn--primary:visited { color: var(--text-on-ember); }
.sal-btn--secondary:visited { color: var(--text-primary); }
.sal-btn--gold:visited { color: var(--text-on-gold); }
.sal-btn--ghost:visited { color: var(--text-primary); }

/* Square icon-only control. Always give it an aria-label. */
.sal-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard),
              transform var(--dur-press) var(--ease-out);
}
/* Anchors styled as icon buttons hit the same `a:visited` trap as .sal-btn
   above: a visited <a class="sal-icon-btn"> went ember. Restated before
   :hover so hover still wins; the variants restate theirs below. */
.sal-icon-btn:visited { color: var(--text-secondary); }
.sal-icon-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
/* Press parity with .sal-btn. An icon button is the same affordance with the
   label taken out — the close, the cog, the kebab — and it was the one
   pressable control in the file that did not move under the finger. */
.sal-icon-btn:active { transform: translateY(1px); }
.sal-icon-btn--sm { width: 32px; height: 32px; }
.sal-icon-btn--lg { width: 48px; height: 48px; }
.sal-icon-btn--solid { background: var(--accent); color: var(--text-on-ember); }
.sal-icon-btn--solid:hover { background: var(--accent-hover); color: var(--text-on-ember); }
.sal-icon-btn--outline { border-color: var(--border-strong); color: var(--text-primary); }
.sal-icon-btn--solid:visited { color: var(--text-on-ember); }
.sal-icon-btn--outline:visited { color: var(--text-primary); }

/* ---------- Display ---------- */

.sal-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  overflow: hidden;
  /* --dur-fast, not --dur-base: this is HOVER feedback, and the note at
     --dur-base's own token calls 350ms the hover tier. At 600ms the lift was
     still travelling after the pointer had moved on, which reads as lag rather
     than as calm — the one thing this brand's motion is not allowed to be. */
  transition:
    transform var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard);
}
.sal-card--plain { border-color: transparent; }
.sal-card--elevated {
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
}
/* A card that must stay OPAQUE whatever the theme. Use it for anything whose
   correctness depends on the surface being a flat known colour — above all a
   chart: charts.css fakes a punched hole four times over by painting
   var(--bg-page) inside a thick border, and on a translucent plate that hole
   fills with whatever is behind it and stops reading as a notch. A gauge
   marker that reads wrong is a data error, not a styling one.

   --surface-card, not a hard-coded ink: dark and light both already point it at
   an opaque colour, so in those two this class is deliberately a no-op. Only a
   TRANSLUCENT theme has anything to say here, and tokens/glass.css says it
   (--glass-solid-plate). It shipped as var(--ink-600), which was right in the
   two themes that existed and would have painted a near-black card on a cream
   page the first time anybody used the class in light mode. */
.sal-card--solid { background: var(--surface-card); }
/* Feature card — 2px gold top rule. */
.sal-card--accent::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold-500);
}
.sal-card--interactive { cursor: pointer; }
/* Gated, because this hover MOVES the card. A touch device fires :hover on tap
   and holds it until the next tap lands somewhere else, so on a phone the card
   you last touched stayed lifted 3px above its row with the large shadow under
   it — a card that looks permanently picked up. Colour-only hovers elsewhere in
   this file can flash harmlessly; a displacement cannot. */
@media (hover: hover) and (pointer: fine) {
  .sal-card--interactive:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-soft);
  }
}

/* Responsive grid of cards. auto-fit so a few cards stretch to fill the row
   while many wrap to a tidy multi-column layout; collapses to one column when
   the tracks no longer fit. Replaces the hand-rolled grids in the dashboard,
   file browser, and test catalog. */
.sal-card-grid {
  display: grid;
  /* Tune column density per surface with --card-min (default 260px); a denser
     file browser can drop it, a two-up dashboard can raise it. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--card-min, 260px)), 1fr));
  gap: var(--space-5);
}

/* Status label. Pill radius is allowed here (chips/tags/badges only).
   One custom property (--badge-hue) drives the whole anatomy: a tinted
   field, an outline in the hue, a dot in the pure hue, and text washed
   toward cream on ink. Light mode re-mixes the same hue the other way —
   dark outline, pastel field, near-ink text — so every variant stays
   legible on cream without per-variant overrides. */
/* Tag (badge) — a small label on a row or card: a status, a count, a team.
   The webapp-template's Badge: a FILL, never an outline (an edge made it read
   as a button), one size (22 px, caption type). Neutral by default; a hue
   variant tints fill and text (--success, --warning, --danger, --ember, --gold).

     <span class="sal-badge">Kommende</span>
     <span class="sal-badge sal-badge--success"><span class="sal-badge__dot"></span>Aktiv</span>

   Inside a narrow cell it truncates: put the text in a child <span> or <a>. */
.sal-badge {
  --badge-hue: var(--text-muted);
  --badge-bg: color-mix(in srgb, var(--text-primary) 7%, transparent);
  --badge-fg: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  min-height: 22px;
  padding: 0 8px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-normal);
  line-height: 1.4;
  white-space: nowrap;
}
/* the class's display would otherwise beat the UA's [hidden] rule */
.sal-badge[hidden] { display: none; }
.sal-badge > :is(span, a):not(.sal-badge__dot) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sal-badge > svg { width: 12px; height: 12px; flex: none; }
.sal-badge__dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--badge-hue); }
.sal-badge--ember   { --badge-hue: var(--ember-500); }
.sal-badge--gold    { --badge-hue: var(--gold-500); }
.sal-badge--success { --badge-hue: var(--success); }
.sal-badge--warning { --badge-hue: var(--warning); }
.sal-badge--danger  { --badge-hue: var(--danger); }
:is(.sal-badge--ember, .sal-badge--gold, .sal-badge--success, .sal-badge--warning, .sal-badge--danger) {
  --badge-bg: color-mix(in srgb, var(--badge-hue) 14%, transparent);
  --badge-fg: color-mix(in srgb, var(--badge-hue) 55%, var(--text-primary));
}
:is([data-theme="light"], [data-glass-tone="white"]) :is(.sal-badge--ember, .sal-badge--gold, .sal-badge--success, .sal-badge--warning, .sal-badge--danger) {
  --badge-bg: color-mix(in srgb, var(--badge-hue) 16%, var(--surface-card));
  --badge-fg: color-mix(in srgb, var(--badge-hue) 40%, var(--text-primary));
}

/* Filter chip. */
.sal-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  letter-spacing: var(--ls-wide);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard);
}
.sal-tag:hover { background: var(--surface-hover); }
/* A selected chip keeps its fill under the pointer: the plain chip's hover
   used to paint its cream label on --surface-hover, 1.11:1 on cream. */
.sal-tag--selected,
.sal-tag--selected:hover {
  background: var(--accent);
  color: var(--text-on-ember);
  border-color: var(--accent);
}

/* Plain hairline rule. */
.sal-divider {
  border: none;
  border-top: 1px solid var(--border-hairline);
  margin: 0;
}
/* Labelled / ornamented rule: <div class="sal-divider-label"><span>Mains</span></div> */
.sal-divider-label {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.sal-divider-label::before,
.sal-divider-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-hairline);
}
.sal-divider-label > span {
  font-family: var(--font-body);
  font-size: var(--fs-overline);
  letter-spacing: var(--ls-overline);
  text-transform: uppercase;
  color: var(--text-muted);
}
/* Gold diamond instead of a label. */
.sal-divider-ornament > span {
  width: 6px;
  height: 6px;
  background: var(--gold-500);
  transform: rotate(45deg);
}

/* ---------- Forms ---------- */

.sal-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* the class's display would otherwise beat the UA's [hidden] rule */
.sal-field[hidden] { display: none; }
.sal-label {
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
}
.sal-input,
.sal-textarea,
.sal-select {
  width: 100%;
  box-sizing: border-box;
  background: var(--control-bg);   /* the control surface, like a button: a recessed dark well read as too heavy */
  color: var(--text-primary);
  /* --field-border, not --border-soft: the line around a control is held to
     3:1 and the soft divider hairline is not. See the token. */
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  /* 36px tall with the border, like a button (the webapp-template's h-9 and
     px-3). 16px text stays: below it iOS zooms the page on focus. */
  min-height: 36px;
  padding: 5px var(--space-3);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}
/* --text-placeholder, not the bare cream-500 this used to name: cream-500 is a
   light grey, right on the ink well and wrong on light mode's --surface-inset
   (2.96:1) and on the glass theme's white tone (3.06:1). See the token. */
.sal-input::placeholder,
.sal-textarea::placeholder { color: var(--text-placeholder); }
/* Focus is a 2px edge in ink — the border plus a 1px ring of the same colour —
   the same weight as every other focus mark in the estate (a 2px outline) and
   as a selected card. It used to be the border PLUS a 3px near-opaque ring:
   4px of black, twice anything else on the page. */
.sal-input:focus,
.sal-textarea:focus,
.sal-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.sal-textarea { resize: vertical; }

/* Native select + inline chevron (stroke-matched to Lucide).

   The stroke colour has to be baked into the data URI — a data: SVG has no
   access to currentColor — so the chevron is the one mark in this file that
   cannot follow a token, and it needs saying once per theme. It was cream-400
   unconditionally until glass arrived, which meant a cream chevron on a cream
   field in light mode: present, correct, and invisible. */
.sal-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;   /* 11 + 14px chevron + 9 */
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239A9A9A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  /* A closed dropdown is a button that opens a list: the normal-button fill
     and the normal-button edge, not a text field's. */
  background-color: var(--control-bg);
  border-color: var(--border-soft);
}
/* Ink at 66%, the same weight --text-muted carries on cream. The glass theme's
   white tone is a light page too — it is not [data-theme="light"], so every
   rule in this file that means "we are on a light ground" has to name it. */
:is([data-theme="light"], [data-glass-tone="white"]) .sal-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235C5C5C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Notice — a band that stays above what it is about until that is fixed
   (a toast says what just happened and goes). Tinted all through by its hue:
   the fill, the edge, the icon and the TEXT, which is the hue pulled toward
   the theme's ink — dark amber on light, pale amber on dark — rather than
   plain black or white on a coloured ground.
     <div class="sal-notice sal-notice--warning" role="status"><svg…/><p>…</p></div>
   Hues: --warning, --danger, --success, --info. */
.sal-notice {
  --notice-hue: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--notice-hue) 30%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--notice-hue) 10%, var(--bg-page));
  color: color-mix(in srgb, var(--notice-hue) 50%, var(--text-primary));
  font-size: var(--fs-body-sm);
  line-height: var(--lh-normal);
}
.sal-notice > svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--notice-hue); }
.sal-notice p { margin: 0; }
.sal-notice a, .sal-notice a:visited { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sal-notice--warning { --notice-hue: var(--warning); }
.sal-notice--danger  { --notice-hue: var(--danger-text); }
.sal-notice--success { --notice-hue: var(--success); }
.sal-notice--info    { --notice-hue: var(--view-them); }
:is([data-theme="light"], [data-glass-tone="white"]) .sal-notice { color: color-mix(in srgb, var(--notice-hue) 45%, var(--text-primary)); }

/* Our own dropdown list (select.js). The <select> stays as the real control,
   hidden; a button with the same classes stands in front of it and opens a
   .sal-listbox, which we can style — the browser's open list we cannot. */
.sal-select--enhanced {
  position: absolute !important;
  width: 1px !important; height: 1px !important; min-height: 0 !important;
  padding: 0 !important; border: 0 !important;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; pointer-events: none;
}
.sal-select__btn {
  display: flex;
  align-items: center;
  text-align: left;
  color: var(--text-primary);
}
.sal-select__btn:disabled { opacity: .5; cursor: not-allowed; }
.sal-select__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sal-select__btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sal-select__btn[aria-expanded="true"] { border-color: var(--border-strong); }

/* The open list. A popover: raised surface, 12 px radius, 4 px inset, so the
   8 px option radius is concentric with it. */
.sal-listbox {
  position: fixed;
  z-index: var(--z-dialog, 1000);
  box-sizing: border-box;
  max-width: min(420px, calc(100vw - 16px));
  margin: 0;
  padding: var(--space-1);
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  outline: none;
}
.sal-listbox.is-pointer { animation: sal-listbox-in 140ms var(--ease-out); }
.sal-listbox[data-side="top"].is-pointer { animation-name: sal-listbox-in-up; }
@keyframes sal-listbox-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes sal-listbox-in-up { from { opacity: 0; transform: translateY(4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .sal-listbox.is-pointer { animation: none; } }
.sal-listbox ul { margin: 0; padding: 0; list-style: none; }
.sal-listbox__opt {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 0 var(--space-3) 0 var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.sal-listbox__opt > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sal-listbox__tick { flex: none; visibility: hidden; color: var(--text-primary); }
.sal-listbox__opt[aria-selected="true"] .sal-listbox__tick { visibility: visible; }
.sal-listbox__opt.is-active { background: var(--control-bg-hover); }
.sal-listbox__opt[aria-disabled="true"] { opacity: .45; cursor: default; }
.sal-listbox__glabel {
  padding: var(--space-2) var(--space-2) var(--space-1);
  color: var(--text-muted);
  font-size: var(--fs-caption);
}
.sal-listbox__group + .sal-listbox__group,
.sal-listbox__opt + .sal-listbox__group { margin-top: var(--space-1); border-top: 1px solid var(--border-hairline); }

/* Our own date picker (datepicker.js): the date field stays as the real
   control, hidden; a normal button with a calendar icon stands in front of it
   and opens .sal-cal, the webapp-template's Calendar (32 px days). */
.sal-date--enhanced {
  position: absolute !important;
  width: 1px !important; height: 1px !important; min-height: 0 !important;
  padding: 0 !important; border: 0 !important;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; pointer-events: none;
}
.sal-btn.sal-date { justify-content: flex-start; min-width: 11rem; font-weight: var(--fw-regular); }
.sal-btn.sal-date.is-empty .sal-date__value { color: var(--text-muted); }
.sal-cal {
  position: fixed;
  z-index: var(--z-dialog, 1000);
  box-sizing: border-box;
  padding: var(--space-3);
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
}
.sal-cal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.sal-cal__head .sal-icon-btn { width: 32px; height: 32px; }
.sal-cal__title { margin: 0; font-family: var(--font-body); font-size: var(--fs-body-sm); font-weight: var(--fw-medium); }
.sal-cal__title::first-letter { text-transform: uppercase; }
.sal-cal__grid { border-collapse: collapse; }
.sal-cal__grid th {
  width: 32px; height: 28px; padding: 0;
  color: var(--text-muted); font-size: var(--fs-caption); font-weight: var(--fw-regular); text-align: center;
}
.sal-cal__grid td { padding: 1px; text-align: center; }
.sal-cal__day {
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-primary);
  font: inherit; font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.sal-cal__day:hover { background: var(--control-bg-hover); }
.sal-cal__day:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.sal-cal__day.is-out { color: var(--text-muted); }
.sal-cal__day.is-today { background: var(--control-bg); box-shadow: inset 0 0 0 1px var(--border-soft); }
.sal-cal__day[aria-pressed="true"] { background: var(--accent); color: var(--text-on-ember, var(--bg-page)); box-shadow: none; }
.sal-cal__day:disabled { opacity: .35; cursor: not-allowed; }
.sal-cal__foot { display: flex; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border-hairline); }

/* Error state — danger is pulled off orange so it never reads as a CTA. */
.sal-input--error,
.sal-textarea--error,
.sal-select--error { border-color: var(--danger-text); }
.sal-input--error:focus,
.sal-textarea--error:focus,
.sal-select--error:focus { box-shadow: none; }

.sal-hint {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  color: var(--text-muted);
}
.sal-hint--error { color: var(--danger-text); }

/* Checkbox / radio / switch — style the native control directly so the
   markup stays a plain <input>, keeping keyboard + screen-reader behaviour. */
.sal-check {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-primary);
  cursor: pointer;
}
:is(.sal-check, .sal-table__check) input[type="checkbox"], input[type="checkbox"].sal-checkbox,
.sal-check input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  display: grid;
  place-content: center;
  background: var(--surface-inset);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
:is(.sal-check, .sal-table__check) input[type="checkbox"], input[type="checkbox"].sal-checkbox { border-radius: var(--radius-xs); }
.sal-check input[type="radio"] { border-radius: var(--radius-pill); }

/* The tick and the dot both come in from scale(0.6) under an opacity fade, not
   from scale(0): a mark that grows out of a single point reads as conjured,
   where one that fades up at nearly its own size reads as revealed. Opacity is
   what makes it absent when unchecked, so the box is still genuinely empty.
   --dur-quick, not --dur-fast: 350ms on a tick is a control that answers late,
   and a checkbox is pressed far too often to be given an entrance. */
:is(.sal-check, .sal-table__check) input[type="checkbox"]::before, input[type="checkbox"].sal-checkbox::before {
  content: "";
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: scale(0.6);
  transition: transform var(--dur-quick) var(--ease-out),
              opacity var(--dur-quick) var(--ease-out);
  background: var(--text-on-ember);
  clip-path: polygon(20% 52%, 8% 64%, 40% 94%, 92% 26%, 80% 16%, 39% 70%);
}
:is(.sal-check, .sal-table__check) input[type="checkbox"]:checked, input[type="checkbox"].sal-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}
:is(.sal-check, .sal-table__check) input[type="checkbox"]:checked::before, input[type="checkbox"].sal-checkbox:checked::before { opacity: 1; transform: scale(1); }

.sal-check input[type="radio"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  opacity: 0;
  transform: scale(0.6);
  transition: transform var(--dur-quick) var(--ease-out),
              opacity var(--dur-quick) var(--ease-out);
  background: var(--accent);
}
.sal-check input[type="radio"]:checked { border-color: var(--accent); }
.sal-check input[type="radio"]:checked::before { opacity: 1; transform: scale(1); }

.sal-check input:disabled, .sal-table__check input:disabled, .sal-checkbox:disabled { opacity: 0.45; cursor: not-allowed; }
:is(.sal-table__check, .sal-checkbox) input:focus-visible, input.sal-checkbox:focus-visible, .sal-check input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Toggle switch — the webapp-template's Switch: a 32 × 18 pill with a 14 px
   knob, no border. Off: a quiet track, the knob a step brighter. On: the
   track in ink, the knob in the page colour, so on and off differ in the
   track AND the knob.
     <label class="sal-switch"><input type="checkbox" role="switch"><span class="sal-switch__track"></span>Label</label> */
.sal-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  color: var(--text-primary);
  cursor: pointer;
}
.sal-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sal-switch__track {
  position: relative;
  flex: none;
  box-sizing: border-box;
  width: 32px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--switch-off, var(--border-strong));
  transition: background-color var(--dur-fast) var(--ease-standard);
}
/* Centred by the transform; the same transform carries the travel, so the
   knob slides on the compositor. */
.sal-switch__track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--switch-knob, #FFFFFF);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transform: translateY(-50%);
  /* --dur-quick: the knob answers a press, it does not make an entrance. */
  transition: transform var(--dur-quick) var(--ease-out), background-color var(--dur-fast) var(--ease-standard);
}
.sal-switch input:checked + .sal-switch__track { background: var(--accent); }
.sal-switch input:checked + .sal-switch__track::after { transform: translate(14px, -50%); background: var(--bg-page); }
.sal-switch input:focus-visible + .sal-switch__track { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sal-switch input:disabled + .sal-switch__track { opacity: .45; }
.sal-switch:has(input:disabled) { cursor: not-allowed; }
/* Dark: off is a dark grey track with a grey knob, not a white one. */
:root:not([data-theme="light"]):not([data-glass-tone="white"]) .sal-switch { --switch-off: var(--ink-400); --switch-knob: var(--text-secondary); }
@media (prefers-reduced-motion: reduce) { .sal-switch__track::after { transition: none; } }

/* ---------- Navigation ---------- */

/* Sticky top bar — the deliberate blur/transparency moment, shared by every
   site. Fixed height so subdomains' headers line up (change it in one place:
   --nav-height in tokens/spacing.css). Write only the wordmark and the page
   links: /design-system/theme.js appends the settings cog (.sal-settings,
   below) to the links row on its own, so there is no slot to keep. An empty
   links row is fine — the cog still lands at its right end.

     <header class="sal-nav">
       <div class="sal-container sal-nav__inner">
         <a class="sal-wordmark" href="/">SÁL</a>
         <nav class="sal-nav__links" aria-label="Hovedmeny">
           <a href="/" aria-current="page">Oversikt</a>   <!-- optional links -->
         </nav>
       </div>
     </header> */
.sal-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--nav-veil);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-gold);
  /* During the theme crossfade (theme.js's startViewTransition) the page is
     composited as one flat snapshot, which would drop the sticky bar behind
     the content scrolled under it. A named group keeps the nav on its own
     layer above the root snapshot for the duration of the animation. */
  view-transition-name: sal-nav;
}
.sal-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Wrap as whole units when the row runs out of room: the links block (with
     the theme control) drops to its own line under the wordmark rather than
     the theme orphaning onto a line of its own — so links and switcher always
     share one baseline. */
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  /* One fixed height everywhere — the bar no longer grows or shrinks with the
     nav's contents, so every subdomain's sticky header lines up. */
  min-height: var(--nav-height);
  padding-block: var(--space-3);
}
/* In the bar the mark owns the row (2.3rem in the 4.5rem bar), so the
   wordmark reads as the site's anchor, not a nav link. */
.sal-nav .sal-wordmark { font-size: 2.3rem; }

/* When the nav holds nothing but the auto-injected cog, keep the wordmark left
   and the control right. */
.sal-nav__links:empty { display: none; }
.sal-nav__links {
  display: flex;
  flex-wrap: wrap;
  /* Center, not baseline: the theme control is an icon-only box whose flex
     "baseline" is its bottom edge, so baseline-aligning text links against it
     pushed them visibly above the control's midline. */
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4) var(--space-6);
  font-size: var(--fs-caption);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  font-weight: var(--fw-light);
}
.sal-nav__links a { color: var(--text-secondary); text-decoration: none; }
.sal-nav__links a:hover { color: var(--accent); }
/* Light caps at 78% ink read washed on cream — links go full ink there;
   the gold stays with the eyebrows. */
:is([data-theme="light"], [data-glass-tone="white"]) .sal-nav__links a { color: var(--text-primary); }
/* Current page in a multi-page site's nav: ink plus one weight step, so it
   stands apart from the gold links in light and the cream links on ink. */
.sal-nav__links a[aria-current="page"] {
  color: var(--text-primary);
  font-weight: var(--fw-regular);
}

/* On phones page links + cog can't share a row with the wordmark, so center the
   whole bar into a tidy stack — wordmark, links, then the cog — instead of
   letting them wrap right-aligned and read as misaligned.

   Only a row that HAS page links needs the stack. A nav holding nothing but the
   auto-injected cog (the app sites: test, admin) fits beside the wordmark at any
   phone width, and stacking it spent a second line — a tenth of the screen — on
   one button. `> a` so the menu's own sign-out link doesn't count as a nav link. */
@media (max-width: 480px) {
  .sal-nav__inner:has(> .sal-nav__links > a) { justify-content: center; text-align: center; }
  .sal-nav__inner:has(> .sal-nav__links > a) .sal-nav__links { width: 100%; justify-content: center; }
}

/* ---- the scrolled bar ---- */

/* Once the page moves, the bar gives its height back to the content: the mark
   steps down from display size to its inline size and the row closes up. On a
   signed-in site the account button comes with it — the name line goes and the
   address carries the button next to the cog, which is what you need to see to
   know whose answers these are. theme.js sets `data-compact` (with two
   thresholds, so a page resting near the line can't flicker).

   Phones and small tablets only: this is a fix for a screen with no room to
   spare, and a desktop header that shrank as you read would be motion for its
   own sake. */
@media (max-width: 768px) {
  .sal-nav__inner {
    transition:
      min-height 180ms var(--ease-out),
      padding-block 180ms var(--ease-out);
  }
  .sal-nav .sal-wordmark { transition: font-size 180ms var(--ease-out); }
  .sal-nav[data-compact] .sal-nav__inner {
    min-height: 3rem;
    padding-block: var(--space-2);
  }
  .sal-nav[data-compact] .sal-wordmark { font-size: 1.5rem; }
  .sal-nav[data-compact] .sal-settings[data-account] .sal-settings__trigger {
    max-width: 12rem;
    padding-block: 3px;
  }
  /* Only drop the name where the address is actually showing: with no roster
     name the top line IS the address (see signed-in.js's fill), and hiding it
     would leave a button with nothing in it but the cog. */
  .sal-nav[data-compact] .sal-account__who:has(.sal-account__email:not([hidden])) .sal-account__name {
    display: none;
  }
  /* Promoted from the 11px caption line it was under the name: alone in the
     button it is the label, so it takes the name's size and tier. */
  .sal-nav[data-compact] .sal-account__email {
    font-size: var(--fs-body-sm);
    color: var(--text-secondary);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sal-nav__inner,
  .sal-nav .sal-wordmark { transition: none; }
}

/* Settings cog — the one control at the right end of the nav row, on every
   site. /design-system/theme.js builds it: a cog button whose menu holds the
   theme switcher. On login-gated sites /design-system/signed-in.js adds the
   account to that same button rather than a second one — the trigger grows the
   signed-in name over the address (`data-account`), and the menu gains the
   name, the address and sign out around the theme row. The name field is an
   input only where the site can save a rename (see test.salnorth.no's
   person.js).

     <div class="sal-settings" data-open data-account>
       <button class="sal-settings__trigger" aria-expanded="true">
         <span class="sal-account__who">          <!-- signed-in sites only -->
           <span class="sal-account__name">Abel</span>
           <span class="sal-account__email">abel@…</span>
         </span>
         <span class="sal-settings__cog">…cog svg…</span>
       </button>
       <div class="sal-settings__menu">
         …account fields…                         <!-- signed-in sites only -->
         <div class="sal-settings__theme">label + .sal-theme</div>
         …sign out…                               <!-- signed-in sites only -->
       </div>
     </div>

   It always sits last in the nav row — `order` keeps it right of the page
   links no matter where in the row the script appended it. */
.sal-settings {
  position: relative;
  order: 1;
  /* Undo the nav links' uppercase + tracking — a name reads as itself. */
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-body);
}
/* Bare, it is a square icon button — the 30px of the switcher it replaces, so
   the bar's right end keeps its old weight. */
.sal-settings__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 30px;
  height: 30px;
  padding: 0;
  /* Framed and filled at rest — a gold hairline over inset surface, so it
     reads as a control before it's touched. */
  background: color-mix(in srgb, var(--surface-inset) 55%, transparent);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  /* Buttons don't inherit type — name the family or the UA font leaks in. */
  font-family: var(--font-body);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    transform 160ms var(--ease-out);
}
/* With an identity it becomes the account button: the name block sets the
   height, so tight block padding keeps it near the bare cog's 30px. */
.sal-settings[data-account] .sal-settings__trigger {
  width: auto;
  height: auto;
  max-width: 15rem;
  padding: var(--space-1) var(--space-3);
}
/* Hovered or open, the fill goes solid and the hairline warms to the same
   quiet ember the theme switcher's active segment uses. */
@media (hover: hover) and (pointer: fine) {
  .sal-settings__trigger:hover {
    background: var(--surface-hover);
    border-color: var(--accent-quiet);
  }
}
.sal-settings[data-open] .sal-settings__trigger {
  background: var(--surface-hover);
  border-color: var(--accent-quiet);
}
.sal-settings__trigger:active { transform: scale(0.98); }
.sal-settings__trigger:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Name over address. Both truncate — a long address must never widen the bar. */
.sal-account__avatar { display: none; }
.sal-account__who {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sal-account__name,
.sal-account__email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: var(--lh-tight);
}
.sal-account__name {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-light);
  color: var(--text-primary);
}
.sal-account__email {
  font-size: var(--fs-overline);
  color: var(--text-muted);
}

.sal-settings__cog {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition:
    color 160ms var(--ease-out),
    transform 250ms var(--ease-out);
}
.sal-settings__trigger:hover .sal-settings__cog { color: var(--accent); }
/* An eighth turn — one tooth of the cog — says "open" without spinning. */
.sal-settings[data-open] .sal-settings__cog {
  color: var(--accent);
  transform: rotate(45deg);
}

/* The menu hangs off the trigger's bottom-right and scales out of that
   corner, so it reads as coming from the button and not from nowhere.

   ONE MEASURE, EVERYWHERE. It used to be `width: max-content` unless the
   account fields were present, on the reasoning that a menu holding the theme
   row alone should take its own small width. storage.js then began mounting a
   whole paragraph of browser-storage disclosure into every one of them, and
   max-content over a sentence is the sentence's own unwrapped length: on the
   signed-out sites the cog opened a 630px slab with the text pressed against
   both rims. 17rem is what the account menu was already using, it is wider than
   the theme row's label-plus-switcher needs, and a paragraph reads better at a
   fixed measure than at whatever its longest sentence happens to be. */
.sal-settings__menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: var(--z-dropdown);
  /* Nothing here resets box-sizing globally, and this measure is now fixed
     rather than shrink-to-fit: without it the panel is 17rem PLUS its padding
     and border, which is 306px on the sites that don't reset it themselves and
     272px on the ones that do — the same component, two widths. */
  box-sizing: border-box;
  width: min(17rem, calc(100vw - var(--space-6)));
  padding: var(--space-3);
  /* A step quieter than the card white, as every menu and popover is. */
  background: var(--surface-raised);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-body-sm);
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.97);
  /* Leaving is quicker than arriving; visibility waits out the fade so the
     fields can't be tabbed into while the menu is closed. */
  transition:
    opacity 120ms var(--ease-out),
    transform 120ms var(--ease-out),
    visibility 0s linear 120ms;
}
.sal-settings[data-open] .sal-settings__menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

/* Theme row: the label to the left, the switcher hard right. Under the account
   fields it takes a hairline of its own, so preference reads as its own thing
   and not as a third field of the account. */
.sal-settings__theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.sal-settings__theme:not(:first-child) {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-hairline);
}

/* .sal-field owns the label/control gap — only the field-to-field rhythm
   and the read-only address need saying here. */
.sal-account__field + .sal-account__field { margin-top: var(--space-4); }
/* The address is shown, not edited — Access owns it. */
.sal-account__static {
  margin: 0;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.sal-account__note { margin: var(--space-3) 0 0; }
/* Sign out: a destructive action, so it speaks in --danger (deliberately off
   orange — errors are not CTAs) at the small button size: quiet crimson
   outline + text, hover tints translucently, never fills. The :visited
   restatement keeps the crimson on this <a> over the ghost variant's own
   :visited rule. */
.sal-account__out {
  display: flex;
  width: fit-content;
  margin-top: var(--space-4);
  margin-left: auto;   /* bottom-right corner of the menu */
  /* The same small ghost button as «Glem valgene mine» above it: signing out
     is not destructive, so no crimson edge or text. */
  min-height: 32px;
  padding: 0 var(--space-3);
  font-size: var(--fs-body-sm);
}
/* The nav-link recolors (`.sal-nav__links a`, plus its light-theme variant)
   reach into the dropdown and out-specify a plain class — hence the extra
   ancestors here, so the crimson wins in both themes and on hover/visited. */
.sal-nav__links .sal-settings__menu .sal-account__out,
.sal-nav__links .sal-settings__menu .sal-account__out:visited { color: var(--text-secondary); }
.sal-nav__links .sal-settings__menu .sal-account__out:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Phones centre the nav row, so a menu hung off the button's right edge can
   run past the screen. Span the viewport's own margins instead — `top: auto`
   keeps it at its static position, right under the trigger, however the row
   wrapped. (The nav's backdrop-filter is the containing block here, and it is
   as wide as the viewport, so these insets read as screen margins.) */
@media (max-width: 480px) {
  .sal-settings__menu {
    position: fixed;
    top: auto;
    left: var(--space-4);
    right: var(--space-4);
    width: auto;
    max-width: none;
    margin-top: var(--space-2);
    transform-origin: top center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sal-settings__menu,
  .sal-settings[data-open] .sal-settings__menu { transform: none; }
  .sal-settings[data-open] .sal-settings__cog { transform: none; }
  .sal-settings__trigger:active { transform: none; }
}

/* Three-way theme switcher (light / system / dark). The markup is generated by
   /design-system/theme.js, which also builds the settings cog it lives in — a
   page only has to load the script:

     <script src="/design-system/theme.js"></script>

   One segmented control — sun · monitor · moon — with a gold thumb that
   slides under the active choice. Dark stays the brand default; "system"
   follows prefers-color-scheme. */
.sal-theme {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.sal-theme:empty { display: none; } /* no JS → no dead control */

/* The track — a quiet gold hairline frame around the three segments. */
.sal-theme__bar {
  /* One segment width, shared by the segments and the sliding thumb — see the
     note on .sal-theme__thumb for why the thumb may not be a fraction. */
  --sal-seg-w: 28px;   /* square options: 28 × 28 */
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: var(--seg-pad);
  border: 1px solid var(--seg-track-border);
  border-radius: var(--seg-radius);
  background: var(--seg-track-bg);
}
.sal-theme__seg {
  position: relative; /* above the thumb */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sal-seg-w);
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--seg-item-radius);
  color: var(--seg-off-color);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard);
}
.sal-theme__seg:hover { color: var(--text-primary); }
.sal-theme__seg:active svg { transform: scale(0.9); }
.sal-theme__seg svg { transition: transform 160ms var(--ease-out); }
.sal-theme__seg[aria-checked="true"] { color: var(--seg-on-color); }
.sal-theme__seg:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

/* The thumb slides — one third of the padded track, moved by segment index. */
/* One segment wide, stated in the same variable the segments are sized from —
   NOT a fraction of the track.

   The fraction is the obvious way to write this and it is wrong here, in the
   one frame that matters most. theme.js sets --sal-theme-count to 4 the instant
   the egg is found, while the fourth segment is still growing 0 → 32px over
   320ms; a thumb sized as a quarter of a track that is still three segments
   wide shrinks to 24px and its translateX(100%) steps 24px instead of 32 — so
   it jumps 8px off the `light` icon it is marking (and the fifth click always
   selects `light`), then crawls back as the track fills out. That is the single
   frame a reader who has just found the egg will remember.

   Sized absolutely, the thumb never moves during the unlock: the track simply
   gets 32px longer to the right. The language switcher below keeps the fraction
   because its count is fixed at build time and never changes at runtime. */
.sal-theme__thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: var(--sal-seg-w);
  /* The raised tab of a segmented control (--seg-*), sliding to the choice. */
  border-radius: var(--seg-item-radius);
  background: var(--seg-on-bg);
  box-shadow: inset 0 0 0 1px var(--seg-on-border), var(--seg-on-shadow);
  transition: transform 250ms var(--ease-out);
}
.sal-theme__bar[data-active="1"] .sal-theme__thumb { transform: translateX(100%); }
.sal-theme__bar[data-active="2"] .sal-theme__thumb { transform: translateX(200%); }
.sal-theme__bar[data-active="3"] .sal-theme__thumb { transform: translateX(300%); }

/* The fourth segment arrives by growing, not by appearing. Animating width is
   a layout animation, which is normally forbidden — it is allowed here because
   it is one element, once, on an event that by definition happens once per
   person. JS drops the attribute on animationend so a later re-render cannot
   replay it. */
@keyframes sal-theme-reveal {
  from { width: 0; opacity: 0; }
  to   { width: var(--sal-seg-w); opacity: 1; }
}
.sal-theme__seg[data-reveal] {
  overflow: hidden;
  animation: sal-theme-reveal 320ms var(--ease-out) both;
}

/* Glass's own two preferences — which tone the material is, and how dense —
   only exist while it is the active theme, and they arrive and leave together.
   So they share ONE hairline rather than taking one each: three rules inside a
   13px popover is a fence, not a rhythm. The tone row carries it, the frost row
   follows on a plain margin. */
.sal-settings__tone[hidden],
.sal-settings__frost[hidden] { display: none; }
.sal-settings__tone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-hairline);
}
.sal-settings__frost { margin-top: var(--space-3); }

/* Tone picker: three swatches, not a fourth segmented bar. Stacked directly
   under the theme bar a second bar of the same shape reads as a second copy of
   the same control — and this choice is about appearance, so it shows the
   appearance instead of naming it. The material each swatch is painted with
   lives in tokens/glass.css, beside the tone definitions it has to agree with;
   only the geometry is here. */
.sal-tone {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
/* A frame, not a fill. The swatch inside is the whole picture, so the button is
   only ever the selection ring — which is why it can afford a transparent
   border at rest instead of shifting 1px when it becomes the chosen one. */
.sal-tone__chip {
  position: relative;
  display: inline-flex;
  padding: 2px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 160ms var(--ease-out);
}
/* The swatch is 20px because it has to sit on the theme bar's own grid, which
   makes the whole chip 26px — a small target for a thumb. So grow the HIT AREA
   and not the chip: a pseudo-element bleeding past the box takes the target to
   32x40 without moving one pixel of what you can see.

   The insets are measured from the PADDING box, not the border box — that is
   what an absolutely positioned child is laid out against — so -4px reaches
   3px past the visible edge, not 4. (Hit-tested, because the first pair of
   numbers reached 2px and the difference is invisible until you probe it.)
   3px each side against --space-2 of gap leaves 2px between neighbouring
   targets: a tap that lands on the wrong swatch is worse than a small one. */
.sal-tone__chip::before {
  content: "";
  position: absolute;
  inset: -7px -4px;
}
.sal-tone__chip[aria-checked="true"] { border-color: var(--accent-quiet); }
.sal-tone__chip:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}
/* The press lands on the swatch, the way the theme bar presses its icon and the
   language bar presses its flag rather than the segment around it. */
.sal-tone__chip:active .sal-tone__swatch { transform: scale(0.92); }
.sal-tone__swatch {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  background-repeat: no-repeat;
  transition: transform 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .sal-tone__chip:hover { border-color: var(--border-strong); }
  .sal-tone__chip[aria-checked="true"]:hover { border-color: var(--accent-quiet); }
}

/* The two rows arrive by fading down into place. Opacity and 3px of travel
   only: the popover's height change is instant, which is what a disclosure
   does, and animating the height would be a layout animation on a surface that
   is already blurring. 40ms of stagger, so they read as a pair arriving rather
   than as one event. theme.js drops the attribute on animationend, and never
   sets it on the first sync — a page that LOADS on glass has always had these
   rows, and should not perform their arrival. */
@keyframes sal-settings-reveal {
  from { opacity: 0; transform: translateY(-3px); }
}
:is(.sal-settings__tone, .sal-settings__frost)[data-reveal] {
  animation: sal-settings-reveal 200ms var(--ease-out) both;
}
.sal-settings__frost[data-reveal] { animation-delay: 40ms; }
/* The density switch is the ONE control the glass theme adds, and .sal-switch's
   default dress — a 42x24 pill with an 18px solid cream circle — is the iOS
   toggle pixel for pixel. Shipping that directly under a bespoke 4px-cornered,
   gold-hairlined segmented bar, in a theme whose token file spends a paragraph
   rejecting Apple's springs so it will not read as an installed iOS theme, is
   the loudest possible way to undo that argument. So this instance takes the
   same track the switcher above it has: a gold hairline over inset ink, with a
   sliding 2px-cornered thumb. Scoped to this one control — every other
   .sal-switch in the estate is untouched.

   The timings come down with it. Flipping this rewrites nine custom properties
   on <html> in a single frame, so the material has finished changing density
   while a 600ms knob is still 40% across: the effect lands before the cause. */
.sal-settings__frost .sal-switch__track {
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-inset) 55%, transparent);
  border-color: var(--border-gold);
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.sal-settings__frost .sal-switch__track::after {
  border-radius: var(--radius-xs);
  transition: transform 200ms var(--ease-out), background 160ms var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .sal-theme__thumb { transition: none; }
  .sal-theme__seg svg { transition: none; }
  .sal-theme__seg[data-reveal] { animation: none; }
  .sal-tone__swatch { transition: none; }
  .sal-tone__chip:active .sal-tone__swatch { transform: none; }
  :is(.sal-settings__tone, .sal-settings__frost)[data-reveal] { animation: none; }
}

/* ── Language switcher ──────────────────────────────────────────────────────
   Built by /design-system/lang.js on a site that declares more than one
   language (`<html data-sal-langs="nb en">`), and placed in the nav row itself,
   immediately left of the account button — not inside its menu. Somebody who
   cannot read the page cannot be asked to find a cog first, so this is the one
   preference that lives out in the open.

   Same instrument as the theme switcher above — a gold hairline track with a
   sliding gold thumb, segments the same 24px tall — and the track comes to
   exactly the bare cog's 30px, so the two read as one pair at the end of the
   bar. It differs in what the segments hold: flags, not words. A flag names a
   country and not a language, which is why this control used to spell the
   names out; recognition without reading is worth more to a visitor on the
   wrong language, and the names are still there to be read aloud (each
   segment's title and aria-label, in its own language).

   The number of segments is not fixed at two: a language can be added by
   dropping a `questions/<lang>/` folder in, and the thumb has to keep landing
   on the right one. `--sal-lang-count` carries it in from the script, so the
   geometry follows the content rather than a constant somebody has to remember
   to change. */
.sal-lang__bar {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: var(--seg-pad);
  border: 1px solid var(--seg-track-border);
  border-radius: var(--seg-radius);
  background: var(--seg-track-bg);
}
/* The row's own column gap is the measure between page links (--space-6);
   between the two controls at its right end that much air reads as a hole in
   the bar, so the pair closes up to --space-3 without the links narrowing. */
.sal-nav__links > .sal-lang__bar { margin-right: calc(var(--space-3) - var(--space-6)); }

.sal-lang__seg {
  position: relative; /* above the thumb */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--seg-item-radius);
  color: var(--seg-off-color);
  /* Buttons inherit no type, and the nav row's uppercase would otherwise be
     the only styling the flagless fallback code gets. */
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: 300;
  letter-spacing: var(--ls-nav);
  line-height: 1;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard);
}
.sal-lang__seg:hover { color: var(--text-primary); }
.sal-lang__seg[aria-checked="true"] { color: var(--seg-on-color); }
.sal-lang__seg:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

/* The flag: a 21×14 chip, corners taken off so it reads as a small object in
   the bar rather than a swatch of colour bleeding to the segment's edge (the
   radius clips the drawing — an <svg> root hides its overflow by default).

   Colour is the state. The language in force keeps its flag whole; the other
   is dimmed and half-drained — far enough to read as the option not taken,
   not so far that it stops being recognisable at 21px, which is the entire
   job. Pointing at it brings the colour back, so the answer to "what do I get
   if I press this" arrives before the press does. */
.sal-lang__flag {
  display: block;
  border-radius: var(--radius-xs);
  filter: saturate(0.55);
  opacity: 0.65;
  transition:
    filter 180ms var(--ease-out),
    opacity 180ms var(--ease-out),
    transform 160ms var(--ease-out);
}
.sal-lang__seg[aria-checked="true"] .sal-lang__flag,
.sal-lang__seg:focus-visible .sal-lang__flag {
  filter: none;
  opacity: 1;
}
/* Hover only where hovering means something — a tap on a phone would
   otherwise light the flag it is about to navigate away from. */
@media (hover: hover) and (pointer: fine) {
  .sal-lang__seg:hover .sal-lang__flag {
    filter: none;
    opacity: 1;
  }
}
/* On cream, dropping a flag's opacity walks it toward the background rather
   than into the dark, so the numbers above leave the unchosen one nearly gone.
   It gets most of that opacity back here and gives up a little more colour
   instead — the same two steps down, taken in different proportions. */
:is([data-theme="light"], [data-glass-tone="white"]) .sal-lang__flag {
  filter: saturate(0.5);
  opacity: 0.8;
}

/* The press lands on the flag itself, the way the theme bar presses its icon
   rather than its segment. */
.sal-lang__seg:active .sal-lang__flag { transform: scale(0.92); }

/* One segment wide, moved by index — the same slide as the theme thumb, at the
   same 250ms, so switching either control feels like the same instrument. */
.sal-lang__thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc((100% - 4px) / var(--sal-lang-count, 2));
  /* The raised tab of a segmented control (--seg-*), sliding to the choice. */
  border-radius: var(--seg-item-radius);
  background: var(--seg-on-bg);
  box-shadow: inset 0 0 0 1px var(--seg-on-border), var(--seg-on-shadow);
  transition: transform 250ms var(--ease-out);
}
.sal-lang__bar[data-active="1"] .sal-lang__thumb { transform: translateX(100%); }
.sal-lang__bar[data-active="2"] .sal-lang__thumb { transform: translateX(200%); }
.sal-lang__bar[data-active="3"] .sal-lang__thumb { transform: translateX(300%); }
.sal-lang__bar[data-active="4"] .sal-lang__thumb { transform: translateX(400%); }

/* Reduced motion keeps the colour coming back — it is what tells you which
   flag you are pointing at — and drops only the two things that move. */
@media (prefers-reduced-motion: reduce) {
  .sal-lang__thumb { transition: none; }
  .sal-lang__flag {
    transition: filter 180ms linear, opacity 180ms linear;
  }
  .sal-lang__seg:active .sal-lang__flag { transform: none; }
}

/* Browser-storage notice — a small card in the bottom-left corner, shown once
   where the reader has something of their own at stake. See consent.js, and
   storage.js for what it is disclosing.

   ---- why this is not a bar any more ----

   It used to be a 40rem card, centred, inside a full gold frame. Two things were
   wrong with that, and both were internal to this file rather than matters of
   taste. The width: nothing else in the estate is 640px, and .sal-dialog — which
   sits over a scrim and has a whole conversation to hold — is 480px. And the
   frame: every full --border-gold box in this file is something you TOUCH
   (.sal-settings__trigger, .sal-theme, .sal-lang__bar). The two surfaces that
   SPEAK, .sal-dialog and .sal-toast, both use --border-soft plus a single gold
   mark. The notice was the only speaking surface wearing the interactive idiom,
   which is exactly why it read as a cookie bar with brand paint on it.

   So: 24rem, corner-anchored, --border-soft, and one gold voice — the eyebrow
   that is also its accessible name. No second mark. .sal-dialog earns its rule
   because a heading follows it and .sal-toast earns its dot because the dot
   carries status; a card whose title IS an eyebrow has nothing for a second mark
   to introduce.

   --z-dropdown, not --z-toast: a persistent disclosure sitting above transient
   toasts is backwards, and 600 is also idunn's fullscreen overlay, so the two
   used to tie and resolve by DOM order.

   --sal-consent-clear lets a page whose bottom edge is already occupied lift the
   notice clear of it: test.salnorth.no parks a sticky submit row down there, and
   a disclosure that covers the button you are reaching for is worse than no
   disclosure. Over-clearing is invisible, so set it generously rather than try
   to match a height. */
.sal-consent {
  position: fixed;
  left: var(--space-4);
  bottom: calc(var(--space-4) + var(--sal-consent-clear, 0px)
               + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-dropdown);
  box-sizing: border-box;
  width: calc(100% - var(--space-4) * 2);
  max-width: 24rem;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md), var(--shadow-inset);

  /* Transitions, not @keyframes, and this is load-bearing three times over.
     A transition animates from wherever the property currently IS, so pressing
     Skjul mid-entrance reverses from the on-screen value instead of snapping to
     full opacity and fading from there. transition-duration is read at the
     moment the property changes, so the 350/180 asymmetry needs no second rule
     set. And with no `animation` property in play, glass.css's `animation: none`
     under reduced motion has nothing to fight — it used to lose to the entrance
     rule and beat the exit, so glass + reduced motion had no entrance fade and a
     full exit fade.

     translateY(100%) is the card's own height rather than a fixed 12px: 200px in
     350ms is 1.75ms per pixel, where 12px over --dur-base was 50, and that ratio
     — not the brand's calm — is why the old entrance read as lag. */
  --sal-consent-lift: 100%;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity   var(--dur-fast) var(--ease-out) var(--dur-slow),
    transform var(--dur-fast) var(--ease-out) var(--dur-slow);
}
/* --dur-slow of nothing first. The entrance used to start at DOMContentLoaded
   and fade in while the questionnaire was still assembling, competing with the
   thing the reader came for — and a disclosure that interrupts the first read
   gets swiped away reflexively, which makes the whole component pointless.
   1100ms is not a number picked by ear: it is the moment after which nothing
   else on a Sál page is still moving. */
.sal-consent[data-entering] {
  opacity: 0;
  transform: translateY(var(--sal-consent-lift));
}
/* Out along the path it came in on, and faster. The entrance is the site
   explaining itself and can afford to be unhurried; the exit is the site doing
   as it was told, and anything unhurried there reads as lag. --ease-standard
   rather than --ease-out: over 180ms the long decel spends most of its time
   nearly stopped, which is the one gesture that must feel instant. */
.sal-consent[data-closing] {
  opacity: 0;
  transform: translateY(var(--sal-consent-lift));
  transition:
    opacity   var(--dur-quick) var(--ease-standard) 0s,
    transform var(--dur-quick) var(--ease-standard) 0s;
}

/* The title is an .eyebrow, reused rather than re-declared — and not for
   tidiness: tokens/base.css already steps .eyebrow back one weight under
   [data-theme="light"] and [data-glass-tone="white"], so the title gets the
   light-ground correction for free on two of five themes. */
.sal-consent__title { margin: 0; }

.sal-consent__text {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-light);
  line-height: var(--lh-normal);
  color: var(--text-secondary);
}

/* The link to the statement lives INSIDE the sentence, as its last words, and
   differs from the body text by an underline rather than by colour and weight.
   Colour alone would fail WCAG 1.4.1; and a coloured, weighted link in a
   three-line card out-shouts the button beside it. */
.sal-consent__more {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color                 var(--dur-fast) var(--ease-standard),
              text-decoration-color var(--dur-fast) var(--ease-standard);
}
.sal-consent__more:hover,
.sal-consent__more:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Hard right, and never first in the tab order of the two: the text is what the
   notice is for. */
.sal-consent__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-1);
}
/* Base size, not --sm. .sal-btn--sm is ~62×28px, which clears WCAG 2.5.8 and
   fails 2.5.5; base is ~40px. On a card that arrives over content on a phone
   this is the only target, and a mis-tap is unrecoverable. */
.sal-consent__ok { flex: none; }

/* Narrow OR short: stop being fixed. Because the card is prepended to <body> it
   becomes an in-flow band at the top of the document, pushes the content down
   and scrolls away for good — which satisfies Reflow at 200% and 400% zoom and
   Focus Not Obscured on the merits, rather than resting on an Escape key nobody
   can discover. The travel is dropped here because in flow it would shove the
   document around. */
@media (max-width: 480px), (max-height: 30rem) {
  .sal-consent {
    /* relative, not static, and z-index --z-base: the card is a sibling of
       .sal-atmosphere, whose two fixed layers are positioned at z-index 0. A
       static box paints below those, so the wash and the grain would sit on top
       of the card — this is the same lift .sal-atmosphere > * takes, for the
       same reason. Layout-wise it still behaves as in-flow. */
    position: relative;
    z-index: var(--z-base);
    /* And inset must go with it. `relative` HONOURS left/bottom where `static`
       ignores them, so the base rule's bottom offset would shift the card
       upwards out of the document — by --sal-consent-clear as well, which on
       the questionnaire is 7rem, putting the card 128px above the top of the
       page where nothing could reach it. */
    inset: auto;
    width: auto;
    max-width: none;
    margin: var(--space-4);
    transition: opacity var(--dur-fast) var(--ease-out) var(--dur-slow);
  }
  .sal-consent[data-entering] { transform: none; }
  .sal-consent[data-closing] {
    transform: none;
    transition: opacity var(--dur-quick) var(--ease-standard) 0s;
  }
  .sal-consent__actions { display: block; }
  .sal-consent__ok { width: 100%; min-height: 44px; }
}

/* Reduced motion keeps both fades — a notice appearing and disappearing with no
   transition at all reads as a glitch — and drops only the movement. One
   variable, so both directions collapse together. The --dur-slow beat stays: a
   delay is not motion, and honouring the preference by making an unbidden notice
   arrive SOONER would be a misreading of it. */
@media (prefers-reduced-motion: reduce) {
  .sal-consent { --sal-consent-lift: 0px; }
}

/* The disclosure row inside the settings cog — the permanent half of this, and
   the reason the button on the card may honestly say «Skjul». Built by
   storage.js's mountRow(). Borrows .sal-settings__theme's own separator idiom so
   the menu keeps one rhythm. */
.sal-settings__storage {
  border-top: 1px solid var(--border-hairline);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  display: grid;
  /* `minmax(0, 1fr)`, not the implicit `auto`: an auto column is sized by its
     widest item's min-content, and .sal-btn is `white-space: nowrap`, so the
     moment the forget button was given a sentence to say it widened the column,
     shoved the disclosure paragraph out with it, and both ran clear of the
     menu's right rim. The column may not outgrow the panel. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}
.sal-settings__storage-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-light);
  line-height: var(--lh-normal);
  color: var(--text-faint);
}
.sal-settings__storage-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  /* The link and the button are one line until they can't be — at 320px, or
     under a text-size setting, they take a line each rather than one of them
     leaving the panel. */
  flex-wrap: wrap;
}
/* What the button used to say once it was spent. A sentence is not a label:
   it lives on its own line, in the disclosure voice, announced rather than
   re-read. It is in the markup from first mount so the live region is already
   there when it fills — hence :empty, which keeps it from spending a grid gap
   on the nine times out of ten it has nothing to add. */
.sal-settings__storage-status {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-light);
  line-height: var(--lh-normal);
  color: var(--text-secondary);
}
.sal-settings__storage-status:empty { display: none; }
.sal-settings__storage-link {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--rule-gold);
  text-underline-offset: 3px;
}
.sal-settings__storage-link:hover { color: var(--accent); }

/* The footer's statement link. Quiet by default like everything else in the
   footer, and it only takes the accent on hover — an ember link beside the
   org.nr. line would be the loudest thing in a deliberately faint row. */
.sal-footer__meta a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule-gold);
  text-underline-offset: 3px;
}
.sal-footer__meta a:hover { color: var(--accent); }

/* Underline tab bar. */
.sal-tabs {
  display: flex;
  gap: var(--space-6);
  border-bottom: 1px solid var(--border-hairline);
}
.sal-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 0 12px;
  margin: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-standard);
}
.sal-tab::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  /* --dur-quick: selection feedback, not an entrance. */
  transition: transform var(--dur-quick) var(--ease-out);
}
.sal-tab:hover { color: var(--text-secondary); }
.sal-tab[aria-selected="true"] {
  color: var(--text-primary);
  font-weight: var(--fw-medium);
}
.sal-tab[aria-selected="true"]::after { transform: scaleX(1); }

/* Segmented control — one value out of a few, chosen in place (the
   webapp-template's SegmentPicker). No track of its own; the chosen item is
   raised (--seg-* in effects.css). 36 px tall, like every other control.

   Three markups, one look — pick the one that says what the control does:
     • a value in a form or a filter: native radios, which buy the arrow keys,
       «2 av 3» and form participation from the browser —
         <fieldset class="sal-seg"><legend class="sal-sr-only">Visning</legend>
           <label class="sal-seg__item"><input type="radio" name="v" value="tre" checked> Tre</label>
           <label class="sal-seg__item"><input type="radio" name="v" value="loddrett"> Loddrett</label>
         </fieldset>
     • a toggle a script owns: <div class="sal-seg" role="group" aria-label="…">
         <button type="button" class="sal-seg__item" aria-pressed="true">…</button>
     • places to go: links (they navigate, so they are <a href>) —
         <nav class="sal-seg" aria-label="…"><a class="sal-seg__item" href="…" aria-current="page">…</a></nav>
   A count after the label: <span class="sal-seg__n">4</span>. */
.sal-seg {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: var(--seg-pad);
  border: 1px solid var(--seg-track-border);
  border-radius: var(--seg-radius);
  background: var(--seg-track-bg);
}
.sal-seg > legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sal-seg__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--seg-item-radius);
  background: none;
  color: var(--seg-off-color);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-normal);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard);
}
.sal-seg__item:visited { color: var(--seg-off-color); }
.sal-seg__item:hover { color: var(--seg-on-color); }
.sal-seg__item > input[type="radio"] {   /* the radio takes focus; the label is what is seen */
  position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit;
}
.sal-seg__item[aria-pressed="true"],
.sal-seg__item[aria-current]:not([aria-current="false"]),
.sal-seg__item:has(> input:checked) {
  background: var(--seg-on-bg);
  box-shadow: inset 0 0 0 1px var(--seg-on-border), var(--seg-on-shadow);
  color: var(--seg-on-color);
}
.sal-seg__item:focus-visible,
.sal-seg__item:has(> input:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}
.sal-seg__item:is(:disabled, [aria-disabled="true"]),
.sal-seg__item:has(> input:disabled) { opacity: .45; cursor: not-allowed; }
.sal-seg__n {
  color: var(--text-muted);
  font-size: var(--fs-caption);
  font-variant-numeric: tabular-nums;
}
.sal-seg__item > svg { width: 16px; height: 16px; flex: none; }
/* Full width: the items share the row. */
.sal-seg--block { display: flex; }
.sal-seg--block > .sal-seg__item { flex: 1 1 0; }

/* The shared site footer — identical on every Sál surface.

     <footer class="sal-footer">
       <div class="sal-container">
         <div class="sal-footer__org">Sál AS</div>
         <div class="sal-footer__meta">Org.nr. 937 386 303 · Sykehusvegen 23, 9019 Tromsø</div>
       </div>
     </footer> */
.sal-footer {
  border-top: 1px solid var(--rule-gold);
  text-align: center;
  color: var(--text-faint);
  padding-block: var(--space-7);
}
.sal-footer__org {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-light);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.sal-footer__meta {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-light);
  letter-spacing: var(--ls-wide);
}

/* ---------- Internal-tool primitives ---------- */

/* Data table — the ONE table every Sál surface uses (settled on the :7000
   bench, design/prototypes/05-samlet, 2026-10-01). Plain and standard on
   purpose; Carbon, Primer, Polaris and Material agree on all of it:
   - a sentence-case header in muted type on a quiet band, never the gold
     uppercase overline (eyebrows are the only uppercase);
   - horizontal hairlines only, with no zebra stripes;
   - a light fill under the pointer, on a row that does something;
   - numbers right-aligned in lining figures.

     <div class="sal-table-card">                     the box it sits in
       <table class="sal-table">
         <caption class="sal-sr-only">…</caption>
         <thead><tr>
           <th scope="col" aria-sort="ascending">
             <button type="button" class="sal-table__sort">Navn <svg…/></button></th>
           <th scope="col" class="sal-table__num">Svar</th></tr></thead>
         <tbody>
           <tr data-href="…">                                a row that opens something
             <th scope="row"><a href="…">Kari Mo</a></th>     the name is a real link
             <td class="sal-table__num">3</td></tr></tbody>
       </table>
     </div>

   Optional parts, all below:
   - __sort: the button inside a sortable <th>, its arrow always in the markup
     (it fades in, so the label never moves). Put aria-sort on the ONE sorted
     header only, never aria-sort="none", and say the new order in a polite
     live region: a screen reader does not re-read a header that changed.
   - __x + __expand + __detail: Carbon's expandable row. The button carries
     aria-expanded and aria-controls, the row carries .is-open, and the detail
     row is a <tr class="sal-table__detail" hidden> holding one <td colspan>.
     The open row and its detail share no rule between them, and no fill.
   - __num: a numeric column.
   - __check: a checkbox column; a ticked row (or aria-selected="true") is filled.
   - <tfoot>: a footer row for sums.
   - __empty: the one centred message when nothing matches.
   - .sal-table-head: a heading above a table (title, count, actions).
   - .sal-progress: «12 av 19» with a thin bar — or, for answer counts, with a
     .sal-battery in place of the bar (see below).

   Modifiers:
   - --dense: 36 px rows.
   - --prose: cells of running text, read top-down — top-aligned and given
     room to breathe, for a table of facts rather than records.
   - --sticky: the header sticks to the window. It only works outside a
     scrolling box, so its card clips instead of scrolling.

   Rows: 44 px (header 40), dense 36 (header 36). The height is the whole
   cell, padding and rule included — every cell is border-box.

   The pointer fill goes only on a row that answers a press: one with
   data-href, a tabindex, or an expand button. On a row that does nothing it
   promises a press that never comes. Keyboard focus anywhere in a row tints
   it too — :focus-visible, so a mouse press leaves no tint behind.

   Specificity is held down on purpose. The cell, state and part rules sit
   inside :where(), at the weight of the one .sal-table class, so a page's own
   `td.cell-meta` or `#list tr.is-new` wins without an !important or an id. The
   row-header link rules stay heavier: they have to beat the base `a:visited`.

   The header band and the hovers are mixed from --sal-table-bg, so they stay
   one step away from what is under them. Re-point that token when a table sits
   on another surface than the card's. */
.sal-table {
  --sal-table-bg: var(--surface-raised);
  /* The header is the table's own surface, as in the webapp-template: no band
     of its own, only muted text and the hairline under it. Kept OPAQUE (not
     transparent) so rows scrolling under a sticky header stay hidden. */
  --sal-table-head: var(--sal-table-bg);
  --sal-table-hover: color-mix(in srgb, var(--text-primary) 2.5%, var(--sal-table-bg));
  --sal-table-open: color-mix(in srgb, var(--text-primary) 3.5%, var(--sal-table-bg));
  /* A name link under the pointer. Plain --accent measured 4.40:1 on the dark
     hover fill and 4.21:1 on the light one, and --accent-hover goes the wrong
     way on ink (a DARKER ember: 3.44:1). The theme's own accent pulled a fifth
     of the way toward the ink you read clears AA in every theme: 5.3:1 dark,
     5.7:1 light, and the glass tones follow their own pair. */
  --sal-table-link-hover: color-mix(in srgb, var(--accent) 80%, var(--text-primary));
  --sal-table-row: 44px;
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-light);
  color: var(--text-secondary);
}
.sal-table :where(thead th) {
  box-sizing: border-box;
  height: 40px;
  padding: 0 var(--space-4);
  background: var(--sal-table-head);
  /* A shadow rather than a border: it stays with the cell when the header is
     sticky, where a collapsed border would scroll away under it. */
  box-shadow: inset 0 -1px 0 var(--border-soft);
  text-align: left;
  vertical-align: middle;
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-normal);
  text-transform: none;
  color: var(--text-muted);
  white-space: nowrap;
}
.sal-table :where(thead th[aria-sort="ascending"], thead th[aria-sort="descending"]) {
  color: var(--text-primary);
}
.sal-table :where(tbody th, tbody td) {
  box-sizing: border-box;
  height: var(--sal-table-row);
  padding: var(--space-2) var(--space-4);
  text-align: left;
  vertical-align: middle;
  font-weight: var(--fw-light);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-hairline);
}
/* A row header is the row's name, so it reads a step up, and when it is a
   link it stays in primary ink until the pointer finds it: a column of ember
   names reads as a column of warnings. */
.sal-table :where(tbody th) { color: var(--text-primary); }
.sal-table tbody th a,
.sal-table tbody th a:visited { color: var(--text-primary); text-decoration: none; }
.sal-table tbody th a:hover {
  color: var(--sal-table-link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sal-table :where(tbody tr) {
  transition: background-color var(--dur-fast) var(--ease-standard);
}
/* Behind (hover: hover): a tap on a touch screen leaves :hover stuck on the
   row it landed on until the next tap somewhere else. */
@media (hover: hover) {
  .sal-table :where(tbody tr:is([data-href], [tabindex], :has(.sal-table__expand)):hover) {
    background: var(--sal-table-hover);
  }
}
.sal-table :where(tbody tr:focus-visible, tbody tr:has(:focus-visible)) {
  background: var(--sal-table-hover);
}
.sal-table :where(tbody tr[data-href]) { cursor: pointer; }
/* A focusable row draws its ring inside itself: the card clips, and a ring
   outside the row would lose its ends at the card's edges. */
.sal-table :where(tbody tr[tabindex]:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}
/* An open row keeps its own background (August, 14 Nov 2026: a row that
   changed colour when opened read as selected); only the rule between it and
   its detail goes, so the two read as one. */
.sal-table :where(tbody tr.is-open > *) { border-bottom-color: transparent; }
/* Numeric column: right-aligned, lining figures. */
.sal-table .sal-table__num { text-align: right; font-variant-numeric: tabular-nums; }
/* A selected row (aria-selected on a row of a selectable grid, or a ticked
   checkbox in its __check cell): the template's data-state=selected fill. */
.sal-table :where(tbody tr[aria-selected="true"], tbody tr:has(> .sal-table__check input:checked)) {
  background: var(--sal-table-open);
}
/* A checkbox column: narrow, the box centred on the row. */
.sal-table .sal-table__check { width: 44px; padding-inline: var(--space-3) 0; }
.sal-table .sal-table__check input { margin: 0; }
/* A footer row: sums, «Viser 4 av 12». */
.sal-table :where(tfoot th, tfoot td) {
  box-sizing: border-box;
  height: 40px;
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border-soft);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  text-align: left;
}

.sal-table--dense { --sal-table-row: 36px; }
.sal-table--dense :where(thead th) { height: 36px; padding-inline: var(--space-3); }
.sal-table--dense :where(tbody th, tbody td) { padding: var(--space-1) var(--space-3); }
.sal-table--prose :where(tbody th, tbody td) {
  vertical-align: top;
  padding-block: var(--space-3);
  line-height: var(--lh-normal);
}
.sal-table--sticky thead th { position: sticky; top: 0; z-index: 1; }

/* The sort control: a real <button> inside the header cell. The arrow shows on
   hover and focus, and stays only on the sorted column. */
.sal-table__sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 -4px;
  padding: 4px;
  background: none;
  border: 0;
  border-radius: var(--radius-xs);
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard);
}
.sal-table__sort:hover { color: var(--text-primary); }
.sal-table__sort:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0; }
.sal-table__num .sal-table__sort { flex-direction: row-reverse; }
.sal-table__sort svg {
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-standard),
              transform var(--dur-quick) var(--ease-out);
}
.sal-table__sort:hover svg,
.sal-table__sort:focus-visible svg { opacity: .6; }
th[aria-sort="ascending"] .sal-table__sort svg,
th[aria-sort="descending"] .sal-table__sort svg { opacity: 1; }
th[aria-sort="descending"] .sal-table__sort svg { transform: rotate(180deg); }

/* The expandable row (Carbon): a leading cell whose button fills it, and a
   detail row under the row it belongs to. */
.sal-table .sal-table__x { width: 44px; padding: 0; }
.sal-table__expand {
  display: grid;
  place-items: center;
  width: 44px;
  /* One pixel short of the row: the cell's own rule is inside its height. */
  height: calc(var(--sal-table-row) - 1px);
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard),
              transform var(--dur-press) var(--ease-out);
}
.sal-table__expand:hover,
.sal-table__expand[aria-expanded="true"] { color: var(--text-primary); }
.sal-table__expand:active { transform: scale(.97); }
.sal-table__expand:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -6px; }
.sal-table__expand svg { transition: transform var(--dur-quick) var(--ease-out); }
.sal-table__expand[aria-expanded="true"] svg { transform: rotate(90deg); }
.sal-table :where(tbody tr.sal-table__detail > td) {
  height: auto;
  padding: var(--space-2) var(--space-4) var(--space-5);
  white-space: normal;
}
/* With an expand column, the detail starts under the name, not under the
   chevron, so it reads as belonging to the row above. */
.sal-table:has(.sal-table__x) :where(tbody tr.sal-table__detail > td) {
  padding-left: calc(44px + var(--space-4));
}

/* The data-table parts (table.js): a column's edge you can drag, the
   «Visning» button in the empty last header cell (or a bar over the table). */
.sal-table :where(thead th) { position: relative; }
.sal-table__resize {
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  z-index: 2;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}
.sal-table__resize::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.sal-table__resize:hover::after,
.is-resizing .sal-table__resize::after { background: var(--border-strong); }
.sal-table__resize:focus-visible::after { background: var(--focus-ring); }
.sal-table.is-resizing, .sal-table.is-resizing * { cursor: col-resize !important; user-select: none !important; }
.sal-table .sal-table__viewcell { text-align: right; padding-right: var(--space-2); }
.sal-table__view { color: var(--icon-color); }
.sal-table-view { display: flex; justify-content: flex-end; margin: 0 0 var(--space-2); }

.sal-table .sal-table__empty {
  height: auto;
  padding: var(--space-7) var(--space-5);
  text-align: center;
  white-space: normal;
  color: var(--text-secondary);
}

/* The box a table sits in. It scrolls sideways on its own, so a table wider
   than a phone is still all there and the page itself never scrolls sideways;
   a page needs no wrapper of its own. position: relative makes it the real
   clipping boundary — without it Chromium still counts the table's overflow
   toward the document's scrollWidth. The scroll box also cuts the rounded
   corners.

   A --sticky table is the one exception: a scroll box would become the
   header's sticky container, and the header would stick to the card instead
   of the window. That card clips — `clip` makes no scroll container — and its
   table must fit the width it is given. */
.sal-table-card {
  position: relative;
  box-sizing: border-box;
  background: var(--surface-raised);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
}
.sal-table-card:has(> .sal-table--sticky) { overflow: clip; }
/* The card draws the bottom edge, so the last visible row draws none — also
   when the last row is followed by its own detail row, folded shut. */
.sal-table-card .sal-table > tbody:last-of-type > tr:last-child > *,
.sal-table-card .sal-table > tbody:last-of-type > tr:has(+ tr[hidden]:last-child) > * {
  border-bottom: 0;
}

/* A heading over a table: what it is, how many, and what you can do to it. */
.sal-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  min-height: 40px;
  margin: 0 0 var(--space-2);
}
.sal-table-head__title {
  margin: 0;
  min-width: 0;
  font-family: var(--font-display);
  font-size: var(--fs-heading-2);
  font-weight: var(--fw-display);
  letter-spacing: var(--ls-normal);
  line-height: var(--lh-snug);
  color: var(--text-primary);
}
.sal-table-head__title a,
.sal-table-head__title a:visited { color: var(--text-primary); text-decoration: none; }
.sal-table-head__title a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.sal-table-head__meta { color: var(--text-muted); font-size: var(--fs-body-sm); font-variant-numeric: tabular-nums; }
.sal-table-head__acts { margin-left: auto; display: flex; align-items: center; gap: var(--space-1); }

/* «12 av 19» and a thin bar. The fill is --value, a percentage:
   <span class="sal-progress"><span>12 av 19</span>
     <span class="sal-progress__bar" style="--value: 63%" aria-hidden="true"></span></span>
   data-done turns the fill to --success once the round is complete. */
.sal-progress {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  font-variant-numeric: tabular-nums;
}
.sal-progress__bar {
  position: relative;
  flex: none;
  width: 44px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--border-soft);
  overflow: hidden;
}
.sal-progress__bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 0%);
  border-radius: inherit;
  background: var(--accent-quiet);
}
.sal-progress__bar[data-done]::after { background: var(--success); }

/* The answer battery — how many of a round's answers are in, as a small
   battery with ONE CELL PER ANSWER up to ten (a round of 4 has 4 cells), and
   one continuous fill for a bigger round (data-bar; a round can wait for 50+). Answer
   counts in the group tables use it in place of .sal-progress__bar, with the
   «7 av 10» text kept to its left:

     <span class="sal-progress"><span>7 av 10</span>
       ${SalBattery.render(7, 10)}</span>

   Build it with battery.js, never by hand: the script lights the cells and
   picks the colour, and SalBattery.update(el, n, total) moves a live one.

   Cells lit: n. The bar's fill: n / total, but at least a sliver once anyone
   has answered and never all of it until everyone has.
   Colour: ONE per battery, mixed linearly in RGB through the --battery-*
   stops (0 crimson, 0.3 ember, 0.6 amber, 1 green). The script names the two
   stops around n/total in --battery-a / --battery-b and the mix in
   --battery-t, so the colour follows the theme the battery sits in; set
   --battery-color yourself to override it. The lit cells, the outline and
   the nub share it. At 0 answers the outline and nub fall back to
   --battery-idle; a full round (data-full) glows.

   56 × 20 px with its nub (.sal-battery--lg: 72 × 20). role="meter", labelled «Svar»; the cells are
   aria-hidden. Colour moves on --dur-fast, with no scale and no bounce. */
.sal-battery {
  --battery-color: color-mix(in srgb, var(--battery-b, var(--battery-0)) var(--battery-t, 0%), var(--battery-a, var(--battery-0)));
  --battery-edge: var(--battery-color);
  /* The size. The default is the table size: the full 20 px height, but
     narrow — a 53 px body (cells 5 px wide at a 1 px gap) and a 3 × 8 nub,
     56 px in all — so a «Fremdrift» column stays narrow. --lg is the original
     72 px width with 2 px gaps, for a place that has the room. */
  --battery-w: 53px;
  --battery-h: 20px;
  --battery-pad: 2px;
  --battery-gap: 1px;
  --battery-nub-w: 3px;
  --battery-nub-h: 8px;
  position: relative;
  flex: none;
  box-sizing: border-box;
  display: inline-grid;
  grid-template-columns: repeat(var(--battery-cells, 8), minmax(0, 1fr));
  gap: var(--battery-gap);
  width: var(--battery-w);
  height: var(--battery-h);
  margin-right: var(--battery-nub-w);
  padding: var(--battery-pad);
  border: 1px solid var(--battery-edge);
  /* Rounded, with the cells concentric inside it: 5 − 1 (border) − 2 (pad) = 2. */
  border-radius: 5px;
  vertical-align: middle;
  transition: border-color var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard);
}
.sal-battery--lg {
  --battery-w: 69px;
  --battery-gap: 2px;
}
.sal-battery::after {       /* the nub, flush outside the right edge */
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: var(--battery-nub-w);
  height: var(--battery-nub-h);
  margin: calc(var(--battery-nub-h) / -2) 0 0 1px;
  border-radius: 0 2px 2px 0;
  background: var(--battery-edge);
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.sal-battery__cell {
  border-radius: 2px;
  background: var(--battery-off);
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.sal-battery__cell[data-on] { background: var(--battery-color); }
/* A round bigger than ten: one continuous fill (battery.js sets --battery-fill). */
.sal-battery[data-bar] { display: inline-flex; }
.sal-battery__fill {
  width: var(--battery-fill, 0%);
  border-radius: 2px;
  background: var(--battery-color);
  transition: width var(--dur-fast) var(--ease-standard), background-color var(--dur-fast) var(--ease-standard);
}
.sal-battery[data-bar]::before {   /* the empty part, behind the fill */
  content: "";
  position: absolute;
  inset: var(--battery-pad);
  border-radius: 2px;
  background: var(--battery-off);
  z-index: 0;
}
.sal-battery[data-bar] > .sal-battery__fill { position: relative; z-index: 1; }
.sal-battery[data-empty] { --battery-edge: var(--battery-idle); }
.sal-battery[data-full] { box-shadow: 0 0 8px color-mix(in srgb, var(--battery-color) 45%, transparent); }

/* Toolbar — one calm row of controls above a table or panel. */
.sal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.sal-toolbar__group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.sal-toolbar__spacer { flex: 1; }

/* Key–value list for record metadata:
     <dl class="sal-kv"><dt>Status</dt><dd>Aktiv</dd>…</dl> */
.sal-kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-6);
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
}
.sal-kv dt {
  font-size: var(--fs-overline);
  letter-spacing: var(--ls-overline);
  text-transform: uppercase;
  font-weight: var(--fw-light);
  color: var(--text-muted);
  align-self: baseline;
  padding-top: 0.2em;
}
.sal-kv dd { margin: 0; color: var(--text-secondary); }

/* Quiet empty state — a dashed hairline box, no illustration, no cheer. */
.sal-empty {
  padding: var(--space-8) var(--space-5);
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
}

/* Transcript / conversation feed — a vertical stack of speaker turns. Side
   alignment (left/right) separates the parties; each bubble's cut corner points
   back toward its speaker name. Shared by the live session panel and the
   read-only archive reader.

     <div class="sal-feed">
       <div class="sal-turn sal-turn--left">
         <div class="sal-turn__speaker"><span class="sal-turn__name">Kari</span></div>
         <div class="sal-bubble">…</div>
       </div>
     </div>

   Add .sal-bubble--editable where a bubble is click-to-edit (session).

   .sal-turn--center is the third party: a voice that belongs to no side of the
   room. Huginn speaking is the case it was drawn for — it is neither of the two
   people talking, and putting it on the left or the right would file it as one
   of them. Centred, narrower than a human turn, and with no cut corner, because
   there is no speaker's edge for the bubble to point back at. */
.sal-feed { display: flex; flex-direction: column; gap: var(--space-4); }
.sal-turn { display: flex; flex-direction: column; gap: var(--space-2); max-width: 84%; }
.sal-turn--right { align-self: flex-end; align-items: flex-end; }
.sal-turn--left  { align-self: flex-start; align-items: flex-start; }
.sal-turn--center {
  align-self: center; align-items: center; text-align: center;
  /* Narrower than the 84% a human turn may take. The centre column has no
     edge to be measured against, so without a ceiling a long reply spans the
     full width and stops reading as a turn at all; 62ch keeps it a paragraph. */
  max-width: min(62ch, 84%);
}
.sal-turn__speaker {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-inline: var(--space-2);
}
.sal-turn__name {
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  font-size: var(--fs-body-lg);
  color: var(--accent-quiet);
  line-height: 1;
}
.sal-bubble {
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-body);
  font-weight: var(--fw-light);
  line-height: var(--lh-normal);
  color: var(--text-secondary);
  word-break: break-word;
}
.sal-turn--right .sal-bubble { border-top-right-radius: var(--radius-xs); background: var(--surface-raised); }
.sal-turn--left  .sal-bubble { border-top-left-radius: var(--radius-xs); }
/* No cut corner (see above), and the gold hairline the rest of the system uses
   for Sál's own voice — the same rule that underlines an eyebrow. It reads as
   set apart from the room without shouting louder than the people in it. */
.sal-turn--center .sal-bubble { border-color: var(--rule-gold); background: var(--surface-raised); }
/* Click-to-edit affordance (live session). */
.sal-bubble--editable { cursor: pointer; transition: border-color var(--dur-fast) var(--ease-standard); }
.sal-bubble--editable:hover { border-color: var(--border-strong); }

/* The account row: .sal-settings--row, the webapp-template's NavUser.
   A host asks for it with data-sal-settings="row" (admin's rail does).
   Initials, the name over a smaller address, ChevronsUpDown; the menu opens
   upward and is exactly as wide as the row, so it always fits where the row
   sits. signed-in.js builds the avatar. --folded (the rail folded to icons)
   keeps only the avatar and opens the menu to its right. */
.sal-settings--row { width: 100%; min-width: 0; }
/* [data-account]: the top bar gives an account button its own width at that weight. */
.sal-settings--row[data-account] .sal-settings__trigger,
.sal-settings--row .sal-settings__trigger {
  width: 100%; max-width: none; min-width: 0; min-height: 48px; box-sizing: border-box;
  justify-content: flex-start; gap: var(--space-2);
  padding: var(--space-2);
  background: transparent; border-color: transparent;
  border-radius: var(--radius-sm);
}
@media (hover: hover) and (pointer: fine) {
  .sal-settings--row .sal-settings__trigger:hover { background: var(--surface-hover); border-color: transparent; }
}
.sal-settings--row[data-open] .sal-settings__trigger { background: var(--surface-hover); border-color: transparent; }
.sal-settings--row .sal-settings__trigger:active { transform: none; }
.sal-settings--row .sal-account__avatar {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-primary);
  font-size: var(--fs-caption); font-weight: var(--fw-semibold); letter-spacing: 0;
}
.sal-settings--row .sal-account__who { flex: 1 1 auto; min-width: 0; gap: 2px; text-align: left; }
.sal-settings--row .sal-account__name { font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); color: var(--text-primary); }
.sal-settings--row .sal-account__email { font-size: var(--fs-caption); color: var(--text-muted); }
/* ChevronsUpDown (Lucide) in place of the cog: the row opens a menu. */
.sal-settings--row .sal-settings__cog { flex: none; margin-left: auto; color: var(--icon-color); }
.sal-settings--row .sal-settings__cog svg { display: none; }
.sal-settings--row .sal-settings__cog::before {
  content: ""; display: block; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sal-settings--row[data-open] .sal-settings__cog { transform: none; }
/* The menu opens upward, exactly as wide as the row: it always fits inside
   the rail and follows it when the rail is dragged wider or narrower. */
.sal-settings--row .sal-settings__menu { top: auto; bottom: calc(100% + var(--space-2)); left: 0; right: auto; width: 100%; min-width: 0; box-sizing: border-box; }

.sal-settings--row .sal-settings__theme { flex-wrap: wrap; row-gap: var(--space-2); }
.sal-settings--row .sal-account__static { overflow-wrap: anywhere; }
.sal-settings--row.sal-settings--folded .sal-account__who,
.sal-settings--row.sal-settings--folded .sal-settings__cog { display: none; }
.sal-settings--row.sal-settings--folded[data-account] .sal-settings__trigger,
.sal-settings--row.sal-settings--folded .sal-settings__trigger { width: 32px; min-height: 32px; padding: 0; justify-content: center; }
.sal-settings--row.sal-settings--folded .sal-settings__menu { left: calc(100% + var(--space-2)); bottom: 0; width: 16rem; }
/* The fold button of a side panel (sidebar.js): an icon button in the icon colour. */
.sal-sidebar-toggle { flex: none; color: var(--icon-color); }

/* A side panel's resize handle and fold button (sidebar.js). The handle is
   an 8 px strip on the panel's inner edge; a 2 px line shows under the
   pointer, while dragging and on keyboard focus. */
.sal-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}
.sal-resizer--left { right: -4px; }
.sal-resizer--right { left: -4px; }
.sal-resizer[hidden] { display: none; }
.sal-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: transparent;
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.sal-resizer:hover::after,
.is-resizing .sal-resizer::after { background: var(--border-strong); }
.sal-resizer:focus-visible::after { background: var(--focus-ring); }
.is-resizing, .is-resizing * { cursor: col-resize !important; user-select: none !important; }
.sal-sidebar-toggle[hidden] { display: none; }

/* ---------- Feedback ---------- */

/* Dialog: a <dialog> element, or any element toggled with [open]. */
/* display:flex would otherwise defeat the hidden attribute. */
.sal-scrim[hidden] { display: none; }
.sal-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: var(--overlay-scrim);
  backdrop-filter: blur(3px);
  animation: sal-fade var(--dur-base) var(--ease-standard);
}
.sal-dialog {
  position: relative;
  z-index: var(--z-dialog);
  width: 100%;
  max-width: 480px;
  box-sizing: border-box;
  /* The page's own background: the scrim behind already darkens and blurs
     the page, so a lighter panel on top read as glaring. 24px inset (the
     webapp-template's dialog). No rule above the title — the short gold bar
     that used to open every dialog was the old identity's ornament. */
  background: var(--bg-page);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  animation: sal-rise var(--dur-slow) var(--ease-out);
}
/* The dialog's title and its one line of explanation. One look in every
   dialog: the heading type, bold, like a page's section headings. */
.sal-dialog__title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--fs-heading-2);
  font-weight: var(--fw-display);
  letter-spacing: var(--ls-normal);
  line-height: var(--lh-snug);
  color: var(--text-primary);
}
.sal-dialog__text { margin: calc(-1 * var(--space-2)) 0 var(--space-4); color: var(--text-secondary); line-height: var(--lh-relaxed); }
.sal-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

/* A key on the keyboard, wherever a <kbd> appears: small and square, a little
   heavier along the bottom edge the way a keycap is, and only as wide as its
   label needs — «n» and «/» are square, «Esc» is a wider key, as it is on a
   real keyboard. */
kbd, .sal-kbd {
  display: inline-grid; place-items: center;
  box-sizing: border-box;
  min-width: 22px; height: 22px; padding: 0 5px;
  font-family: var(--font-body); font-size: var(--fs-caption); font-weight: var(--fw-medium);
  line-height: 1; text-align: center; letter-spacing: 0;
  color: var(--text-primary);
  background: var(--control-bg);
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 5px;
  vertical-align: middle;
}

.sal-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 280px;
  max-width: 420px;
  box-sizing: border-box;
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  /* A CEILING, because a toast is anchored to the bottom of the window and
     grows upward: a message longer than the screen leaves its own first line
     off the top, which is the one line that says what happened. Nothing should
     ever be that long — a toast says one thing — but the anchor makes the
     failure invisible to whoever wrote the message, so the box refuses rather
     than trusting every caller. */
  max-height: min(50vh, 20rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* Status reads from a small leading dot — the same mark as .sal-badge__dot and
   the live indicator — not a coloured border bar. Default gold; the semantic
   modifiers recolour only the dot, and the ember variant carries the brand
   glow so it reads as "live/attention", not error. */
.sal-toast::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--gold-500);
}
.sal-toast--success::before { background: var(--success); }
.sal-toast--danger::before  { background: var(--danger-text); }
.sal-toast--ember::before   { background: var(--ember-500); box-shadow: var(--glow-ember); }

/* Centre-bottom fixed placement — was copy-pasted into three apps' <style>.
   Toggle .show to reveal; the box itself stays .sal-toast[+ status modifier]. */
.sal-toast--fixed {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  transform: translateX(-50%) translateY(12px);
  z-index: var(--z-toast);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--dur-fast) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard);
}
.sal-toast--fixed.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.sal-toast__title {
  font-family: var(--font-body);
  font-weight: var(--fw-medium);
  font-size: var(--fs-body-sm);
  color: var(--text-primary);
}
.sal-toast__msg {
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  color: var(--text-muted);
}
/* The two of them share the middle column, so a title and its message stack
   rather than sitting side by side. */
.sal-toast__body { flex: 1 1 auto; min-width: 0; }
/* THE WAY OUT. A toast that says something worth reading has to be allowed to
   stay, and anything allowed to stay has to be dismissible — it sits over the
   bottom of the page it is talking about. Small, quiet, and after the message:
   it is the last thing in the box, not an equal of the sentence.
   `.sal-toast--fixed` is pointer-events: none while hidden so it never eats a
   click through an invisible box; the shown state gives them back, or this
   button could not be pressed at all. */
.sal-toast__close {
  flex: none;
  margin: -4px -8px -4px 0;
  color: var(--text-faint);
}
.sal-toast__close:hover { color: var(--text-primary); }

/* Tooltip: <span class="sal-tooltip" data-tip="Label">…</span> */
.sal-tooltip { position: relative; display: inline-flex; }
.sal-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  z-index: var(--z-tooltip);
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--cream-200);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-standard);
}
.sal-tooltip:hover::after,
.sal-tooltip:focus-within::after { opacity: 1; }

/* Rich tooltip: same trigger, a wider box for a *list* rather than a single
   label — several microphones, the four model roles and their service, a
   block of session facts. Feed the lines through data-tip separated by real
   newlines (an HTML attribute value can hold one as-is); pre-line turns each
   into a break while still collapsing runs of spaces and still wrapping a
   line too long for the cap below. Left-aligned on purpose — a centred list
   reads as decoration, not information.

     <span class="sal-tooltip sal-tooltip--rich" data-tip="Mic 1 — tilkoblet
Mic 2 — frakoblet">…</span>

   This is layered on top of .sal-tooltip, not a replacement for it: surface,
   radius, shadow, z-index and the opacity fade above carry over untouched —
   opacity is only restated below because a transition shorthand must list
   every property it drives together; its duration is inherited as-is, not
   re-approved here. The scale-in is the one thing this variant actually
   adds, and it alone is what follows house motion rules — starts at 0.97
   (never 0, nothing pops from nothing), anchored where the box meets its
   trigger, settled well under the 200ms a tooltip has before the delay
   starts reading as lag, at 160ms ease-out.

   Accessibility: data-tip is CSS generated content (attr()) rendered by a
   pointer-events:none pseudo-element — it is never exposed to assistive
   tech, so a screen reader gets only the trigger's own aria-label and
   nothing of what this box says. Fine for a one-word label duplicating
   visible text; not fine for this variant, whose entire purpose is
   carrying information (which mics are connected, which service fills
   each role). Any consumer of --rich MUST mirror the data-tip text into
   the trigger's aria-label — there is no CSS-only way to make this
   announced. */
.sal-tooltip--rich::after {
  /* `pre`, not `pre-line`: a row here is one fact — «Økt 350572b3-…-4b9b909fca00»,
     «ASR — sonetra» — and a fact broken across two lines reads as two. So the
     newlines in data-tip are the ONLY breaks; everything else widens the box
     instead, up to the cap below. The cap is sized past the longest row this is
     ever asked to carry (a full uuid behind its label) so that in practice
     nothing reaches it, and `overflow: hidden` is only the backstop for a value
     nobody planned for — a model's error detail — which is clipped rather than
     allowed to run off the side of the viewport. */
  white-space: pre;
  overflow: hidden;
  width: max-content;
  text-align: left;
  max-width: min(32rem, calc(100vw - var(--space-6)));
  transform: translateX(-50%) scale(0.97);
  transform-origin: bottom center;
  transition:
    opacity var(--dur-fast) var(--ease-standard),
    transform 160ms var(--ease-out);
}
.sal-tooltip--rich:hover::after,
.sal-tooltip--rich:focus-within::after { transform: translateX(-50%) scale(1); }

/* Anchor the box's right edge to the trigger instead of centring it — the
   last icon in a toolbar has no room to spare on its right, and a centred
   box there would push half of itself past the viewport edge. Combines with
   --rich (the common case: a mic/model list off the last toolbar icon) but
   stands alone too, since a long single-line tip can overrun the same edge. */
.sal-tooltip--right::after { left: auto; right: 0; transform: none; }
.sal-tooltip--right.sal-tooltip--rich::after { transform: scale(0.97); transform-origin: bottom right; }
.sal-tooltip--right.sal-tooltip--rich:hover::after,
.sal-tooltip--right.sal-tooltip--rich:focus-within::after { transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  /* The centring translateX is layout, not motion — keep it and drop only
     the scale, or a reduced-motion reader gets a tooltip stuck off-centre. */
  .sal-tooltip--rich::after,
  .sal-tooltip--rich:hover::after,
  .sal-tooltip--rich:focus-within::after { transform: translateX(-50%); }
  .sal-tooltip--right.sal-tooltip--rich::after,
  .sal-tooltip--right.sal-tooltip--rich:hover::after,
  .sal-tooltip--right.sal-tooltip--rich:focus-within::after { transform: none; }
}

/* ---------- Context menu ---------- */

/* The right-click surface — one menu for every row that has more to offer than
   its single primary click (a round, a person, a file). The markup is built by
   /design-system/menu.js (SalMenu); these are the classes it emits, and nothing
   here assumes that script, so the same classes can be written by hand.

     <div class="sal-menu" role="menu">
       <p class="sal-menu__title">Runde 3</p>
       <div class="sal-menu__body">
         <button class="sal-menu__item">…</button>
       </div>
       <div class="sal-menu__foot">
         <button class="sal-menu__item sal-menu__item--danger">…</button>
       </div>
     </div>

   Three bands: only the middle one scrolls, so a long list never pushes the
   destructive action at the foot out of reach.

   It is placed AT the pointer and scales out of the corner nearest it (menu.js
   writes left/top and transform-origin), so it reads as having come from the
   click rather than from the page. A light material, not a dialog's: no scrim
   and nothing dimmed — this layer sits beside the content, it does not block
   it. */
.sal-menu {
  position: fixed;
  z-index: var(--z-menu);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 208px;
  max-width: min(360px, calc(100vw - 2 * var(--space-4)));
  max-height: min(70vh, 460px);
  padding-block: var(--space-2);
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  /* The deep shadow, though the surface is small: this one lands ON a table of
     text, and separation is what it is for. */
  box-shadow: var(--shadow-lg);
  /* Enter 150ms, exit 100ms (see [data-closing]) — the system responds faster
     than it announces itself. Not --dur-fast: a menu is opened tens of times an
     hour, and 350ms on this reads as lag. */
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
/* Pre-open and closing state. Never scale(0) — the menu shrinks toward the
   pointer, it does not come out of nothing. */
.sal-menu:not([data-open]) { opacity: 0; transform: scale(0.96); }
.sal-menu[data-closing] { transition-duration: 100ms; }
.sal-menu:focus { outline: none; }

/* A floating layer over changing content: frosted where the browser can, solid
   where it cannot (or where the reader asked for less transparency). */
@supports (backdrop-filter: blur(1px)) {
  .sal-menu {
    background: color-mix(in srgb, var(--surface-raised) 86%, transparent);
    backdrop-filter: blur(16px) saturate(140%);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .sal-menu { background: var(--surface-raised); backdrop-filter: none; }
}

/* The object the menu is about — «Runde 3», a person's name. Sentence case,
   Cormorant, and a hairline closing it off from the actions below. */
.sal-menu__title {
  flex: none;
  margin: 0;
  padding: 0 var(--space-4) var(--space-2);
  font-family: var(--font-display);
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-display);
  line-height: var(--lh-snug);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-hairline);
}
.sal-menu__title + .sal-menu__body { padding-top: var(--space-2); }

/* Only the list scrolls — a long list of files must not push the title, or the
   action at the foot, out of the menu. */
.sal-menu__body {
  overflow-y: auto;
  overscroll-behavior: contain;
  /* A thin, always-drawn bar rather than an overlay one that appears on the
     first scroll: the whole question a capped list raises is «is there more
     below?», and the bar is the answer. */
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.sal-menu__foot {
  flex: none;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-hairline);
}

.sal-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-sizing: border-box;
  width: 100%;
  padding: 8px var(--space-4);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-light);
  letter-spacing: var(--ls-wide);
  line-height: var(--lh-snug);
  text-align: left;
  text-decoration: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 120ms var(--ease-out), color 120ms var(--ease-out);
}
/* Keyboard and pointer land on the same highlight — the row IS the indicator,
   so no ring is drawn on top of it. Hover is not gated behind a media query
   here: a menu only exists while it is open, so a phone can never leave a
   stuck hover behind it. */
.sal-menu__item:hover,
.sal-menu__item:focus,
.sal-menu__item:focus-visible {
  background: var(--surface-hover);
  color: var(--text-primary);
  outline: none;
}
.sal-menu__item:visited { color: var(--text-secondary); }
.sal-menu__item[aria-disabled="true"] {
  color: var(--text-muted);
  cursor: default;
  background: transparent;
}

/* The one action that does not come back. It stays quiet until it is under the
   pointer — a menu should not shout on the way past — and only then takes the
   crimson wash. */
.sal-menu__item--danger { color: var(--danger-text); }
.sal-menu__item--danger:hover,
.sal-menu__item--danger:focus,
.sal-menu__item--danger:focus-visible {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger-text);
}

.sal-menu__icon { flex: none; width: 15px; height: 15px; }
.sal-menu__lines { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.sal-menu__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sal-menu__lines .sal-menu__label { flex: none; }
/* The second line of a two-line row: when, where, about whom. */
.sal-menu__meta {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sal-menu__hint { flex: none; color: var(--text-muted); font-size: var(--fs-caption); }

/* A row that carries its own trailing action (delete this one file). The row
   and the action are separate targets, so a mis-aimed click opens rather than
   destroys. */
.sal-menu__row { display: flex; align-items: stretch; }
.sal-menu__row .sal-menu__item { padding-right: var(--space-2); }
.sal-menu__act {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  margin-right: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  opacity: 0.5;
  cursor: pointer;
  transition: background 120ms var(--ease-out), color 120ms var(--ease-out),
              opacity 120ms var(--ease-out);
}
.sal-menu__row:hover .sal-menu__act { opacity: 1; }
.sal-menu__act:hover,
.sal-menu__act:focus,
.sal-menu__act:focus-visible {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger-text);
  opacity: 1;
  outline: none;
}

/* A row you can tick. The box is drawn whether or not it is ticked, so marking
   the list up moves nothing; the tick itself is always in the DOM and revealed
   by colour, for the same reason. */
.sal-menu__mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  box-sizing: border-box;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  color: transparent;
  transition: background 120ms var(--ease-out), border-color 120ms var(--ease-out),
              color 120ms var(--ease-out);
}
.sal-menu__item--selected { color: var(--text-primary); }
.sal-menu__item--selected .sal-menu__mark {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-ember);
}
/* Ember, not a grey highlight: a marked row is the ACTION colour, so a marked
   set reads at a glance against the plain rows around it — and still reads when
   the pointer highlight sits on top of one of them. */
.sal-menu__item--selected,
.sal-menu__item--selected:visited { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sal-menu__item--selected:hover,
.sal-menu__item--selected:focus,
.sal-menu__item--selected:focus-visible {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text-primary);
}

/* Group label inside the list — the same overline the cards use. */
.sal-menu__heading {
  margin: var(--space-2) 0 var(--space-1);
  padding: 0 var(--space-4);
  font-family: var(--font-body);
  font-size: var(--fs-overline);
  letter-spacing: var(--ls-overline);
  text-transform: uppercase;
  font-weight: var(--fw-light);
  color: var(--text-muted);
}

/* The heading as a bar: what the list is called on the left, the one thing you
   can do to it on the right («Tester (7)  ·  marker flere»). When the list is in
   a mode, the left slot becomes the control too and the right one leaves it. */
.sal-menu__bar {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-4) var(--space-1);
}
.sal-menu__bar .sal-menu__heading {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
}
/* Text controls, not buttons — a bar of two buttons would out-weigh the list
   it labels. The lead one carries the consequence, so it takes the colour. */
.sal-menu__lead,
.sal-menu__link {
  padding: 0;
  background: transparent;
  border: 0;
  font-family: var(--font-body);
  font-weight: var(--fw-light);
  letter-spacing: var(--ls-wide);
  line-height: var(--lh-snug);
  cursor: pointer;
  transition: color 120ms var(--ease-out);
}
.sal-menu__lead {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  font-size: var(--fs-body-sm);
  color: var(--accent-quiet);
}
.sal-menu__link {
  flex: none;
  font-size: var(--fs-caption);
  color: var(--accent-quiet);
}
.sal-menu__lead:hover,
.sal-menu__lead:focus,
.sal-menu__lead:focus-visible,
.sal-menu__link:hover,
.sal-menu__link:focus,
.sal-menu__link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}
.sal-menu__lead--danger { color: var(--danger-text); }
.sal-menu__lead--danger:hover,
.sal-menu__lead--danger:focus,
.sal-menu__lead--danger:focus-visible { color: var(--danger-text); }
.sal-menu__lead[aria-disabled="true"] {
  color: var(--text-muted);
  cursor: default;
  text-decoration: none;
}
/* A line that says something rather than doing something (an empty list). */
.sal-menu__note {
  margin: 0;
  padding: 4px var(--space-4) 8px;
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-light);
  color: var(--text-muted);
}
.sal-menu__sep {
  height: 1px;
  margin: var(--space-2) 0;
  background: var(--border-hairline);
}

/* The row a menu is currently open on keeps a mark, so it is obvious which one
   the menu belongs to once the pointer has moved off it. */
[data-sal-menu-open] { background: var(--surface-hover) !important; }

@keyframes sal-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes sal-rise {
  from { opacity: 0; transform: translateY(12px) }
  to   { opacity: 1; transform: none }
}

/* Calm motion is part of the brand — but never at the cost of accessibility. */
@media (prefers-reduced-motion: reduce) {
  .sal-btn,
  .sal-card,
  .sal-tag,
  .sal-table tbody tr,
  .sal-table__sort svg,
  .sal-table__expand,
  .sal-table__expand svg,
  .sal-tab::after,
  .sal-switch__track,
  .sal-switch__track::after,
  .sal-input, .sal-textarea, .sal-select {
    transition: none;
  }
  .sal-card--interactive:hover { transform: none; }
  /* Reduced motion is gentler feedback, not none: the press nudge and the
     tick's growth are displacement and go, the opacity fade that says the box
     is now ticked stays. */
  .sal-btn:active,
  .sal-icon-btn:active { transform: none; }
  :is(.sal-check, .sal-table__check) input[type="checkbox"]::before, input[type="checkbox"].sal-checkbox::before,
  .sal-check input[type="radio"]::before {
    transform: none;
    transition: opacity var(--dur-quick) var(--ease-out);
  }
  .sal-scrim, .sal-dialog { animation: none; }
  /* The menu still fades — that is what says «this is new» — but it no longer
     travels or scales. */
  .sal-menu { transition: opacity 100ms var(--ease-out); }
  .sal-menu:not([data-open]) { transform: none; }
  .sal-menu__mark { transition: none; }
}

/* ── Dangerous actions ────────────────────────────────────────────────────
   Never a grey button with red words. A dangerous action that is not yet the
   confirmation is only its red words, and turns fully red under the pointer;
   only the CONFIRMING button (in the dialog that asks «are you sure») is
   solid red before it is touched. On red, text is white in both themes. */
:root { --text-on-danger: #FFFFFF; }
.sal-btn.reg-btn--danger-ghost, .sal-btn.reg-btn--danger-ghost:visited,
.sal-btn.lad-withdraw {
  background: transparent; border-color: transparent; color: var(--danger-text);
}
.sal-btn.reg-btn--danger-ghost:hover:not(:disabled),
.sal-btn.lad-withdraw:hover:not(:disabled) {
  background: var(--danger); border-color: var(--danger); color: var(--text-on-danger);
}
/* The confirming buttons: the dialogs' «Slett …» (.reg-btn--danger, and the
   group page's confirm dialog, which marks its OK .btn-danger) and the map's
   «Lagre» when saving would drop answers. */
.sal-btn.btn-danger, .sal-btn.btn-danger:visited { background: var(--danger); border-color: var(--danger); }
.sal-btn.btn-danger:hover { background: color-mix(in srgb, var(--danger) 86%, var(--bg-page)); border-color: var(--danger); }
.sal-btn.reg-btn--danger, .sal-btn.reg-btn--danger:hover,
.sal-btn.btn-danger, .sal-btn.btn-danger:hover, .sal-btn.btn-danger:visited,
.ws .sal-btn.ws-danger-btn, .ws .sal-btn.ws-danger-btn:hover { color: var(--text-on-danger); }
