/* rigg components. Colors, type, spacing, radius, sizes and shadows come only from tokens.css
   (generated from design/tokens.json): no literal colors here, so both themes and forced-colors
   mode work everywhere. WCAG 2.2 AA is the floor — see design/README.md. */

/* ---------- Base ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute always wins: components set display (grid/flex), which otherwise overrides it and shows
   e.g. the 2FA error box empty on every login. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-family: var(--font-display); font-size: 32px; line-height: 36px; font-weight: 600; }
h2 { font-size: 22px; line-height: 28px; font-weight: 600; }
h3 { font-size: 17px; line-height: 24px; font-weight: 600; }
p { margin: 0; max-width: 68ch; }
a { color: var(--cue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--spike-soft); color: var(--ink); }
code, kbd, samp { font-family: var(--font-mono); font-size: 13px; }

/* Focus: always visible, never obscured (WCAG 2.4.7, 2.4.11). 3px, ≥3:1 on every surface. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
html { scroll-padding-top: 72px; } /* keep focused/anchored elements clear of the sticky top bar */

/* Icons are <use> instances of the sprite: they inherit paint from the <svg class="icon">, not from the sprite's
   own root, so stroke must be set here. Without it they paint black on dark surfaces (invisible in Show). */
.icon { width: 20px; height: 20px; flex: none; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; vertical-align: -3px; }
.icon--lg { width: 32px; height: 32px; }
.icon--xl { width: 48px; height: 48px; }
/* The sprite itself (templates/rigg/icon_sprite.html): zero size and out of the flow, but not display: none. */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* HTMX request indicators; htmx-config.js stops htmx injecting these as an inline <style>. */
.htmx-indicator { opacity: 0; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; transition: opacity 200ms ease-in; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  background: var(--spike); color: var(--on-spike); padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--space-2); }

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

/* ---------- Layout ------------------------------------------------------------------------- */
.page {
  max-width: 1280px; margin-inline: auto;
  padding-block: var(--space-6) var(--space-7);
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: var(--space-5);
}
@media (min-width: 760px) {
  .page { padding-left: max(var(--space-5), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-5), env(safe-area-inset-right, 0px)); }
}
/* Narrow single-column pages (sign-in, 2FA, invitations) and the version footer; classes, not style="…", which the
   Content-Security-Policy blocks (apps/core/csp.py). */
.page--narrow { max-width: 480px; }
.page--sm { max-width: 560px; }
.page--md { max-width: 640px; }
.page--footer { padding-block: 0 var(--space-5); }
.inline-form { display: inline; }
/* Page head: title, its status badge right beside it, then the actions as one group at the right end
   (`.page-head__actions` or a `.cluster`; loose buttons after the title/badge are pushed right the same way). */
.page-head { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-3) var(--space-4); }
.page-head__text { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
/* A long name (one word longer than a phone is wide) breaks instead of widening the page (#617). */
.page-head h1 { overflow-wrap: anywhere; }
.page-head > .badge { margin-bottom: calc((36px - var(--target-min)) / 2); } /* centred on the h1 line */
.page-head > :is(.page-head__text, .badge) + :not(.badge), .page-head__actions { margin-left: auto; }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* The company's logo on the customer's quote and running order (#2337). The <img> carries data-theme="light", so its
   plate is the light card in both themes and a dark logo shows in the dark theme too; at most 56 px high and 200 px
   wide, never stretched. */
.brand-logo { display: block; width: auto; height: auto; max-height: 56px; max-width: min(200px, 100%); object-fit: contain; background: var(--surface-raised); padding: var(--space-1); border-radius: var(--radius-sm); }
/* The company's colour on those pages: the stylesheet behind the page's token (apps/projects/branding.py) sets
   --brand-title (the colour, or --ink where it fails 4.5:1) and --primary; without it the title inherits as before. */
.brand-scope h1 { color: var(--brand-title); }
.eyebrow, .label { font-family: var(--font-sans); font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-muted); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* Cards side by side (Innstillinger's overview, #1749): as many 14rem columns as fit, so 4 at 1440px, 2 at 768px
   beside the open sidebar and 1 on a phone; min(100%, …) never scrolls sideways. Cards in a row share its height. */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: var(--space-4); align-items: stretch; }
/* A short list of links without bullets (a card's links); each link is at least the 24px target (WCAG 2.5.8) and
   keeps the global 3px focus ring. */
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.link-list a { display: inline-flex; align-items: center; min-height: var(--target-min); border-radius: var(--radius-sm); }
.muted { color: var(--ink-muted); }

/* ---------- Top bar (app shell) ------------------------------------------------------------ */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5);
  min-height: 56px; padding-block: var(--space-2);
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
  background: var(--surface-raised); border-bottom: 1px solid var(--line);
}
/* Wide but low (a phone on its side, #536): the bar scrolls with the page, like the app's page head below 560px. */
@media (min-width: 760px) and (max-height: 559px) {
  .topbar { position: relative; }
  html { scroll-padding-top: 0; }
}
.brand {
  display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 32px; letter-spacing: 0.01em;
}
.brand__logo { display: block; height: 22px; width: auto; flex: none; color: var(--ink); }
.brand__letters { fill: currentColor; }
.brand__cue { fill: var(--spike); }
/* GoPlan's wordmark (templates/rigg/logo_goplan.html, #839): the name in the display face over the spike cue line. */
.brand__wordmark { display: block; flex: none; font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 20px; letter-spacing: 0; color: var(--ink); border-bottom: 3px solid var(--spike); padding-bottom: 1px; white-space: nowrap; }
.brand__tenant { font-family: var(--font-sans); font-size: 15px; font-weight: 500; color: var(--ink-muted); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar__nav { display: flex; gap: var(--space-1); overflow-x: auto; flex: 1 1 auto; min-width: 0; }
.topbar__nav a {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-md);
  padding: 0 var(--space-3); color: var(--ink-muted); text-decoration: none; font-weight: 500; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.topbar__nav a:hover { color: var(--ink); }
.topbar__nav a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }
.topbar__end { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }

/* ---------- Top-bar shell (platform admin only, templates/platform/shell.html; the app uses .sidebar below) ----------
   Top categories, collapsible sidebar, profile menu, phone drawer. Sidebar state lives on
   <html data-sidebar="expanded|collapsed"> (set before first paint, remembered in localStorage["rigg-sidebar"]).
   Menus are disclosure buttons (aria-expanded), not ARIA menus. .iconbtn, .profilebtn, .avatar and .menu are shared. */
.appbar { flex-wrap: nowrap; gap: var(--space-2) var(--space-4); }
.appbar .topbar__nav { align-self: stretch; align-items: stretch; margin-block: calc(-1 * var(--space-2)); }
.appbar .topbar__nav a { min-height: 56px; }
.iconbtn {
  position: relative; display: inline-grid; place-items: center; flex: none; width: var(--control-md); height: var(--control-md); padding: 0;
  border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink-muted); cursor: pointer; text-decoration: none;
}
.iconbtn:hover { background: var(--surface-sunken); color: var(--ink); }
.iconbtn[aria-current] { background: var(--spike-soft); color: var(--ink); }
.iconbtn:disabled { cursor: not-allowed; opacity: 0.6; }
.iconbtn:disabled:hover { background: transparent; color: var(--ink-muted); }
.iconbtn__count { position: absolute; top: 0; right: -2px; min-width: 18px; padding: 0 5px; font-size: 11px; line-height: 18px; text-align: center; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-pill); background: var(--ink); color: var(--surface-raised); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.profilebtn {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-md); padding: 0 var(--space-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--ink); cursor: pointer;
}
.profilebtn:hover { background: var(--surface-sunken); }
.menu { position: relative; }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: 30; width: 280px; max-width: calc(100vw - var(--space-4));
  padding: var(--space-2); background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay);
}
.menu__panel[hidden] { display: none; }
.menu__who { display: flex; flex-direction: column; padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--line); margin-bottom: var(--space-1); overflow-wrap: anywhere; }
.menu__list { list-style: none; margin: 0; padding: 0; }
.menu__list a, .menu__list button {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--control-md); padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.menu__list a:hover, .menu__list button:hover { background: var(--surface-sunken); }
.menu__heading { padding: var(--space-3) var(--space-3) var(--space-1); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.menu__theme { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); }
.menu__label { color: var(--ink); }
/* A sub-menu (profile menu › Hjelp): a disclosure button whose links open indented below it, in the same panel. */
.menu__sub > button .icon:last-child { margin-left: auto; transition: transform 120ms ease; }
.menu__sub > button[aria-expanded="true"] .icon:last-child { transform: rotate(180deg); }
.menu__sub > .menu__list { padding-left: var(--space-5); }
.menu__sub > .menu__list[hidden] { display: none; }

.shell { display: block; }
@media (min-width: 760px) {
  .shell--side { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 56px); }
  html[data-sidebar="collapsed"] .shell--side { grid-template-columns: 64px minmax(0, 1fr); }
}
.shell > main { min-width: 0; }
/* The nav is the full-height column (its background reaches the bottom of the page); the inner part sticks under the top bar. */
.sidenav { display: none; background: var(--surface-raised); border-right: 1px solid var(--line); }
.sidenav__inner {
  display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3);
  position: sticky; top: 56px; max-height: calc(100vh - 56px); overflow-y: auto;
}
@media (min-width: 760px) { .sidenav { display: block; } }
.sidenav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sidenav__title { padding: var(--space-3) var(--space-3) var(--space-1); }
.sidenav__list { flex: 1 1 auto; list-style: none; margin: 0; padding: 0; }
.sidenav__section { margin-top: var(--space-2); } /* a sub-heading inside the category (CRM › Økonomi) */
.sidenav__toggle, .sidenav__link {
  position: relative; display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--control-md); padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink-muted); font: inherit; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
}
.sidenav__toggle:hover, .sidenav__link:hover { background: var(--surface-sunken); color: var(--ink); }
.sidenav__link[aria-current="page"] { background: var(--spike-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--ink); }
.sidenav__icon-collapsed { display: none; }
html[data-sidebar="collapsed"] .sidenav__icon-collapsed { display: inline; }
html[data-sidebar="collapsed"] .sidenav__icon-expanded { display: none; }
/* Icon rail: names stay in the accessibility tree (visually hidden), targets are 40px, tooltip shows on hover and focus. */
html[data-sidebar="collapsed"] .sidenav__label, html[data-sidebar="collapsed"] .sidenav__title {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
html[data-sidebar="collapsed"] .sidenav__toggle, html[data-sidebar="collapsed"] .sidenav__link { justify-content: center; padding: 0; }
html[data-sidebar="collapsed"] .sidenav__link:hover::after, html[data-sidebar="collapsed"] .sidenav__link:focus-visible::after {
  content: attr(data-tip); position: absolute; left: calc(100% + var(--space-2)); top: 50%; transform: translateY(-50%); z-index: 30;
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--ink); color: var(--surface-raised); white-space: nowrap; font-size: 14px;
}
html[data-tip-hidden] .sidenav__link::after { display: none !important; } /* Escape dismisses the tooltip (WCAG 1.4.13) */

.drawer { position: fixed; inset: 0; z-index: 40; display: flex; }
.drawer[hidden] { display: none; }
.drawer__backdrop { position: absolute; inset: 0; background: var(--ink); opacity: 0.5; }
.drawer__panel {
  position: relative; display: flex; flex-direction: column; gap: var(--space-1); width: min(320px, 88vw); height: 100%; overflow-y: auto;
  padding: var(--space-3); background: var(--surface-raised); border-right: 1px solid var(--line-strong);
}
.drawer__close { align-self: flex-end; }
.drawer__group summary, .drawer__foot a, .drawer__foot button {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--control-lg); padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font: inherit; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
}
.drawer__group ul, .drawer__foot { list-style: none; margin: 0; padding: 0; }
.drawer__group li a { display: flex; align-items: center; min-height: var(--control-lg); padding: 0 var(--space-3) 0 calc(var(--space-3) + 32px); color: var(--ink-muted); text-decoration: none; border-radius: var(--radius-md); }
.drawer__section { margin: 0; padding: var(--space-2) var(--space-3) var(--space-1) calc(var(--space-3) + 32px); }
.drawer__group li a[aria-current="page"] { background: var(--spike-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--ink); }
.drawer__foot { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--line); }
@media (min-width: 760px) { .drawer, .appbar__menu { display: none !important; } }
@media (max-width: 759px) {
  .filters__field, .filters__cols, .filters > .cluster, .page-head > .cluster, .page-head__actions { flex: 1 1 100%; min-width: 0; }
  .filters > .cluster .btn, .page-head > .cluster .btn, .page-head__actions .btn { flex: 1 1 auto; }
  /* The title and its status badge keep the first line (#617): a title wider than the phone breaks beside the badge
     instead of pushing it onto a row of its own («Plukkliste PL-0004 fra Oslo – Alnabru · Åpen»), which kept the
     pick list's first «Skann» under the tab bar (#1282). */
  .page-head > .page-head__text:has(+ .badge) { flex: 1 1 0; }
  /* Phones (#617): a button in a row of actions wraps its words rather than widening the page past the screen. The
     line height keeps a one-line button as it was (the control's min-height still sets it). */
  :is(.page-head__actions, .page-head > .cluster, .card__action, .card__footer, .select-toolbar, .form-actions, .more-menu__body) .btn {
    white-space: normal; overflow-wrap: anywhere; max-width: 100%; line-height: 20px; padding-block: var(--space-1); text-align: center;
  }
}
@media (max-width: 759px) { .appbar__cats, .appbar__search, .appbar__settings { display: none; } .menu__panel { position: fixed; right: var(--space-2); } }
/* Phone (issue 616): the bar never makes the page scroll sideways. What does not fit beside the brand (the environment
   badge, «Avslutt support») wraps to a second row, the end group still at the right edge; the profile button is
   only the avatar (its state is aria-expanded, the chevron was decoration). */
@media (max-width: 759px) {
  .appbar { flex-wrap: wrap; }
  .appbar .topbar__end { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .topbar .profilebtn { width: var(--control-md); padding: 0; justify-content: center; }
  .topbar .profilebtn > .icon { display: none; }
}

/* ---------- App shell (#364): all navigation in the sidebar, content in full width ------------------------------
   design/components/AppShell. <header class="sidebar"> holds the brand, company switcher, search, the categories as
   disclosure groups (.sidebar__group) and, at the foot, bell, gear and profile menu. Collapsed (html[data-sidebar=
   "collapsed"]) it is a 56px icon rail whose groups open as flyouts on hover and focus. Under 760px it is a top strip
   (menu button, brand, bell, gear, profile) and .sidebar__body becomes the drawer (html[data-drawer="open"]). */
.app { display: block; }
.app__content { min-width: 0; }
.app__content > main { min-width: 0; }
.app .page { max-width: none; } /* the content gets the full width next to the sidebar */
.app__footer { padding: 0 max(var(--space-4), env(safe-area-inset-right, 0px)) var(--space-5) max(var(--space-4), env(safe-area-inset-left, 0px)); }
@media (max-width: 759px) {
  /* crew and warehouse: the space kept free above the tab bar moves below the footer */
  .tabbar-shell:has(+ .app__footer) { padding-bottom: 0; }
  .tabbar-shell + .app__footer { padding-bottom: calc(var(--tabbar-height, calc(var(--control-lg) + env(safe-area-inset-bottom, 0px))) + var(--space-3)); }
}
@media (min-width: 760px) { .app__footer { padding-inline: var(--space-5); } }
.sidebar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) max(var(--space-3), env(safe-area-inset-right, 0px)) var(--space-2) max(var(--space-3), env(safe-area-inset-left, 0px));
  background: var(--sidebar); color: var(--sidebar-foreground); border-bottom: 1px solid var(--sidebar-border);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar__head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; flex: 1 1 auto; }
.sidebar__brand { min-height: var(--control-md); padding-inline: var(--space-1); }
.sidebar__toggle, .sidebar__close { display: none; }
.sidebar__foot { display: flex; align-items: center; gap: var(--space-1); }
/* issue 1210: Søk is in the strip on the phone; «Foreslå forbedring» gives it the room (it stays under Profil › Hjelp) */
.sidebar__suggest { display: none; }
.sidebar__body { display: none; }
.sidebar__item, .sidebar__link {
  position: relative; display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--control-md); margin: 0;
  padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--muted-foreground);
  font: inherit; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
}
.sidebar__item:hover, .sidebar__link:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.sidebar__item:focus-visible, .sidebar__link:focus-visible { outline-offset: -3px; } /* inside the scrolling column, never clipped */
.sidebar__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__company, .sidebar__company > button, .sidebar__tenant, .sidebar__tenant > button { color: var(--sidebar-foreground); font-weight: 600; }
p.sidebar__company, p.sidebar__tenant { cursor: default; }
p.sidebar__company:hover, p.sidebar__tenant:hover { background: transparent; color: var(--sidebar-foreground); }
/* the company in the phone's top strip (issue 1126), every role; the column has its own .sidebar__company */
.sidebar__tenant { flex: 1 1 auto; width: auto; min-width: 0; }
.sidebar__tenant.sidebar__item, .sidebar__tenant > .sidebar__item { padding-inline: var(--space-2); gap: var(--space-2); }
.sidebar__mark {
  display: inline-grid; place-items: center; flex: none; min-width: 24px; height: 24px; padding-inline: 3px; border-radius: var(--radius-sm);
  background: var(--foreground); color: var(--background); font-size: 13px; font-weight: 700;
}
/* Company colour (design/components/CompanyMark, issue 1129): on .app for users with several companies only. The
   modifier picks one of the company-* tokens; the mark takes it as fill and a thin edge runs along the top. */
.company-color { --company: var(--foreground); }
.company-color--1 { --company: var(--company-1); }
.company-color--2 { --company: var(--company-2); }
.company-color--3 { --company: var(--company-3); }
.company-color--4 { --company: var(--company-4); }
.company-color--5 { --company: var(--company-5); }
.company-color--6 { --company: var(--company-6); }
.company-color--7 { --company: var(--company-7); }
.company-color--8 { --company: var(--company-8); }
.company-color .sidebar__mark { background: var(--company); color: var(--on-company); }
.company-color::before {
  content: ""; position: fixed; inset: 0 0 auto 0; z-index: 25; height: 3px; background: var(--company); pointer-events: none;
}
.sidebar__search { border: 1px solid var(--input); }
.sidebar__kbd { padding: 0 var(--space-1); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted-foreground); font-size: 12px; line-height: 18px; }
.sidebar__nav { margin-top: var(--space-2); }
.sidebar__groups { display: flex; flex-direction: column; gap: 2px; }
.sidebar__group { position: relative; }
.sidebar__cat[aria-current="page"], .sidebar__group--current > .sidebar__cat { color: var(--sidebar-foreground); font-weight: 600; }
.sidebar__cat[aria-current="page"], .sidebar__link[aria-current="page"] { background: var(--spike-soft); color: var(--foreground); box-shadow: inset 3px 0 0 var(--foreground); }
.sidebar__chevron { display: inline-flex; transition: transform 120ms ease; }
.sidebar__cat[aria-expanded="true"] .sidebar__chevron { transform: rotate(180deg); }
.sidebar__sections { padding: 2px 0 var(--space-2); }
.sidebar__sections ul { display: flex; flex-direction: column; gap: 2px; }
.sidebar__link { padding-left: calc(var(--space-3) + 32px); font-weight: 400; }
/* Issue 1574: a sub-heading (Utstyr › Lager/Verksted, Innstillinger › Firma …) reads as a label, not a link: a muted
   eyebrow in capitals like .menu__heading, set out to the left of the links, with a thin rule above every heading
   but the group's first; the links under it keep the links' indent, so they sit indented under the heading. */
.sidebar__heading {
  margin: 0 var(--space-3) 0 calc(var(--space-3) + 20px); padding: var(--space-2) 0 var(--space-1);
  color: var(--muted-foreground); font-size: 12px; line-height: 16px; letter-spacing: 0.06em; text-transform: uppercase;
}
.sidebar__heading ~ .sidebar__heading { margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.sidebar__flyout-title { display: none; }
.sidebar__backdrop { display: none; }
.sidebar .menu__panel { color: var(--popover-foreground); }
.sidebar .menu__panel--start { left: 0; right: 0; width: auto; } /* the company list, as wide as the column */
.navsearch { display: flex; flex-direction: column; gap: var(--space-2); }
.navsearch__count:empty { display: none; }
.navsearch__results { max-height: min(60vh, 480px); overflow-y: auto; }
.navsearch__heading { margin: var(--space-3) 0 var(--space-1); padding: 0 var(--space-3); }
.navsearch__heading:first-child { margin-top: 0; }
.navsearch__list { list-style: none; margin: 0; padding: 0; }
.navsearch__list a { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-md); padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--foreground); text-decoration: none; }
.navsearch__list a:hover, .navsearch__list a:focus-visible { background: var(--accent); color: var(--accent-foreground); }
.navsearch__list a:focus-visible { outline-offset: -3px; }

/* Phone: the strip, and the drawer when the menu button opens it; every role, crew and warehouse next to their tab bar (issue 2087). */
@media (max-width: 759px) {
  /* the company takes the wordmark's place in the strip (issue 1126), for every role, so the drawer leaves its own out */
  .sidebar__brand, .sidebar__body .sidebar__company { display: none; }
  .sidebar__tenant .menu__panel {
    position: fixed; top: calc(56px + env(safe-area-inset-top, 0px)); left: var(--space-2); right: var(--space-2); width: auto; bottom: auto;
    max-height: calc(100dvh - 56px - env(safe-area-inset-top, 0px) - var(--space-4)); overflow-y: auto;
  }
  .sidebar__foot .iconbtn__count { right: -4px; }
  /* issue 616: the strip fits 320px and up without sideways scroll. The company is the only part that gives way (its name
     ends in an ellipsis, the mark stays); the profile button is only the avatar, a round 40px target as in the rail. */
  .sidebar__head, .sidebar__tenant > button { min-width: 0; }
  .sidebar__tenant > button, p.sidebar__tenant { overflow: hidden; } /* at 320px nothing runs under the icons */
  .sidebar__foot { flex: none; }
  .sidebar__profile .profilebtn { width: var(--control-md); padding: 0; justify-content: center; }
  .sidebar__profile .profilebtn > .icon { display: none; }
  .sidebar__profile .menu__panel {
    position: fixed; top: calc(56px + env(safe-area-inset-top, 0px)); right: var(--space-2); left: auto; bottom: auto;
    max-height: calc(100dvh - 56px - env(safe-area-inset-top, 0px) - var(--space-4)); overflow-y: auto; /* with Hjelp open */
  }
  /* the sticky strip is its own stacking context: lift it while the drawer is open, so the scrim and the drawer
     cover the tab bar (z-index 20, later in the DOM) and its last links are never hidden under it (2.4.11) */
  html[data-drawer="open"] .sidebar { z-index: 40; }
  html[data-drawer="open"] .sidebar__backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: var(--scrim); }
  html[data-drawer="open"] .sidebar__body {
    position: fixed; inset: 0 auto 0 0; z-index: 41; display: flex; flex-direction: column; gap: var(--space-1);
    width: min(320px, 88vw); overflow-y: auto; padding: max(var(--space-3), env(safe-area-inset-top, 0px)) var(--space-3) var(--space-5) max(var(--space-3), env(safe-area-inset-left, 0px));
    background: var(--sidebar); border-right: 1px solid var(--input);
  }
  html[data-drawer="open"] .sidebar__close { display: inline-grid; align-self: flex-end; }
  html[data-drawer="open"] { overflow: hidden; }
  .sidebar__body .sidebar__item, .sidebar__body .sidebar__link { min-height: var(--control-lg); }
}

/* Desktop: a sticky full-height column, 248px or a 56px rail. */
@media (min-width: 760px) {
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); align-items: start; }
  html[data-sidebar="collapsed"] .app { grid-template-columns: 56px minmax(0, 1fr); }
  .sidebar {
    height: 100vh; height: 100dvh; flex-direction: column; align-items: stretch; gap: var(--space-2); padding: var(--space-3) var(--space-2);
    border-bottom: 0; border-right: 1px solid var(--sidebar-border);
  }
  .sidebar__head { flex: none; justify-content: space-between; }
  .sidebar__menu, .sidebar__tenant { display: none; }
  .sidebar__toggle { display: inline-grid; }
  .sidebar__body { display: flex; flex-direction: column; gap: var(--space-1); flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-inline: calc(-1 * var(--space-2)); padding-inline: var(--space-2); }
  .sidebar__foot { position: relative; flex: none; padding-top: var(--space-2); border-top: 1px solid var(--sidebar-border); }
  .sidebar__find { display: none; } /* the column has its own «Søk ⌘K» */
  .sidebar__suggest { display: inline-grid; }
  .sidebar__profile { position: static; margin-left: auto; } /* its menu opens upwards from the foot's left edge */
  .sidebar .menu__panel--up { top: auto; bottom: calc(100% + var(--space-2)); left: 0; right: auto; max-height: calc(100dvh - 96px); overflow-y: auto; }
  .sidebar__toggle[data-tip]:hover::after, .sidebar__toggle[data-tip]:focus-visible::after,
  .sidebar__foot .iconbtn[data-tip]:hover::after, .sidebar__foot .iconbtn[data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + var(--space-1)); transform: translateX(-50%); z-index: 30;
    padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--foreground); color: var(--background); white-space: nowrap; font-size: 14px; line-height: 20px;
  }
  .sidebar__toggle[data-tip]:hover::after, .sidebar__toggle[data-tip]:focus-visible::after { bottom: auto; top: calc(100% + var(--space-1)); }
  .sidebar__icon-collapsed { display: none; }

  /* Icon rail: every name stays in the accessibility tree; targets are 40px; tooltips and flyouts show on hover and
     focus and go away with Escape (WCAG 1.4.13). The column does not scroll, so flyouts are not clipped. */
  html[data-sidebar="collapsed"] .sidebar__body { overflow: visible; margin-inline: 0; padding-inline: 0; }
  html[data-sidebar="collapsed"] .sidebar__head, html[data-sidebar="collapsed"] .sidebar__foot { flex-direction: column; justify-content: flex-start; }
  html[data-sidebar="collapsed"] .sidebar__brand, html[data-sidebar="collapsed"] .sidebar__kbd, html[data-sidebar="collapsed"] .sidebar__chevron,
  html[data-sidebar="collapsed"] .sidebar__company > button > .icon:last-child { display: none; }
  html[data-sidebar="collapsed"] .sidebar__icon-collapsed { display: inline; }
  html[data-sidebar="collapsed"] .sidebar__icon-expanded { display: none; }
  html[data-sidebar="collapsed"] .sidebar__label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  html[data-sidebar="collapsed"] .sidebar__item { justify-content: center; padding: 0; }
  html[data-sidebar="collapsed"] .sidebar__search { border-color: transparent; }
  html[data-sidebar="collapsed"] .sidebar__profile { margin-left: 0; }
  /* Issue 698: only the avatar in the rail, a 40px round target like the icons, so it stays inside the 56px column */
  html[data-sidebar="collapsed"] .sidebar__profile .profilebtn { width: var(--control-md); padding: 0; justify-content: center; }
  html[data-sidebar="collapsed"] .sidebar__profile .profilebtn > .icon { display: none; }
  html[data-sidebar="collapsed"] .sidebar__foot .iconbtn[data-tip]:hover::after, html[data-sidebar="collapsed"] .sidebar__foot .iconbtn[data-tip]:focus-visible::after,
  html[data-sidebar="collapsed"] .sidebar__toggle[data-tip]:hover::after, html[data-sidebar="collapsed"] .sidebar__toggle[data-tip]:focus-visible::after,
  html[data-sidebar="collapsed"] .sidebar__item[data-tip]:hover::after, html[data-sidebar="collapsed"] .sidebar__item[data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; left: calc(100% + var(--space-3)); top: 50%; bottom: auto; transform: translateY(-50%); z-index: 30;
    padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--foreground); color: var(--background); white-space: nowrap; font-size: 14px; line-height: 20px;
  }
  /* a group's own name is the flyout's title, so its button shows no tooltip */
  html[data-sidebar="collapsed"] .sidebar__group > button.sidebar__cat::after { content: none !important; }
  html[data-sidebar="collapsed"] .sidebar__sections { display: none; }
  /* !important: a group the column shows closed carries [hidden] (always hidden, see Base), and its flyout must still
     open in the rail; the column's open/closed state stays untouched. */
  html[data-sidebar="collapsed"] .sidebar__group:hover > .sidebar__sections,
  html[data-sidebar="collapsed"] .sidebar__group.is-open > .sidebar__sections {
    display: block !important; position: absolute; left: calc(100% + var(--space-3)); top: 0; z-index: 31; width: 240px; padding: var(--space-2);
    background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--input); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay);
  }
  /* a bridge over the gap, so the pointer can move from the icon into the flyout */
  html[data-sidebar="collapsed"] .sidebar__sections::before { content: ""; position: absolute; top: 0; bottom: 0; right: 100%; width: calc(var(--space-3) + 2px); }
  html[data-sidebar="collapsed"] .sidebar__flyout-title { display: block; padding: var(--space-1) var(--space-3) var(--space-2); font-weight: 600; }
  html[data-sidebar="collapsed"] .sidebar__link { padding-left: var(--space-3); }
  /* in the flyout the heading lines up with the flyout's title and the links under a heading are indented (issue 1574) */
  html[data-sidebar="collapsed"] .sidebar__heading { margin-left: var(--space-3); }
  html[data-sidebar="collapsed"] .sidebar__heading + ul .sidebar__link { padding-left: calc(var(--space-3) * 2); }
  html[data-tip-hidden] .sidebar [data-tip]::after { display: none !important; }
  html[data-tip-hidden][data-sidebar="collapsed"] .sidebar__group:hover:not(.is-open) > .sidebar__sections { display: none !important; }
  html[data-sidebar="collapsed"] .sidebar .menu__panel--start { left: calc(100% + var(--space-3)); right: auto; top: 0; width: 280px; }
  html[data-sidebar="collapsed"] .sidebar .menu__panel--up { left: calc(100% + var(--space-3)); bottom: 0; }
}
/* Wide but low (a phone on its side, 844×390, issue 616): the rail does not scroll inside itself (its flyouts would be
   clipped), so with every category it is taller than the screen. Here it scrolls with the page instead of sticking,
   as the top bar and page head do (issue 536), and reaches down the whole page; every icon and the foot can be reached.
   The expanded column keeps sticking: its list scrolls inside it and the foot stays in view. */
@media (min-width: 760px) and (max-height: 559px) {
  html[data-sidebar="collapsed"] .sidebar { position: relative; align-self: stretch; height: auto; min-height: 100dvh; }
}

/* Content top: breadcrumb, then the page head (h1 · view or card tabs · actions, the create button last). The head
   sticks while scrolling on screens tall enough for it; shell.js keeps scroll-padding-top equal to its height so focus
   never hides under it (WCAG 2.4.11). */
.app__crumbs {
  padding-top: var(--space-4);
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
}
.app__crumbs ~ .page { padding-top: var(--space-3); }
/* A menu item's own page on a phone (issue 870): the trail only repeats the menu and the h1, so it goes and the h1 takes
   its place right under the top bar; deeper pages keep «‹ forelder» (.breadcrumb--back). */
@media (max-width: 639px) {
  .app__crumbs:not(.breadcrumb--back) { display: none; }
  .app__crumbs:not(.breadcrumb--back) ~ .page { padding-top: var(--space-4); }
}
.page-head__tabs { flex: 1 1 auto; min-width: 0; align-self: end; }
.page-head__tabs--row { flex-basis: 100%; order: 3; }
@media (min-width: 760px) {
  .app__crumbs { padding-left: var(--space-5); padding-right: var(--space-5); }
}
@media (min-width: 760px) and (min-height: 560px) {
  .app .page > .page-head {
    position: sticky; top: 0; z-index: 10; margin-block: calc(-1 * var(--space-3)); padding-block: var(--space-3);
    background: var(--background);
  }
  .app .page > .page-head.is-stuck { box-shadow: 0 1px 0 var(--border); }
  html:has(.app .page > .page-head) { scroll-padding-top: calc(var(--page-head-height, 0px) + var(--space-3)); }
}

/* ---------- Button (shadcn variants; {% button %}) ------------------------------------------
   Every .btn carries one variant: default (spike, one per view) · secondary · outline · ghost · destructive ·
   link. Sizes: sm · md (default) · lg · icon. The base .btn is drawn as outline. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-md); min-width: var(--target-min); padding: 0 var(--space-4);
  border: 1px solid transparent; border-radius: var(--radius);
  font: 600 15px/1 var(--font-sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--card); color: var(--card-foreground); border-color: var(--input);
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover, .btn--outline:hover { background: var(--accent); color: var(--accent-foreground); }
.btn--outline { background: var(--card); color: var(--card-foreground); border-color: var(--input); }
.btn--default { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary-hover); }
.btn--default:hover { background: var(--primary-hover); color: var(--primary-foreground); }
.btn--secondary { background: var(--secondary); color: var(--secondary-foreground); border-color: var(--input); }
.btn--secondary:hover { background: var(--card); }
.btn--ghost { background: transparent; color: var(--foreground); border-color: transparent; }
.btn--ghost:hover { background: var(--accent); color: var(--accent-foreground); }
.btn--destructive { background: var(--destructive); color: var(--destructive-foreground); border-color: var(--destructive); }
.btn--destructive:hover { background: var(--destructive); color: var(--destructive-foreground); text-decoration: underline; }
.btn--link { background: transparent; color: var(--cue); border-color: transparent; padding-inline: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
.btn--link:hover { background: transparent; color: var(--cue); text-decoration-thickness: 2px; }
.btn--sm { min-height: var(--control-sm); padding: 0 var(--space-3); font-size: 14px; }
.btn--md { min-height: var(--control-md); }
.btn--lg { min-height: var(--control-lg); padding: 0 var(--space-5); font-size: 17px; }
.btn--icon { padding: 0; width: var(--control-md); }
.btn--icon.btn--sm { width: var(--control-sm); }
.btn--icon.btn--lg { width: var(--control-lg); }
.btn--link.btn--sm, .btn--link.btn--lg { padding-inline: 0; }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }

/* ---------- Forms -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.field__label { font-weight: 600; }
/* A required field's * (#875): hidden from screen readers, which hear aria-required; «* må fylles ut» by the buttons. */
.field__required { font-weight: 600; color: var(--destructive); }
/* When a field is needed only for one choice: «(kreves for Tapt)» after the label. */
.field__optional { font-weight: 400; color: var(--ink-muted); }
.field__hint { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.field__error { display: flex; gap: var(--space-1); align-items: flex-start; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--danger); }
/* A live check's answer under the control ({% field … live=True %}): a badge, the reason and maybe a suggestion. */
.field__status { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: 13px; line-height: 18px; }
.field__status:empty { display: none; }
/* Autosave (#1938): an autosaved field's error element is there, empty, until a save is refused. autosave.js marks the
   page live, which hides the forms' own «Lagre» and shows what is only for autosave («Lukk»). */
.field__error:empty { display: none; }
.field__hint:empty { display: none; }
[data-autosave-live] [data-autosave-submit] { display: none; }
html:not([data-autosave-live]) [data-autosave-only] { display: none; }
.input {
  width: 100%; min-height: var(--control-md); padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-raised); color: var(--ink); font: 400 15px/22px var(--font-sans);
  display: block; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; /* one box for text, select, number, date/time */
}
select.input, .filters__multi > summary.input {
  padding-right: calc(var(--space-3) + 24px); text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.input::-webkit-date-and-time-value { text-align: left; min-height: 22px; }
/* Chrome pads the date/time text 1px above and below, which made those boxes 2px taller than the rest (#640). */
.input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]) { height: var(--control-md); line-height: 22px; }
.input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"])::-webkit-datetime-edit { padding-block: 0; line-height: 22px; }
.input::placeholder { color: var(--ink-muted); opacity: 1; }
/* The second pixel of the error border is an inset shadow, so an invalid box keeps the size of its neighbours. */
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
textarea.input { min-height: 96px; resize: vertical; }
.input--lg { min-height: var(--control-lg); font-size: 17px; }
.input--lg:is([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]) { height: var(--control-lg); }
.choice { display: flex; align-items: flex-start; gap: var(--space-2); min-height: var(--target-min); cursor: pointer; }
/* 12px between options (shadcn's gap-3, #2191): axe measures a box under 24px from the centre of its uncovered part,
   so with 4px a sticky bar over the top of one radio brought the two centres under 24px apart. */
.choices, .choices > div { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.choices label { display: flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); min-width: 0; width: 100%; overflow-wrap: anywhere; cursor: pointer; }
.choices input { width: 20px; height: 20px; margin: 0; accent-color: var(--cue); flex: none; }
.choice input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--cue); flex: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* Phones (#617): the form's buttons share the line and fill it, like the page head's (a link-styled «Avbryt» keeps its
   size); a text field is 16px, so iOS does not zoom the page sideways when it gets focus (input--lg is 17px already). */
@media (max-width: 759px) {
  .form-actions > .btn:not(.btn--link) { flex: 1 1 auto; }
  .input:not(.input--lg) { font-size: 16px; }
}
/* A long form's actions stay at the bottom of the screen (#2007, the count list): opaque, with a status line first
   («12 av 104 talt»). Above the phone tab bar when there is one; focus never hides behind it. */
.form-actions--sticky {
  position: sticky; bottom: 0; z-index: 15; align-items: center; padding-block: var(--space-3);
  border-top: 1px solid var(--border); background: var(--background);
}
.form-actions__status { flex: 1 1 auto; margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
html:has(.form-actions--sticky) { scroll-padding-bottom: calc(var(--control-lg) + var(--space-6) + var(--space-3)); }
@media (max-width: 759px) {
  /* edge to edge, so rows don't show beside it as they scroll under */
  .page > .form-actions--sticky, .page > form > .form-actions--sticky { margin-inline: calc(-1 * var(--space-4)); padding-inline: var(--space-4); }
  .form-actions--sticky > .form-actions__status { flex-basis: 100%; }
  .form-actions--sticky > .btn { flex: 1 1 0; }
  html:has(.form-actions--sticky) { scroll-padding-bottom: calc(var(--control-lg) + 22px + var(--space-6) + var(--space-3)); }
  /* --tabbar-height is measured by shell.js (a tab name on two lines makes the bar taller); the fallback is one row */
  .tabbar-shell .form-actions--sticky { bottom: var(--tabbar-height, calc(var(--control-lg) + 1px + env(safe-area-inset-bottom, 0px))); }
  html:has(.tabbar):has(.form-actions--sticky) {
    scroll-padding-bottom: calc(var(--tabbar-height, var(--control-lg)) + var(--control-lg) + 22px + var(--space-6) + var(--space-3));
  }
}

/* Form controls through {% field %} (#150): radio/checkbox group, single checkbox, switch, combobox.
   design/components/RadioGroup, Checkbox, Switch, Combobox. */
.field--group { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.field--group > .field__label { padding: 0; }
.field--check { gap: var(--space-1); }
.field--check .choice { align-items: center; }
.field--check > .field__hint, .field--check > .field__error { padding-left: calc(20px + var(--space-2)); }
.field--check:has(.switch) > .field__hint, .field--check:has(.switch) > .field__error { padding-left: calc(36px + var(--space-2)); }
/* a checkbox that only applies with the one above it, lined up with that one's label (#2255) */
.field-indent { padding-left: calc(20px + var(--space-2)); }

/* Field row (#640, design/components/FieldRow): fields side by side share four rows (label, hint, control, error)
   through subgrid, so a hint or an error in one field leaves its neighbours' labels and controls where they are.
   The rows have no gap (an empty hint row would still cost two); each part brings its own space above it. A fifth,
   empty track of space-4 parts fields that wrap to the next line and is taken back from the row as a whole. It was
   the fields' bottom margin, but a subgrid's margin sizes the parent's tracks only through the items at its edge,
   and the error track is mostly empty: the row took back space it never got, stood space-4 too close to the next
   field and its last line hung out of the fieldset or card it closed (#2135). A track has its size either way. */
.field-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  grid-auto-rows: auto auto auto auto var(--space-4);
  column-gap: var(--space-3); row-gap: 0; margin-block-end: calc(-1 * var(--space-4)); min-width: 0;
}
.field-row > * {
  display: grid; grid-template-rows: subgrid; grid-row: span 5; row-gap: 0; margin-block-end: 0; min-width: 0;
}
.field-row > * > * { grid-row: 3; align-self: start; margin-block-start: var(--space-2); min-width: 0; }
.field-row > * > .field__label { grid-row: 1; align-self: end; margin-block-start: 0; }
.field-row > * > .field__hint { grid-row: 2; align-self: end; }
.field-row > * > .field__error { grid-row: 4; }
.field-row > .field--check > .choice, .field-row > :not(.field) > * { align-self: center; justify-self: start; }
@media (max-width: 759px) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
}
.choice input.switch {
  -webkit-appearance: none; appearance: none; flex: none; width: 36px; height: 20px; margin: 0; border-radius: var(--radius-pill);
  border: 1px solid var(--input); cursor: pointer;
  /* the thumb is a radial gradient: inputs have no ::before in every browser */
  background: radial-gradient(circle at 9px 50%, var(--background) 0 6px, transparent 7px), var(--input);
  transition: background-position 120ms, background-color 120ms;
}
.choice input.switch:checked {
  border-color: var(--foreground);
  background: radial-gradient(circle at 25px 50%, var(--background) 0 6px, transparent 7px), var(--foreground);
}
.choice input.switch[aria-invalid="true"] { border: 2px solid var(--danger); }
.choice input.switch:disabled { opacity: 0.55; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .choice input.switch { transition: none; } }

.combobox { position: relative; min-width: 0; }
.combobox__list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: var(--space-1);
  list-style: none; max-height: min(20rem, 50dvh); overflow: auto;
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--input); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
}
.combobox__list[hidden] { display: none; }
.combobox__option {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-2); min-height: var(--control-sm);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); cursor: pointer; overflow-wrap: anywhere;
}
.combobox__option:hover, .combobox__option[aria-selected="true"] { background: var(--accent); color: var(--accent-foreground); }
.combobox__option[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--foreground); }
.combobox__meta { font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.combobox__empty { padding: var(--space-2) var(--space-3); color: var(--muted-foreground); }
.combobox__group + .combobox__group { margin-top: var(--space-1); padding-top: var(--space-1); border-top: 1px solid var(--border); }
.combobox__heading {
  display: block; padding: var(--space-1) var(--space-3); font-size: 13px; line-height: 18px; font-weight: 600;
  color: var(--muted-foreground);
}
.combobox__options { margin: 0; padding: 0; list-style: none; }
@media (max-width: 759px) { .combobox__option { min-height: var(--control-md); } }

.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 2px; margin: 0; gap: 2px; background: var(--surface-sunken); }
.segmented legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.segmented label { position: relative; display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-sm); min-width: var(--control-sm); padding: 0 var(--space-2); border-radius: var(--radius-sm); color: var(--ink-muted); cursor: pointer; justify-content: center; font-size: 14px; font-weight: 500; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
/* The current choice is filled (--spike-soft, the same "you are here" fill as the side menu), bold and ruled, so it
   reads as chosen in light and dark and not as plain text next to the others (#1269). */
.segmented label:has(input:checked) { background: var(--spike-soft); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-strong); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
/* Link variant (calendar scale): each choice is a link, the current one has aria-current="true"; the URL carries it */
.segmented--links { flex-wrap: nowrap; white-space: nowrap; }
.segmented--links a { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-sm); min-width: var(--control-sm); padding: 0 var(--space-3); border-radius: var(--radius-sm); color: var(--ink-muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.segmented--links a:hover { color: var(--ink); background: var(--surface); text-decoration: underline; text-underline-offset: 3px; }
.segmented--links a[aria-current="true"] { background: var(--spike-soft); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-strong); text-decoration: none; }
.segmented--links a:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }

/* ---------- Badge = status pill ({% badge %}; always icon + word, color is never the only signal)
   Variants: default (neutral) · secondary · outline · ok · warn · destructive · info · tone-* · count.
   --danger is the status tone name (ok/warn/danger/info) that views pass in, drawn as destructive. */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--target-min);
  padding: 0 var(--space-2) 0 6px; border-radius: var(--radius-pill); border: 1px solid transparent;
  font-family: var(--font-sans); font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: 0; text-transform: none;
  background: var(--muted); color: var(--muted-foreground); white-space: nowrap;
}
.badge .icon { width: 16px; height: 16px; vertical-align: 0; }
/* A badge with a name in it («Forespurt for <prosjekt>», #158) wraps inside 16rem instead of widening a table past
   the screen; the icon stays on the first line. */
.badge--wrap { white-space: normal; max-width: 16rem; border-radius: var(--radius-md); align-items: flex-start; padding-block: 3px; }
.badge--wrap .icon { flex: none; margin-top: 1px; }
.badge--secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge--outline { background: transparent; color: var(--foreground); border-color: var(--input); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--destructive, .badge--danger { background: var(--danger-soft); color: var(--destructive); }
.badge--info { background: var(--cue-soft); color: var(--cue); }
.badge--tone-grey { background: var(--tone-grey-soft); color: var(--tone-grey); }
.badge--tone-slate { background: var(--tone-slate-soft); color: var(--tone-slate); }
.badge--tone-blue { background: var(--tone-blue-soft); color: var(--tone-blue); }
.badge--tone-violet { background: var(--tone-violet-soft); color: var(--tone-violet); }
.badge--tone-teal { background: var(--tone-teal-soft); color: var(--tone-teal); }
.badge--tone-green { background: var(--tone-green-soft); color: var(--tone-green); }
.badge--tone-amber { background: var(--tone-amber-soft); color: var(--tone-amber); }
.badge--tone-red { background: var(--tone-red-soft); color: var(--tone-red); }
.badge--count { background: var(--cue); color: var(--on-cue); padding: 0 var(--space-2); font-family: var(--font-mono); letter-spacing: 0; }
/* A badge that is a link (#1369, «7 timeføringer venter» on Min dag) keeps its variant's colours and is underlined,
   so it reads as something to tap. */
a.badge { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a.badge:hover { text-decoration-thickness: 2px; }

/* ---------- Alert -------------------------------------------------------------------------- */
.alert {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-1) var(--space-3); align-items: start;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--line-strong);
  background: var(--surface-raised); color: var(--ink);
  overflow-wrap: anywhere; /* a long name or link wraps: the alert never grows past its dialog or the screen (#797) */
}
.alert > .icon { grid-row: span 2; margin-top: 1px; }
.alert__title { font-weight: 600; }
.alert__body { grid-column: 2; min-width: 0; }
.alert__body :is(ul, ol) { margin: var(--space-1) 0; padding-left: var(--space-5); }
.alert__actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
/* #1334: on a touch screen an alert's action is a 48px target (like the TabBar and the answer buttons), small or not. */
@media (pointer: coarse) { .alert__actions .btn { min-height: var(--control-lg); } }
.alert--ok { background: var(--ok-soft); border-color: var(--ok); }
.alert--ok > .icon { color: var(--ok); }
.alert--warn { background: var(--warn-soft); border-color: var(--warn); }
.alert--warn > .icon { color: var(--warn); }
.alert--danger { background: var(--danger-soft); border-color: var(--danger); }
.alert--danger > .icon { color: var(--danger); }
.alert--info { background: var(--cue-soft); border-color: var(--cue); }
.alert--info > .icon { color: var(--cue); }
/* The environment strip (#1125): one line across the top of the content, flush with its edges. */
.alert--strip {
  grid-template-columns: auto auto; justify-content: center; align-items: center;
  padding: var(--space-1) var(--space-4); border-width: 0 0 1px; border-radius: 0;
}
.alert--strip > .icon { grid-row: auto; margin-top: 0; }
.alert--strip .alert__title { text-transform: uppercase; letter-spacing: 0.06em; font-size: 13px; }
/* «Angre» after an archive (design/components/Undo): an ok alert with its one button on the text's line. */
.undo { grid-template-columns: auto 1fr auto; align-items: center; }
.undo > .icon { grid-row: auto; margin-top: 0; }
@media (max-width: 480px) {
  .undo { grid-template-columns: auto 1fr; }
  .undo__action { grid-column: 2; }
  /* #975: on a phone as easy to hit as the buttons it takes back (48px, like .btn--lg). */
  .undo__action .btn { min-height: var(--control-lg); padding: 0 var(--space-5); font-size: 17px; }
}
/* Platform announcements above the page content (templates/platform/_announcements.html): alerts in the page gutter. */
.announcements {
  display: flex; flex-direction: column; gap: var(--space-2); max-width: 1280px; margin-inline: auto;
  padding-top: var(--space-4);
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
}
@media (min-width: 760px) {
  .announcements { padding-left: max(var(--space-5), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-5), env(safe-area-inset-right, 0px)); }
}

/* ---------- Card ({% card %}: header · content · footer) ------------------------------------
   .card--compact is the small board card (padding on the card itself, no header/content parts). */
.card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-raised); min-width: 0; }
.card__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-4) var(--space-4) var(--space-3); border-bottom: 1px solid var(--border); }
.card__heading { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.card__title { font-size: 17px; line-height: 24px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.card__description { font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.card__action { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; max-width: 100%; }
.card__content { padding: var(--space-4); }
.card__content--flush { padding: 0; }
.card__footer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
/* A form (.stack) in the footer takes the whole width: as a shrink-to-fit flex item its .field-row had no definite
   width, auto-fit fell back to one column and the fields stood under each other on desktop (#960). */
.card__footer > .stack { flex: 1 1 100%; min-width: 0; }
@media (min-width: 760px) {
  .card__header, .card__footer { padding-inline: var(--space-5); }
  .card__content { padding: var(--space-5); }
  .card__content--flush { padding: 0; }
}
/* A form section drawn as a card (<fieldset class="card card__content">): browsers put a fieldset's
   legend on its border. Floating it turns it into an ordinary first child, so it sits inside the
   padding like a card title (and becomes a flex item when the fieldset is also a .stack). */
fieldset.card { margin: 0; min-inline-size: 0; }
fieldset.card > legend {
  float: left; width: 100%; padding: 0; margin: 0 0 var(--space-3);
  font-size: 17px; line-height: 24px; font-weight: 600; overflow-wrap: break-word;
}
fieldset.card.stack > legend { margin-bottom: 0; }
fieldset.card > legend + * { clear: both; }

/* ---------- Data table --------------------------------------------------------------------- */
/* position: relative makes the wrap the containing block of what is absolutely positioned inside the table, above all
   the .visually-hidden labels of a wide table's last columns (#858). Without it they sat outside the scroller: the
   whole page grew wider than a phone, the phone zoomed out, and taps landed on the cards above. */
.table-wrap { position: relative; overflow-x: auto; }
/* A wrap that scrolls sideways gets tabindex="0" from table-wrap.js (#1066), so Tab and the arrow keys can scroll it. */
.table-wrap:focus-visible { outline: 3px solid var(--ring); outline-offset: -3px; } /* inside: never clipped by a card or scroller */
.table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.table caption { text-align: left; padding: var(--space-3); color: var(--ink-muted); font-size: 13px; caption-side: bottom; }
.table td { overflow-wrap: break-word; }
.table th {
  position: sticky; top: 0; z-index: 1; text-align: left; vertical-align: bottom; white-space: nowrap;
  padding: var(--space-2) var(--space-3); background: var(--surface-raised); border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-sans); font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-muted);
}
/* 10px + 22px line + 10px + 1px rule ≈ 44px a row */
.table td { padding: 10px var(--space-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
/* Links in cells are quiet: ink, no underline until hover or focus (the focus ring still shows). The row's name
   (.table__primary) carries the row in medium weight. */
.table td a:not(.btn, .badge) { color: var(--ink); text-decoration: none; }
.table td a:not(.btn, .badge):hover, .table td a:not(.btn, .badge):focus-visible { text-decoration: underline; }
/* #1369: a table whose cells hold several links in a row (Min dag: project · customer · call sheet) shows them as
   links (cue, underlined) in both themes, so a phone user sees what can be tapped. A second line under the names
   (.table__row-extra, a .cluster) holds what is left to do as linked badges and the row's action button. */
.table--links td a:not(.btn, .badge) { color: var(--cue); text-decoration: underline; }
.table--links td a:not(.btn, .badge):hover { text-decoration-thickness: 2px; }
.table td .table__row-extra { margin-top: var(--space-2); }
.table .table__primary { font-weight: 500; }
.table__empty { color: var(--ink-muted); }
/* Sortable header: looks like the header, with an arrow for the order (aria-sort on the th says which). */
.table th a.table__sort { display: inline-flex; align-items: center; gap: var(--space-1); color: inherit; text-decoration: none; }
.table th a.table__sort:hover, .table th a.table__sort:focus-visible { color: var(--ink); }
.table th.num a.table__sort { flex-direction: row-reverse; }
.table__sort .icon { width: 14px; height: 14px; flex: none; }
.table th[aria-sort] .table__sort { color: var(--ink); }
/* A picture beside the name must not make the row taller than a text row */
.table td > .thumb-cell { display: flex; margin-block: -5px; }
/* Row headers (th scope=row) read like a cell, not like the sticky column header: same rule, padding and line height as
   td, so label and value share a baseline and one line runs under the whole row. A fixed label column instead of half
   the width. A key/value row is a row header and one value (design/components/DescriptionList is the <dl> twin). */
.table th[scope="row"] {
  position: static; width: 13rem; white-space: normal; vertical-align: top;
  padding: 10px var(--space-3); background: transparent; border-bottom: 1px solid var(--line);
  font-size: 14px; line-height: 22px; font-weight: 500; color: var(--muted-foreground);
}
.table tr:has(> th[scope="row"]:first-child + td:last-child) > td { vertical-align: top; }
@media (max-width: 759px) {
  /* Phones: the label over its value, no sideways scrolling. */
  .table tr:has(> th[scope="row"]:first-child + td:last-child) > :is(th, td) { display: block; width: auto; }
  .table tr:has(> th[scope="row"]:first-child + td:last-child) > th { padding-bottom: 0; border-bottom: 0; }
  .table tr:has(> th[scope="row"]:first-child + td:last-child) > td { padding-top: 2px; }
}
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .mono { font-family: var(--font-mono); font-size: 13px; }
/* A time span («man 21.12 08:00–18:00») stays on one line instead of breaking at every space and dash (#1171). */
.table td.table__cell--nowrap { white-space: nowrap; }
.table tbody tr:hover > :is(td, th[scope="row"]) { background: var(--surface-sunken); }
.table tbody tr[aria-selected="true"] > :is(td, th[scope="row"]) { background: var(--spike-soft); }
.table tbody tr[aria-selected="true"] > :first-child { box-shadow: inset 3px 0 0 var(--ink); }
.table--dense td, .table--dense th, .table--dense th[scope="row"] { padding-block: 6px; }
/* Aligned columns (#2296): tables stacked one under another (Min dag's cards) share one column grid, so the badge and
   the date start on the same line in every card whatever their content. A <colgroup> of table__col--name, --badge and
   --date; the name takes the rest and wraps, a long badge wraps inside its column. Phones: the name over badge + date. */
.table--aligned { table-layout: fixed; }
.table--aligned .table__col--name { width: auto; }
.table--aligned .table__col--badge { width: 12rem; }
.table--aligned .table__col--date { width: 10rem; }
.table--aligned td { overflow-wrap: anywhere; }
.table--aligned td .badge { white-space: normal; }
@media (max-width: 639px) {
  .table--aligned, .table--aligned tbody { display: block; }
  .table--aligned colgroup { display: none; }
  .table--aligned tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); align-items: center;
    padding: 10px var(--space-3); border-bottom: 1px solid var(--line);
  }
  .table--aligned td { padding: 0; border: 0; }
  .table--aligned td:first-child { grid-column: 1 / -1; margin-bottom: var(--space-1); }
  .table--aligned tbody tr:hover { background: var(--surface-sunken); }
}
/* Grouped rows: one <tbody> per group, its first row a <th scope="rowgroup" colspan> with the group's name. */
.table .table__group th { position: static; white-space: normal; padding-top: var(--space-3); color: var(--foreground); font-size: 15px; line-height: 22px; }
.table .table__group th .table__note { margin-left: var(--space-2); font-size: 13px; font-weight: 400; color: var(--muted-foreground); }

/* ---------- Description list (design/components/DescriptionList): key/value pairs as a <dl> ------------------
   The same rhythm as a key/value table: a 13rem label column, one line under each pair, label over value on phones.
   Pairs may be wrapped in a <div> (display: contents keeps them in the grid). In a narrow card (two side by side on a
   phone on its side, 844px beside the sidebar) the label column gives way to at most 40% (#617). */
.dl { display: grid; grid-template-columns: min(13rem, 40%) minmax(0, 1fr); margin: 0; font-size: 15px; line-height: 22px; }
.dl > div { display: contents; }
.dl dt, .dl dd { margin: 0; padding: 10px var(--space-3); border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: break-word; }
.dl dt { grid-column: 1; font-size: 14px; font-weight: 500; color: var(--muted-foreground); }
.dl dd { grid-column: 2; color: var(--foreground); }
.dl--dense dt, .dl--dense dd { padding-block: 6px; }
@media (max-width: 759px) {
  .dl { display: block; }
  .dl dt { padding-bottom: 0; border-bottom: 0; }
  .dl dd { padding-top: 2px; }
}

/* ---------- Stacked table (#459, design/components/StackTable): a table on desktop, a card per item on phones ---- */
/* Each item is a <tbody class="table__item"> with its row and, optionally, a full-width row of what is done to it
   (<tr class="table__actions"><td colspan>). A cell names itself on phones (.table__label), where the header is gone. */
.table__label { display: none; }
.table .table__item:hover td { background: var(--muted); }
.table .table__item > tr:not(:last-child):not(:has(+ tr[hidden]:last-child)) > td { border-bottom: 0; }
.table .table__actions > td { padding-top: 0; }
.table__actions-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* An editable cell on desktop (#1916): a number field as wide as a number and a select as wide as its choice, all one
   height, and what stands beside the field (the quote line's «faktor 2») on the same line. */
@media (min-width: 640px) {
  /* A percentage as a bar (#795): the column's header names it, so the field's own label is for screen readers. */
  .table td.table__cell--progress { min-width: 7rem; }
  .table td.table__cell--progress .progress-field__label > span:first-child {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .table td.table__cell--field .input[type="number"] { width: 6.5rem; }
  .table td.table__cell--field select.input { width: auto; }
  .table td.table__cell--field .cluster { flex-wrap: nowrap; justify-content: flex-end; }
  .table td.table__cell--field > .field__error { width: min-content; min-width: 100%; text-align: left; } /* wraps under the field, never widens the column (#2007) */
}
@media (max-width: 639px) {
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; }
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .table--stack .table__item { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
  .table--stack td { padding: 0; border: 0; text-align: left; min-width: 0; overflow-wrap: anywhere; }
  /* A list that sorts by its headers sorts on a phone with «Sorter etter» behind «Filtrer» (.filters__sort, #625), so
     the first card is on the first screen (#1642, #172): the header row is left out, and no focus lands on a clipped
     link (#534). */
  .table--stack thead:has(.table__sort) { display: none; }
  /* A picture beside a cell's label, on the same line (the desktop cell pulls it into the row's padding) */
  .table--stack td > .thumb-cell { display: inline-flex; vertical-align: middle; margin-block: 0; }
  /* The item is a card (#795): the name as its title on top with the status (--status) beside it, the quiet line
     (--sub: «25.11.2026 08:00 Avgang») under it, then every other cell on a line of its own, its label muted in
     front of the value, so no label stands on the line of the previous cell's value. Rows 1 and 2 are placed by
     the grid, whatever the cells' order; the rest keep theirs. --break starts a group (a little space above). */
  .table--stack .table__item > tr:first-child {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; column-gap: var(--space-3); align-items: baseline;
  }
  .table--stack .table__item > tr:first-child > :is(td, th),
  .table--stack .table__item > tr:first-child > td.table__cell--block { grid-column: 1 / -1; }
  .table--stack .table__item > tr:first-child > .table__primary { grid-row: 1; }
  .table--stack .table__item > tr:first-child:has(> .table__cell--status) > .table__primary { grid-column: 1 / -2; }
  .table--stack .table__item > tr:first-child > td.table__cell--status { grid-row: 1; grid-column: -2 / -1; justify-self: end; }
  /* A short value on the title line, after the name (Mine timer's «tor 26.11 08–16 · 8,00 t», #1182). The title line
     has no room for a status beside both on 390 px, so the status starts the line under it, followed by the --sub
     cells on one line (the last one cut with «…»); every other cell keeps a line of its own. */
  .table--stack .table__item > tr:first-child:has(> .table__cell--title) {
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-2);
  }
  .table--stack .table__item > tr:first-child:has(> .table__cell--title) > * { flex: 0 0 100%; order: 5; }
  .table--stack .table__item > tr:first-child:has(> .table__cell--title)::after { content: ""; flex: 0 0 100%; order: 2; }
  .table--stack .table__item > tr:first-child:has(> .table__cell--title) > .table__primary { flex: 0 1 auto; order: 1; }
  .table--stack .table__item > tr:first-child > td.table__cell--title { flex: 0 0 auto; order: 1; white-space: nowrap; overflow-wrap: normal; }
  .table--stack .table__item > tr:first-child > td.table__cell--title::before { content: "·" / ""; margin-inline-end: var(--space-2); }
  .table--stack .table__item > tr:first-child:has(> .table__cell--title) > td.table__cell--status {
    flex: 0 0 auto; order: 3; justify-self: auto; margin-top: var(--space-1); white-space: nowrap;
  }
  .table--stack .table__item > tr:first-child:has(> .table__cell--title) > td.table__cell--sub {
    flex: 1 1 0; order: 4; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  }
  .table--stack .table__item > tr:first-child > td.table__cell--sub {
    grid-row: 2; grid-column: auto; font-size: 13px; line-height: 18px; color: var(--muted-foreground);
  }
  .table--stack td.table__cell--break { margin-top: var(--space-2); }
  /* The item's buttons in a cell of its own row (a column on desktop): on a line of their own under the item. */
  .table--stack .table__item > tr:first-child > td.table__cell--actions { margin: var(--space-3) 0 0; }
  /* A percentage as a bar (Dagstavle's «Klar (%)»): the field's own label names it on the card. */
  .table--stack .table__item > tr:first-child > td.table__cell--progress { margin-top: var(--space-1); }
  /* The one thing read at a glance (Mine oppdrag's «tor 26.11 kl. 08:00», #661): its own line, large, never broken
     between the day and the time; the column's name is for screen readers only. */
  .table--stack .table__item > tr:first-child > td.table__cell--lead {
    display: block; margin: var(--space-1) 0 0; font-size: 20px; line-height: 28px; font-weight: 600; white-space: nowrap;
    overflow-wrap: normal;
  }
  .table--stack td:is(.table__cell--lead, .table__cell--status, .table__cell--sub, .table__cell--title) .table__label {
    position: absolute; width: 1px; height: 1px; min-width: 0; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  } /* min-width 0: a hidden 7rem label past the card's edge would make the list scroll sideways (#795) */
  /* A section's heading between the cards (the quote's sections, #2141) */
  .table--stack .table__group th { display: block; padding: var(--space-3) var(--space-4) var(--space-2); }
  .table--stack td.table__cell--optional { display: none !important; }
  .table--stack td.table__cell--meta { font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
  /* A field: its label beside the input, one field a line. */
  .table--stack .table__item > tr:first-child > td.table__cell--field { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-2) 0 0; }
  /* its error on a line of its own under them (the count list, #2007) */
  .table--stack .table__item > tr:first-child > td.table__cell--field:has(> .field__error) { flex-wrap: wrap; }
  .table--stack td.table__cell--field:has(> .field__error) > .input { flex: 1 1 0; min-width: 0; }
  .table--stack td.table__cell--field > .field__error { flex-basis: 100%; text-align: left; }
  .table--stack .table__label { display: inline-block; min-width: 7rem; margin-inline-end: var(--space-2); color: var(--muted-foreground); }
  .table--stack td.table__cell--field .table__label { min-width: 0; margin-inline-end: 0; }
  .table--stack .table__actions { margin-top: var(--space-3); }
  .table--stack .table__actions-bar > * { flex: 1 1 auto; }
  /* The item's one main button on a line of its own, in full width (Mine oppgaver's «Ferdig», #1023). */
  .table--stack .table__actions-bar > .btn--default { flex-basis: 100%; }
  /* The card is marked as a whole, hovered or where a tap left it (#oppgave-…, #1023), not with a grey field behind
     each line, which looked like text still loading. The row's hover (`.table tbody tr:hover > td`, 0,3,3) is
     out-specified here (0,4,2), or each cell would keep its own grey field inside the card. */
  .table--stack .table__item > tr:hover > :is(td, th[scope="row"]),
  .table--stack .table__item:hover td { background: transparent; }
  .table--stack .table__item:is(:hover, :target) { background: var(--muted); }
  .table--stack .stepper .input { flex: 1 1 auto; }
}

/* Sections of a stacked table: «Gjenstår (4)» on top, «Plukket (12)» below in a <details> (closed on phones,
   static/rigg/stack-table.js). */
.table-section + .table-section { border-top: 1px solid var(--border); }
.table-section__title {
  display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-lg); margin: 0;
  padding: var(--space-2) var(--space-4); font-size: 15px; line-height: 22px; font-weight: 600; color: var(--foreground);
}
summary.table-section__title { cursor: pointer; list-style: none; }
summary.table-section__title::-webkit-details-marker { display: none; }
/* the title's heading inside a summary (ListFilter): keeps heading navigation, looks like the summary itself */
summary.table-section__title > h3 { margin: 0; font: inherit; color: inherit; }
summary.table-section__title:hover { background: var(--muted); }
.table-section__chevron { display: inline-flex; transition: transform 120ms; }
details[open] > summary .table-section__chevron { transform: rotate(90deg); }
.table-section__empty { display: flex; align-items: center; gap: var(--space-2); margin: 0; padding: 0 var(--space-4) var(--space-4); color: var(--muted-foreground); }
@media (prefers-reduced-motion: reduce) { .table-section__chevron { transition: none; } }

/* ListFilter (design/components/ListFilter, #1880): a search field over a long list that hides the rows as you type
   (static/rigg/list-filter.js), and jump links to the list's sections. */
.list-filter { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border-bottom: 1px solid var(--border); }
.list-filter__status { margin: 0; font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.list-filter__status:empty { display: none; }
.jump-links { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.jump-links__list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.jump-links__link {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-lg); padding: 0 var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--foreground); text-decoration: none;
  font-size: 14px; line-height: 20px; max-width: 100%; overflow-wrap: anywhere;
}
.jump-links__link:hover { background: var(--muted); }
@media (forced-colors: active) { .jump-links__link { border-color: LinkText; } }

/* Stepper (design/components/Stepper): − number +, each a 48px target, for counting on a phone. */
.stepper { display: inline-flex; align-items: stretch; }
.stepper .input { width: 6rem; min-height: var(--control-lg); text-align: center; border-radius: 0; margin-inline: -1px; -moz-appearance: textfield; appearance: textfield; }
.stepper .input::-webkit-inner-spin-button, .stepper .input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .input:focus-visible { position: relative; z-index: 1; }
.stepper > .btn:first-child { border-start-end-radius: 0; border-end-end-radius: 0; }
.stepper > .btn:last-child { border-start-start-radius: 0; border-end-start-radius: 0; }

/* ---------- Tabs (page sections: links with aria-current; in-page: {% tabs %}, role="tab", tabs.js) ---------- */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--line); overflow-x: auto; }
/* Narrow screens (issue 616): a row wider than its box scrolls inside itself, never the page. tabs.js sets data-more on
   the side with tabs beyond the edge, and that edge fades out (a mask, so it works on every surface and theme) as
   the hint; the current tab is scrolled into view, and scroll-padding keeps a focused tab clear of the fade. The
   same holds for the console's category row (.topbar__nav) and for the tab bar's row from 760px (.tabbar). */
.tabs, .topbar__nav, .tabbar { max-width: 100%; overscroll-behavior-x: contain; scrollbar-width: thin; scroll-padding-inline: var(--space-6); }
.tabs[data-more="end"], .topbar__nav[data-more="end"], .tabbar[data-more="end"] {
  -webkit-mask-image: linear-gradient(to left, transparent, var(--foreground) var(--space-6));
  mask-image: linear-gradient(to left, transparent, var(--foreground) var(--space-6));
}
.tabs[data-more="start"], .topbar__nav[data-more="start"], .tabbar[data-more="start"] {
  -webkit-mask-image: linear-gradient(to right, transparent, var(--foreground) var(--space-6));
  mask-image: linear-gradient(to right, transparent, var(--foreground) var(--space-6));
}
.tabs[data-more="both"], .topbar__nav[data-more="both"], .tabbar[data-more="both"] {
  -webkit-mask-image: linear-gradient(to right, transparent, var(--foreground) var(--space-6), var(--foreground) calc(100% - var(--space-6)), transparent);
  mask-image: linear-gradient(to right, transparent, var(--foreground) var(--space-6), var(--foreground) calc(100% - var(--space-6)), transparent);
}
.tabs a, .tabs__tab {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-md); padding: 0 var(--space-3);
  color: var(--ink-muted); text-decoration: none; font-weight: 500; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs__tab { border-width: 0 0 3px; background: transparent; font: inherit; font-weight: 500; cursor: pointer; }
.tabs a:hover, .tabs__tab:hover { color: var(--ink); }
.tabs a[aria-current="page"], .tabs__tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabs a:focus-visible, .tabs__tab:focus-visible { outline-offset: -3px; } /* inside the scrolling row, never clipped */
.tabs-group { display: flex; flex-direction: column; }
.tabs__panel { padding-top: var(--space-4); }
.tabs__panel:focus-visible { outline-offset: 2px; }

/* ---------- Asset tag (the printed QR label) ----------------------------------------------- */
.asset-tag {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min);
  padding: 2px var(--space-2); border: 1px solid var(--ink); border-radius: var(--radius-sm);
  background: var(--surface-raised); color: var(--ink);
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.04em;
}
.asset-tag .icon { width: 16px; height: 16px; vertical-align: 0; }
.asset-tag--case { border-width: 2px; padding: var(--space-1) var(--space-3); }
.asset-tag__product { font-family: var(--font-sans); letter-spacing: 0; color: var(--ink-muted); font-weight: 400; }

/* ---------- QR code on screen (authenticator-app setup) and recovery codes ------------------ */
/* The SVG carries data-theme="light": scanners need dark modules on a light quiet zone in both themes. */
.qr { display: block; width: 200px; height: 200px; background: var(--card); color: var(--foreground); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: var(--space-2) var(--space-6); margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 22px; }

/* ---------- Colour field (#2335): a hex field with a colour picker beside it (static/rigg/colour-field.js) --- */
.colour-field { min-width: 0; }
.colour-field__row { display: flex; align-items: center; gap: var(--space-3); }
.input--colour { max-width: 12ch; font-family: var(--font-mono); }
.colour-field__picker {
  flex: none; width: var(--control-md); height: var(--control-md); padding: 2px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-raised); cursor: pointer;
}
.colour-field__picker[hidden] { display: none; }

/* ---------- Thumbnail (product image; the whole picture, never cropped) -------------------- */
.thumb {
  display: inline-block; flex: none; width: 40px; height: 40px; object-fit: contain; vertical-align: middle;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card);
}
.thumb--sm { width: 32px; height: 32px; }
.thumb--none { border-color: transparent; background: none; } /* keeps names aligned in a list */
.thumb--lg { width: auto; height: auto; max-width: min(100%, 320px); max-height: 320px; border-radius: var(--radius-md); }
.thumb-cell { display: inline-flex; align-items: center; gap: var(--space-2); }

/* ---------- Planner timeline --------------------------------------------------------------- */
.planner-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
.planner { --days: 7; --label-w: 200px; --day-w: 120px; display: grid; grid-template-columns: var(--label-w) repeat(var(--days), minmax(var(--day-w), 1fr)); min-width: calc(var(--label-w) + var(--days) * var(--day-w)); }
.planner__corner, .planner__day { position: sticky; top: 0; z-index: 6; background: var(--surface-raised); border-bottom: 1px solid var(--line-strong); padding: var(--space-2) var(--space-3); }
/* The crew planner (#891): the grid scrolls inside itself, at most the screen under the filter row tall, so the day
   row stays at its top and the name column at its left (above the bars, z 1–4) both ways. scroll-padding keeps a
   focused bar clear of both (2.4.11; --planner-head-height from shell.js). */
.planner-board .planner-wrap { overflow: auto; max-height: max(16rem, calc(100dvh - var(--planner-bar-bottom, 0px) - var(--space-3)));
  scroll-padding-top: var(--planner-head-height, 0px); scroll-padding-left: 200px; }
.planner-board .planner__corner { left: 0; z-index: 7; }
.planner-board .planner__label { position: sticky; left: 0; z-index: 5; background: var(--surface-raised); }
.planner-board .planner__label.planner__group { background: var(--muted); }
/* A phone: a narrower name column, so the days keep most of the screen beside it. */
@media (max-width: 759px) {
  .planner-board .planner { --label-w: 128px; }
  .planner-board .planner-wrap { scroll-padding-left: 128px; }
  .planner-board .planner__label { overflow-wrap: anywhere; }
}
.planner__day { display: flex; flex-direction: column; border-left: 1px solid var(--line); font-size: 13px; line-height: 18px; }
.planner__day strong { font-family: var(--font-display); font-size: 12px; line-height: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.planner__day--today { background: var(--spike-soft); }
.planner__day--today strong { color: var(--ink); }
.planner__label { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.planner__label small { color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.planner__lane { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(var(--days), minmax(var(--day-w), 1fr)); align-items: center; gap: 4px 0; padding: 6px 0; border-bottom: 1px solid var(--line); background: var(--surface-sunken);
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / var(--days)) 100%; }
.booking {
  display: flex; align-items: center; gap: var(--space-1); min-height: 32px; margin: 0 3px; padding: 0 var(--space-2);
  border: 1px solid var(--ink); border-radius: var(--radius-sm); background: var(--ink); color: var(--surface-raised);
  font: 500 13px/18px var(--font-sans); text-align: left; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0;
}
.booking .icon { width: 16px; height: 16px; }
.booking--tentative { background: var(--surface-raised); color: var(--ink); border: 2px dashed var(--line-strong); }
.booking--conflict { background: var(--danger-soft); color: var(--ink); border: 2px solid var(--danger); }
.booking--conflict .icon { color: var(--danger); }
.booking--free { background: var(--ok-soft); color: var(--ink); border-color: var(--ok); }
.booking--free .icon { color: var(--ok); }
.booking--tentative .icon { color: var(--warn); }
/* A task on a person's row (#456): a rounded, light bar, never an ink one, so it never looks like an assignment.
   Done: the title struck through (the word «Ferdig» is in its text). Highlighted («Fremhev»): spike-soft with an ink
   edge, and the word in its text. Tags as emoji after the title, hidden from screen readers (their names are in the
   tooltip). Before the tone rules, so a tag's tone still gives the left edge. */
.booking--task { background: var(--secondary); color: var(--secondary-foreground); border: 1px solid var(--border); border-radius: var(--radius-pill); }
.booking--task .icon { color: currentColor; }
.booking--done .booking__project { text-decoration: line-through; }
.booking--highlight { background: var(--spike-soft); color: var(--ink); border: 2px solid var(--ink); }
.booking__tags { flex: none; }
/* The quick field in an empty cell: title and Enter (planner-tasks.js places it with grid-column). */
.planner__lane[data-task-row] { cursor: cell; }
/* The project view (#476): a project's row is a group that folds (planner-tasks.js); folded, its bars are hidden and
   the label keeps the count. A project the picker leaves out is toned down in the person view (the words say so). */
.planner__group { background: var(--muted); }
.planner__group .cluster { flex-wrap: nowrap; min-width: 0; }
.planner__fold { flex: none; padding: 0; min-width: 24px; min-height: 24px; }
.planner__fold[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.planner__lane--folded { min-height: 0; padding: 2px 0; cursor: default; }
.planner__lane--folded > .booking, .planner__lane--folded > .planner__quick, .planner__lane--folded > .timeline__edge { display: none; }
.booking--dimmed { opacity: 0.5; }
.planner__quick { position: relative; z-index: 3; min-width: 0; margin: 0 3px; }
.planner__quick .input { width: 100%; min-height: 32px; padding: 2px var(--space-2); font-size: 13px; }
/* 16px on a phone too, like every text control (#617, Field), or iOS zooms the page when the quick field gets focus. */
@media (max-width: 759px) { .planner__quick .input { font-size: 16px; } }
/* The production role's colour as a thick left edge; the role's name is always in the bar's text too. */
.booking--tone-grey { border-left: 6px solid var(--tone-grey); }
.booking--tone-slate { border-left: 6px solid var(--tone-slate); }
.booking--tone-blue { border-left: 6px solid var(--tone-blue); }
.booking--tone-violet { border-left: 6px solid var(--tone-violet); }
.booking--tone-teal { border-left: 6px solid var(--tone-teal); }
.booking--tone-green { border-left: 6px solid var(--tone-green); }
.booking--tone-amber { border-left: 6px solid var(--tone-amber); }
.booking--tone-red { border-left: 6px solid var(--tone-red); }
.booking[aria-pressed="true"], .booking[aria-current="true"] { box-shadow: 0 0 0 3px var(--spike), 0 0 0 4px var(--ink); }
a.booking { text-decoration: none; }
a.booking:hover { text-decoration: underline; }
/* Crew planner bar: a link to the assignment («Prosjekt · Rolle · Status») and, on a conflict, a badge button
   (icon + count) that opens the details in a sheet. The ring sits on the bar, outside its clipped edge. */
.booking__link { display: flex; align-items: center; gap: var(--space-1); flex: 1 1 auto; min-width: 0; min-height: 28px; color: inherit; text-decoration: none; }
.booking__link:hover .booking__project { text-decoration: underline; }
.booking__text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* A one-day bar starts with its clock («08–12»), so the ellipsis cuts the project name, not the time (#1441). */
.booking__time { font-variant-numeric: tabular-nums; font-weight: 600; }
/* Several assignments on one project the same day: one button bar «Prosjekt · N» that opens their list in a sheet. */
button.booking__link { padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.booking__link > .badge { flex: none; }
.booking__flag { flex: none; display: inline-flex; align-items: center; min-width: 24px; min-height: 24px; margin-right: -4px; padding: 0; border: 0; border-radius: var(--radius-pill); background: none; color: inherit; cursor: pointer; }
.booking__link:focus-visible, .booking__flag:focus-visible { outline: none; }
.booking:has(:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.booking__flag:focus-visible .badge { box-shadow: inset 0 0 0 2px currentColor; }
.booking .badge .icon { color: inherit; }
@media (max-width: 759px) {
  /* Phones: status icon, time and project name; role and status stay for screen readers. */
  .booking__more { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.planner__label[draggable="true"] { cursor: grab; }
/* A confirmed assignment's padlock (#457): it is never moved by the timeline; the word «låst» is in its text. */
.booking__lock { flex: none; display: inline-flex; }
.booking__lock .icon { width: 14px; height: 14px; }
/* ---------- Timeline (#457, design/components/Timeline): the planner grid with static/rigg/timeline.js ---------- */
.timeline__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--muted); color: var(--foreground); }
.timeline__count { min-width: 12ch; font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.timeline__sep { width: 1px; align-self: stretch; background: var(--border); }
.timeline__status { margin: 0; color: var(--muted-foreground); font-size: 13px; line-height: 18px; }
.timeline .planner__lane { position: relative; }
.timeline .booking--task { position: relative; cursor: grab; -webkit-user-select: none; user-select: none; }
.timeline .booking--task .booking__link { -webkit-touch-callout: none; }
.timeline.is-dragging, .timeline.is-dragging .booking { cursor: grabbing; }
.booking.is-selected { box-shadow: 0 0 0 3px var(--spike), 0 0 0 4px var(--ink); }
.booking.is-dragging { z-index: 4; transform: translate(var(--tl-dx, 0px), var(--tl-dy, 0px)); box-shadow: 0 0 0 3px var(--spike), 0 0 0 4px var(--ink), var(--shadow-overlay); pointer-events: none; will-change: transform; }
/* Drag an edge to change the first or last day (8px; the bar itself is the 24px target, WCAG 2.5.8). */
.timeline__handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.timeline__handle--start { left: 0; }
.timeline__handle--end { right: 0; }
.timeline__rect { position: absolute; z-index: 50; border: 2px dashed var(--ring); background: var(--spike-soft); opacity: 0.6; pointer-events: none; }
/* «◀ 3» / «2 ▶»: the row's tasks outside the days or scrolled out of view, at the visible ends of the lane. */
.timeline__edge { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); min-width: 24px; min-height: 24px; padding: 0 var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--background); color: var(--foreground); font: 600 12px/22px var(--font-sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.timeline__edge:hover { background: var(--accent); color: var(--accent-foreground); }
.timeline__edge:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.timeline__edge--before { left: calc(var(--tl-left, 0px) + 2px); }
.timeline__edge--after { right: calc(var(--tl-right, 0px) + 2px); }
/* Overdue tasks that are not done (#476): red, and «forfalt» in its text, tooltip and name (never colour alone). */
.timeline__edge--overdue, .timeline__edge--overdue:hover { background: var(--destructive); color: var(--destructive-foreground); border-color: var(--destructive); }
@media (prefers-reduced-motion: no-preference) {
  .booking.is-selected { transition: box-shadow 120ms ease-out; }
}
.is-drop-target { outline: 2px dashed var(--spike); outline-offset: -2px; background: var(--spike-soft); }
/* ---------- TaskTimeline (#834, design/components/TaskTimeline): the compact Timeline of a plan project's Plan tab.
   One 24px row per task: the name in a fixed column, the bar on a day ruler (24px per day, --day-w is the zoom). The
   frame scrolls both ways with the ruler and the names held in place. Positions come from data-col/data-span
   (layout.js) or static/rigg/plan.js (CSSOM), never style="…". */
.tasktl { --title-w: 248px; --day-w: 24px; --row-h: 24px; --days: 56; position: relative; overflow: auto; max-height: calc(100dvh - 220px); min-height: 240px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); color: var(--foreground); overscroll-behavior: contain; }
.tasktl:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tasktl__head, .tasktl__row, .tasktl__section, .tasktl__project { display: grid; grid-template-columns: var(--title-w) calc(var(--days) * var(--day-w)); width: calc(var(--title-w) + var(--days) * var(--day-w)); }
.tasktl__head { position: sticky; top: 0; z-index: 4; background: var(--background); border-bottom: 1px solid var(--border); }
.tasktl__corner { position: sticky; left: 0; z-index: 5; display: flex; align-items: flex-end; padding: 0 var(--space-2) 4px; border-right: 1px solid var(--border); background: var(--background); color: var(--muted-foreground); font-size: 12px; line-height: 16px; font-weight: 600; }
.tasktl__ruler { display: grid; grid-template-columns: repeat(var(--days), var(--day-w)); grid-template-rows: 18px 20px; }
.tasktl__month { grid-row: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding-left: 2px; border-left: 1px solid var(--border); white-space: nowrap; color: var(--foreground); font-size: 12px; line-height: 18px; font-weight: 600; }
.tasktl__day { grid-row: 2; display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); font-size: 12px; line-height: 20px; font-variant-numeric: tabular-nums; }
.tasktl__day--weekend { background: var(--muted); }
.tasktl__day--today { background: var(--primary); color: var(--primary-foreground); font-weight: 700; border-radius: var(--radius-sm); }
.tasktl__body { position: relative; }
.tasktl__label { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 2px; min-width: 0; padding: 0 var(--space-1) 0 0; border-right: 1px solid var(--border); background: var(--background); }
.tasktl__row { height: var(--row-h); }
.tasktl__row:hover .tasktl__label, .tasktl__row:hover .tasktl__lane { background-color: var(--accent); }
.tasktl__lane { position: relative; display: grid; grid-template-columns: repeat(var(--days), var(--day-w)); align-items: center; min-width: 0; border-bottom: 1px solid var(--border); background-image: repeating-linear-gradient(90deg, transparent 0 calc(5 * var(--day-w)), var(--muted) calc(5 * var(--day-w)) calc(7 * var(--day-w))); cursor: cell; }
.tasktl__row .tasktl__label { border-bottom: 1px solid var(--border); }
.tasktl__grip { flex: none; display: inline-flex; align-items: center; justify-content: center; width: var(--target-min); height: var(--target-min); color: var(--muted-foreground); cursor: grab; touch-action: none; }
.tasktl__grip .icon { width: 14px; height: 14px; }
.tasktl__name { position: relative; display: flex; align-items: center; gap: var(--space-1); flex: 1 1 auto; min-width: 0; min-height: var(--target-min); padding: 0 var(--space-1); border-radius: var(--radius-sm); color: var(--foreground); font-size: 13px; line-height: 18px; text-decoration: none; }
.tasktl__name .icon { flex: none; width: 14px; height: 14px; color: var(--muted-foreground); }
.tasktl__title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* The full title on hover and focus: the name grows over the timeline instead of wrapping the row. */
.tasktl__name:hover, .tasktl__name:focus-visible { z-index: 6; flex: none; min-width: 100%; max-width: 60ch; background: var(--popover); box-shadow: 0 0 0 1px var(--border); }
.tasktl__name:hover .tasktl__title, .tasktl__name:focus-visible .tasktl__title { overflow: visible; text-overflow: clip; }
.tasktl__name:focus-visible { outline: 3px solid var(--focus); outline-offset: -1px; }
/* #1059: an editor's finger held on a name lifts the row, without the link's callout or a text selection. */
.tasktl__label:has(.tasktl__grip) .tasktl__name { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.tasktl__name--done .tasktl__title { text-decoration: line-through; color: var(--muted-foreground); }
.tasktl__bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 2px; height: 20px; min-width: 0; padding: 0 4px; overflow: hidden; border: 1px solid var(--input); border-left-width: 4px; border-radius: var(--radius-sm); background: var(--card); color: var(--card-foreground); font-size: 12px; line-height: 16px; white-space: nowrap; cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.tasktl__bar--tone-grey { background: var(--tone-grey-soft); border-color: var(--tone-grey); }
.tasktl__bar--tone-slate { background: var(--tone-slate-soft); border-color: var(--tone-slate); }
.tasktl__bar--tone-blue { background: var(--tone-blue-soft); border-color: var(--tone-blue); }
.tasktl__bar--tone-violet { background: var(--tone-violet-soft); border-color: var(--tone-violet); }
.tasktl__bar--tone-teal { background: var(--tone-teal-soft); border-color: var(--tone-teal); }
.tasktl__bar--tone-green { background: var(--tone-green-soft); border-color: var(--tone-green); }
.tasktl__bar--tone-amber { background: var(--tone-amber-soft); border-color: var(--tone-amber); }
.tasktl__bar--tone-red { background: var(--tone-red-soft); border-color: var(--tone-red); }
.tasktl__bar--done { border-style: dashed; border-left-style: solid; }
.tasktl__bar--new { border-style: dashed; background: var(--spike-soft); border-color: var(--foreground); }
.tasktl__person { flex: none; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; border-radius: var(--radius-pill); background: var(--background); color: var(--foreground); font-size: 12px; line-height: 14px; }
.tasktl__tags { flex: none; font-size: 12px; line-height: 16px; }
.tasktl__handle { position: absolute; top: -2px; bottom: -2px; width: 8px; cursor: ew-resize; }
.tasktl__handle--start { left: -4px; }
.tasktl__handle--end { right: -4px; }
/* #902: the task's people as small avatars on the bar (Oppgaver), «delt med N» by the name (Personer), and the person
   a bar is dragged to (Personer). */
.tasktl__people { flex: none; display: inline-flex; }
.tasktl__avatar { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 2px; border: 1px solid var(--foreground); border-radius: var(--radius-pill); background: var(--background); color: var(--foreground); font-size: 10px; font-weight: 600; line-height: 1; letter-spacing: 0.02em; }
.tasktl__avatar + .tasktl__avatar { margin-left: -3px; }
.tasktl__shared { flex: none; padding: 0 4px; border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--muted-foreground); font-size: 11px; line-height: 14px; white-space: nowrap; }
.tasktl__section.is-target .tasktl__label, .tasktl__row.is-target .tasktl__label { box-shadow: inset 0 0 0 2px var(--ring); }
/* Merket: the spike ring with an ink edge on the bar, and the row's name on spike-soft (never colour alone: the toolbar
   counts them and the name says «merket» to screen readers). */
.tasktl__row.is-selected .tasktl__label, .tasktl__row.is-selected .tasktl__lane { background-color: var(--spike-soft); }
.tasktl__row.is-selected .tasktl__bar { box-shadow: 0 0 0 2px var(--foreground); }
.tasktl.is-dragging, .tasktl.is-dragging .tasktl__bar { cursor: grabbing; }
.tasktl__row.is-dragging .tasktl__bar { z-index: 3; transform: translate(var(--tl-dx, 0px), 0); box-shadow: 0 0 0 2px var(--foreground); }
.tasktl__row.is-lifted, .tasktl__section.is-lifted { opacity: 0.5; }
/* A section is dragged by its grip or heading (#893): no text selection or touch callout while it is held. */
.tasktl__section[data-pl-section-row] .tasktl__label { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }.tasktl__section { height: 28px; }
.tasktl__section .tasktl__label { gap: var(--space-1); border-bottom: 1px solid var(--input); border-left: 4px solid var(--border); background: var(--muted); }
.tasktl__section > :last-child { border-bottom: 1px solid var(--input); background: var(--muted); }
.tasktl__section--tone-grey .tasktl__label { border-left-color: var(--tone-grey); }
.tasktl__section--tone-slate .tasktl__label { border-left-color: var(--tone-slate); }
.tasktl__section--tone-blue .tasktl__label { border-left-color: var(--tone-blue); }
.tasktl__section--tone-violet .tasktl__label { border-left-color: var(--tone-violet); }
.tasktl__section--tone-teal .tasktl__label { border-left-color: var(--tone-teal); }
.tasktl__section--tone-green .tasktl__label { border-left-color: var(--tone-green); }
.tasktl__section--tone-amber .tasktl__label { border-left-color: var(--tone-amber); }
.tasktl__section--tone-red .tasktl__label { border-left-color: var(--tone-red); }
.tasktl__heading { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; line-height: 18px; font-weight: 700; }
.tasktl__count { flex: none; margin-left: auto; padding-right: var(--space-1); color: var(--muted-foreground); font-size: 12px; line-height: 16px; }
.tasktl__fold, .tasktl__edit { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: var(--target-min); min-height: var(--target-min); padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--foreground); font: inherit; cursor: pointer; }
.tasktl__edit { justify-content: flex-start; min-width: 0; padding: 0 var(--space-1); }
.tasktl__fold .icon { width: 16px; height: 16px; }
.tasktl__fold[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.tasktl__fold:hover, .tasktl__edit:hover { background: var(--accent); }
.tasktl__fold:focus-visible, .tasktl__edit:focus-visible { outline: 3px solid var(--focus); outline-offset: -1px; }
.tasktl__input { flex: 1 1 auto; min-width: 0; height: 22px; padding: 0 var(--space-1); border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--foreground); font: inherit; font-size: 13px; }
.tasktl__input::placeholder { color: var(--muted-foreground); opacity: 1; }
.tasktl__input:hover { border-color: var(--border); }
.tasktl__input:focus { border-color: var(--ring); outline: 2px solid var(--focus); outline-offset: 0; background: var(--background); }
.tasktl__row--new .tasktl__lane { background-image: none; }
.tasktl__empty { padding: var(--space-4); }
/* The company's days off (#905): a hatched column down the rows behind the bars (plan.js puts it first in the body
   with --col) and a hatched band under the date in the ruler, whose title names the day; never colour alone. */
.tasktl__off { position: absolute; top: 0; bottom: 0; width: var(--day-w); margin-left: calc(var(--title-w) + var(--col, 0) * var(--day-w)); pointer-events: none;
  background: repeating-linear-gradient(135deg, var(--muted) 0 4px, var(--border) 4px 6px); }
.tasktl__day--off { background-image: repeating-linear-gradient(135deg, var(--muted-foreground) 0 1px, transparent 1px 4px); background-size: 100% 4px; background-position: bottom; background-repeat: no-repeat; }
.tasktl__today { position: absolute; top: 0; bottom: 0; z-index: 1; width: 2px; margin-left: calc(var(--title-w) + var(--today, 0) * var(--day-w) + var(--day-w) / 2 - 1px); background: var(--ring); pointer-events: none; }
.tasktl__drop { position: absolute; left: 0; right: 0; z-index: 7; height: 3px; margin-top: -2px; background: var(--ring); pointer-events: none; }
.tasktl__tip { position: fixed; z-index: 60; padding: 2px var(--space-2); border-radius: var(--radius-sm); background: var(--foreground); color: var(--background); font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap; }
.tasktl__rect { position: absolute; z-index: 50; border: 2px dashed var(--ring); background: var(--spike-soft); opacity: 0.6; pointer-events: none; }
/* The Plan tab's toolbar (#1409): from 760 px the status line takes what is left of the row and cuts its words with
   «…» rather than pushing «Angre» and itself onto a second row, so the plan under it does not jump when a task is
   merket; «Angre: …» is cut the same way past 16rem. Its whole sentence is still read out (a polite live region).
   On a phone the row is too narrow for that: the status wraps onto its own row and stays whole (since #1019 the
   saves are said only there). The merkede's «⋯ Mer» opens under its button, inside it. */
.tasktl__toolbar { position: relative; }
@media (min-width: 760px) {
  .tasktl__toolbar .timeline__status { flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .tasktl__toolbar [data-pl-undo] { display: block; line-height: calc(var(--control-sm) - 2px); max-width: 16rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}
.tasktl__filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; }
.tasktl__filters .input { width: auto; min-width: 0; max-width: 16rem; }
.tasktl__shown { margin: 0 0 0 auto; color: var(--muted-foreground); font-size: 13px; line-height: 18px; }
.tasktl__zoom { display: inline-flex; gap: 2px; }
/* #1016: «⋯ Mer» on the Plan tab, a popover inside the filter form: the editors' rarer actions as left-aligned rows,
   then the filters with their labels and the zoom. display only when open (see «Overlays»). */
.tasktl__more:popover-open { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3); }
.tasktl__more .btn:not(.btn--icon) { justify-content: flex-start; }
.tasktl__filters .tasktl__more .input { width: 100%; max-width: none; flex: none; }
/* #837: a milestone is a ♦ on its day (the bar turned 45°, its tone as fill edge); the key times are a row of ♦ under
   the ruler; «Starter etter» is an arrow from the one's end to the other's start (an SVG over the lanes, drawn by
   plan.js), dashed in destructive when the task starts before the one it waits for is done. */
.tasktl__bar--milestone { justify-self: center; width: 14px; height: 14px; padding: 0; border-width: 2px; border-left-width: 2px; border-radius: 2px; transform: rotate(45deg); }
.tasktl__row.is-dragging .tasktl__bar--milestone { transform: translate(var(--tl-dx, 0px), 0) rotate(45deg); }
.tasktl__keys-label { height: 20px; border-top: 1px solid var(--border); }
.tasktl__keys { display: grid; grid-template-columns: repeat(var(--days), var(--day-w)); height: 20px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.tasktl__key { grid-row: 1; display: flex; align-items: center; justify-content: center; color: var(--foreground); font-size: 12px; line-height: 18px; cursor: default; }
.tasktl__key[hidden] { display: none; }
.tasktl__links { position: absolute; top: 0; left: 0; z-index: 1; overflow: visible; pointer-events: none; }
.tasktl__link { fill: none; stroke: var(--muted-foreground); stroke-width: 1.5; }
.tasktl__arrow { fill: var(--muted-foreground); }
.tasktl__link--late { stroke: var(--destructive); stroke-dasharray: 4 3; }
.tasktl__arrow--late { fill: var(--destructive); }
/* Prosjektplan (#837): one heading per project over its tasks, with the filter above. */
.tasktl__project .tasktl__label { gap: var(--space-1); border-bottom: 1px solid var(--input); background: var(--muted); }
.tasktl__project > :last-child { border-bottom: 1px solid var(--input); background: var(--muted); }
.tasktl__project { height: 28px; }
/* #1167: a read row's name (Prosjektplan, a shared plan) is a link and looks like one, as the project's name above.
   Where the tasks change on Prosjektplan, the project's heading row takes a click on a day (a new task), its last row
   holds «Ny oppgave» (`tasktl__add`), and a task without days has «Gi dager» (`tasktl__give`) in its lane. */
.tasktl__name--link { color: var(--cue); }
.tasktl__name--link .tasktl__title { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
.tasktl__name--link:hover .tasktl__title { text-decoration-thickness: 2px; }
.tasktl__project--editable > :last-child { cursor: cell; }
.tasktl__add { flex: none; display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--target-min); padding: 0 var(--space-1); border: 0; border-radius: var(--radius-sm); background: none; color: var(--cue); font: inherit; font-size: 13px; line-height: 18px; cursor: pointer; }
.tasktl__add .icon { width: 14px; height: 14px; }
.tasktl__add:hover { background: var(--accent); }
.tasktl__give { justify-self: start; position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 var(--space-1); border: 1px dashed var(--foreground); border-radius: var(--radius-sm); background: var(--background); color: var(--foreground); font: inherit; font-size: 12px; line-height: 16px; white-space: nowrap; cursor: pointer; }
.tasktl__give .icon { width: 12px; height: 12px; }
.tasktl__give:hover { background: var(--spike-soft); }
.tasktl__add:focus-visible, .tasktl__give:focus-visible { outline: 3px solid var(--focus); outline-offset: -1px; }
@media (max-width: 759px) {
  /* Phones: a narrower name column; the frame scrolls sideways and holds the names. */
  .tasktl { --title-w: 148px; max-height: none; }
  .tasktl__filters .input { max-width: 100%; flex: 1 1 10rem; }
  .tasktl__shown { margin-left: 0; }
}
@media (forced-colors: active) {
  .tasktl__row.is-selected .tasktl__bar { outline: 3px solid Highlight; }
  .tasktl__bar { border-color: CanvasText; }
  .tasktl__link { stroke: CanvasText; }
  .tasktl__arrow { fill: CanvasText; }
}
/* «Mangler folk» (#392): the open needs as draggable cards above the grid. It scrolls away with the page and folds
   (#891, a <details>; planner.js remembers it per user). While a need is dragged each row gets data-fit: a fitting
   person a strong edge and «Passer», the rest a badge with icon + word, people without the skill toned down; the
   need's busy days are marked on the lane. */
.planner-board { display: flex; flex-direction: column; gap: var(--space-4); }
.needs__summary { cursor: pointer; list-style: none; flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-2); }
.needs__summary::-webkit-details-marker { display: none; }
.needs:not([open]) .needs__summary { border-bottom: 0; }
.needs:not([open]) .needs__summary .icon { transform: rotate(-90deg); }
.needs__list { display: flex; gap: var(--space-2); overflow-x: auto; margin: 0; padding: var(--space-3) var(--space-4); list-style: none; }
.need { flex: 0 0 auto; width: 16rem; display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); font-size: 14px; line-height: 20px; cursor: grab; }
.need__project { font-weight: 600; }
.need__when { font-size: 13px; color: var(--muted-foreground); }
.need[aria-current="true"] { border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring); }
/* The planner's filter row (#891): the one thing held at the top while the page scrolls, right under what sticks
   above it (the phone's menu strip, or the page head from 760×560; on a phone on its side it scrolls with the page,
   as the page head does, #536). shell.js puts its
   bottom edge in --planner-bar-bottom: scroll-padding-top keeps focus below it (2.4.11), and the grid is at most the
   screen under it tall, so its day row and name column stick inside it. On a phone the fields wait behind
   «Filtrer» (one line with «N mangler folk ↑»); open, the bar scrolls inside itself. From 1200px the fields share
   one line. */
.planner-bar { position: sticky; top: var(--planner-bar-top, 0px); z-index: 9; display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2) var(--space-3); padding-block: var(--space-2); background: var(--background); }
.planner-bar > .filters__panel { flex: 1 1 auto; min-width: 0; }
.planner-bar__needs { flex: none; align-self: center; min-height: var(--target-min); text-decoration: none; }
.planner-bar__needs:hover { text-decoration: underline; }
html:has(.planner-bar) { scroll-padding-top: calc(var(--planner-bar-bottom, 72px) + var(--space-3)); }
@media (max-width: 759px) {
  .planner-bar { --planner-bar-top: var(--strip-height, 0px); max-height: calc(100dvh - var(--strip-height, 0px)); overflow-y: auto; }
  .planner-bar > .filters__panel { flex-basis: 0; }
  .planner-bar > .filters__panel[open] { flex-basis: 100%; }
}
@media (min-width: 760px) and (min-height: 560px) {
  .planner-bar { --planner-bar-top: var(--page-head-height, 0px); }
  html:has(.app .page > .page-head):has(.planner-bar) { scroll-padding-top: calc(var(--planner-bar-bottom, 0px) + var(--space-3)); }
}
@media (min-width: 760px) and (max-height: 559px) {
  .planner-bar { position: relative; }
}
@media (min-width: 1200px) {
  .planner-bar .filters { flex-wrap: nowrap; }
  .planner-bar .filters__field { flex: 1 1 0; min-width: 0; }
}
.booking[draggable="true"] { cursor: grab; }
.planner__fit { margin-top: var(--space-1); }
.planner__fit:empty { display: none; }
.planner__lane { position: relative; }
.planner__lane > .booking { position: relative; z-index: 1; }
.planner__lane[data-fit] { padding-bottom: 30px; }
.planner__label[data-fit="fits"] { box-shadow: inset 6px 0 0 var(--ok); }
.planner__lane[data-fit="fits"] { box-shadow: inset 0 0 0 3px var(--ok); }
.planner__label[data-fit="no_skill"], .planner__label[data-fit="assigned"] { background: var(--muted); }
.planner__lane[data-fit="no_skill"] > .booking, .planner__lane[data-fit="assigned"] > .booking { opacity: 0.5; }
.planner__clash { position: absolute; top: 2px; bottom: 2px; left: calc((var(--col) - 1) * 100% / var(--days)); width: calc(100% / var(--days));
  display: flex; align-items: flex-end; gap: var(--space-1); padding: 0 var(--space-2) 2px; border: 2px dashed var(--warn); border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--ink); font-size: 12px; line-height: 20px; pointer-events: none; }
.planner__clash .icon { width: 14px; height: 14px; color: var(--warn); }
/* A day off on a person's row (#905): a hatched block down its day behind the bars (layout.js gives the column; an
   absolutely placed grid item fills it top to bottom). The hatching, not the colour, says «blocked»; the name is in
   its title and visually hidden text; the day header names the company's days in words. */
.planner__off { position: absolute; inset: 0; z-index: 0;
  background: repeating-linear-gradient(135deg, var(--muted) 0 5px, var(--border) 5px 7px); }

/* ---------- Mini calendar (design/components/MiniCalendar) -------------------------------------
   One person's days around a need, one planner bar state per day (icon + hidden word). On phones only the
   summary badge («Ledig hele perioden / Delvis ledig / Opptatt») is shown. */
.minical { --days: 5; display: grid; grid-template-columns: repeat(var(--days), 28px); gap: 2px; margin: 0 0 var(--space-1); padding: 0; list-style: none; }
.minical .booking, .minical-legend .booking { justify-content: center; min-height: 28px; width: 28px; margin: 0; padding: 0; cursor: default; }
.minical--head { margin: var(--space-1) 0 0; }
.minical__date { display: inline-block; min-width: 28px; font: 500 12px/16px var(--font-mono); text-align: center; color: var(--ink-muted); border-bottom: 2px solid transparent; }
.minical__date--request { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.minical-legend { margin: 0; padding: 0; list-style: none; gap: var(--space-2) var(--space-4); font-size: 13px; line-height: 18px; }
.minical-legend li { display: inline-flex; align-items: center; gap: var(--space-1); }
@media (max-width: 479px) { .minical, .minical-legend { display: none; } }

/* ---------- PhaseTimeline (#2144, design/components/PhaseTimeline): phases as bands, tasks on their date ---------- */
/* The wrap scrolls sideways, never the page; the labels stay in view while it does. */
.phaseline-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); }
.phaseline { --days: 7; --label-w: 168px; --day-w: 104px; display: grid; grid-template-columns: var(--label-w) repeat(var(--days), var(--day-w)); min-width: calc(var(--label-w) + var(--days) * var(--day-w)); }
.phaseline__corner, .phaseline__day { padding: var(--space-2) var(--space-2); border-bottom: 1px solid var(--border); background: var(--card); color: var(--foreground); font-size: 13px; line-height: 18px; }
.phaseline__corner { position: sticky; left: 0; z-index: 2; font-weight: 600; }
.phaseline__day { display: flex; flex-direction: column; border-left: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.phaseline__day strong { font-family: var(--font-display); font-size: 12px; line-height: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.phaseline__day--today { background: var(--spike-soft); color: var(--ink); }
.phaseline__day--today strong { color: var(--ink); }
.phaseline__label { position: sticky; left: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: var(--space-2); border-bottom: 1px solid var(--border); background: var(--card); color: var(--foreground); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.phaseline__label small { color: var(--muted-foreground); font-size: 13px; line-height: 18px; }
.phaseline__lane { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--border); background: var(--muted);
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px); background-size: var(--day-w) 100%; }
.phaseline__bands, .phaseline__tasks { display: grid; grid-template-columns: repeat(var(--days), var(--day-w)); grid-auto-flow: row dense; gap: 4px 0; margin: 0; padding: 0; list-style: none; }
.phaseline__bands:empty { display: none; }
.phaseline__tasks > li { min-width: 0; }
.phaseline__band { display: flex; align-items: center; gap: var(--space-1); min-width: 0; min-height: 28px; margin: 0 3px; padding: 0 var(--space-2); border: 1px solid var(--foreground); border-radius: var(--radius-sm); background: var(--background); color: var(--foreground); font: 600 13px/18px var(--font-sans); white-space: nowrap; overflow: hidden; }
.phaseline__band--billable { background: var(--spike-soft); color: var(--ink); border-color: var(--ink); }
.phaseline__name, .phaseline__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phaseline__band .icon, .phaseline__task .icon { flex: none; width: 16px; height: 16px; }
/* A task: status icon + title, the status in hidden words too; 28px high (WCAG 2.5.8). */
.phaseline__task { display: flex; align-items: center; gap: var(--space-1); min-width: 0; min-height: 28px; margin: 0 3px; padding: 0 var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--secondary); color: var(--secondary-foreground); font: 500 13px/18px var(--font-sans); text-decoration: none; }
a.phaseline__task:hover .phaseline__title { text-decoration: underline; }
.phaseline__task--doing { background: var(--cue-soft); color: var(--ink); border-color: var(--cue); }
.phaseline__task--doing .icon { color: var(--cue); }
.phaseline__task--done { background: var(--ok-soft); color: var(--ink); border-color: var(--ok); }
.phaseline__task--done .icon { color: var(--ok); }
.phaseline__task--done .phaseline__title { text-decoration: line-through; }
.phaseline__task--overdue { background: var(--danger-soft); color: var(--ink); border: 2px solid var(--destructive); }
.phaseline__task--overdue .icon { color: var(--destructive); }
.phaseline__legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0; padding: 0; list-style: none; }
.phaseline__legend .phaseline__task { margin: 0; }
@media (max-width: 759px) {
  .phaseline { --label-w: 112px; --day-w: 88px; }
}
.stack--tight { gap: var(--space-1); }
.conflict-list { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.conflict-list li { display: flex; align-items: flex-start; gap: var(--space-1); }
.conflict-list .icon { flex: none; color: var(--warn); }
.conflict-list__blocking .icon { color: var(--danger); }

/* ---------- Selection toolbar (design/components/SelectToolbar) -------------------------------- */
.select-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); border: 1px solid var(--input); border-radius: var(--radius-md); background: var(--muted); }
.select-toolbar__count, .select-toolbar__warn { margin: 0; }
.select-toolbar__warn { display: inline-flex; align-items: center; gap: var(--space-1); }
.select-toolbar__warn[hidden] { display: none; }
.select-toolbar__warn .icon { flex: none; color: var(--warn); }
.select-toolbar > .btn { margin-left: auto; }
/* Phones (#617): the counts and the warning wrap above, the button takes its own full line under them. */
@media (max-width: 759px) {
  .select-toolbar > .btn { flex: 1 1 100%; margin-left: 0; }
}

/* ---------- Catalogue browser (design/components/Catalogue) ------------------------------------- */
.catalogue { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.catalogue__tree { display: none; }
.catalogue__nodes { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.catalogue__nodes .catalogue__nodes { padding-left: var(--space-4); }
.catalogue__node {
  display: block; width: 100%; min-height: var(--target-min); padding: var(--space-1) var(--space-2);
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--foreground);
  font: inherit; text-align: left; cursor: pointer; transition: background-color 120ms ease;
}
.catalogue__node:hover { background: var(--accent); }
.catalogue__node:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.catalogue__node[aria-current="true"] { background: var(--spike-soft); box-shadow: inset 3px 0 0 var(--foreground); font-weight: 600; }
.catalogue__main { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.catalogue__picked { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.catalogue__picked li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.catalogue__qty { max-width: 8rem; }
@media (min-width: 760px) {
  .catalogue { grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr); align-items: start; }
  .catalogue__tree { display: block; }
  .catalogue__picker { display: none; }
}

/* ---------- Scan result (warehouse scanner) ------------------------------------------------ */
.scan { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4); align-items: center; padding: var(--space-5); border-radius: var(--radius-lg); border: 2px solid var(--line-strong); background: var(--surface-raised); }
.scan__title { font-family: var(--font-display); font-size: 48px; line-height: 48px; font-weight: 700; }
.scan__detail { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--space-2); }
.scan--ok { background: var(--ok-soft); border-color: var(--ok); }
.scan--ok .scan__title, .scan--ok > .icon { color: var(--ok); }
.scan--error { background: var(--danger-soft); border-color: var(--danger); }
.scan--error .scan__title, .scan--error > .icon { color: var(--danger); }
/* Already done (#535): the unit is on the list or taken in already; nothing changed, nothing is wrong with it. */
.scan--warn { background: var(--warn-soft); border-color: var(--warn); }
.scan--warn .scan__title, .scan--warn > .icon { color: var(--warn); }
/* The phone camera's picture while it looks for a QR code (static/rigg/scan.js). */
.scan-camera { width: 100%; max-height: 50vh; object-fit: cover; border-radius: var(--radius-lg); border: 2px solid var(--line-strong); background: var(--surface-raised); }

/* ---------- Empty state -------------------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-7) var(--space-5); }
.empty__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--ink-muted); }
.empty p { color: var(--ink-muted); }

/* ---------- Stat tile (Rapporter, design/components/StatTile) ------------------------------- */
.stat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-4); }
.stat__label { margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; }
.stat__value { margin: 0; font-family: var(--font-mono); font-size: 28px; line-height: 36px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat__unit { font-family: var(--font-sans); font-size: 15px; font-weight: 500; color: var(--muted-foreground); }
.stat__detail { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }

/* ---------- Chart (one series over a report's table, design/components/Chart) ------------- */
.chart { margin: 0 0 var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.chart__title { font-size: 15px; line-height: 20px; font-weight: 600; }
.chart__unit { font-weight: 400; color: var(--muted-foreground); }
.chart__bars { display: grid; grid-template-columns: fit-content(40%) minmax(6rem, 1fr) max-content; align-items: center; gap: var(--space-2) var(--space-3); }
.chart__label { font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.chart__value { font-family: var(--font-mono); font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; text-align: end; }
.chart__track { display: block; width: 100%; height: 16px; overflow: visible; }
.chart__bar { fill: var(--chart-1); }
.chart__zero { stroke: var(--muted-foreground); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart__plot { display: block; width: 100%; height: auto; min-width: 30rem; max-width: 40rem; }
.chart__grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart__line { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart__point { fill: var(--chart-1); stroke: var(--card); stroke-width: 2; }
.chart__tick { fill: var(--muted-foreground); font-family: var(--font-mono); font-size: 15px; font-variant-numeric: tabular-nums; }
.chart__mark { fill: var(--foreground); font-family: var(--font-mono); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart__note { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
@media (forced-colors: active) {
  .chart__bar, .chart__point { fill: CanvasText; }
  .chart__line, .chart__zero { stroke: CanvasText; }
  .chart__tick, .chart__mark { fill: CanvasText; }
}

/* ---------- Definition (how a number is computed: a disclosure, not a hover-only tooltip) ---- */
.definition { font-size: 14px; line-height: 20px; }
.definition > summary { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 24px; cursor: pointer; color: var(--muted-foreground); }
.definition > summary .icon { width: 16px; height: 16px; }
.definition > p { margin: var(--space-2) 0 0; max-width: 72ch; }

/* ---------- Disclosure (a form behind a button: <details class="disclosure"><summary class="btn …">; no JS) ---- */
.disclosure > summary { list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure[open] > summary { background: var(--accent); color: var(--accent-foreground); }
/* A chevron in the toggle points up while it is open (the quote's «Pris og seksjon», #2141). */
.disclosure > summary > .icon:has(> use[href="#i-chevron-down"]) { transition: transform 120ms ease; }
.disclosure[open] > summary > .icon:has(> use[href="#i-chevron-down"]) { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .disclosure > summary > .icon { transition: none; } }
.disclosure__body { margin-top: var(--space-3); }

/* ---------- Status list (Innstillinger › Statuser) ----------------------------------------- */
.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.status-row { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.status-row:target { background: var(--spike-soft); }
/* Mine oppgaver (#1021, #1023): the card is marked where a tap left it (#oppgave-…), and its one main button («Ferdig»)
   takes a line of its own on a phone. */
.status-list > .card:target { background: var(--muted); }
@media (max-width: 759px) { .status-list > .card form > .btn--default { flex-basis: 100%; } }
/* The task's date, how near it is («I morgen», «Over frist») and its project as one row (#1414); as a link it is one tap
   target of at least 44 px (`--control-lg`), set apart from the buttons under it. */
.status-list__when {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); min-height: var(--control-lg);
  margin: 0; padding: var(--space-1) var(--space-2); margin-inline: calc(-1 * var(--space-2)); border-radius: var(--radius-md);
  color: var(--foreground); text-decoration: none;
}
.status-list__project { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
a.status-list__when .status-list__project { text-decoration: underline; text-underline-offset: 2px; }
a.status-list__when:hover { background: var(--muted); }
a.status-list__when:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.status-list__when > .icon { color: var(--muted-foreground); }
.status-row__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.status-row__head form { margin: 0; }
.status-row__grip { color: var(--ink-muted); cursor: grab; letter-spacing: -0.2em; }
.status-row__move { margin-left: auto; }
.status-row__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.status-row__field { display: flex; flex-direction: column; gap: var(--space-1); font-size: 14px; line-height: 20px; min-width: 150px; }
/* Statuser (#1576): the fields are top-aligned, so a hint under a control (.status-row__hint) hangs below it without
   lifting its label and control above the others; the actions after the fields drop past the 20px label line and
   centre on the controls. Forms built from {% field %} (Pipeline-steg) keep the bottom alignment: their hint sits above. */
.status-row__form > .status-row__field { align-self: flex-start; }
.status-row__form > .status-row__field ~ .choice, .status-row__form > .status-row__field ~ .cluster { align-self: flex-start; align-items: center; min-height: var(--control-md); margin-top: calc(20px + var(--space-1)); }
.status-row__hint { font-size: 13px; line-height: 18px; color: var(--muted-foreground); max-width: 32ch; }

/* ---------- Sortable list (design/components/SortableList; Innstillinger › Produksjonsroller) - */
.sort-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.sort-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--background); }
.sort-row:target { background: var(--spike-soft); }
.sort-row form { margin: 0; }
.sort-row__grip { color: var(--muted-foreground); cursor: grab; letter-spacing: -0.2em; }
.sort-row__main { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; flex: 1 1 16rem; }
.sort-row__meta { color: var(--muted-foreground); font-size: 14px; line-height: 20px; }
.sort-row__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-left: auto; }

/* ---------- Icon grid (design-system reference) -------------------------------------------- */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-2); }
.icon-grid figure { margin: 0; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2); color: var(--ink); }
.icon-grid figcaption { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); }

/* ---------- View switcher + filters (list · calendar · board) ------------------------------ */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-3) var(--space-4); }
.filters__field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 160px; }
.filters__cols { position: relative; }
.filters__colbox { position: absolute; z-index: 5; margin: var(--space-1) 0 0; padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); min-width: 200px;
  background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-raised); }
/* A multiple-choice filter (#2224): the summary reads like the select it sits beside; «Velg alle» / «Fjern alle»
   need filters.js. */
.filters__multi > summary { cursor: pointer; white-space: nowrap; overflow: hidden; list-style: none; }
.filters__multi > summary::-webkit-details-marker { display: none; }
/* On a phone the open list pushes the fields below it down instead of covering the «Filtrer» panel. */
.filters__group { margin: 0; padding: 0 0 0 var(--space-3); border: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.filters__grouplabel { padding: 0; margin-left: calc(-1 * var(--space-3)); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); }
@media (max-width: 759px) { .filters__multi > .filters__colbox { position: static; min-width: 0; box-shadow: none; } }
.filters__checkall { display: none; }
.filters--live .filters__checkall { display: flex; }
/* filters.js sends a data-autofilter form as it changes: its «Bruk filter» is not needed (Enter still sends). */
.filters--live [type="submit"] { display: none; }
/* Phone (#1642): the form waits behind «Filtrer (n)» (a Disclosure), and the export sits under the list rather than in
   the page head (a head left with nothing else in it goes too), so the first rows are on the first screen; a person's
   own list (Mine oppdrag, #1021) has it behind «⋯ Mer» instead (`.more-menu__body`). From 760px
   the button is gone and the form always shows; a browser without ::details-content keeps the button there too. */
.filters__panel > summary { width: 100%; }
@media (max-width: 759px) {
  .page-head .filters__export:not(.more-menu__body > *), .page-head__wide,
  .page-head > :is(.cluster, .page-head__actions):not(:has(> :not(.filters__export, .page-head__wide))) { display: none; }
}
/* «Vis arkiverte» (#871): in the page head from 760px (`.page-head__wide`), in the «Filtrer» panel on a phone. */
@media (min-width: 760px) {
  .filters__panel > summary { width: auto; }
  .filters__export--foot, .filters__archived { display: none; }
}
/* «Sorter etter» (#625) is for the cards under 640px, where a list has no header row (StackTable); from 640px the
   column headers sort, and the hidden field still sends the order with the filters. */
@media (min-width: 640px) { .filters__sort { display: none; } }
@supports selector(::details-content) {
  @media (min-width: 760px) {
    .filters__panel > summary { display: none; }
    .filters__panel::details-content { content-visibility: visible; }
    .filters__panel > .disclosure__body { margin-top: 0; }
  }
}
.check { display: flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); }
.viewswitch a .icon { width: 16px; height: 16px; }
/* A switcher and the segmented choice that goes with it on one row (Oppgaver: Liste | Tavle · Status | Fase, #2142):
   the underline runs under the whole row; on a narrow screen it stays under the tabs and the segmented control wraps
   below it. */
.viewswitch__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); }
.viewswitch__bar > .tabs { border-bottom: 0; min-width: 0; }
.viewswitch__bar > .segmented { margin-bottom: var(--space-1); }
/* Narrow: the underline goes with the tabs, so the active tab's mark sits on it; the segmented control goes under. */
@media (max-width: 639px) {
  .viewswitch__bar { border-bottom: 0; }
  .viewswitch__bar > .tabs { flex-basis: 100%; border-bottom: 1px solid var(--line); }
}

/* ---------- Calendar (month/week, bars in lanes) ------------------------------------------- */
/* The toolbar takes its own row under the title in every scale, so switching scale never moves the buttons (#1440);
   the date and «Gå til» wrap as one unit, never apart. */
.cal-toolbar { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-width: 0; }
.cal-toolbar__goto { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-2); }
.cal-toolbar__goto .input { width: auto; min-width: 9.5rem; flex: 0 1 auto; } /* a date input without appearance can collapse (iOS) */
.cal-toolbar__goto .btn { flex: none; }
/* Positioned, so the visually hidden texts in the calendar (absolutely positioned) are clipped by its scroll box too:
   without it they made the whole page 720px wide on a phone, and a dialog opened from it sat off the screen (#2300). */
.cal-wrap { position: relative; overflow-x: auto; }
.cal { --wk-w: 40px; min-width: 720px; }
.cal__heads { display: grid; grid-template-columns: var(--wk-w) repeat(7, 1fr); border-bottom: 1px solid var(--line-strong); padding-block: var(--space-2); text-align: center; }
.cal__week { display: grid; grid-template-columns: var(--wk-w) repeat(7, minmax(0, 1fr)); grid-auto-rows: min-content; border-bottom: 1px solid var(--line); }
.cal__wk { grid-column: 1; grid-row: 1 / -1; padding: var(--space-2); font-size: 13px; text-align: center; border-right: 1px solid var(--line); }
.cal__day { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 96px; padding: var(--space-1) var(--space-2); border-left: 1px solid var(--line); }
.cal__day--out { background: var(--surface-sunken); color: var(--ink-muted); }
.cal__day--today { background: var(--spike-soft); }
.cal__num { font-weight: 600; text-decoration: none; color: inherit; }
.cal__today { font-family: var(--font-display); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.cal__more { margin-top: auto; font-size: 13px; }
.cal__bar {
  display: flex; align-items: center; gap: var(--space-1); min-height: 28px; margin: 2px 3px; padding: 0 var(--space-2); z-index: 1; min-width: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink);
  font-size: 13px; line-height: 18px; font-weight: 500; text-decoration: none; overflow: hidden; white-space: nowrap;
}
.cal__bar .icon { width: 16px; height: 16px; flex: none; }
.cal__title { overflow: hidden; text-overflow: ellipsis; }
.cal__status { margin-left: auto; font-weight: 400; color: var(--ink-muted); }
.cal__bar--ok { background: var(--ok-soft); border-color: var(--ok); }
.cal__bar--warn { background: var(--warn-soft); border-color: var(--warn); }
.cal__bar--danger { background: var(--danger-soft); border-color: var(--danger); }
.cal__bar--info { background: var(--cue-soft); border-color: var(--cue); }
.cal__bar--tone-grey { background: var(--tone-grey-soft); border-color: var(--tone-grey); }
.cal__bar--tone-slate { background: var(--tone-slate-soft); border-color: var(--tone-slate); }
.cal__bar--tone-blue { background: var(--tone-blue-soft); border-color: var(--tone-blue); }
.cal__bar--tone-violet { background: var(--tone-violet-soft); border-color: var(--tone-violet); }
.cal__bar--tone-teal { background: var(--tone-teal-soft); border-color: var(--tone-teal); }
.cal__bar--tone-green { background: var(--tone-green-soft); border-color: var(--tone-green); }
.cal__bar--tone-amber { background: var(--tone-amber-soft); border-color: var(--tone-amber); }
.cal__bar--tone-red { background: var(--tone-red-soft); border-color: var(--tone-red); }
[class*="cal__bar--tone-"] .cal__status { color: var(--ink); }
/* Phases (#2225): a bar with parts (a project's get-in, show, get-out) is two rows: its head, and below it a segment
   per phase under the days it covers. The bar is a subgrid of its week's day columns, so a segment's data-col/data-span
   count the bar's own days. Days without a phase have no segment. Without phases the head is no box of its own. */
.cal__head { display: contents; }
.cal__bar--phased { display: grid; grid-template-columns: subgrid; grid-template-rows: auto auto; align-items: center; padding: 0 0 2px; }
.cal__bar--phased .cal__head { display: flex; align-items: center; gap: var(--space-1); grid-column: 1 / -1; grid-row: 1; min-width: 0; min-height: 24px; padding: 0 var(--space-2); }
.cal__phase {
  grid-row: 2; min-width: 0; margin: 0 1px; padding: 0 var(--space-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--card-foreground);
  font-size: 12px; line-height: 16px; font-weight: 600;
}
/* every other phase has a dashed edge in the text colour, so two neighbours stay apart in both themes even when
   their fills (card, secondary) are close and their names are cut off */
.cal__phase--alt { border-style: dashed; border-color: var(--foreground); background: var(--secondary); color: var(--secondary-foreground); }
.cal__bar--conflict { border: 2px solid var(--danger); }
.cal__bar--conflict .icon { color: var(--danger); }
.cal__bar--before { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.cal__bar--after { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.cal__bar:hover { text-decoration: underline; }
/* Editable month calendar (#2300, design/components/CalendarEdit): every day is a button filling its cell (under the
   bars, which sit above it), and the freelancer's own periods are buttons drawn as bars. The selection is a ring as
   well as a tint, never colour alone; the status line names it for screen readers. */
.cal-edit__page { display: flex; flex-direction: column; gap: var(--space-5); }
.cal-edit { user-select: none; -webkit-user-select: none; }
.cal-edit .cal__day { padding: 0; }
.cal-edit__day {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: 1 1 auto; align-self: stretch; width: 100%;
  min-height: var(--target-min); padding: var(--space-1) var(--space-2); border: 0; border-radius: 0; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.cal-edit__day:hover { background: var(--accent); color: var(--accent-foreground); }
/* Selection and focus look different, so the focused end of a Shift selection shows (WCAG 2.4.7): the selection is a
   2px inset ring in --foreground, the focus a 3px --ring outline drawn inside it. */
.cal__day.is-selected .cal-edit__day { background: var(--accent); color: var(--accent-foreground); box-shadow: inset 0 0 0 2px var(--foreground); }
.cal-edit__day:focus-visible { outline: 3px solid var(--ring); outline-offset: -5px; }
/* Days outside the month are already --surface-sunken (= --accent): their hover and selection tint is --line. */
.cal__day--out .cal-edit__day:hover, .cal__day--out.is-selected .cal-edit__day { background: var(--line); }
.cal-edit__period { justify-self: stretch; width: auto; font-family: inherit; text-align: left; cursor: pointer; }
.cal-edit__period:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
/* On a touch screen the period buttons are crew-sized (48px), not just the 24px minimum (WCAG 2.5.8). */
@media (pointer: coarse) { .cal-edit__period { min-height: var(--control-lg); } }
/* The calendar's hint (#706): a touch screen gets one sentence, other screens the Shift and keyboard help. The other
   part is display: none, so a screen reader does not read it either. */
.cal-edit__hint-touch { display: none; }
@media (pointer: coarse) { .cal-edit__hint-touch { display: inline; } .cal-edit__hint-keys { display: none; } }
/* Dragging a period (#2301): the grips at its first and last day change that end, the middle moves it. A finger on
   a period drags it sideways and still scrolls the page up and down (pan-y); on a grip it only drags. The grip shows
   as a bar in --foreground on hover and focus, and always on a touch screen, which has no hover; it is not colour
   alone. At 60% it is 4.5:1 on ok-soft and warn-soft in Daylight and over 5:1 in Show (test_availability_calendar). */
.cal-edit__period { position: relative; touch-action: pan-y; -webkit-touch-callout: none; }
.cal-edit__grip {
  position: absolute; top: 0; bottom: 0; width: var(--space-3); cursor: ew-resize; touch-action: none;
}
.cal-edit__grip--start { left: 0; }
.cal-edit__grip--end { right: 0; }
/* The bar is 3px from the period's outer edge at both ends, clear of the title however wide the grip is. */
.cal-edit__grip::after {
  content: ""; position: absolute; top: 25%; bottom: 25%; width: 2px; border-radius: 1px;
  background: var(--foreground); opacity: 0;
}
.cal-edit__grip--start::after { left: 3px; }
.cal-edit__grip--end::after { right: 3px; }
.cal-edit__period:hover .cal-edit__grip::after, .cal-edit__period:focus-visible .cal-edit__grip::after,
.cal-edit__period.is-dragging .cal-edit__grip::after { opacity: 1; }
.cal-edit__period.is-dragging { outline: 2px dashed var(--foreground); outline-offset: 1px; }
.cal-edit--dragging, .cal-edit--dragging * { cursor: grabbing; }
.cal-edit--dragging .cal-edit__grip { cursor: ew-resize; }
@media (pointer: coarse) {
  .cal-edit__grip { width: var(--space-5); }
  .cal-edit__grip::after { opacity: .6; }
  /* The period menu is opened with a finger (a long press), so its items are crew-sized at every width, not just
     --control-md under 760px as in other dropdowns. */
  #period-menu .dropdown__item { min-height: var(--control-lg); }
}

/* Continuous («Dag for dag», #1028): its own scroll box, one grid per six-week window. Column 1 is the date, each
   further column a lane; a bar runs down over its days (data-col/data-row/data-row-span, layout.js). The month
   heading sticks to the top of the box while its window scrolls past; a later heading slides over it. */
.cal-strip { --date-w: 8.5rem; --row-h: 40px; position: relative; max-height: max(70vh, 420px); overflow: auto; overflow-anchor: none; }
.cal-strip--zoom-1 { --row-h: 28px; }
.cal-strip--zoom-3 { --row-h: 64px; }
.cal-strip--zoom-4 { --row-h: 96px; }
.cal-strip:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.cal-strip__window { display: grid; grid-template-columns: var(--date-w); grid-auto-columns: minmax(10rem, 1fr); grid-auto-rows: minmax(var(--row-h), auto); }
.cal-strip__window:focus { outline: none; }
.cal-strip__window:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.cal-strip__month {
  position: sticky; top: 0; z-index: 2; margin: 0; padding: var(--space-2) var(--space-3);
  background: var(--card); color: var(--foreground); border-top: 2px solid var(--foreground); border-bottom: 1px solid var(--border);
  font-family: var(--font-display); font-size: 16px; line-height: 22px; font-weight: 600;
}
.cal-strip__month > span { position: sticky; left: var(--space-3); }
.cal-strip__day { border-bottom: 1px solid var(--border); }
.cal-strip__day--monday { border-top: 1px solid var(--foreground); }
.cal-strip__day--weekend, .cal-strip__day--holiday { background: var(--muted); }
.cal-strip__day--today { background: var(--spike-soft); }
.cal-strip__label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); width: var(--date-w); padding: var(--space-1) var(--space-2); border-right: 1px solid var(--border); min-height: 100%; }
.cal-strip--zoom-1 .cal-strip__label { padding-block: 2px; } /* the date's 24px target still fits a 28px row */
.cal-strip__date { display: inline-flex; align-items: center; min-width: var(--target-min); min-height: var(--target-min); font-weight: 600; color: inherit; text-decoration: none; font-variant-numeric: tabular-nums; }
.cal-strip__date:hover { text-decoration: underline; }
.cal-strip__wk, .cal-strip__tag { font-size: 12px; line-height: 16px; }
.cal-strip__tag { font-weight: 600; }
.cal-strip__bar { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; padding: var(--space-1) var(--space-2); white-space: normal; }
.cal-strip__bar .cal__status { margin-left: 0; }
/* Title first (#2223): a short bar gives its room to the name. The status word and the conflict text shrink a thousand
   times faster than the title, so they are cut to nothing first; they stay in the bar for screen readers, and the tone,
   the status icon (horizontal) and the conflict icon still show them. */
.cal-strip__bar .cal__title { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.cal-strip__bar .cal__status { flex: 0 1000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* The conflict text shrinks only in horizontal (a row; its alert icon stays). In vertical the bar is a column with a
   fixed height, where it would shrink to no height and hide the icon, so there it keeps its place. */
.cal-strip--h .cal-strip__bar .cal__flag { flex: 0 1000 auto; min-width: 16px; overflow: hidden; text-overflow: ellipsis; }
.cal-strip__bar--before { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: 0; }
.cal-strip__bar--after { border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0; }
/* Phases running down (#2225): the bar is a subgrid of its days' rows; the head on the left over all of them, a
   segment per phase on the right beside its days (data-row/data-row-span). */
.cal-strip__bar.cal__bar--phased { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: subgrid; align-items: stretch; padding: 0; }
.cal-strip__bar.cal__bar--phased .cal__head { flex-direction: column; align-items: flex-start; gap: 0; grid-column: 1; grid-row: 1 / -1; padding: var(--space-1) var(--space-2); }
.cal-strip__bar .cal__phase { grid-column: 2; max-width: 6rem; margin: 1px; }
.cal-strip__edge { display: flex; justify-content: center; padding: var(--space-2); }

/* Horizontal («Dag for dag» turned, #1094): the windows sit side by side and the box scrolls sideways, with a frame and
   an always-visible scrollbar so a phone shows there is more. Row 1 is the month heading over its days, row 2 the date
   (the day is that one cell), every further row a lane; zoom sets the column width. The day columns below the dates
   are the window's background, not an element or a subgrid per day, so a window stays cheap to lay out when four sit
   side by side (#2192): a rule right of every column, a strong rule left of every Monday and the weekend tint, each
   repeating every week from the window's first column (a window starts on a Monday, calendar_grid.visible_range).
   Today and holidays fall on any day, so they get a `.cal-strip__shade` over the lanes, inset by 1px so the rules show. A window has its day columns from the start (--days, 42 = six weeks,
   calendar_grid.STRIP_DAYS; layout.js sets it from data-days), so it is full width before layout.js has placed its
   days and bars: WebKit kept an unplaced window one column wide, and its edges loaded window after window (#1429).
   Rows 1 and 2 have fixed heights (--month-h, --date-h; SUN-234): each window is a grid of its own, and with `auto` a
   window whose date cell wrapped («Helligdag: 1. juledag» in a 6rem column) had a taller date row, so its lanes
   sat lower than the neighbour's. The month heading and every line of the date cell stay on one line (ellipsis;
   the holiday's full name is in the date link's aria-label and the tag's title). --date-h holds the 24px date link
   and two 16px lines (Uke N, I dag, Helg or Helligdag); a Monday holiday that is today has a third, which is cut off. */
/* The box is a grid with one column per window and edge, not a flex row (#2223): a single-line flex row clamps its line
   to the box's max-height, so a window with more lanes than the box is high was only as high as the box, its lanes
   overflowed it, and its sticky month and date rows left with the window's own bottom edge after about one box height
   of scrolling. A grid row is as high as the highest window, so every window holds all its lanes (and its day columns
   reach the last one). */
.cal-strip--h { --col-w: 6rem; --lane-h: 32px; --month-h: 40px; --date-h: 64px; display: grid; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: scroll; border-inline: 1px solid var(--border); }
.cal-strip--h.cal-strip--zoom-1 { --col-w: 4.5rem; --date-h: 60px; } /* 2px padding instead of 4px */
.cal-strip--h.cal-strip--zoom-3 { --col-w: 8rem; }
.cal-strip--h.cal-strip--zoom-4 { --col-w: 11rem; }
.cal-strip--h .cal-strip__window { --days: 42; flex: none; grid-template-columns: repeat(var(--days), var(--col-w)); grid-auto-columns: var(--col-w); grid-template-rows: var(--month-h) var(--date-h); grid-auto-rows: minmax(var(--lane-h), auto);
  background:
    repeating-linear-gradient(to right, var(--foreground) 0 1px, transparent 0 calc(7 * var(--col-w))),
    repeating-linear-gradient(to right, transparent 0 calc(var(--col-w) - 1px), var(--border) 0 var(--col-w)),
    repeating-linear-gradient(to right, transparent 0 calc(5 * var(--col-w)), var(--muted) 0 calc(7 * var(--col-w)));
}
/* The month and date rows stay at the top of the box while the lanes scroll up under them (#2223): the month at 0 and
   the date cell right below it (--month-h is the month row's fixed height), both opaque and above the bars. A date has
   its day's fill. overflow: clip on the month, not hidden: hidden would make the heading the scroll container of its
   sticky name. */
.cal-strip--h .cal-strip__month { top: 0; height: var(--month-h); white-space: nowrap; overflow: clip; border-top: 0; border-bottom: 2px solid var(--foreground); border-left: 2px solid var(--foreground); }
.cal-strip--h .cal-strip__day { position: sticky; top: var(--month-h); z-index: 2; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; overflow: hidden; padding: var(--space-1) var(--space-2); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); background: var(--card); }
.cal-strip--h :is(.cal-strip__day--weekend, .cal-strip__day--holiday) { background: var(--muted); }
.cal-strip--h .cal-strip__day--today { background: var(--spike-soft); }
.cal-strip--h .cal-strip__date { white-space: nowrap; }
.cal-strip--h .cal-strip__date:focus-visible { outline-offset: -3px; } /* inside the cell, which clips */
.cal-strip--h.cal-strip--zoom-1 .cal-strip__day { padding: 2px var(--space-1); } /* «Man 16.» on one line in 4.5rem */
.cal-strip--h .cal-strip__day--monday { border-top: 0; border-left: 1px solid var(--foreground); }
.cal-strip__shade { margin-inline: 1px; background: var(--muted); }
.cal-strip__shade--today { background: var(--spike-soft); }
.cal-strip--h .cal-strip__wk, .cal-strip--h .cal-strip__tag, .cal-strip--h .cal__today { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.cal-strip--h .cal-strip__bar { flex-direction: row; align-items: center; gap: var(--space-1); padding: 0 var(--space-2); white-space: nowrap; }
.cal-strip--h .cal-strip__bar .cal__status { margin-left: auto; }
.cal-strip--h .cal-strip__bar.cal__bar--phased { grid-template-columns: subgrid; grid-template-rows: auto auto; align-items: center; padding: 0 0 2px; }
.cal-strip--h .cal-strip__bar.cal__bar--phased .cal__head { flex-direction: row; align-items: center; gap: var(--space-1); grid-column: 1 / -1; grid-row: 1; padding: 0 var(--space-2); }
.cal-strip--h .cal-strip__bar .cal__phase { grid-column: auto; grid-row: 2; max-width: none; margin: 0 1px; }
.cal-strip--h .cal-strip__bar--before { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 2px 3px 2px 0; }
.cal-strip--h .cal-strip__bar--after { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin: 2px 0 2px 3px; }
.cal-strip--h .cal-strip__bar--before.cal-strip__bar--after { border-radius: 0; margin: 2px 0; }
.cal-strip--h .cal-strip__edge { flex: none; align-items: flex-start; padding: var(--space-3) var(--space-2); }

/* ---------- Board (kanban) ----------------------------------------------------------------- */
/* position: relative makes the wrap the containing block of the .visually-hidden labels in the columns (the count
   badge's «prosjekter», the card buttons' names), like .table-wrap (#858). Without it the far columns' labels sat
   outside the scroller: the page grew wider than a phone and the tap on a card's «Flytt» landed above it (#1065). */
.board-wrap { position: relative; overflow-x: auto; padding-bottom: var(--space-3); }
.board { display: flex; gap: var(--space-3); align-items: flex-start; }
.board__col { flex: 0 0 280px; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); background: var(--surface-sunken); border: 1px solid var(--line); border-radius: var(--radius-md); }
.board__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.board__cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.board__empty { padding: var(--space-2); font-size: 14px; }
.card--compact { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3); }
.card__name { font-weight: 600; margin: 0; }
.card__line { margin: 0; font-size: 14px; line-height: 20px; }
/* A card that needs nothing more (Crew: an assignment that has started, #1860): last in its column, flat with a dashed
   edge and muted text, and a .card__note line that says why in words. Text stays on --card, so contrast holds. */
.card--muted { box-shadow: none; border-style: dashed; color: var(--muted-foreground); }
.card--muted .card__name { font-weight: 500; }
.card__note { display: flex; align-items: center; gap: var(--space-1); font-weight: 500; color: var(--card-foreground); }
.card__move { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--line); align-items: flex-start; }
/* «Flytt …» (#372): a small disclosure button (static/rigg/disclosure.js) over the card's move form; a link without JS. */
.card__toggle { align-self: flex-start; margin-top: var(--space-1); }
.card__toggle[hidden], .card__move[hidden] { display: none; }

/* ---------- Wallboard (Lager › Skjermtavle, design/components/Wallboard): a read-only board on a big screen ----------
   Type follows the screen's width (1.3vw: 25px on a 1920 px TV), so everything inside is in em. Three columns side
   by side from 960 px; narrower (a phone preview, 200 % zoom) they stack and the page scrolls. */
.wallboard {
  min-height: 100dvh; display: flex; flex-direction: column; gap: 1em; padding: 1.25em 1.5em;
  font-size: clamp(16px, 1.3vw, 48px); line-height: 1.3; background: var(--background); color: var(--foreground);
}
.wallboard__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5em 1.5em; }
.wallboard__title { margin: 0; font-family: var(--font-display); font-size: 2.2em; line-height: 1.1; font-weight: 700; }
.wallboard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em 1em; margin: 0; color: var(--muted-foreground); }
.wallboard__clock { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--foreground); }
.wallboard__cols { flex: 1; display: grid; grid-template-columns: 1fr; gap: 1em; align-items: start; }
@media (min-width: 960px) { .wallboard__cols { grid-template-columns: 1.25fr 1fr 1fr; } }
.wallboard__col { display: flex; flex-direction: column; gap: 0.5em; min-width: 0; }
.wallboard__heading { display: flex; align-items: center; justify-content: space-between; gap: 0.5em; margin: 0; padding-bottom: 0.25em; border-bottom: 2px solid var(--input); font-size: 1.3em; font-weight: 700; }
.wallboard__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4em; }
.wallboard__row {
  display: grid; grid-template-columns: 4.2em 1fr auto; align-items: start; gap: 0.15em 0.75em; padding: 0.45em 0.6em;
  background: var(--card); border: 1px solid var(--border); border-left: 0.3em solid var(--border); border-radius: var(--radius-md);
}
.wallboard__row--late { background: var(--warn-soft); border-color: var(--warn); }
.wallboard__time { font-family: var(--font-mono); font-size: 1.1em; font-weight: 600; font-variant-numeric: tabular-nums; }
.wallboard__day { display: block; font-size: 0.7em; font-weight: 500; }
.wallboard__name { margin: 0; font-size: 1.1em; font-weight: 600; overflow-wrap: anywhere; }
.wallboard__sub { margin: 0; font-size: 0.8em; color: var(--muted-foreground); overflow-wrap: anywhere; }
.wallboard__row--late .wallboard__sub { color: var(--foreground); }
.wallboard__status { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25em; }
.wallboard__progress { grid-column: 2 / -1; }
.wallboard__empty, .wallboard__more { margin: 0; padding: 0.4em 0.6em; color: var(--muted-foreground); }
/* The components inside keep their shape and grow with the board. */
.wallboard .badge { font-size: 0.75em; line-height: 1.3; padding: 0.15em 0.6em; }
.wallboard .badge .icon { width: 1.1em; height: 1.1em; }
.wallboard .progress-field__label { font-size: 0.75em; line-height: 1.3; }
.wallboard .progress { height: 0.4em; }

/* ---------- Tab bar (phone shells: my.gorigg.com, crew and warehouse in the app) ------------------------------------------
   Four or five destinations with icon + word and 48px targets. Phones: fixed to the bottom edge, after the top bar in
   the DOM so the keyboard order stays header → tabs → content. Wider screens: a row of tabs under the top bar. */
.tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--card); }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--control-lg); padding: var(--space-1); color: var(--muted-foreground);
  font-size: 12px; line-height: 16px; font-weight: 500; text-align: center; text-decoration: none;
  border-top: 3px solid transparent;
}
.tabbar a:hover { background: var(--accent); color: var(--accent-foreground); }
.tabbar a[aria-current] { color: var(--foreground); border-top-color: var(--foreground); font-weight: 600; }
/* issue 616: a word longer than its share of a 320–430px bar («Tilgjengelighet», a longer translation) breaks inside its
   own tab instead of running into the next one. */
.tabbar a { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.tabbar a:focus-visible { outline-offset: -3px; } /* inside the bar (it scrolls on wider screens), never clipped */
/* A count on a tab (#160): beside the icon on a phone, after the word on wider screens. The link carries the
   spoken form («Forespørsler, 1 venter») in a .visually-hidden span; the badge itself is aria-hidden. */
.tabbar a { position: relative; }
.tabbar a .badge { min-height: 0; padding: 0 6px; font-size: 12px; line-height: 16px; }
@media (max-width: 759px) {
  .tabbar a .badge { position: absolute; top: 2px; left: calc(50% + 6px); }
  .tabbar { position: fixed; inset: auto 0 0 0; z-index: 20; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0px); }
  /* --tabbar-height (shell.js) is the bar as drawn, safe area included, also when a name takes two lines (issue 616) */
  .tabbar-shell { padding-bottom: calc(var(--tabbar-height, calc(var(--control-lg) + env(safe-area-inset-bottom, 0px))) + var(--space-3)); }
  html:has(.tabbar) { scroll-padding-bottom: calc(var(--tabbar-height, var(--control-lg)) + var(--space-5)); } /* focus never hides behind it */
}
@media (min-width: 760px) {
  .tabbar { grid-auto-columns: max-content; justify-content: safe center; gap: var(--space-2); border-bottom: 1px solid var(--border); overflow-x: auto; }
  .tabbar a { flex-direction: row; gap: var(--space-2); padding: 0 var(--space-4); font-size: 15px; line-height: 22px; border-top: 0; border-bottom: 3px solid transparent; }
  .tabbar a[aria-current] { border-bottom-color: var(--foreground); }
  .tabbar--phone { display: none; } /* crew and warehouse in the app shell: the office menu returns on wider screens */
}

/* ---------- Overlays (#150): dialog, alert dialog, sheet, popover, tooltip, dropdown menu ----------
   Markup from {% dialog %}, {% alert_dialog %}, {% sheet %}, {% popover %}, {% tooltip %}, {% dropdown_menu %};
   behaviour (focus, Escape, Tab trap, placement) in overlay.js. Never set display on a closed <dialog> or
   popover: author styles beat the browser's display: none, so display goes on [open] / :popover-open only. */
.dialog {
  inset: 0; margin: auto; padding: 0; overflow: hidden;
  width: min(calc(100% - 2 * var(--space-4)), 32rem); max-width: none; max-height: calc(100% - 2 * var(--space-4));
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay);
}
.dialog[open] { display: flex; flex-direction: column; }
.dialog--sm { width: min(calc(100% - 2 * var(--space-4)), 24rem); }
.dialog--lg { width: min(calc(100% - 2 * var(--space-4)), 48rem); }
.dialog::backdrop { background: var(--scrim); }
html:has(.dialog:modal) { overflow: hidden; } /* the page behind does not scroll */
.dialog__header { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-5) calc(var(--space-5) + var(--control-sm)) var(--space-3) var(--space-5); }
.dialog[role="alertdialog"] .dialog__header { padding-right: var(--space-5); }
.dialog__title { font-size: 17px; line-height: 24px; font-weight: 600; }
.dialog__description { font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.dialog__content { flex: 1 1 auto; min-height: 0; min-width: 0; overflow: auto; overflow-wrap: anywhere; padding: var(--space-2) var(--space-5) var(--space-4); }
.dialog__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5) var(--space-5); }
.dialog__close { position: absolute; top: var(--space-3); right: var(--space-3); }

/* Sheet: a dialog docked to an edge. On phones the side sheets take the full width, with 48px controls. */
.sheet { margin: 0; border-radius: 0; max-height: none; width: min(100%, 28rem); height: 100%; }
.sheet--right { inset: 0 0 0 auto; border-width: 0 0 0 1px; }
.sheet--left { inset: 0 auto 0 0; border-width: 0 1px 0 0; }
.sheet--top, .sheet--bottom { width: 100%; height: auto; max-height: 85dvh; }
.sheet--top { inset: 0 0 auto 0; border-width: 0 0 1px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.sheet--bottom { inset: auto 0 0 0; border-width: 1px 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.sheet .dialog__footer { padding-bottom: max(var(--space-5), env(safe-area-inset-bottom, 0px)); }
@media (max-width: 759px) {
  .sheet--left, .sheet--right { width: 100%; border-width: 0; }
  .sheet .dialog__close { width: var(--control-lg); min-height: var(--control-lg); top: var(--space-2); right: var(--space-2); }
  .sheet .dialog__header { padding-right: calc(var(--space-4) + var(--control-lg)); }
  .sheet .dialog__footer .btn { min-height: var(--control-lg); flex: 1 1 auto; }
}

/* Popover, dropdown menu and tooltip float in the top layer; overlay.js sets top and left next to the trigger. */
.popover[popover], .dropdown[popover], .tooltip[popover] { position: fixed; inset: auto; margin: 0; }
.popover, .dropdown {
  max-width: calc(100vw - 2 * var(--space-2)); overflow: auto; max-height: calc(100dvh - 2 * var(--space-2));
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--input); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
}
.popover { width: 20rem; padding: var(--space-4); }
.dropdown { min-width: 12rem; padding: var(--space-1); }
.dropdown__item {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--control-sm);
  padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit;
  font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.dropdown__item:hover, .dropdown__item:focus { background: var(--accent); color: var(--accent-foreground); }
.dropdown__item:focus-visible { outline-offset: -3px; }
.dropdown__item--destructive, .dropdown__item--destructive:hover, .dropdown__item--destructive:focus { color: var(--destructive); }
.dropdown__item[aria-disabled="true"], .dropdown__item:disabled { opacity: 0.55; cursor: not-allowed; }
.dropdown__separator { height: 1px; margin: var(--space-1) calc(-1 * var(--space-1)); background: var(--border); }
.tooltip {
  max-width: min(20rem, calc(100vw - 2 * var(--space-2))); padding: var(--space-1) var(--space-2);
  background: var(--foreground); color: var(--background); border: 0; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 18px; overflow: visible;
}
@media (max-width: 759px) { .dropdown__item { min-height: var(--control-md); } }

/* More menu (#617, design/components/MoreMenu; {% more_menu %}): a view's secondary actions. From 760px they stand in
   the row as before and the «Mer» button is gone; on a phone they wait behind it, so the status and the main button
   keep the first line. A native <details> (keyboard, screen reader and no-JS work by themselves); disclosure.js closes
   it on Escape and on a click outside. The open list spans the page head or card header it sits in (its containing
   block), under the button, so it never reaches past the screen. A browser without ::details-content keeps the
   button from 760px too, and the list opens in the row. */
.more-menu > summary { list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu[open] > summary { background: var(--accent); color: var(--accent-foreground); }
@media (forced-colors: active) { .more-menu[open] > summary { border-color: Highlight; } }
.more-menu__body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
@media (max-width: 759px) {
  .more-menu { flex: none; }
  .page-head:has(.more-menu), .card__header:has(.more-menu) { position: relative; }
  .more-menu__body {
    position: absolute; z-index: 20; left: 0; right: 0; margin-top: var(--space-1);
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: var(--space-1);
    background: var(--popover); color: var(--popover-foreground);
    border: 1px solid var(--input); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
  }
  .more-menu__body > form { display: flex; flex-direction: column; margin: 0; }
  .more-menu__body .btn { flex: none; width: 100%; min-height: var(--control-md); justify-content: flex-start; text-align: left; }
  /* A group of main buttons beside «Mer» (the project card's «Neste steg» and «Endre status», #856) shares its row:
     the buttons wrap their words rather than the group dropping to a line of its own. */
  .page-head__actions:has(> .more-menu) > .cluster { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; }
}
@supports selector(::details-content) {
  @media (min-width: 760px) {
    .more-menu:not(.more-menu--collapsed) > summary { display: none; }
    .more-menu:not(.more-menu--collapsed)::details-content { content-visibility: visible; }
  }
}
/* Collapsed (#1015, {% more_menu collapsed=True %}): behind «Mer» at every width, so a GoPlan screen keeps its one main
   action (design/README.md «GoPlan»). From 760px the list opens under the button, at its right edge. */
@media (min-width: 760px) {
  .more-menu--collapsed { position: relative; flex: none; }
  .more-menu--collapsed .more-menu__body {
    position: absolute; z-index: 20; right: 0; width: max-content; max-width: 20rem; margin-top: var(--space-1);
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: var(--space-1);
    background: var(--popover); color: var(--popover-foreground);
    border: 1px solid var(--input); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
  }
  .more-menu--collapsed .more-menu__body > form { display: flex; flex-direction: column; margin: 0; }
  .more-menu--collapsed .more-menu__body .btn { flex: none; width: 100%; justify-content: flex-start; text-align: left; }
}

/* ---------- Feedback (#150): toast, skeleton, progress ---------------------------------------
   The toaster is a manual popover (toast.js shows it at load): reset the browser's popover box, and let clicks
   through where there is no toast. */
.toaster[popover] {
  position: fixed; inset: auto var(--space-4) max(var(--space-4), env(safe-area-inset-bottom, 0px)) auto; margin: 0;
  width: min(24rem, calc(100vw - 2 * var(--space-4))); padding: 0; border: 0; background: transparent; color: inherit;
  overflow: visible; pointer-events: none;
}
.toaster:popover-open { display: flex; flex-direction: column; gap: var(--space-2); }
@media (max-width: 759px) {
  /* Above the bar as drawn (--tabbar-height, shell.js), as .tabbar-shell: on a Pixel 7 «Tilgjengelighet» takes two
     lines, the bar grew past one control and the toast lay over the tabs (WCAG target-size on /foresporsler/, #807). */
  html:has(.tabbar) .toaster[popover] { bottom: calc(var(--tabbar-height, calc(var(--control-lg) + env(safe-area-inset-bottom, 0px))) + var(--space-3)); }
}
.toast {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: var(--space-3);
  padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4); pointer-events: auto;
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--input); border-left-width: 4px; border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
}
.toast--default { grid-template-columns: 1fr auto; }
.toast > .icon { margin-top: 2px; }
.toast__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-block: 2px; }
.toast__title { font-weight: 600; }
.toast__description { font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.toast__close { margin-block: -4px; }
.toast--ok { border-left-color: var(--ok); }
.toast--ok > .icon { color: var(--ok); }
.toast--info { border-left-color: var(--cue); }
.toast--info > .icon { color: var(--cue); }
.toast--warn { border-left-color: var(--warn); }
.toast--warn > .icon { color: var(--warn); }
.toast--danger { border-left-color: var(--danger); }
.toast--danger > .icon { color: var(--danger); }

/* Skeleton: the shape of what is loading. It pulses (opacity only, nothing moves) unless motion is reduced. */
.skeletons { display: flex; flex-direction: column; gap: var(--space-2); }
.skeleton { display: block; background: var(--muted); border-radius: var(--radius-sm); animation: skeleton-pulse 1.6s ease-in-out infinite; }
.skeleton--text { height: 14px; }
.skeleton--text:last-child:not(:nth-child(2)) { width: 60%; } /* child 1 is the hidden label */
.skeleton--block { height: 6rem; border-radius: var(--radius-md); }
.skeleton--circle { width: var(--control-md); height: var(--control-md); border-radius: 50%; }
@keyframes skeleton-pulse { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* Progress: native <progress>; the fill (--foreground) is 3:1 or more on the track and the track edge on the page. */
.progress-field { display: flex; flex-direction: column; gap: var(--space-1); }
.progress-field__label { display: flex; justify-content: space-between; gap: var(--space-3); font-size: 13px; line-height: 18px; }
/* the value in the body font with tabular figures, so it keeps still while it changes (#795: not monospace) */
.progress-field__value { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
/* a quiet status line under the bar that belongs to its numbers («Oppdatert 22:02 …», #795) */
.progress-field__note { font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
/* A named bar in a row (Lager › Dagstavle's readiness per warehouse): the name beside the bar on a wide screen, above
   it on a phone, so the bar and its numbers get the whole width (#795); badges follow. */
.progress-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.progress-row > .progress-field { flex: 1 1 16rem; min-width: 0; max-width: 28rem; }
@media (max-width: 639px) {
  .progress-row { flex-direction: column; align-items: stretch; }
  .progress-row > .progress-field { flex: none; max-width: none; }
  .progress-row > :not(.progress-field) { align-self: flex-start; }
}
.progress {
  appearance: none; display: block; width: 100%; height: 8px; overflow: hidden;
  border: 1px solid var(--input); border-radius: var(--radius-pill); background: var(--muted); color: var(--foreground);
}
.progress::-webkit-progress-bar { background: var(--muted); }
.progress::-webkit-progress-value { background: var(--foreground); }
.progress::-moz-progress-bar { background: var(--foreground); }
.progress:indeterminate { background: repeating-linear-gradient(-45deg, var(--muted) 0 6px, var(--input) 6px 12px); }
.progress:indeterminate::-webkit-progress-bar { background: transparent; }
.progress:indeterminate::-moz-progress-bar { background: transparent; }

/* ---------- Navigation (#150): breadcrumb, pagination (tabs: above) ---------------------------- */
.breadcrumb { min-width: 0; }
.breadcrumb__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.breadcrumb__item { display: inline-flex; align-items: center; gap: var(--space-1); }
.breadcrumb__item:first-child > .breadcrumb__sep { display: none; }
.breadcrumb__item a { display: inline-flex; align-items: center; min-height: var(--target-min); color: var(--muted-foreground); }
.breadcrumb__item a:hover { color: var(--foreground); }
.breadcrumb__item [aria-current="page"] { color: var(--foreground); font-weight: 500; }
/* `--back` on a phone (#870): only the way one step up, «‹ Produkter» — the step before the current page, or the last
   step when the trail ends in a link (an `also` page without its own crumb). The others are hidden, also for screen
   readers, so the nav («Brødsmulesti») holds exactly the one link a sighted user sees. Desktop shows the whole trail. */
@media (max-width: 639px) {
  .breadcrumb--back .breadcrumb__item { display: none; }
  .breadcrumb--back .breadcrumb__item:nth-last-child(2):has(+ .breadcrumb__item > [aria-current]),
  .breadcrumb--back .breadcrumb__item:last-child:not(:has([aria-current])) { display: inline-flex; }
  .breadcrumb--back .breadcrumb__item > .breadcrumb__sep { display: inline-block; transform: scaleX(-1); }
}
.pagination__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.pagination__page { min-width: var(--control-sm); padding-inline: var(--space-2); justify-content: center; }
.pagination__page[aria-current="page"] { font-weight: 600; }
.pagination__gap { display: inline-flex; align-items: center; justify-content: center; min-width: var(--control-sm); color: var(--muted-foreground); }

/* ---------- Windows high contrast / forced colors ------------------------------------------ */
@media (forced-colors: active) {
  .btn, .badge, .alert, .asset-tag, .booking, .scan, .card, .segmented label:has(input:checked), .segmented--links a[aria-current="true"] { border: 1px solid CanvasText; }
  .dialog, .popover, .dropdown, .tooltip { border: 1px solid CanvasText; }
  .dropdown__item:focus { outline: 2px solid Highlight; }
  .combobox__list { border: 1px solid CanvasText; }
  .input[aria-invalid="true"] { border-width: 2px; } /* forced colours drop the inset shadow, the error's second pixel */
  .combobox__option[aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .choice input.switch { -webkit-appearance: auto; appearance: auto; width: 20px; height: 20px; border-radius: 0; } /* a native checkbox keeps its state visible */
  .toast, .progress { border: 1px solid CanvasText; }
  .table--stack .table__item { border-bottom: 1px solid CanvasText; }
  .skeleton { forced-color-adjust: none; background: GrayText; }
  .progress::-webkit-progress-value { background: Highlight; }
  .progress::-moz-progress-bar { background: Highlight; }
  .tabs__tab[aria-selected="true"], .pagination__page[aria-current="page"] { outline: 2px solid Highlight; }
  .tabbar a[aria-current], .booking[aria-pressed="true"], .booking.is-selected, .booking[aria-current="true"], .tabs a[aria-current="page"], .topbar__nav a[aria-current], .sidenav__link[aria-current="page"], .iconbtn[aria-current], .drawer__group li a[aria-current="page"] { outline: 2px solid Highlight; }
  .sidebar__link[aria-current="page"], .sidebar__cat[aria-current="page"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .sidebar__sections, .sidebar__search, .sidebar__kbd, .sidebar [data-tip]::after { border: 1px solid CanvasText; }
  .sidebar__mark, .company-color .sidebar__mark { forced-color-adjust: none; background: CanvasText; color: Canvas; }
  .company-color::before { display: none; } /* the edge is decoration; the company's name says which it is */
  .brand__cue { fill: CanvasText; }
  .brand__wordmark { border-bottom-color: CanvasText; }
}

/* Error pages (templates/errors/_page.html, 400/403/404/500): a big stencil code, a plain heading, what to do next. */
.oops {
  max-width: 40rem; margin-inline: auto; padding-block: var(--space-7) var(--space-6);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 8rem); column-gap: var(--space-3);
}
.oops__code {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(72px, 16vw, 144px); line-height: 1;
  letter-spacing: 0.02em; color: var(--ink); margin: 0 0 var(--space-4);
  display: inline-block; border-bottom: 10px solid var(--primary); padding-bottom: var(--space-1);
}
/* The motif (design/components/Illustration) stands beside the code, not above it, so it adds little height and the
   way on («Til forsiden», «Tilbake») stays in the first screen: 360 × 640 and 1280 × 800 (UX, #1337). The code and
   the motif share the first row (the motif at most 8rem, 18rem from 760px; .oops is a grid, not .page's flex column),
   everything else spans both columns, so a page without a motif keeps the one column it had. */
.oops > * { grid-column: 1 / -1; }
.oops__code { grid-area: 1 / 1; align-self: end; }
.oops__art { grid-area: 1 / 2; align-self: end; margin: 0 0 var(--space-4); }
@media (max-width: 759px) { .oops { padding-block-start: var(--space-5); } }
@media (min-width: 760px) { .oops { grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); column-gap: var(--space-5); } }
.oops__title { margin: 0 0 var(--space-4); }
.oops__body p { margin: 0 0 var(--space-3); }
.oops__aside { color: var(--ink-muted); font-style: italic; }
.oops__who { margin: var(--space-4) 0 0; }
.oops__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.oops__actions form { margin: 0; }
.oops__list { margin-top: var(--space-6); }

/* Illustration (design/components/Illustration): the isometric «Riggkartet» motifs from gorigg.com as inline SVG with
   role="img" and a <title>. Every colour is an il-* token, so a motif follows Daylight and Show; nothing moves.
   A box has three faces (-t top, -l left, -r right) and .il__o draws its outline. */
.il { display: block; width: 100%; height: auto; }
.il__o { stroke: var(--il-line); stroke-width: 1.2; stroke-linejoin: round; }
.il__ground { fill: var(--il-ground); }
.il__grid { stroke: var(--il-grid); stroke-width: 1; }
.il__lat { stroke: var(--il-metal-r); stroke-width: 1; }
.il__rail { stroke: var(--il-rail); stroke-width: 1.2; }
.il__base-t { fill: var(--il-base-t); } .il__base-l { fill: var(--il-base-l); } .il__base-r { fill: var(--il-base-r); }
.il__metal-t { fill: var(--il-metal-t); } .il__metal-l { fill: var(--il-metal-l); } .il__metal-r { fill: var(--il-metal-r); }
.il__case-t { fill: var(--il-case-t); } .il__case-l { fill: var(--il-case-l); } .il__case-r { fill: var(--il-case-r); }
.il__spike-t { fill: var(--il-spike-t); } .il__spike-l { fill: var(--il-spike-l); } .il__spike-r { fill: var(--il-spike-r); }
.il__head-t { fill: var(--il-head-t); } .il__head-l { fill: var(--il-head-l); } .il__head-r { fill: var(--il-head-r); }
.il__shirt-t { fill: var(--il-shirt-t); } .il__shirt-l { fill: var(--il-shirt-l); } .il__shirt-r { fill: var(--il-shirt-r); }
.il__cloth-t { fill: var(--il-cloth-t); } .il__cloth-l { fill: var(--il-cloth-l); } .il__cloth-r { fill: var(--il-cloth-r); }
.il__screen { fill: var(--il-screen); }
.il__beam { fill: var(--il-beam); }
.il__smoke { fill: var(--il-metal-l); opacity: 0.55; }

/* ---------- Print sheet (#901, design/components/PrintSheet): a page crew print and read on a phone -------------
   The changeover sheet: its own column of cards, `.print-sheet__columns` side by side where there is room (one column
   on a 360px phone). On paper only the sheet prints: the shell, the crumbs, the footer and `.print-sheet__hide`
   (buttons, forms, the way back) are left out, in black on white whatever the theme, without shadows, and a card is
   not split over two pages. static/rigg/print.js opens the print dialog from a `[data-print]` button. */
.print-sheet { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.print-sheet__columns { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.print-sheet__columns > * { min-width: 0; }
@media print {
  body:has(.print-sheet) .sidebar, body:has(.print-sheet) .app__crumbs, body:has(.print-sheet) .app__footer,
  .print-sheet .print-sheet__hide { display: none !important; }
  body:has(.print-sheet) { background: Canvas; }
  .print-sheet { color-scheme: light; gap: var(--space-3); }
  .print-sheet, .print-sheet * { color: CanvasText !important; background: transparent !important; box-shadow: none !important; }
  .print-sheet .card, .print-sheet tr { break-inside: avoid; }
  .print-sheet .badge { border: 1px solid CanvasText; }
  .print-sheet a { text-decoration: none; }
}

/* ---------- Light profile («lett», GoPlan, #896) ------------------------------------------------------------------
   <html data-profile="lett">: more air, fewer lines and no shadows (tokens.json «profiles» sets --control-md and
   --shadow-raised), body text 16/24 and links in ink, so the brand's primary is the one accent. Sizes only: no colour
   is changed or added, every pair here is one tokens.json already tests. A card keeps a transparent border, which
   forced colours draw, so it is still outlined in a Windows contrast theme. design/README.md, «GoPlan». */
[data-profile="lett"] body { font-size: 16px; line-height: 24px; }
[data-profile="lett"] .input { font-size: 16px; line-height: 24px; padding-inline: var(--space-4); }
[data-profile="lett"] .btn { padding-inline: var(--space-5); }
[data-profile="lett"] .btn--sm { padding-inline: var(--space-3); }
[data-profile="lett"] .btn.btn--icon, [data-profile="lett"] .btn.btn--link { padding-inline: 0; }
[data-profile="lett"] :is(p, li, dd, td) a:not(.btn), [data-profile="lett"] .btn--link,
[data-profile="lett"] .btn--link:hover { color: var(--ink); }
[data-profile="lett"] .page { gap: var(--space-6); padding-block: var(--space-6) var(--space-8); }
[data-profile="lett"] .page-head { gap: var(--space-3) var(--space-5); }
[data-profile="lett"] .stack { gap: var(--space-5); }
[data-profile="lett"] .card { border-color: transparent; border-radius: var(--radius-lg); }
[data-profile="lett"] .card__header { border-bottom: 0; padding: var(--space-5) var(--space-5) 0; }
[data-profile="lett"] .card__content { padding: var(--space-4) var(--space-5) var(--space-5); }
[data-profile="lett"] .card__content--flush { padding: 0; }
[data-profile="lett"] .card__footer { border-top: 0; padding: 0 var(--space-5) var(--space-5); }
[data-profile="lett"] .empty { align-items: center; text-align: center; padding: var(--space-8) var(--space-5); }
[data-profile="lett"] .empty p { margin-inline: auto; }
@media (max-width: 759px) {
  [data-profile="lett"] .card__header { padding: var(--space-4) var(--space-4) 0; }
  [data-profile="lett"] .card__content { padding: var(--space-3) var(--space-4) var(--space-4); }
  [data-profile="lett"] .card__footer { padding: 0 var(--space-4) var(--space-4); }
  [data-profile="lett"] .empty { padding: var(--space-7) var(--space-4); }
}
