/* granite — the design system.
 *
 * An instrument, not an office system. Used under time pressure by people who
 * are not designers: the provider on a laptop with thirteen assistants and a
 * deadline, an assistant on a phone with one thumb between two shifts.
 *
 * Rules that hold everywhere:
 *   - One ground, layered surfaces. Depth comes from tone and a hairline, not
 *     from boxes drawn around things.
 *   - Colour is information, never decoration. Four status colours, no more, and
 *     every one dual-coded with a glyph or a word — some people using this are
 *     older, and the provider prints the whole thing in black and white.
 *   - One family, tabular numerals. Every number here is an hour, a date or a
 *     count, and hour columns that do not line up are unreadable.
 *   - Nothing animates that costs layout. Transitions are on colour, shadow,
 *     opacity and transform only.
 *
 * ⚠️ On translucency. `backdrop-filter` is beautiful and it is the most
 * expensive property in this file: every element carrying one is its own
 * composited layer that the compositor re-blurs on scroll. It is used in exactly
 * three places — the top bar, the phone tab bar, and the unsaved bar — all of
 * which are single, fixed, and small. It is never put on a card, a chip, a
 * calendar day or a board cell. The month board draws upwards of four hundred
 * cells; a blur on each is a slideshow.
 */

/* ---------- tokens ---------- */

:root {
  color-scheme: light;

  /* Ground and the surfaces that sit on it. */
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f0f0f3;
  --surface-hover: #f5f5f7;

  /* Hairlines, not borders. A 1px line at 8 % reads as an edge without drawing
     a box; at full strength thirty of them on one screen read as a cage. */
  --hairline: rgba(18, 20, 24, 0.09);
  --hairline-strong: rgba(18, 20, 24, 0.17);

  --ink: #16181c;
  --ink-soft: #5b6068;
  /* ⚠️ 4.6:1 on white, was #8b9098 at 3.2:1 — and it is used exactly where the
     type is smallest: tab labels at 0.66rem, board day headers at 0.67rem. It
     still reads as faint through size and weight (granite#160). */
  --ink-faint: #6f757e;

  /* What sits ON a filled accent or missing surface. Buttons had a dark-mode
     override and nothing else did, so every other "selected" state was white on
     mint at 2.3:1 — including the count of shifts waiting (granite#160). Two
     tokens, so it cannot drift apart again. */
  --on-accent: #ffffff;
  --on-missing: #ffffff;

  /* Dov ros — the brand colour (granite#210).
   *
   * 🔴 It was green, and green already means something here: --attested is
   * #1c7a50 and the accent was #39b57c, the same hue. In dark mode they were
   * the SAME HEX. So the brand and the receipt for work somebody has signed
   * for said the same thing in the same colour, and neither read cleanly.
   *
   * ⚠️ Red was the obvious warm answer and is the one colour that cannot be
   * used: --conflict is #b3261e, and a clash is the gravest thing this system
   * reports. A brand in red makes every button compete with every alarm, and
   * an alarm nobody sees is worse than no alarm.
   *
   * So: rose. Warm enough for a care business, 30° of hue and a long way
   * in lightness from the conflict red, and clear of --missing (#a85f00),
   * --leave (#4a5fb0) and --sick (#8a4aa8). White on --accent is 5.3:1 and on
   * --accent-deep 10.0:1. TheBrandIsNotAStatusColour keeps it there. */
  --accent: #a64e76;
  --accent-deep: #6b2d49;
  --accent-ink: #58233b;
  --accent-wash: #faedf3;
  --accent-tint: rgba(107, 45, 73, 0.10);

  /* ⚠️ How much of the bottom of the screen belongs to the tab bar. Anything
     fixed to the bottom on a phone stacks ON this rather than over it
     (granite#197). Zero above 720px, where the tab bar is not there at all —
     so the same rule works on both without a media query at each use site. */
  --bottom-bar: 0px;

  /* The day grid behind the sign-in page (granite#189). */
  --door-line: rgba(107, 45, 73, 0.085);
  --door-fill: rgba(166, 78, 118, 0.075);
  --door-edge: rgba(166, 78, 118, 0.12);

  /* The four states. Nothing else gets a colour. */
  --attested: #1c7a50;
  --attested-wash: #e8f5ee;
  --attested-line: #a8d5c0;
  --waiting: #6b7079;
  --waiting-wash: #f1f1f3;
  --waiting-line: #d3d5da;
  --missing: #a85f00;
  --missing-wash: #fdf3e4;
  /* A help text for something new (Hans, 2026-10-02): a yellow star, not the
     brand rose every other control already wears. */
  /* What is new (granite#286): a blue of its own, as in a Tesla's menus —
     not the brand's pink, the warning amber, the done green, nor the muted
     indigo of a holiday on the board. One colour means new, dot or help text. */
  --new: #2563eb;
  --new-wash: #eaf1ff;
  --leave: #4a5fb0;
  --leave-wash: #eceffa;
  --sick: #8a4aa8;
  --sick-wash: #f4ecf8;
  --missing-line: #e8c391;
  /* An activity, and a shift held by hand. Neither may wear the brand colour
     (granite#212): a reader scanning a grid cannot tell the interface from the
     content, and these two were the SAME colour as each other besides — a
     locked shift and a riding lesson were indistinguishable without reading.

     ⚠️ Teal because it is what is left. With conflict at 3°, missing at 34°,
     attested at 153°, leave at 228°, sick at 281° and the brand at 333°, the
     only bands more than 25° clear of all six are 59–128°, 178–203° and two
     slivers. 190° is the middle of the one that does not look like a warning.

     ⚠️ And locked is NOT a hue. It is a modifier — this one is held — not a
     category beside the others, so it is a heavier edge and a cooler surface.
     A seventh colour to carry a seventh meaning is how a legend becomes
     unreadable. The padlock stays; this is so the eye finds it first. */
  --activity: #276e7c;
  --activity-ink: #1d5563;
  --activity-wash: #ebf5f7;
  --held: #454a55;
  --held-wash: #edeef1;
  --held-edge: #6d7484;

  --conflict: #b3261e;
  --conflict-wash: #fdeeed;
  --conflict-line: #eab3ae;

  /* Radii. Bigger than a form library's defaults on purpose — the softness is
     most of what separates this from an admin panel. */
  --r-xs: 6px;
  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Two shadows stacked: a tight one that grounds the edge, a wide soft one
     that lifts it. A single shadow either floats or looks stuck on. */
  --shadow-1: 0 1px 1px rgba(16, 18, 22, 0.04), 0 2px 8px rgba(16, 18, 22, 0.045);
  --shadow-2: 0 1px 2px rgba(16, 18, 22, 0.06), 0 10px 28px rgba(16, 18, 22, 0.07);
  --shadow-3: 0 2px 6px rgba(16, 18, 22, 0.10), 0 18px 50px rgba(16, 18, 22, 0.16);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* Translucent chrome. Solid enough to read text through, sheer enough that
     the page moving underneath is visible. */
  --glass: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(18, 20, 24, 0.08);

  /* Apple's curve: fast out of the gate, long settle. A linear ease reads as
     machinery; this reads as something moving because it was pushed. */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --fast: 120ms;
  --base: 200ms;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", ui-sans-serif,
          system-ui, "Segoe UI Variable", "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;

  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Dark is the same design at a different weight, not a second one: the tokens
   change and nothing else does. Two rules keep it honest — a surface is always
   lighter than the ground it sits on, and the four status colours keep their
   hue so the glyph and the colour still say the same thing.

   ⚠️ Selected by data-theme, never by a media query (granite#332). The person
   chooses Enhet, Ljust or Mörkt in Settings; App.razor and granite.js put the
   answer on <html>, asking the device only for Enhet. A prefers-color-scheme
   rule here would overrule a person who chose Ljust on a dark phone. */
:root[data-theme="dark"] {
  color-scheme: dark;

  /* ⚠️ Warmed towards the brand hue rather than neutral grey (granite#212).
     A pure blue-black ground under a rose accent reads as two unrelated
     palettes; a trace of the same hue in the neutrals makes the dark theme
     the same design at a different weight, which is what the note above
     claims it is. Saturation is 6–8 %, far below anything that reads as a
     colour — it is only felt when the two are put side by side. */
  --bg: #120f10;
  --surface: #1d191b;
  --surface-2: #221e20;
  --surface-3: #2a2527;
  --surface-hover: #262123;

  --hairline: rgba(255, 246, 250, 0.10);
  --hairline-strong: rgba(255, 246, 250, 0.19);

  --ink: #f4f0f2;
  --ink-soft: #b3a8ad;
  --ink-faint: #9a8d93;
  /* ⚠️ Vit, som i dagsljus. The accent is dark enough here that light ink
     is what reads on it — and one rule for both themes is one less thing to
     get wrong (granite#211). */
  --on-accent: #ffffff;
  --on-missing: #1a1206;

  /* ⚠️ Lighter here than in daylight, so it carries on a dark ground — and
     note that --attested below is NOT this colour any more. It was the same
     hex, which is the fault this change exists for.

     ⚠️ Toned down from the first attempt (granite#211). Lifting a colour for
     a dark ground is right; lifting it this far turned a dusty rose into a
     pink, and the two themes stopped looking like one product. It sits close
     to daylight now and takes white ink, the same as daylight does. */
  --accent: #b65480;
  --accent-deep: #a74470;
  --accent-ink: #cc759c;
  --accent-wash: rgba(182, 84, 128, 0.16);
  --accent-tint: rgba(182, 84, 128, 0.20);

  /* The grid has to carry on a dark ground too, and a little brighter: the
     same alpha over black reads as nothing. */
  --door-line: rgba(204, 117, 156, 0.075);
  --door-fill: rgba(182, 84, 128, 0.08);
  --door-edge: rgba(182, 84, 128, 0.13);

  --attested: #4ecb95;
  --attested-wash: rgba(78, 203, 149, 0.13);
  --attested-line: rgba(78, 203, 149, 0.34);
  --waiting: #9aa1aa;
  --waiting-wash: rgba(255, 255, 255, 0.055);
  --waiting-line: rgba(255, 255, 255, 0.16);
  --missing: #e9a54a;
  --new: #5b9bff;
  --new-wash: rgba(91, 155, 255, 0.15);
  --missing-wash: rgba(233, 165, 74, 0.14);
  --leave: #93a4ef;
  --leave-wash: rgba(74, 95, 176, 0.25);
  --sick: #c99be0;
  --sick-wash: rgba(138, 74, 168, 0.25);
  --missing-line: rgba(233, 165, 74, 0.36);
  --activity: #70bdcd;
  --activity-ink: #8fcfdc;
  --activity-wash: #1f4249;
  --held: #9aa2b4;
  --held-wash: #242730;
  --held-edge: #7c8496;

  --conflict: #ff6b60;
  --conflict-wash: rgba(255, 107, 96, 0.14);
  --conflict-line: rgba(255, 107, 96, 0.36);

  --shadow-1: 0 1px 1px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.45), 0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 2px 6px rgba(0, 0, 0, 0.5), 0 18px 50px rgba(0, 0, 0, 0.6);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --glass: rgba(23, 25, 29, 0.72);
  --glass-line: rgba(255, 255, 255, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { font-weight: 600; margin: 0; }
h1 { font-size: 1.4rem; letter-spacing: -0.021em; }
h2 { font-size: 1.05rem; letter-spacing: -0.014em; }
h3 { font-size: 1.02rem; letter-spacing: -0.008em; }

a { color: var(--accent-ink); text-underline-offset: 2px; }

/* One ring, everywhere, and only for a keyboard. A mouse user who sees a focus
   ring on every click learns to ignore rings. */
:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

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

/* ---------- shell ---------- */

.shell {
  max-width: 1120px;
  margin: 0 auto;
  /* Bottom padding clears the phone tab bar and the unsaved bar, both fixed. */
  padding: 22px 20px calc(96px + env(safe-area-inset-bottom));
}

/* ⚠️ One of three translucent elements in the file. Sticky, so the page slides
   under it — which is the whole reason it is translucent rather than solid. */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* Where the blur is not available the bar has to be readable anyway, so it
   falls back to opaque rather than to a wash of text over content. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar { background: var(--surface); }
}

.mark {
  font-weight: 600; letter-spacing: -0.02em; font-size: 0.98rem;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none;
}
/* The mark itself, in place of the plain square that stood here until there
   was one (granite#211). Takes the accent rather than the text colour beside
   it: it is the one piece of brand on the screen and it is allowed to say so. */
.brand-mark { flex: 0 0 auto; color: var(--accent); display: block; }

.topbar .account { display: flex; align-items: center; gap: 4px; margin-left: auto; min-width: 0; }
/* With the help switch beside it (granite#347), the name gives way rather than
   the buttons: at 370 px "Logga ut" broke onto two lines. */
.topbar .who { color: var(--ink-faint); font-size: 0.83rem; padding-left: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .account .btn { white-space: nowrap; }

/* How far below the top of the window something sticky has to stop. The top
   bar is there on a phone and before sign-in; once the menu is on the left it
   is not, and a sticky header that still kept 52px clear of it floated in the
   air above the page. */
:root { --chrome-top: 52px; }
@media (min-width: 721px) {
  :root:has(.sidebar) { --chrome-top: 0px; }
}

/* ---------- the menu ---------- */

/* Down the left on anything wider than a phone (granite#75). A column the page
   sits beside, never over: the board and the schedule are the widest things
   here, and a menu that covered them would be closed again every time.

   ⚠️ The width is not animated. Growing a grid column moves every cell of a
   thirty-one-day board, which is the kind of motion this file does not do. */
:root { --nav-w: 232px; }
:root[data-nav="narrow"] { --nav-w: 64px; }

.frame:has(> .sidebar) {
  display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr);
  min-height: 100vh;
}
.frame-main { min-width: 0; }
.frame:has(> .sidebar) .topbar { display: none; }

/* Beside the menu, not centred in what is left of the window. Centred, a wide
   screen put an empty band between the menu and the page on one side and the
   same band on the other, and the page read as belonging to neither. */
.frame:has(> .sidebar) .shell { margin-inline: 0; }

/* The schedule is a four-week grid of names and times, and every pixel the
   reading width held back was a name broken over two lines. It takes the
   width; pages of sentences keep theirs. */
.frame:has(> .sidebar) .shell:has(.sched-head) { max-width: none; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  padding: 12px 10px;
  background: var(--surface);
  border-right: 1px solid var(--hairline);
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 4px 6px 10px; min-height: 40px;
}
.nav { display: flex; flex-direction: column; gap: 1px; }

.nav-toggle {
  appearance: none; border: 0; background: none; cursor: pointer;
  width: 30px; height: 30px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: var(--r-xs); color: var(--ink-faint);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav-toggle:hover { background: var(--surface-hover); color: var(--ink); }
.nav-toggle svg { width: 18px; height: 18px; }

/* Group names are labels, not links: small, spaced, and quiet, so the eye reads
   the items and uses the groups only to find its place. */
.nav-group {
  padding: 14px 10px 5px;
  font-size: 0.67rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-faint); white-space: nowrap;
}

.nav-item {
  appearance: none; border: 0; background: none; font: inherit; cursor: pointer;
  position: relative; width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--ink-soft); text-decoration: none; text-align: left;
  font-size: 0.875rem; font-weight: 500; white-space: nowrap;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav-item:hover { background: var(--surface-hover); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--accent-wash); color: var(--accent-ink); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; }
/* The help switch says it is on (Hans 2026-10-30): the help boxes' own blue,
   so the button and what it shows read as one thing. */
form[data-help-toggle] .nav-item[aria-pressed="true"] {
  background: var(--new-wash); color: var(--new);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--new) 28%, transparent);
}
.nav-label { overflow: hidden; text-overflow: ellipsis; }

/* How many shifts are waiting. The missing colour, because a shift nobody has
   confirmed is exactly what that colour means everywhere else. */
.nav-count {
  margin-left: auto; min-width: 20px; padding: 1px 7px;
  border-radius: var(--r-pill); text-align: center;
  background: var(--missing-wash); color: var(--missing);
  font-size: 0.7rem; font-weight: 700;
}

.sidebar-foot {
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 1px;
}
.sidebar-foot form { margin: 0; }
.nav-who {
  padding: 4px 10px 2px; color: var(--ink-faint); font-size: 0.79rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Folded: icons only. Every item keeps its title, so pointing at one still
   says what it is; the count becomes a dot's worth of number on the icon. */
:root[data-nav="narrow"] .sidebar :is(.nav-label, .nav-group, .nav-who, .mark-text) { display: none; }
:root[data-nav="narrow"] .sidebar-head { flex-direction: column; padding: 4px 0 6px; gap: 10px; }
:root[data-nav="narrow"] .nav-group + .nav-item { margin-top: 14px; }
:root[data-nav="narrow"] .nav-item { justify-content: center; padding: 9px 0; }
:root[data-nav="narrow"] .nav-count {
  position: absolute; top: 1px; right: 5px;
  min-width: 16px; padding: 0 4px; font-size: 0.62rem; line-height: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 20px;
  margin-bottom: 16px;
}

/* A card that is only a container for one number or one sentence does not need
   the same weight as one holding a month of work. */
.card.flat { box-shadow: none; background: var(--surface-2); }

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 0.85rem; }

/* A heading and its actions, on one line, wrapping cleanly. Repeated by hand
   with inline styles on six screens before it was named. */
.head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.head > :last-child.push { margin-left: auto; }
.push { margin-left: auto; }

/* ---------- the countdown: the primary object on the board ---------- */

.deadline { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* Never shrinks: the one thing on this screen that must stay readable from
   across a room. */
.deadline .count {
  flex: 0 0 auto;
  font-size: 3rem; font-weight: 600; letter-spacing: -0.04em; line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

/* Shrinks and wraps inside its own column instead of pushing the controls out.
   Left to grow, the sentence wrapped the whole toolbar onto a second line at a
   three-digit countdown and not at a two-digit one — fine at 59 days, broken at
   120. `min-width: 0` is the half that actually does it: a flex item will not
   shrink below its longest word without it. */
.deadline .what { flex: 1 1 240px; min-width: 0; color: var(--ink-soft); }

.deadline .count.urgent { color: var(--missing); }
.deadline .count.past { color: var(--conflict); }

/* ⚠️ Green means handed in, and nothing more. Not paid, not accepted, and not
   still correct — a figure that moves afterwards turns the row on Blanketter
   red again. The tick is deliberately not a number: there is no countdown left
   to run (granite#172). */
.deadline .count.filed { color: var(--attested); }

/* What of the month actually reached Försäkringskassan, under the countdown
   that cannot say it. */
.forms-filed {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline);
}
.forms-filed .muted { min-width: 0; }

/* ---------- status ---------- */

/* ⚠️ max-width and wrapping, not nowrap alone (granite#233). A pill promising
 * never to wrap keeps that promise by running out of its container, and the
 * label that did it was a sentence — long enough to leave the popover entirely
 * and short enough that nobody noticed until a reader saw it. The short labels
 * are the real fix; this is so the next long one cannot escape the box. */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 0.79rem; font-weight: 500;
  max-width: 100%; white-space: normal; overflow-wrap: anywhere;
  border: 1px solid transparent;
}
.pill::before { font-size: 0.9em; }

.pill.attested { color: var(--attested); background: var(--attested-wash); border-color: var(--attested-line); }
.pill.attested::before { content: "✓"; }
.pill.waiting  { color: var(--waiting);  background: var(--waiting-wash);  border-color: var(--waiting-line); }
.pill.waiting::before  { content: "○"; }
.pill.missing  { color: var(--missing);  background: var(--missing-wash);  border-color: var(--missing-line); }
.pill.missing::before  { content: "△"; }
.pill.conflict { color: var(--conflict); background: var(--conflict-wash); border-color: var(--conflict-line); }
.pill.conflict::before { content: "✕"; }

/* ---------- month board ---------- */

.board-scroll {
  overflow-x: auto;
  /* Wide content scrolls inside its own box. The page body never does. */
  scrollbar-width: thin;
}

/* ⚠️ And the table is allowed to be wider than the box (granite#218).
   `width: 100%` inside a scroll container is not a wide table that scrolls —
   it is a table squeezed to fit, which is how a date column came out reading
   "2026-2026-01-0106-30": two dates wrapped into one another because neither
   cell had room for ten characters.

   Only on a phone. On a desktop the table should fill the card as before. */
@media (max-width: 720px) {
  .board-scroll > .board { min-width: max-content; }
  .board-scroll > .board th,
  .board-scroll > .board td { white-space: nowrap; }
}

.board { border-collapse: separate; border-spacing: 0; width: 100%; }
.board th, .board td { padding: 0; }

.board th.day {
  font-size: 0.67rem; font-weight: 500; color: var(--ink-faint);
  text-align: center; padding-bottom: 5px; min-width: 24px;
}
.board th.day.weekend { color: var(--ink-soft); font-weight: 600; }

.board th.who {
  text-align: left; font-weight: 500; font-size: 0.85rem;
  padding-right: 14px; white-space: nowrap; position: sticky; left: 0;
  background: var(--surface); z-index: 1;
}

.board tr.user-row th.who { font-weight: 600; padding-top: 16px; }
.board tr.user-row td { padding-top: 16px; }

/* A cell is a day. Shape carries the state as well as colour, so the board
   survives a black-and-white printout and a colour-blind reader.
   ⚠️ No shadow and no transition here on purpose — there are hundreds. */
.cell {
  display: block; width: 22px; height: 22px; margin: 1px auto;
  border-radius: 6px; border: 1px solid var(--hairline);
  background: var(--waiting-wash);
  font-size: 0.7rem; line-height: 20px; text-align: center; color: var(--ink-faint);
}
.cell.none      { border-style: dashed; background: transparent; color: transparent; }
.cell.attested  { background: var(--attested-wash); border-color: var(--attested-line); color: var(--attested); }
.cell.attested::after { content: "✓"; }
.cell.waiting   { background: var(--waiting-wash);  border-color: var(--waiting-line); }
.cell.waiting::after   { content: "·"; }
.cell.missing   { background: var(--missing-wash);  border-color: var(--missing-line); color: var(--missing); }
.cell.missing::after   { content: "△"; }
.cell.conflict  { background: var(--conflict-wash); border-color: var(--conflict-line); color: var(--conflict); }
.cell.conflict::after  { content: "✕"; }
/* granite#81. Not worked: settled, and nothing covered — a heavier edge than
   missing, so the two read apart in black and white too. Confirmed with other
   times: still green, with a dot, because it is confirmed. */
.cell.notworked { background: var(--missing-wash); border: 2px solid var(--missing); color: var(--missing); line-height: 18px; }
.cell.notworked::after { content: "–"; }

/* Recovery codes (granite#88): printed on their own, nothing else on the page. */
.recovery-codes ol.codes {
  columns: 2; margin: 0; padding-left: 22px;
  font-variant-numeric: tabular-nums; line-height: 1.9;
}
.recovery-codes code { font-size: 1rem; letter-spacing: 0.08em; }
@media print {
  body * { visibility: hidden; }
  .recovery-codes, .recovery-codes * { visibility: visible; }
  .recovery-codes { position: absolute; inset: 0 auto auto 0; background: #fff; color: #000; border: 0; }
  .recovery-codes .no-print { display: none; }
}

/* Holiday and leave (granite#83): neither waiting nor missing, so a look of its
   own — stripes, in a colour no other state uses. */
.cell.absent {
  background: repeating-linear-gradient(135deg, var(--leave-wash) 0 4px, transparent 4px 8px);
  border-color: var(--leave); color: var(--leave);
}
/* A day off with no shift on it: the same stripes, lighter, and no border that
   reads as something to act on. */
.cell.absent-day {
  background: repeating-linear-gradient(135deg, var(--leave-wash) 0 3px, transparent 3px 6px);
  border: 1px dashed var(--leave);
}
/* A shift that clashes or leaves too little rest (Hans, 2026-10-02): marked
   where it was put, in the board's colours for the same finding. */
.cal-entry.trouble.shortrest { border-left-color: var(--missing); box-shadow: inset 0 0 0 1px var(--missing-line); }
.cal-entry.trouble.clash { border-left-color: var(--conflict); box-shadow: inset 0 0 0 1px var(--conflict-line); }
.cal-entry.trouble .trouble-mark { margin-right: 3px; }
.cal-entry.trouble.shortrest .trouble-mark { color: var(--missing); }
.cal-entry.trouble.clash .trouble-mark { color: var(--conflict); }
.trouble-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.trouble-list a { color: var(--accent-ink); white-space: nowrap; }
.cal-entry.absent {
  border-left-color: var(--leave);
  background: repeating-linear-gradient(135deg, var(--leave-wash) 0 6px, transparent 6px 12px);
}
.pill.leave { color: var(--leave); background: var(--leave-wash); border-color: var(--leave); }

/* Long sick leave (granite#84): the same shapes as leave, in its own colour —
   it is paid differently and has a report attached. */
.cell.absent.sick {
  background: repeating-linear-gradient(135deg, var(--sick-wash) 0 4px, transparent 4px 8px);
  border-color: var(--sick); color: var(--sick);
}
.cell.absent-day.sick {
  background: repeating-linear-gradient(135deg, var(--sick-wash) 0 3px, transparent 3px 6px);
  border-color: var(--sick);
}
.cal-entry.absent.sick {
  border-left-color: var(--sick);
  background: repeating-linear-gradient(135deg, var(--sick-wash) 0 6px, transparent 6px 12px);
}
.pill.sick { color: var(--sick); background: var(--sick-wash); border-color: var(--sick); }
.leave-line { color: var(--leave); font-weight: 600; }
.note.leave-note { border-left-color: var(--leave); }
.absences { list-style: none; margin: 0; padding: 0; }
.absences > li {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  padding: 10px 0;
}
.absences > li + li { border-top: 1px solid var(--hairline); }
.absences a { display: inline-block; margin: 4px 12px 0 0; color: var(--accent-ink); }
.cell.deviates { position: relative; }
.cell.deviates::before {
  content: ""; position: absolute; top: -3px; right: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--missing); box-shadow: 0 0 0 2px var(--surface);
}

/* Whether each day is covered, above the people who cover it. */
.board tr.coverage-row th.who { color: var(--ink-soft); font-weight: 600; }
.cov {
  display: block; width: 22px; margin: 1px auto;
  border-radius: 5px; text-align: center;
  font-size: 0.62rem; font-weight: 700; line-height: 18px;
}
/* 🔴 Not --attested (granite#230). This row says whether a day is COVERED, and
 * it sat in the attested green directly above a grid where that green means a
 * shift somebody signed for — so the tick read as "this date is done for the
 * monthly report", which is not a claim this board makes anywhere. A colour
 * argues louder than the row's own label, and the tooltip explaining it does not
 * exist on a phone.
 *
 * ⚠️ Quiet on purpose. Its neighbours in this row are −4 and +2, problems in red;
 * "covered" is the absence of a problem and should not compete with them for the
 * eye. --attested now means one thing on this screen. */
.cov.full  { color: var(--ink-faint); font-size: 0.85rem; }
.cov.short { background: var(--missing-wash); color: var(--missing); }
.cov.over  { background: var(--conflict-wash); color: var(--conflict); }
/* Too little rest before or after the shift (Hans, 2026-10-02). A ring rather
   than a corner dot: the corners already say "other times" and "over the
   allowance", and a short night is about the shift as a whole. */
.cell.shortrest { outline: 2px solid var(--missing); outline-offset: 1px; }
.cell.conflict.shortrest { outline-color: var(--conflict); }
.card.trouble { background: var(--missing-wash); border-color: transparent; }
.card.trouble.conflict { background: var(--conflict-wash); }
.cell.overlaps { position: relative; }
.cell.overlaps::before {
  content: ""; position: absolute; top: -3px; right: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--conflict); box-shadow: 0 0 0 2px var(--surface);
}
.shortfalls.over { background: var(--conflict-wash); }
.shortfalls.over .sentence { color: var(--conflict); }

.shortfalls { background: var(--missing-wash); border-radius: var(--r); padding: 10px 14px; margin: 0 0 12px; }
.shortfalls .sentence { color: var(--missing); font-weight: 600; }
.shortfalls ul { margin: 4px 0 0; padding-left: 18px; }
.cell-compare { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; margin: 0 0 6px; }
.cell-compare .short { color: var(--missing); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- conflicts ---------- */

.conflict-item {
  border-left: 3px solid var(--conflict); background: var(--conflict-wash);
  padding: 11px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-bottom: 8px;
}
.conflict-item.behind  { border-left-color: var(--missing); background: var(--missing-wash); }
.conflict-item.schedule { border-left-color: var(--waiting); background: var(--waiting-wash); }
.conflict-item .sentence { font-weight: 500; }

/* A clash that links somewhere should look like it does. */
a.conflict-item {
  display: block; text-decoration: none; color: inherit;
  transition: border-left-width var(--fast) var(--ease), padding-left var(--fast) var(--ease);
}
a.conflict-item:hover { border-left-width: 6px; padding-left: 11px; }
.conflict-go { color: var(--conflict); font-weight: 600; margin-top: 4px; }

/* ---------- an attestation history ---------- */

.history { list-style: none; margin: 0 0 12px; padding: 0; }
.history li {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--hairline);
}
.history li:first-child { border-top: 0; }

/* A signature another one replaced (granite#129). Struck through and dimmed,
   because it is still a named person's statement and is never deleted — but two
   signatures over the same hours must not read as equals. The pill beside it
   carries the word, so the meaning does not rest on the strike alone. */
.history li.superseded { color: var(--ink-faint); }
.history li.superseded > span:not(.pill) { text-decoration: line-through; }

/* ---------- controls ---------- */

.field { margin-bottom: 16px; }
.field > label,
.field > .label,
.label {
  display: block; font-size: 0.79rem; font-weight: 500;
  color: var(--ink-soft); margin-bottom: 5px;
}

/* A form as a grid rather than a row of floats. Fields keep their own width and
   wrap at a sane place instead of at whatever the flex algorithm decides. */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px 14px;
  margin-bottom: 14px;
}
.form-grid .field { margin-bottom: 0; }
.form-grid .field.narrow { grid-column: span 1; }
.form-grid .field.wide { grid-column: 1 / -1; }

/* One input look for every kind of input. Left at the browser default they sit
   a size apart from every button beside them, and a date box and a text box on
   the same row look like two different systems. */
/* ⚠️ No width here. These sit in two kinds of place — stacked in a .field, where
   they should fill it, and side by side in a .choices row, where a shift's two
   time boxes and the person beside them each need their own size. A blanket
   `width: 100%` put one control per line and made the shift form four rows tall. */
.input,
input.choice, select.choice, textarea.choice {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  font: inherit; font-size: 0.92rem; font-weight: 500;
  min-height: 38px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.input:hover, input.choice:hover, select.choice:hover { border-color: var(--ink-faint); }
.input:focus, input.choice:focus, select.choice:focus {
  outline: none;
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.input::placeholder { color: var(--ink-faint); }

/* Filling its label is what a stacked field means. */
.field > .input, .field > input.choice, .field > select.choice,
.form-grid .input { width: 100%; }

/* The select needs its own arrow once appearance is gone. Drawn rather than
   loaded — an image request for a chevron is a request too many. */
select.input, select.choice {
  padding-right: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 14px center, right 9px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--ink);
}

.choices { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* A button that is a choice. Selected is filled, not merely tinted — "which one
   is on" was the question being asked, and a pale border does not answer it. */
.choice {
  appearance: none; border: 1px solid var(--hairline-strong); background: var(--surface);
  color: var(--ink); border-radius: var(--r-sm); padding: 7px 13px;
  font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer; min-height: 38px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.choice:hover { border-color: var(--ink-faint); background: var(--surface-hover); }
.choice:active { transform: scale(0.98); }

/* Choosing this person is a decision, not a default (granite#242): they are away,
 * already working then, short of rest, or kept out of automatic staffing on
 * purpose. ⚠️ Marked, never disabled — somebody on holiday who agrees to come in
 * covers a sick call, and a button that refuses sends the provider to a phone.
 * The reason is in the label beside it; this is what makes the eye stop. */
.choice.guarded { border-color: var(--missing); color: var(--missing); }
.choice.guarded:hover { border-color: var(--missing); background: var(--missing-wash); }
.choice.guarded.selected { border-color: var(--missing); background: var(--missing); color: var(--on-accent); }
.choice.selected {
  border-color: var(--accent-deep); background: var(--accent-deep);
  color: var(--on-accent); font-weight: 600;
}
.choice.selected .faint { color: color-mix(in srgb, var(--on-accent) 75%, transparent); }
.choice.selected::before { content: "✓"; font-size: 0.85em; }

/* ---------- segmented control ---------- */

/* Three views of one thing, in one control. Built as three buttons with a
   shared trough rather than three buttons in a row with negative margins, which
   is what it was — and which put a 1px seam through the selected one. */
.segmented {
  display: inline-flex; padding: 3px; gap: 3px;
  background: var(--surface-3); border-radius: var(--r);
  border: 1px solid var(--hairline);
}
.segmented > button {
  appearance: none; border: 0; background: none; color: var(--ink-soft);
  font: inherit; font-size: 0.85rem; font-weight: 500; cursor: pointer;
  padding: 6px 14px; min-height: 32px; border-radius: calc(var(--r) - 4px);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}
.segmented > button:hover { color: var(--ink); }
/* Filled, like every other chosen thing here. A white pill on a pale trough
   was Apple's answer and the provider could not see which tab was open. */
.segmented > button[aria-pressed="true"] {
  background: var(--accent-deep); color: var(--on-accent);
  box-shadow: var(--shadow-1);
}

/* ---------- buttons ---------- */

/* ⚠️ `display` is not optional here. A <button> is inline-block by default and
   looks right without it; an <a class="btn"> stays `inline`, where min-height
   does not apply at all and vertical padding overflows the line box instead of
   pushing it apart — so the button renders on top of the line above it. It was
   struck through the sentence it belonged to on the month board's
   previous-month warning, and on every other link-shaped button that was not
   already inside a flex container. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  appearance: none; border: 1px solid transparent;
  background: var(--accent-deep);
  color: var(--on-accent); border-radius: var(--r-sm); padding: 9px 17px;
  font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; min-height: 38px;
  text-align: center; text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: background-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
              transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}
.btn:hover { background: var(--accent-ink); box-shadow: var(--shadow-2); }
.btn:active { transform: scale(0.975); box-shadow: var(--shadow-1); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }

/* Colour comes from --on-accent now; only the hover tint is dark-specific. */
:root[data-theme="dark"] .btn:hover { background: var(--accent); }

.btn.secondary {
  background: var(--surface); color: var(--ink); border-color: var(--hairline-strong);
}
.btn.secondary:hover { background: var(--surface-hover); border-color: var(--ink-faint); }

/* Quieter than secondary: an action that is available, in a place where a
   second bordered button would compete with the one that matters. */
.btn.quiet {
  background: none; color: var(--ink-soft); border-color: transparent; box-shadow: none;
}
.btn.quiet:hover { background: var(--surface-3); color: var(--ink); box-shadow: none; }

.btn.small { min-height: 30px; padding: 4px 11px; font-size: 0.79rem; }

/* The confirming button carries the weight; cancel stays quiet. A destructive
   action that looks like every other button is how a benefit period disappears
   from one mis-click. */
.btn.danger { background: var(--conflict); border-color: transparent; color: #fff; }
.btn.danger:hover { background: var(--conflict); filter: brightness(0.92); }

/* A control that is only an icon. Needs a hit area a finger can find and a
   label a screen reader can read; it has no text of its own. */
.icon-btn {
  appearance: none; border: 0; background: none; color: var(--ink-faint);
  cursor: pointer; border-radius: var(--r-pill);
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.95rem; line-height: 1;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }

/* ---------- checkbox and switch ---------- */

/* Which one to use is a question about what the control means, not about how it
   looks: a checkbox is part of a form that gets submitted, a switch takes effect
   the moment it is flipped. Getting that backwards is why a settings page can
   feel like it did not save. */
.check {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.875rem; color: var(--ink); cursor: pointer; user-select: none;
  min-height: 38px;
}
/* ⚠️ Every checkbox, not only those inside a .check label. A bare one is drawn
   by the browser in the browser's blue, which is how the form picker on
   Blanketter came to sit in another product's colours beside the rose of
   everything around it (Hans 2026-10-05). The switch is the one exception and
   draws itself below. */
input[type="checkbox"]:not(.switch input) {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 22px; height: 22px; flex: 0 0 auto; vertical-align: middle;
  border: 1.5px solid var(--hairline-strong); border-radius: var(--r-xs);
  background: var(--surface); cursor: pointer; position: relative;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
input[type="checkbox"]:not(.switch input):hover { border-color: var(--ink-faint); }
input[type="checkbox"]:not(.switch input):checked {
  background: var(--accent); border-color: var(--accent);
}
/* Drawn, not a glyph: a font's checkmark sits differently in every family and
   at every size, and this one has to be centred in a 22px box. */
input[type="checkbox"]:not(.switch input):checked::after {
  content: ""; position: absolute; left: 6.5px; top: 2.5px;
  width: 6px; height: 11px;
  border: solid var(--on-accent); border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 38px; }
.switch input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 44px; height: 26px; flex: 0 0 auto; border-radius: var(--r-pill);
  background: var(--hairline-strong); cursor: pointer; position: relative;
  transition: background-color var(--base) var(--ease);
}
.switch input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform var(--base) var(--ease);
}
.switch input[type="checkbox"]:checked { background: var(--accent-deep); }
.switch input[type="checkbox"]:checked::after { transform: translateX(18px); }
.switch .switch-text { display: flex; flex-direction: column; }
.switch .switch-text .small { color: var(--ink-soft); }

/* ---------- notes: warn, done, plain ---------- */

/* One shape, three colours, always in the same place on a card. The eye finds
   it without reading it, and the colour says which it is. */
.note, .warn, .done, .restaff {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--waiting);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 12px 14px; margin: 14px 0;
}
.note .sentence, .warn .sentence, .done .sentence { font-weight: 600; }
.note p:last-child, .warn p:last-child, .done p:last-child { margin-bottom: 0; }

.warn, .note.warn {
  border-color: var(--conflict-line); border-left-color: var(--conflict);
  background: var(--conflict-wash);
}
.warn .sentence, .note.warn .sentence { color: var(--conflict); }

/* Proposals that resolve short rest and clashes, under the warning box in
   Schemahantering (granite#282). One card per shift to move; its options are
   radios with a one-line reason each, the picker's own words. */
.fix-panel { display: grid; gap: 10px; border: 1px solid var(--hairline-strong); border-radius: var(--r); padding: 12px 14px; background: var(--surface); }
.fix { display: grid; gap: 8px; border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface-2); }
.fix.off { opacity: 0.65; }
.fix-head { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.fix-title { flex: 0 1 auto; min-width: 0; align-items: flex-start; }
.fix-head > .pill { margin-left: auto; }
.fix-title > span { display: grid; gap: 3px; min-width: 0; }
.fix-item { display: block; }
.fix-byhand { display: block; color: var(--missing); }
.fix-opts { display: grid; gap: 4px; padding-left: 30px; }
.fix-opt { align-items: flex-start; min-height: 0; padding: 4px 0; justify-self: start; max-width: 100%; }
.fix-opt.unusable { opacity: 0.6; cursor: not-allowed; }
.fix-opt-text { display: grid; gap: 1px; min-width: 0; }
.fix-rec { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); }
.fix-person { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.fix-person .radio { min-height: 0; padding-top: 6px; }
.fix-person .choice { width: 100%; max-width: 460px; }
.fix-picks { display: grid; gap: 6px; padding: 2px 0 6px 28px; }
.fix-pick { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; align-items: center; }
.fix-pick .choice { width: 100%; max-width: 420px; }
@media (max-width: 560px) { .fix-pick { grid-template-columns: 1fr; } }
.fix-totals { display: grid; gap: 4px; }
.fix-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--hairline); padding-top: 10px; }
.fix-swaps { margin: 6px 0 0; padding-left: 18px; }
.fix-hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin-top: 8px; }
.fix-hour { display: grid; gap: 1px; font-size: 0.84rem; font-variant-numeric: tabular-nums; border: 1px solid var(--hairline); border-radius: var(--r-xs); padding: 6px 8px; background: var(--surface); }

/* What "Bemanna om" would do, before it does it (granite#285): the same
   language as the proposals — green for new, dashed red for removed, the
   brand's pink for changed — in the panel and on the month. */
.restaff-preview { display: grid; gap: 10px; border: 1px solid var(--hairline-strong); border-radius: var(--r); padding: 12px 14px; background: var(--surface); }
.preview-group { display: grid; gap: 4px; }
.preview-group h4 { margin: 0; font-size: 0.86rem; }
.preview-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.preview-list li { display: grid; grid-template-columns: 18px 70px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 0.86rem; padding: 4px 8px; border-radius: var(--r-xs); background: var(--surface-2); }
.preview-list .mark { font-weight: 700; text-align: center; color: var(--ink-faint); }
.preview-list .mark.new { color: var(--attested); }
.preview-list .mark.gone { color: var(--conflict); }
.preview-list .mark.change { color: var(--accent-ink); }
.preview-list .when { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.preview-kept summary { cursor: pointer; font-size: 0.86rem; color: var(--ink-soft); }
.pill.preview-new { color: var(--attested); background: var(--attested-wash); border-color: var(--attested-line); }
.pill.preview-gone { color: var(--conflict); background: var(--conflict-wash); border-color: var(--conflict-line); }
.pill.preview-change { color: var(--accent-ink); background: var(--accent-wash); border-color: var(--accent); }
.cal-entry.ghost { opacity: 0.95; border-style: solid; }
.cal-entry.ghost-new, .cal-entry.restaff-new { outline: 1.5px solid var(--attested); outline-offset: -1.5px; background: var(--attested-wash); }
.cal-entry.ghost-change, .cal-entry.restaff-changed { outline: 1.5px solid var(--accent); outline-offset: -1.5px; background: var(--accent-wash); }
.cal-entry.preview-gone { outline: 1.5px dashed var(--conflict); outline-offset: -1.5px; background: var(--conflict-wash); text-decoration: line-through; }
.cal-entry.preview-from { outline: 1.5px dashed var(--accent); outline-offset: -1.5px; text-decoration: line-through; opacity: 0.75; }
.ghost-tag { display: block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }

/* What a month's forms are missing, on Blanketter: the form it stops, what is
   missing, and where it is put right — one item each, read top to bottom. */
.lacks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.lacks li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; }
.lacks .lack-form { grid-row: span 2; font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; padding-top: 2px; }
.lacks .lack-what { color: var(--ink); }
.lacks .lack-fix { color: var(--ink-soft); }
.lacks .lack-fix a { white-space: nowrap; margin-left: 4px; }

.done, .note.done {
  border-color: var(--attested-line); border-left-color: var(--attested);
  background: var(--attested-wash);
}
.done .sentence, .note.done .sentence { color: var(--attested); }

.note.caution {
  border-color: var(--missing-line); border-left-color: var(--missing);
  background: var(--missing-wash);
}
.note.caution .sentence { color: var(--missing); }

/* Something coming up to know about, not a problem: a staff meeting on Mitt
   schema (granite#260). Blue, the meeting's own colour. */
.note.info {
  border-color: var(--leave-wash); border-left-color: var(--leave);
  background: var(--leave-wash);
}
.note.info .sentence { color: var(--leave); }

/* The quiet counterpart: an action that is available rather than one that needs
   attention. Staffing a month again is ordinary maintenance. */
.restaff { display: flex; flex-direction: column; gap: 7px; }

/* ---------- open sign-in ---------- */

/* Authentication is off. Solid, full width, above everything, and with no way
   to dismiss it — this has to still be noticeable on the day the system is
   handed over, not just on the day it was switched on. */
.open-signin-banner {
  position: sticky; top: 0; z-index: 100;
  background: var(--conflict); color: #fff;
  font-weight: 700; font-size: 0.79rem; letter-spacing: 0.05em;
  text-align: center; padding: 7px 14px;
}

/* Setting up (granite#247): nothing is mailed to staff until the provider
   starts. Amber, not red — it is a state the provider chose, not a fault — and
   not dismissible, for the same reason as the banner above: it has to still be
   there on the day they forget it is on. */
.setup-banner {
  background: var(--missing-wash); color: var(--missing);
  border-bottom: 1px solid var(--missing-line);
  font-size: 0.86rem; text-align: center; padding: 8px 14px;
}
.setup-banner a { color: inherit; font-weight: 700; margin-left: 6px; white-space: nowrap; }

/* The welcome mail as it will arrive (granite#247) — plain text, because that
   is what is sent. */
.mail-preview {
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  background: var(--surface-2); padding: 12px 14px; margin: 10px 0;
}
.mail-preview .mail-subject { font-weight: 700; margin-bottom: 8px; }
.mail-preview pre {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: 0.9rem;
}

/* Week 1 of a cycle that starts mid-week (granite#251): the days before the
   start date are real cycle days, first used a turn later — dimmed, not
   hidden, because shifts can still be put on them. */
.cal-day.before-start { opacity: 0.55; }
.cal-start {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  color: var(--accent-deep); margin-right: 6px;
}

/* The versions of a base schedule, always on screen (granite#255). One card
   per version in date order; the open one filled and marked, because a pale
   tint answers "which one is open" with a shrug. */
.versions { display: flex; flex-direction: column; gap: 10px; }
.versions-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; justify-content: space-between; }
.version-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; }
.version-card {
  flex: 0 0 auto; min-width: 190px; max-width: 240px; text-align: left; position: relative;
  display: flex; flex-direction: column; gap: 5px; font: inherit; color: var(--ink); cursor: pointer;
  border: 1px solid var(--hairline-strong); background: var(--surface); border-radius: var(--r-sm);
  padding: 11px 13px; transition: border-color .15s ease;
}
.version-card:hover { border-color: var(--ink-faint); }
.version-card[aria-pressed="true"] { border: 2px solid var(--accent); padding: 10px 12px; background: var(--accent-wash); }
.version-card[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 9px; right: 12px; font-weight: 700; color: var(--accent-deep);
}
.version-card .v-name { font-weight: 700; padding-right: 22px; }
.version-card .pill { align-self: flex-start; }
.version-card .v-when { font-size: .82rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.version-card .v-uses { font-size: .78rem; color: var(--ink-faint); }
.version-card.add { border-style: dashed; align-items: center; justify-content: center; color: var(--accent-deep); font-weight: 600; min-width: 150px; background: transparent; }
.editing-head {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  border: 1px solid var(--hairline); background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 14px;
}
.editing-head .what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.editing-head .what strong { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 1rem; }
.new-version { display: flex; flex-direction: column; gap: 10px; }
.new-choices { display: flex; flex-direction: column; gap: 6px; }
.new-choice {
  display: flex; gap: 9px; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); padding: 9px 11px;
}
.new-choice input { margin-top: 3px; accent-color: var(--accent); }
.new-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.month-basis { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--ink-soft); margin-bottom: 8px; }
/* Laying a template out from a chosen week (granite#256): every calendar
   week in the period, with the template week it gets. Four washes repeat so
   the rhythm of the cycle is visible at a glance. */
.lay-out { display: flex; flex-direction: column; gap: 10px; }
.lay-scroll { overflow-x: auto; }
.lay-timeline { display: flex; gap: 4px; min-width: min-content; }
.lay-week {
  flex: 0 0 auto; min-width: 46px; text-align: center; border-radius: var(--r-sm);
  padding: 5px 4px; font-size: .74rem; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; border: 1px solid var(--hairline);
}
.lay-week small { display: block; font-weight: 500; color: var(--ink-soft); }
.lay-week.mw-0 { background: var(--accent-wash); border-color: var(--accent); }
.lay-week.mw-1 { background: var(--leave-wash); }
.lay-week.mw-2 { background: var(--activity-wash); }
.lay-week.mw-3 { background: var(--missing-wash); }
.layouts { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--hairline); padding-top: 10px; }
.layout-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .86rem; }
.pop-rule { border: 0; border-top: 1px solid var(--hairline); margin: 10px 0; }
.segmented .step {
  display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  font-size: .68rem; font-weight: 700; margin-right: 6px; background: var(--hairline-strong); color: var(--ink);
}
.segmented [aria-pressed="true"] .step { background: rgba(255, 255, 255, .28); color: var(--on-accent); }

/* ---------- figures and meters ---------- */

.meter {
  height: 10px; border-radius: var(--r-pill);
  background: var(--surface-3); overflow: hidden;
  border: 1px solid var(--hairline);
}
.meter > span {
  display: block; height: 100%; background: var(--accent-deep);
  border-radius: var(--r-pill);
  transition: width var(--base) var(--ease);
}
.meter.over > span { background: var(--conflict); }

/* Two marks on one bar: the filled part is what has been attested, the tick is
   where the period is heading. A single bar cannot say both, and the gap
   between them is the whole question. */
.meter.outlook { position: relative; overflow: visible; }
.meter.outlook > span { overflow: hidden; }
.meter.outlook i {
  position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px;
  background: var(--ink); opacity: 0.7;
}
.meter.outlook.over i { background: var(--conflict); opacity: 1; }

.figures { display: flex; gap: 28px; flex-wrap: wrap; margin: 12px 0 10px; }
.figures div { display: flex; flex-direction: column; }
.figures dt { font-size: 0.79rem; color: var(--ink-soft); }
.figures dd { margin: 0; font-size: 1.2rem; font-weight: 600; letter-spacing: -0.015em; }
.figures .sub { font-size: 0.75rem; color: var(--ink-faint); }

/* ---------- calendar ---------- */

/* The grid lines are the container's background showing through a 1px gap. One
   colour, one border, and no per-cell borders to double up at the seams. */
/* ⚠️ overflow: visible, not hidden. A box opened on a day in the last row
   extends below the grid, and hidden cut it off with the save button in the
   part nobody could reach. The corners are rounded on the head and the last
   row instead. */
.calendar {
  --cal-gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--r); overflow: visible;
}
.calendar .cal-head { border-radius: var(--r) var(--r) 0 0; overflow: hidden; }
.calendar .cal-row:last-child { border-radius: 0 0 var(--r) var(--r); overflow: hidden; }
.calendar .cal-row:last-child:has(.pop) { overflow: visible; }

.cal-head, .cal-row {
  display: grid;
  grid-template-columns: 36px repeat(7, minmax(0, 1fr));
  gap: var(--cal-gap);
  background: var(--hairline);
}
.cal-head + .cal-row, .cal-row + .cal-row { margin-top: var(--cal-gap); }

.cal-weekday, .cal-week {
  background: var(--surface); padding: 7px 8px;
  font-size: 0.67rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-faint);
}
.cal-head .cal-week { text-align: center; }

.cal-row .cal-week {
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 9px; font-weight: 500;
}

.cal-day {
  background: var(--surface); min-height: 94px; padding: 6px 7px 8px;
  display: flex; flex-direction: column; gap: 3px;
}
.cal-day.weekend { background: var(--surface-2); }
.cal-day.outside { opacity: 0.38; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent-deep); }

.cal-date { font-size: 0.79rem; font-weight: 600; color: var(--ink-soft); }
.cal-day.today .cal-date { color: var(--accent-ink); }

/* One shift. Small, quiet, and readable at a glance — a day with four of them
   still has to fit without the row growing taller than the screen. */
.cal-entry {
  display: block; text-decoration: none; color: inherit;
  border-left: 3px solid var(--waiting-line);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: var(--surface-3); padding: 3px 6px;
  font-size: 0.75rem; line-height: 1.28;
}
a.cal-entry, .cal-entry.editable {
  transition: background-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
a.cal-entry:hover { background: var(--accent-wash); }
.cal-entry .who { display: block; font-weight: 600; }
.cal-entry .when { display: block; color: var(--ink-soft); }
.cal-entry.attested { border-left-color: var(--attested); }
.cal-entry.waiting  { border-left-color: var(--waiting); }
.cal-entry.missing  { border-left-color: var(--missing); background: var(--missing-wash); }
.cal-entry.conflict { border-left-color: var(--conflict); background: var(--conflict-wash); }
.cal-entry.activity { border-left-color: var(--activity); background: var(--activity-wash); }

/* Coverage, on the schedule builder. Green is around the clock with nobody
   doubled — the bar the provider's own spreadsheet already clears. */
/* ⚠️ Not --attested either (granite#230). Found by sweeping rather than by
 * anybody reporting it: this stripe means the day's hours are covered, and it
 * sat in the attested green one line below .cal-entry.attested — the same colour
 * for "covered" and "signed for", side by side on one screen. Covered is the
 * expected state here; uncovered and doubled below are the ones that need ink. */
.cal-day.covered   { box-shadow: inset 3px 0 0 var(--hairline-strong); }
.cal-day.uncovered { box-shadow: inset 3px 0 0 var(--conflict); background: var(--conflict-wash); }
.cal-day.doubled   { box-shadow: inset 3px 0 0 var(--waiting); background: var(--waiting-wash); }
.cal-day.uncovered.weekend, .cal-day.doubled.weekend { background: var(--conflict-wash); }

.cover-gap    { float: right; color: var(--conflict); font-weight: 700; font-size: 0.7rem; }
.cover-double { float: right; color: var(--waiting); font-weight: 700; font-size: 0.7rem; }

/* A gap is a button, so it should not look like a paragraph. */
button.cover-gap {
  appearance: none; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 0.7rem; color: var(--conflict); padding: 0;
}
button.cover-gap:hover { text-decoration: underline; }

/* A shift placed against the daily rest rule. Allowed, and never quiet. */
.cal-entry.rest-breach { border-left-color: var(--missing); background: var(--missing-wash); }
.rest-flag { color: var(--missing); font-weight: 700; }

/* A shift held by hand, in either grid.
 *
 * ⚠️ Findable without hunting for the padlock (granite#212), which is what Hans
 * asked for — but still quiet, because most shifts are not held and a grid
 * where the exceptions shout is a grid nobody reads. So: a heavier edge and a
 * cooler surface rather than a seventh colour.
 *
 * It wore --accent-deep, the brand colour, and so did .activity — a locked
 * shift and a riding lesson were the same thing to look at. */
.cal-entry.pinned {
  border-left-color: var(--held);
  border-left-width: 4px;
  background: var(--held-wash);
}
.cal-entry.pinned .lock { color: var(--held-edge); opacity: 1; }

/* The shift a link from the month board arrived at (granite#226).
 *
 * 🔴 An outline, not a background or a border. Every other slot on this element
 * is taken and means something: the left border carries held (--held) and rest
 * breaches, the background carries attested, waiting, absence and activity, and
 * an inset shadow is already "being edited". Painting over any of them would
 * trade the fact the reader came for — this is the shift — against the fact they
 * need next, which is whether it is locked, worked or on somebody who is away.
 * outline draws outside the box and stacks with all of it.
 *
 * ⚠️ It wears --accent deliberately, and this is not the thing Hans objected to.
 * The brand colour on an activity or a locked shift claimed those were a status;
 * here it is the interface pointing at one row for one arrival, which is the one
 * job a brand accent should have. Nothing else on this screen is outlined, so it
 * cannot be confused with a state.
 *
 * It does not fade. A highlight that disappears after two seconds is gone before
 * somebody has read the row above it, and then they are back to remembering
 * which shift they clicked — the state this exists to end. */
.cal-entry.arrived,
.cell.arrived {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* One pulse on arrival, so the eye finds it even mid-scroll. The resting state
 * above is the outline, never opacity or a transform — a rule that animates
 * from invisible leaves the mark invisible for anyone whose animations are off,
 * on a screenshot, and in a thumbnail. */
@media (prefers-reduced-motion: no-preference) {
  .cal-entry.arrived,
  .cell.arrived { animation: arrived 1.1s var(--ease) 2; }
}

@keyframes arrived {
  0%, 100% { outline-color: var(--accent); outline-offset: 2px; }
  50% { outline-color: var(--accent-deep); outline-offset: 5px; }
}

.cal-entry.editable { cursor: pointer; }
.cal-entry.editable:hover { box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.cal-entry.editing { box-shadow: inset 0 0 0 2px var(--accent-deep); }

.pin {
  appearance: none; border: 0; background: none; cursor: pointer;
  padding: 0 3px; font-size: 0.75rem; line-height: 1; opacity: 0.4;
  transition: opacity var(--fast) var(--ease);
}
.pin:hover { opacity: 0.9; }
.pin.on { opacity: 1; }

/* An activity on a day. Sits above the shifts, because it is why the day is
   staffed the way it is rather than one of the shifts itself.
   Name over time, the same two-line shape a shift uses: a day column is a
   seventh of the width, so "Ridning 12:00–14:00" on one nowrap line was simply
   cut off at the ellipsis — the time was there in the markup and invisible. */
.cal-activity {
  display: block; width: 100%; text-align: left;
  font-size: 0.67rem; line-height: 1.3;
  /* 🔴 The activity's own colour, not the brand's (granite#213). This is the
     chip a reader actually sees in a day cell — `.cal-entry.activity` is the
     row in the left-hand list, and fixing only that one left every activity in
     the grid still wearing the interface colour. Two rules for one thing, and
     only one of them was changed. */
  color: var(--activity-ink); background: var(--activity-wash);
  border: 0; border-radius: var(--r-xs); padding: 2px 5px; margin-bottom: 2px;
  font-family: inherit;
}
.cal-activity .what {
  display: block; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The time never wraps and never gets elided: it is four characters wider than
   the name and it is the half being asked for. */
.cal-activity .when { display: block; font-weight: 500; opacity: 0.85; white-space: nowrap; }

.cal-activity.extra { color: var(--missing); background: var(--missing-wash); }
/* A staff meeting on the month (granite#260): blue like on Mitt schema, a link
   to where it is changed, never part of the template. */
.cal-activity.meeting { color: var(--leave); background: var(--leave-wash); text-decoration: none; }
/* On the name, not on the whole chip — appended to the block it would land
   under the time instead of after what it qualifies. */
.cal-activity.extra .what::after { content: " +1"; }

/* Clickable, because an activity is edited where it is seen. */
button.cal-activity {
  cursor: pointer;
  transition: box-shadow var(--fast) var(--ease);
}
button.cal-activity:hover { box-shadow: inset 0 0 0 1px currentColor; }
button.cal-activity.editing { box-shadow: inset 0 0 0 2px var(--activity); }

.month-picker { display: flex; align-items: center; gap: 8px; }
.month-picker strong { min-width: 11ch; text-align: center; font-size: 0.92rem; }

.by-other { color: var(--missing); font-weight: 700; }

/* Three months across. Below a laptop's width they stack, because three
   seven-column grids on a phone is three unreadable grids. */
.three-up { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.three-month h3 { margin-bottom: 7px; display: flex; gap: 8px; align-items: baseline; }
.three-up .cal-day { min-height: 62px; }
.three-up .cal-entry { font-size: 0.65rem; }
.three-up .cal-head, .three-up .cal-row { grid-template-columns: 22px repeat(7, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .three-up { grid-template-columns: 1fr; }
  .three-up .cal-day { min-height: 94px; }
  .three-up .cal-entry { font-size: 0.75rem; }
}

@media (max-width: 720px) {
  /* Seven columns of nothing is worse than a list. Below this width the grid
     becomes one day per row, which is what a phone can actually show. */
  .cal-head { display: none; }
  .cal-row { grid-template-columns: 1fr; }
  .cal-row .cal-week {
    justify-content: flex-start; padding: 5px 9px; border-radius: 0;
  }
  .cal-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 7px; }
  .cal-day.outside { display: none; }
  .cal-date::after { content: " " attr(data-weekday); font-weight: 500; color: var(--ink-faint); }
  .cal-entry { flex: 1 1 100%; font-size: 0.79rem; padding: 6px 9px; }
  .cal-activity { flex: 1 1 100%; font-size: 0.75rem; padding: 5px 8px; }
}

/* ---------- a sheet: one thing, opened over the page it belongs to ---------- */

/* Not a modal. It sits in the flow next to what it is about, so the grid behind
   it is still readable while it is open — which is the point, since the thing
   being edited is on that grid. */
.sheet {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.sheet-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.sheet-head h3 { flex: 1 1 auto; min-width: 0; }
.sheet-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline);
}

/* Filling a hole, and editing one shift. Same shape as a sheet, quieter frame —
   they open inside a card rather than over one. */
.fill-panel {
  border: 1px solid var(--hairline-strong); border-radius: var(--r);
  padding: 15px; margin-bottom: 14px; background: var(--surface-2);
}
.fill-option {
  border-top: 1px solid var(--hairline); padding-top: 11px; margin-top: 11px;
  display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start;
}
.fill-shifts { display: flex; gap: 6px; flex-wrap: wrap; min-width: 190px; }
.fill-who { list-style: none; margin: 0; padding: 0; flex: 1 1 240px; font-size: 0.85rem; }
.fill-who li { display: flex; gap: 8px; align-items: baseline; }

.edit-shift { margin-bottom: 12px; }

/* ---------- a fenced-off group inside a card ---------- */

/* The cycle's shape decides what every tab under it is about. Unlabelled at the
   top of a page, two input boxes read as page settings rather than as the thing
   being edited. */
.panel {
  border: 1px solid var(--hairline); border-radius: var(--r);
  padding: 14px 16px; margin-top: 16px; background: var(--surface-2);
}
.panel-title {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 10px;
}

/* Each week of the cycle gets its own heading and its own two buttons, because
   a week is a unit a provider builds. Inside the 36px week column there was no
   room for a confirmation that names what it is about to remove. */
.week-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 11px; background: var(--surface-2);
  border-top: 1px solid var(--hairline);
}
.calendar.cycle > .week-bar:first-of-type { border-top: 0; }
.week-bar strong { font-size: 0.79rem; }

/* ---------- chips: things you drag onto a day ---------- */

/* A rail of people or activities, above the grid they go onto. Each carries
   what it is short of — the question while building is "who still needs hours",
   and answering it in a tooltip means hovering thirteen names. */
.rail {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  padding: 11px 13px; margin-bottom: 11px;
  border: 1px solid var(--hairline); border-radius: var(--r);
  background: var(--surface-2);
}
.rail > .rail-label {
  flex: 1 1 100%; margin-bottom: 2px;
  font-size: 0.79rem; color: var(--ink-soft);
}
.rail.picking { border-color: var(--accent-deep); background: var(--accent-wash); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.chip, .staff-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  /* One chip, one line (granite#118). A name beside an hours badge and a lock
     is wider than the chip's natural width, and without this the contents wrap
     inside it — so one person in the list stood two rows tall and read as two
     people. The row of chips still wraps; the chip itself does not. */
  white-space: nowrap;
  /* ⚠️ And never wider than what holds it (granite#199). nowrap fixed the
     contents wrapping inside the chip, and gave it the opposite fault: a flex
     item does not shrink below its content, so "Fredrik Lundmark −120,35 t 🔒"
     ran straight out of the rail. The name is what gives, in .chip-name below
     — the hours and the lock are why anybody looks at the chip at all. */
  max-width: 100%;
  min-width: 0;
  padding: 6px 12px; border-radius: var(--r-pill); cursor: pointer;
  border: 1px solid var(--hairline-strong); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 0.79rem; font-weight: 600;
  user-select: none;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease), transform var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}
.chip:hover, .staff-chip:hover { border-color: var(--ink-faint); box-shadow: var(--shadow-1); }
.chip:active, .staff-chip:active { transform: scale(0.97); }
.staff-chip { cursor: grab; }
.staff-chip:active { cursor: grabbing; }

.chip-note, .chip .faint, .staff-chip .faint { font-weight: 500; color: var(--ink-faint); }

/* The one part of a chip allowed to be cut short. The whole name is in the
   chip's title, so nothing is lost — only shortened on screen. */
.chip-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* The badges never shrink: an hours figure with a digit missing is worse than
   no figure, and a half-drawn lock says nothing. */
.chip-note { flex: 0 0 auto; }

/* Short of contracted hours. */
.staff-chip.short { border-color: var(--accent-deep); color: var(--accent-ink); }

.chip.picked, .staff-chip.picked {
  border-color: var(--accent-deep); background: var(--accent-deep); color: var(--on-accent);
  box-shadow: var(--shadow-2);
}
.chip.picked .faint, .staff-chip.picked .faint, .chip.picked .chip-note {
  color: color-mix(in srgb, var(--on-accent) 78%, transparent);
}

/* The chip that starts something new rather than placing something that exists. */
.chip.new { border-style: dashed; color: var(--ink-soft); font-weight: 500; }

/* While something is picked, every day says it will take it. Drag highlights
   itself; a click needs to be told where it can land. */
.cal-day.awaiting-drop { cursor: copy; }
.cal-day.awaiting-drop:hover {
  box-shadow: inset 0 0 0 2px var(--accent-deep); background: var(--accent-wash);
}

/* ---------- unsaved work ---------- */

/* Follows the reader. The button at the top of the page is off screen by the
   time twenty-eight days have been built, and a generated cycle looks exactly
   like a stored one — so a whole cycle was built and lost in silence.
   ⚠️ Fixed, not sticky. Sticky does nothing for the last element on a page: its
   natural position IS the bottom, so it never has anywhere to stick to. */
.unsaved-bar {
  position: fixed; left: 0; right: 0;
  /* ⚠️ Above the tab bar, not on it. With bottom: safe-area it sat exactly
     where the tabs are and, at z-index 60, hid them — so a provider with an
     unsaved schedule lost the navigation, which is the moment they most want
     to check something on another screen (granite#197). */
  bottom: var(--bottom-bar);
  z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 20px calc(13px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--missing-line);
  background: color-mix(in srgb, var(--missing-wash) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.09);
}
.unsaved-bar .sentence { font-weight: 600; color: var(--missing); }

/* Keeps the bar from covering the last row of whatever it is watching. */
.unsaved-space { height: 78px; }

@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .unsaved-bar { background: var(--missing-wash); }
}

/* ---------- saving ---------- */

.save-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Under the button, where the click just happened — not at the top of a page
   the eye has already left. */
.saved { color: var(--attested); font-size: 0.85rem; font-weight: 600; }
.saved::before { content: "✓ "; }

/* ---------- confirming something destructive ---------- */

.confirm {
  display: inline-flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 8px 11px; border-radius: var(--r-sm);
  background: var(--conflict-wash); border: 1px solid var(--conflict-line);
}
/* The sentence on its own line, above the buttons (granite#117). Inside a menu
   the box is narrower than 42ch, so the text ran outside the red panel it was
   meant to sit in — a warning that overflows reads as a broken screen rather
   than as something to weigh. */
.confirm-what { font-size: 0.85rem; flex: 1 1 100%; max-width: 42ch; text-align: left; }

/* ---------- a list of rows ---------- */

/* A list, not a table. A table row that carries every setting for every person
   has no rows left to line up, and on a phone it stops being a table at all. */
.people { list-style: none; margin: 0; padding: 0; }
.people > li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 2px;
}
.people > li + li { border-top: 1px solid var(--hairline); }
.people > li > :first-child { flex: 1 1 220px; min-width: 0; }
.people li.left { opacity: 0.55; }
.people li.editing { box-shadow: inset 3px 0 0 var(--accent-deep); background: var(--accent-wash); }

.people .person {
  display: grid; align-items: center; gap: 4px 16px;
  grid-template-columns: minmax(140px, 1.2fr) minmax(160px, 1.3fr) 2fr auto;
  padding: 12px 6px; text-decoration: none; color: inherit;
  border-radius: var(--r-sm);
  transition: background-color var(--fast) var(--ease);
}
.people .person:hover { background: var(--surface-hover); }

.people .person-name { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.people .person-roles { display: flex; gap: 6px; flex-wrap: wrap; }
.people .person-go { white-space: nowrap; font-size: 0.85rem; color: var(--accent-ink); }
/* An email address is longer than the phone number this column was sized for. */
.people .person-number { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A row that is itself a link to somewhere. */
.row-link {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 12px; margin: 0 -12px;
  text-decoration: none; color: inherit; border-radius: var(--r);
  transition: background-color var(--fast) var(--ease);
}
.row-link:hover { background: var(--surface-hover); }
.row-link .row-go { margin-left: auto; color: var(--ink-faint); font-size: 1.1rem; }

@media (max-width: 720px) {
  /* Stacked, because four columns on a phone is four columns of nothing. */
  .people .person {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name go"
      "number go"
      "roles roles";
  }
  .people .person-name   { grid-area: name; }
  .people .person-number { grid-area: number; }
  .people .person-roles  { grid-area: roles; margin-top: 4px; }
  .people .person-go     { grid-area: go; align-self: center; }
}

/* ---------- links and quiet buttons ---------- */

.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  text-decoration: none; margin-bottom: 6px;
  font-size: 0.85rem; color: var(--ink-soft);
}
.back-link:hover { color: var(--ink); text-decoration: underline; }

/* Text that opens something, without looking like a button in a list of them. */
.linklike {
  appearance: none; border: 0; background: none; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-align: left;
}
.linklike:hover { text-decoration: underline; }

/* Present for a screen reader, absent for the eye. Used where the page has a
   name it does not need to draw. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- the schedule workbench ---------- */

/* The bar that follows the reader down a four-week grid: who this is, which
   version, which tab, and whether what is on screen is what is stored. */
.sched-head {
  position: sticky; top: var(--chrome-top); z-index: 45;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; margin: -22px -20px 16px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--glass-line);
}
.sched-head h1 { font-size: 1.15rem; }

/* A refusal on its own line inside the sticky bar, so it travels with the button
   that produced it (granite#201). `flex-basis: 100%` is what breaks the line;
   without it the sentence squeezes in beside the tabs and gets three words wide. */
.sched-head .head-note {
  flex: 1 0 100%;
  margin: 0;
  padding: 8px 11px;
}


/* Whose schedule this is, as a switch (granite#76). The names read as the
   heading they replace — larger and heavier than the tabs beside them, so the
   two segmented controls are not mistaken for one. */
.who-switch > button { font-size: 0.98rem; font-weight: 600; padding-inline: 14px; }

/* Mina · Alla on the assistant's schedule (granite#77). Two links that look like
   one switch, because they are one schedule read two ways. */
.scope {
  display: inline-flex; gap: 2px; padding: 3px; margin-top: 10px;
  border-radius: var(--r-pill); background: var(--surface-3);
}
.scope a {
  padding: 6px 18px; border-radius: var(--r-pill);
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.875rem; text-align: center;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.scope a:hover { color: var(--ink); }
/* Filled like .segmented (granite#287) — the white pill on grey left Hans
   unsure these were toggles at all. */
.scope a[aria-current="page"] { background: var(--accent-deep); color: var(--on-accent); box-shadow: var(--shadow-1); }
/* Each choice its own soft surface on the trough (Hans, 2026-10-06): with only
   the chosen one filled, the other two ran together as one long grey field. */
.scope { gap: 4px; }
.scope a:not([aria-current="page"]) { background: var(--surface); }
.segmented > button:not([aria-pressed="true"]) { background: var(--surface); }
@media (max-width: 640px) {
  .scope { display: flex; }
  .scope a { flex: 1 1 0; padding-block: 9px; }
}
.crumb { color: var(--ink-faint); font-size: 0.85rem; text-decoration: none; }
.crumb:hover { color: var(--ink); }

.vchip {
  display: inline-flex; align-items: center; gap: 6px;
  appearance: none; padding: 5px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--hairline-strong); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 0.83rem; font-weight: 500; cursor: pointer;
}
.vchip::after { content: "▾"; color: var(--ink-faint); font-size: 0.75rem; }

.save-state { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--attested); display: inline-block; }
.dot.unsaved { background: var(--missing); }

.workbench { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }

/* ---------- a page catching up with its own address ----------

   ⚠️ The delay is the point. A load that lands in under a fifth of a second
   never dims at all, so changing month or service user looks instant instead of
   blinking; only a wait long enough to wonder about shows anything. Coming back
   has no delay, so the moment the figures are there the page is bright again.

   One rule for every screen that does this. Written per page it became four
   slightly different waits, which is how two screens end up disagreeing about
   what waiting looks like. */
[data-settles] { transition: opacity 120ms ease 0ms; }

[data-settles="waiting"] {
  opacity: .45;
  pointer-events: none;
  transition: opacity 140ms ease 200ms;
}

@media (prefers-reduced-motion: reduce) {
  [data-settles] { transition: none; }
}
.rail-col { position: sticky; top: calc(var(--chrome-top) + 66px); display: flex; flex-direction: column; gap: 12px; }
.rail-col .card { padding: 12px 13px; margin: 0; }
.rail-col.picking .card { border-color: var(--accent-deep); }
.rail-title {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 8px;
}
.hint { font-size: 0.79rem; color: var(--ink-faint); margin: 6px 0 0; }
.work { min-width: 0; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.strip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 10px; font-size: 0.83rem;
  border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--surface-2);
}
.strip .ok { color: var(--attested); font-weight: 600; }
.strip .warnt { color: var(--missing); font-weight: 600; }
.strip .badt { color: var(--conflict); font-weight: 600; }

.chip.small { padding: 3px 9px; font-size: 0.75rem; }
.cal-entry .lock { font-size: 0.62rem; opacity: 0.7; margin-left: 3px; }

/* ---------- popover ---------- */

/* Rendered inside the element it belongs to; that element is the anchor. */
.anchor { position: relative; }
.anchor.block { display: block; }

.pop-backdrop {
  position: fixed; inset: 0; z-index: 69;
  appearance: none; border: 0; background: transparent; cursor: default;
}
.pop {
  position: absolute; z-index: 70; top: calc(100% + 6px); left: 0;
  width: 340px; max-width: calc(100vw - 32px);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3); padding: 14px 16px;
  text-align: left; font-size: 0.92rem; font-weight: 400; cursor: default;
  animation: pop var(--base) var(--ease);
}
.pop:where(.wide) { width: 440px; }
.pop:where(.menu) { width: auto; min-width: 220px; padding: 6px; }
:where(.anchor.flip) > .pop,
:where(.anchor.flip .anchor) > .pop { left: auto; right: 0; }
.pop:where(.below) { top: calc(100% + 8px); }
/* Flipped above the anchor when there is more room there, and capped to the
   viewport with an inner scroll only when it is taller than the screen — set by
   granitePopover.fit (granite#259). */
.pop:where(.up) { top: auto; bottom: calc(100% + 6px); }
.pop:where(.capped) { overflow-y: auto; overscroll-behavior: contain; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.pop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pop-head h3 { flex: 1 1 auto; min-width: 0; }
.pop .field { margin-bottom: 10px; }
.pop .form-grid { margin-bottom: 8px; }
.pop-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hairline);
}
.pop .fill-option { border-top: 1px solid var(--hairline); padding-top: 10px; margin-top: 10px; display: flex; gap: 12px; align-items: flex-start; }
.pop .fill-who { flex: 1 1 auto; }
.pop .fill-who li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }

.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  appearance: none; border: 0; background: none; text-align: left;
  font: inherit; font-size: 0.875rem; color: var(--ink);
  padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap;
}
.menu-item:hover { background: var(--surface-hover); }
.menu-item.static { cursor: default; }
.menu-item.static:hover { background: none; }
.menu-item .k { margin-left: auto; color: var(--ink-faint); font-size: 0.75rem; padding-left: 14px; }
.pop.menu hr { border: 0; border-top: 1px solid var(--hairline); margin: 5px 0; }

@media (max-width: 900px) {
  .workbench { grid-template-columns: 1fr; }
  .rail-col { position: static; }
  .sched-head { margin: -16px -14px 14px; }
  /* Menus size to their own items; only the wide boxes are capped. */
  .pop:where(:not(.menu)) { width: min(440px, calc(100vw - 32px)); }
}

/* A box opened from a control at the right edge of a toolbar. */
:where(.anchor) > .pop:where(.flip-self) { left: auto; right: 0; }
.cal-entry .lock { font-size: 0.62rem; opacity: 0.75; margin-left: 3px; }

/* ---------- one person, in sections ---------- */

.person-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; }
.toc { position: sticky; top: calc(var(--chrome-top) + 12px); display: flex; flex-direction: column; gap: 2px; }
.toc button {
  appearance: none; border: 0; background: none; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink-soft); font-size: 0.875rem;
  padding: 6px 10px; border-radius: var(--r-sm);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.toc button:hover { background: var(--surface-3); color: var(--ink); }

.sect { padding: 18px 0; border-top: 1px solid var(--hairline); scroll-margin-top: 70px; }
.sect:first-child { border-top: 0; padding-top: 0; }
.sect h2 { margin-bottom: 4px; }
.sect .lead { color: var(--ink-soft); font-size: 0.875rem; margin: 0 0 12px; max-width: 68ch; }

/* Label to the left, control to the right — the shape a settings pane has. */
/* Against contract (granite#91): one block per service user, granted against
   what the schedule lays out. */
.contract-users { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.contract-user {
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--r); padding: 10px 12px;
}
.contract-user h3 { margin: 0 0 6px; font-size: 1.02rem; }
.contract-user dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; margin: 0; font-size: 0.875rem; }
.contract-user dt { color: var(--ink-soft); }
.contract-user dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.rows { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px 16px; align-items: center; }
.rows .lbl { font-size: 0.875rem; color: var(--ink-soft); }
.opts { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; }

.radio { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; cursor: pointer; min-height: 36px; user-select: none; }
.radio input[type="radio"] {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%;
  border: 1.5px solid var(--hairline-strong); background: var(--surface); cursor: pointer;
  transition: border-color var(--fast) var(--ease), border-width var(--fast) var(--ease);
}
.radio input[type="radio"]:hover { border-color: var(--ink-faint); }
.radio input[type="radio"]:checked { border-color: var(--accent-deep); border-width: 6px; }

/* Follows the window, not the page. */
.savebar {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; margin: 18px -20px -20px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--hairline);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

@media (max-width: 720px) {
  .person-layout { grid-template-columns: 1fr; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .rows { grid-template-columns: 1fr; gap: 6px; }
  .rows .lbl { margin-top: 6px; }
  .savebar { margin: 16px -16px -16px; padding: 12px 16px; bottom: calc(60px + env(safe-area-inset-bottom)); }
}

/* ---------- the month board: reporting ---------- */

.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 14px; margin-bottom: 12px; font-size: 0.875rem;
  border: 1px solid var(--conflict-line); border-left: 3px solid var(--conflict);
  border-radius: var(--r-sm); background: var(--conflict-wash);
}
.banner .sentence { font-weight: 600; color: var(--conflict); flex: 1 1 240px; }

.su { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 12px; }
.su .card { margin: 0; padding: 14px 16px; cursor: pointer; transition: box-shadow var(--fast) var(--ease); }
.su .card:hover { box-shadow: var(--shadow-2); }
.su .card.on { box-shadow: inset 0 0 0 2px var(--accent-deep), var(--shadow-1); }
.su .meter { margin: 4px 0 8px; }
.figs { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.79rem; color: var(--ink-soft); }
.figs b { display: block; color: var(--ink); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }

/* A cell is a button now: it opens on what is behind it. */
button.cell { appearance: none; padding: 0; font-family: inherit; cursor: pointer; transition: transform var(--fast) var(--ease); }
button.cell:hover { transform: scale(1.12); }
.cell.editing { box-shadow: 0 0 0 2px var(--accent-deep); }
:where(.board td.anchor) .pop { top: calc(100% + 4px); }
/* ⚠️ Desktop only. Below 720px this switched off the scroll container while a
   popover was open: scrollLeft reset to 0, the 744px table spilled out of the
   card into page-level scroll, and the popover — absolute inside the cell —
   landed off the right edge for any day past about the tenth. On a phone the
   popover becomes a sheet instead, and the board keeps scrolling
   (granite#160). */
@media (min-width: 721px) {
  .board-scroll:has(.pop:not(.fixed)) { overflow: visible; }
}
.cell-shift + .cell-shift { border-top: 1px solid var(--hairline); padding-top: 8px; margin-top: 8px; }

/* ---------- an assistant's own days ---------- */

.day-card { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; }
.day-date { text-align: center; min-width: 40px; }
.day-date .day-num { display: block; font-size: 1.35rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.day-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.day-shift { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.day-shift strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* The reader's own shift, on the whole schedule. Quiet — the point of that
   screen is everybody else. */
.cal-entry.mine { box-shadow: inset 0 0 0 1px var(--accent-deep); }

/* ---------- the phone tab bar ---------- */

/* Not shown at all above 720px, where the top bar has room for every
   destination. Below it, the top bar keeps the mark and the account and the
   navigation moves down to where a thumb is.
   ⚠️ The third and last translucent element in this file. */
/* Reporting a fault, from every page (granite#241).
 *
 * 🔴 Fixed, because the furniture it could otherwise live in is not the same on
 * both layouts: the side menu is hidden on a phone and the top bar is hidden on
 * a laptop after sign-in. A trigger in either one means "on every page unless
 * you are holding the other device".
 *
 * ⚠️ Above the bottom bar on a phone, where the tab bar is. A button underneath
 * it is a button that cannot be pressed on the device the assistants use. */
.fault-open {
  position: fixed; right: 16px; z-index: 56;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong);
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px);
  color: var(--ink-faint); font: inherit; font-size: 0.8rem; cursor: pointer;
}
.fault-open:hover { color: var(--ink); border-color: var(--ink-faint); }
.fault-open svg { width: 15px; height: 15px; }

/* Quiet until it is needed: a permanent label beside every screen's own heading
 * competes with the work. The icon stays, and the name arrives on hover and for
 * anything reading the page out. */
@media (max-width: 900px) {
  .fault-open-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .fault-open { padding: 8px; }
}

.fault-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(8, 6, 7, 0.45);
}

/* ⚠️ Deliberately not full screen. The page being reported has to stay visible
 * behind it — that is the whole reason this is a dialog and not the page it
 * used to be. */
.fault-dialog {
  position: fixed; z-index: 91;
  right: 16px; left: auto; width: min(420px, calc(100vw - 32px));
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  max-height: calc(100vh - 120px); overflow: auto;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3); padding: 16px 18px;
  animation: pop var(--base) var(--ease);
}

@media (max-width: 720px) {
  .fault-dialog {
    left: 16px; right: 16px; width: auto;
    max-height: calc(100vh - var(--bottom-bar) - 80px);
  }
}

.tabbar { display: none; }

@media (max-width: 720px) {
  :root { --bottom-bar: calc(60px + env(safe-area-inset-bottom, 0px)); }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    display: flex; justify-content: space-around; align-items: stretch;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--glass-line);
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
  }

  .tabbar a, .tabbar button {
    appearance: none; border: 0; background: none;
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; border-radius: var(--r-sm);
    text-decoration: none; color: var(--ink-faint);
    font: inherit; font-size: 0.67rem; font-weight: 600; cursor: pointer;
    transition: color var(--fast) var(--ease);
  }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a, .tabbar button { position: relative; }
  .tabbar a[aria-current="page"], .tabbar button.open { color: var(--accent-ink); }

  /* How many shifts are waiting, on the Intyga tab. Solid rather than washed,
     because at this size a tinted number disappears into the bar behind it. */
  .tab-count {
    position: absolute; top: 2px; left: calc(50% + 6px);
    min-width: 16px; padding: 0 5px; border-radius: var(--r-pill);
    background: var(--missing); color: var(--on-missing);
    font-size: 0.62rem; font-weight: 700; line-height: 16px; text-align: center;
  }
  .tabbar a:active, .tabbar button:active { color: var(--ink); }
  .tabbar .tab-label {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* Everything that did not fit, opened from "Mer". A sheet from the bottom,
     which is where it was tapped. */
  .more-sheet {
    /* ⚠️ Above the tab bar, not over it. Covering the bar hides the Mer button
       that opened this — so the way out of the menu is the one thing the menu
       is sitting on (granite#197). Found by the test, not by anybody using it,
       which is the point of testing the class rather than the case. */
    position: fixed; left: 0; right: 0; bottom: var(--bottom-bar); z-index: 56;
    background: var(--surface);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: var(--shadow-3);
    padding: 10px 14px calc(84px + env(safe-area-inset-bottom));
    animation: sheet-up var(--base) var(--ease);
  }
  /* The desk's menu at thumb size: the same groups and items, taller rows. It
     scrolls on its own if a short phone cannot show all of it. */
  .more-sheet { max-height: calc(100dvh - 24px); overflow-y: auto; }
  .more-sheet .nav-group { padding: 14px 10px 4px; }
  .more-sheet .nav-item { padding: 12px 10px; font-size: 1rem; }
  .more-sheet .nav-item svg { width: 20px; height: 20px; }
  .more-scrim {
    position: fixed; inset: 0; z-index: 54;
    background: rgba(0, 0, 0, 0.28);
    border: 0; padding: 0; width: 100%;
  }

  @keyframes sheet-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  /* A phone has no room for a column beside the page. The menu goes, the top
     bar comes back with the mark and the account, and the destinations are
     in the tab bar. */
  .frame:has(> .sidebar) { display: block; }
  .sidebar { display: none; }
  .frame:has(> .sidebar) .topbar { display: flex; }
  /* Room for the fault report button, which is fixed in this corner and sat
     on top of "Logga ut" (granite#252). The button is 33px wide at this size;
     the rest is the gap between them. */
  .frame:has(> .sidebar) .topbar { padding-right: 64px; }
}

/* The file's own words, not ours (granite#111). Quoted and in the reader's
   text colour so the heading reads as a quotation rather than as a second
   language in our own sentence. */
.quoted { color: var(--ink); font-style: normal; }

/* ---------- how far off contract (granite#119) ---------- */

/* Three readings, not one. Somebody scanning a column needs to know at a glance
   whether a figure is fine, worth watching, or worth acting on — and before this
   the only colour was for a shortfall, so every other row read as unremarkable
   whether it was on contract or well over it. */
.who.on-contract { color: var(--attested); }
.who.near-contract { color: var(--missing); }
.who.under-contract { color: var(--conflict); font-weight: 600; }

/* ---------- the board's key (granite#102) ---------- */

/* Below the grid, folded away. What it explains is three rows of colour that
   somebody learns in a week, so it must not sit on top of the thing being
   learnt. */
.key { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }

.key-toggle {
  appearance: none; border: 0; background: none; cursor: pointer; font: inherit;
  font-size: 0.79rem; color: var(--ink-faint); padding: 4px 0;
  display: inline-flex; align-items: center; gap: 6px;
}
.key-toggle:hover { color: var(--ink); }
.key-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-xs); }
.key-toggle .chev { display: inline-block; transition: transform var(--fast) var(--ease); }
.key-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }

.key-group { margin-top: 10px; }
.key-group h4 {
  margin: 0 0 5px; font-size: 0.67rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
}

.key-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.key-item { display: inline-flex; align-items: center; gap: 7px; font-size: 0.79rem; color: var(--ink-soft); }

/* The squares in the key are real board squares and must not react to a pointer
   the way the grid's do — there is nothing behind them to open. */
.key-item .cell { cursor: default; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .key-toggle .chev { transition: none; }
}

/* ---------- the manual (granite#98) ---------- */

.manual { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; align-items: start; }

.manual-toc {
  position: sticky; top: calc(var(--chrome-top) + 12px);
  display: flex; flex-direction: column; gap: 1px;
}

.manual-toc-head {
  font-size: 0.67rem; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; padding: 4px 8px 6px;
}

.manual-link {
  appearance: none; border: 0; background: none; text-align: left; cursor: pointer;
  font: inherit; font-size: 0.875rem; color: var(--ink-soft);
  padding: 6px 8px; border-radius: var(--r-sm);
}
.manual-link:hover { background: var(--surface-hover); color: var(--ink); }

.manual-section {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r); padding: 18px 20px; margin-bottom: 12px;
  /* Cleared by the sticky chrome when the contents list scrolls to it. */
  scroll-margin-top: calc(var(--chrome-top) + 16px);
}

.manual-section h2 { margin: 0 0 8px; font-size: 1.05rem; }
.manual-section p { margin: 0 0 10px; color: var(--ink-soft); max-width: 62ch; }

.manual-note {
  border-left: 3px solid var(--accent); background: var(--accent-wash);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 9px 12px; margin-top: 12px; font-size: 0.875rem;
}

@media (max-width: 720px) {
  .manual { grid-template-columns: 1fr; gap: 12px; }
  /* Sticky is for a column beside the text. Above it, it would cover the text. */
  .manual-toc { position: static; }
}

/* ---------- the question mark (granite#97) ---------- */

/* Quiet until looked for. It sits beside a heading or a label and must not
   compete with it, so it borrows the faint ink and only takes the accent once
   it is the thing being read. */
.help-mark {
  appearance: none; cursor: pointer; font: inherit;
  width: 17px; height: 17px; padding: 0; margin-left: 6px;
  border-radius: 50%; border: 1px solid var(--hairline-strong);
  background: var(--surface-2); color: var(--ink-soft);
  font-size: 0.67rem; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: 1px; flex: none;
}

.help-mark:hover {
  background: var(--accent-wash); color: var(--accent-ink); border-color: var(--accent);
}

.help-mark[aria-expanded="true"] {
  background: var(--accent-deep); border-color: var(--accent-deep); color: var(--on-accent);
}

/* The mark is inline in a heading; the box it opens is not. */
.help-mark + .pop-backdrop + .pop { font-weight: 400; }

/* ---------- the guided tour (granite#96) ---------- */

/* The hole. One enormous shadow dims everything except the thing being
   explained — cheaper and steadier than four rectangles around it, and it
   follows the target with one transition instead of four. Fixed, because the
   measurement it is given is against the viewport. */
.tour-hole {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  border-radius: var(--r);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(8, 10, 13, 0.62);
  transition: top var(--base) var(--ease), left var(--base) var(--ease),
              width var(--base) var(--ease), height var(--base) var(--ease);
}

.tour-card {
  position: fixed;
  z-index: 201;
  width: min(320px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r);
  padding: 15px 16px 13px;
  box-shadow: 0 20px 48px -16px rgba(0, 0, 0, 0.5);
  transition: top var(--base) var(--ease), left var(--base) var(--ease);
}

.tour-card h2 { margin: 0 0 5px; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.tour-card p { margin: 0 0 12px; font-size: 0.875rem; color: var(--ink-soft); }
/* Two rows, always: where you are on one, where you can go on the other. Four
   things on one line fits in English and breaks in Swedish — "Tillbaka" and
   "Inte nu" beside a counter wrapped to three lines each. The spacer is the
   break rather than a second element, so the markup stays one row. */
.tour-foot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tour-foot .spacer { flex: 1 0 100%; height: 0; }
.tour-step { font-size: 0.75rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.tour-dots { display: flex; gap: 4px; }
.tour-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--hairline-strong); }
.tour-dots span.on { background: var(--accent-deep); }

/* Never in the way of what it is pointing at. On a phone the card sits at the
   bottom, where it cannot cover a menu item being explained. */
@media (max-width: 640px) {
  .tour-card {
    left: 16px !important;
    right: 16px;
    top: auto !important;
    bottom: calc(80px + env(safe-area-inset-bottom));
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-hole, .tour-card { transition: none; }
}

/* ---------- phone ---------- */

@media (max-width: 640px) {
  .shell { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .card { padding: 16px; border-radius: var(--r); }
  .deadline .count { font-size: 2.4rem; }

  /* A thumb, not a pointer. Worth the extra height only where that is true. */
  .choice, .btn, .input, input.choice, select.choice { min-height: 44px; }
  .btn { padding: 11px 18px; }
  /* Two to a row, and the last of an odd number is the same size as the
     rest. Left to grow it filled the whole row and read as a different kind
     of choice. */
  .choice { flex: 1 1 44%; max-width: calc(50% - 5px); justify-content: center; }
  .btn.small { min-height: 34px; }
  .segmented { width: 100%; }
  .segmented > button { flex: 1 1 0; justify-content: center; min-height: 38px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .field.wide, .form-grid .field:has(input:not([type])) { grid-column: 1 / -1; }
}

@media print {
  .topbar, .tabbar, .sidebar, .btn, .unsaved-bar, .open-signin-banner, .setup-banner { display: none; }
  .frame:has(> .sidebar) { display: block; }
  body { background: #fff; }
  .card, .sheet { box-shadow: none; border-color: #999; break-inside: avoid; }
  .shell { padding: 0; max-width: none; }
}

/* Signing a form (granite#137).
   The preview is the generated PDF itself, tall enough to read a page of rather
   than to glance at — the reading is what gives the signature its meaning. */
/* The form to read before signing, one image per page.
   ⚠️ Not an embedded PDF: iOS Safari draws page one of one in an iframe and
   stops, and the record of hours is on page two (granite#149). A scroll box
   rather than the whole page inline, so the signing pad stays within reach of
   the thumb on a phone. */
.form-pages {
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r);
    background: var(--surface);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
}

.form-pages img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-xs);
}

/* Roughly the proportions of the box on the form, so what is drawn here needs
   little stretching to land there. touch-action: none is not optional — without
   it a finger scrolls the page instead of drawing, on every phone. */
.signing-pad {
    display: block;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 4 / 1;
    border: 1px solid var(--hairline-strong);
    border-bottom-width: 2px;
    border-radius: var(--r);
    background: var(--surface);
    color: var(--ink);
    touch-action: none;
    cursor: crosshair;
}

@media (max-width: 620px) {
    .form-pages { max-height: 50vh; }
}

/* Signing in (granite#145).
   ⚠️ min(), not a flat 420px. An iPhone viewport is 390px wide, so a card fixed
   at 420 ran off the right edge and the fields with it — the first thing anybody
   sees of this system, on the device the assistants use. The margin keeps a
   gutter at every width. */
.signin-card {
    max-width: min(420px, 100%);
    margin: 40px auto;
}

@media (max-width: 480px) {
    .signin-card { margin: 20px auto; }
}

/* Two classes pages asked for and the stylesheet never defined (granite#156). */

/* The manual's column. Held to a reading measure rather than the card's width —
   the help text is prose, and prose set to 900px is not read. */
.manual-body {
    max-width: 62ch;
}

/* "Ladda om" in the crash bar. It sits on a yellow strip that is not on the
   token palette, so the colour is inherited rather than set. */
.reload {
    margin-left: 10px;
    font-weight: 600;
    text-decoration: underline;
}


/* ---------- popovers on a phone (granite#160, widened in granite#197) ------ */
@media (max-width: 720px) {
  /* A popover becomes a bottom sheet, the shape .more-sheet already uses. Fixed
     to the viewport, so where the thing it belongs to sits — in a wide scrolling
     table, or near the right edge — stops mattering.

     ⚠️ EVERY .pop, not just the board's. This said `.board td.anchor .pop` and
     so described one screen when it meant one screen size: Grundschema and the
     schedule view kept an absolutely positioned popover anchored to whatever was
     clicked, and for anything past the middle of the week it opened half outside
     the phone (granite#197). The board worked, which is why it went unnoticed —
     the rule was right and its selector was a sample.

     Taller than the sheet? It scrolls inside itself. A dialog that runs past the
     bottom of a phone is a dialog with an unreachable Save button.

     🔴 A MEDIA QUERY ADDS NO SPECIFICITY (granite#201). `.pop.below` is two
     classes and this is one, so `top: calc(100% + 8px)` kept winning here — and
     on a FIXED box `100%` is the viewport, not the anchor, so the Generera and
     Töm menus in Grundschema opened 8px below the bottom of the screen. With
     `bottom` also set the box was over-constrained into zero height: a menu that
     was open, focusable, and invisible. `.board td.anchor .pop` did the same to
     the board's day popover.

     The fix is not more overrides — it is that EVERY geometry rule for `.pop`
     is written at exactly one class (`.pop:where(.below)`, not `.pop.below`), so
     this block, being last, always wins. OneSheetWinsOnPhonesTests enforces it,
     because the next variant somebody adds will otherwise reintroduce the bug
     silently and only on a phone. */
  .pop {
    position: fixed;
    left: 0; right: 0; bottom: var(--bottom-bar); top: auto;
    width: auto; max-width: none;
    max-height: calc(100dvh - var(--bottom-bar) - 72px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
  }

  /* Nothing else needed: the flip rules, `.below`, `.wide`, `.menu` and the
     board's own offset are all written at one class of specificity above, so
     the four lines in this block override every one of them by source order. */
}

@media (max-width: 640px) {
  /* 22px is half a touch target. 31 days at 30px scrolls inside the card,
     which is what the scroll container is for. */
  .cell { width: 28px; height: 28px; line-height: 26px; font-size: 0.75rem; }
}

/* ---------- the signing pad (granite#160) ---------- */
@media (max-width: 640px) {
  /* 4:1 on a 390px screen is about 82px of height — cramped for a finger. */
  .signing-pad { aspect-ratio: 5 / 2; }
}

/* A line to sign on, and a mark where one starts, the way a paper form has
   both. Drawn in the background so the canvas above it stays untouched. */
.signing-pad {
  background-image:
    linear-gradient(to right, var(--hairline-strong) 0 6px, transparent 6px),
    linear-gradient(to right, transparent 0 24px, var(--hairline) 24px);
  background-repeat: no-repeat;
  background-position: 18px 72%, 0 72%;
  background-size: 100% 1px, 100% 1px;
}

/* ---------- the board, reordered (granite#160) ---------- */

/* The service users as a strip to choose with, above the grid. What were cards
   of up to nine lines each, standing between the countdown and the instrument. */
.su-strip { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.su-pick {
  flex: 1 0 auto; min-width: 200px; text-align: left; cursor: pointer;
  display: grid; gap: 6px; padding: 10px 13px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--r);
  font: inherit;
}
.su-pick:hover { background: var(--surface-hover); }
.su-pick.on { border-color: var(--accent-deep); box-shadow: inset 3px 0 0 var(--accent-deep); }
.su-pick .nm { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.95rem; }
.su-pick .nm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.su-pick .meter { margin: 0; }

/* ---------- the service users on a phone (granite#195) --------------------

   ⚠️ `flex: 1 0 auto; min-width: 200px` meant each card was at least 200px and
   never shrank, so two of them were wider than a phone and the second was cut
   off at the edge — the strip scrolled sideways and nothing said so. The name
   and its status pill sitting side by side is what made a card that wide.

   So on a phone they stack: name on one line, status under it. Two service
   users then share the screen. With more than three the strip still scrolls,
   which is correct — at that point there is genuinely more than fits. */
@media (max-width: 720px) {
  .su-pick {
    flex: 1 1 140px;
    min-width: 140px;
    padding: 9px 11px;
  }

  .su-pick .nm {
    display: grid;
    justify-items: start;
    gap: 3px;
    font-size: 0.92rem;
  }

  /* The pill stops being pushed to the right: there is no right any more. */
  .su-pick .nm .push { margin-left: 0; }
}

/* A disclosure that reads as one, and matches the key's toggle. */
.fold {
  font: inherit; font-size: 0.83rem; font-weight: 600; cursor: pointer;
  background: transparent; border: 0; color: var(--accent-deep); padding: 2px 0;
}
.fold::after { content: " ›"; display: inline-block; transition: transform var(--fast) var(--ease); }
.fold[aria-expanded="true"]::after { transform: rotate(90deg); }

.hidden { display: none; }

/* The problem sentence, named rather than written out with inline colour in
   five places on this screen. */
.line-conflict { color: var(--conflict); font-weight: 600; }
.line-missing { color: var(--missing); font-weight: 600; }

/* --- foldable settings cards (granite#179, restyled granite#181) ---------- */

/* A card that folds is still a card. It keeps .card's radius, border and
   shadow untouched; only the padding moves inward, onto the head and the body,
   so the whole heading row — not a word in the middle of it — is the hit area.
   The first version dropped the radius by pulling the padding off the card and
   letting a square hover fill run to the edges: it read as a list row, not as
   the cards on every other page (Hans 2026-09-24). */
.foldcard { padding: 0; }

.fold-head {
  width: 100%;
  appearance: none;
  background: none;
  border: 0;
  /* Same shape as the card, so the hover fill stays inside the corners and the
     head alone is the card while it is folded. */
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: background var(--fast) var(--ease);
}

/* Open, the body carries the bottom corners. */
.foldcard.open .fold-head { border-radius: var(--r-lg) var(--r-lg) 0 0; }

.fold-head:hover { background: var(--surface-2); }
.fold-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* One glyph that turns, in a token of its own, rather than two characters
   swapping: the movement is what says the card opened. */
.fold-mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1;
  transition: transform var(--fast) var(--ease);
}
.foldcard.open .fold-mark {
  transform: rotate(90deg);
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* An <h2>, weighted and sized like every other card's heading. */
.fold-name { flex: 0 0 auto; }

/* Takes the slack, so the warning sits hard right whatever the summary says. */
.fold-summary {
  flex: 1 1 auto;
  color: var(--ink-faint);
  font-size: 0.86rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fold-body { padding: 18px 20px 20px; border-top: 1px solid var(--hairline); }

@media (prefers-reduced-motion: reduce) {
  .fold-mark { transition: none; }
}

/* At phone width the summary would squeeze the name to nothing, so it drops to
   its own line and the warning keeps its place beside the name. */
@media (max-width: 620px) {
  .fold-head { flex-wrap: wrap; row-gap: 6px; padding: 16px; }
  .fold-summary { flex-basis: 100%; order: 3; padding-left: 34px; white-space: normal; }
  .fold-body { padding: 16px; }
}

/* --- the front door (granite#189) -----------------------------------------

   ⚠️ This page is static server-rendered, on purpose: signing in writes a
   cookie and a cookie needs a real HTTP response. So the background grid is
   rendered in Razor rather than built by script — no flash of an empty page,
   and it works with scripting off. */

/* ⚠️ One column now. The page carried two — an explanation on the left, the
   card on the right — until the copy moved out to a public site (granite#193).
   Everybody who reaches this page already has an account, so the card is the
   whole page and is centred rather than pushed to one side. */
.door {
  position: relative;
  min-height: calc(100vh - 80px);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 30px;
  max-width: 1120px;
  margin: 0 auto;
  padding-block: 56px;
}

/* ⚠️ Every control in the card is the same width, stated here rather than left
   to each element's own default (granite#194). On a phone the address field
   came out narrower than the button below it, which reads as a mistake — and
   the two measure identically in a desktop browser, so it is a user-agent rule
   that only shows up on the device. Saying it outright costs three lines and
   does not depend on working out which rule. */
.signin-card .field input,
.signin-card .btn {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  box-sizing: border-box;
}

/* The day grid from FK 3059: 31 rows, one per day of the month, shifts lit.
   The most characteristic shape in this domain, and the one pattern that could
   not sit on anybody else's sign-in page. */
.door-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-auto-rows: 1fr;
  pointer-events: none;
  /* ⚠️ A background, not a band across the top. It was masked to a wedge at the
     top of the page and stopped before the card, so it read as a decoration
     that had run out rather than as something the card sits on (granite#194).
     It now covers the page and fades only at the very edges — including behind
     the card, which is where it was asked to be. */
  -webkit-mask-image: radial-gradient(135% 115% at 50% 38%, #000 0%, #000 52%, transparent 92%);
  mask-image: radial-gradient(135% 115% at 50% 38%, #000 0%, #000 52%, transparent 92%);
}
.door-grid i {
  border-right: 1px solid var(--door-line);
  border-bottom: 1px solid var(--door-line);
}
.door-grid i.on { background: var(--door-fill); }
.door-grid i.shift { background: var(--door-fill); box-shadow: inset 0 0 0 1px var(--door-edge); }

/* ⚠️ Direct children only, and the grid is deliberately NOT one of them. It
   lived inside .door at first and broke twice over: it took a grid cell, which
   pushed the card to a second row, and this rule gave it position:relative,
   which cancelled its own position:fixed and shrank it to a strip. */
.door > * { position: relative; z-index: 1; }

.door-mark {
  display: inline-flex; align-items: center; gap: 11px;
  font-weight: 640; font-size: 1.12rem; letter-spacing: -.017em;
  margin-bottom: 40px;
}
.door-mark .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent-deep); box-shadow: 0 0 0 4px var(--accent-wash);
}

.door h1 {
  margin: 0 0 18px;
  font-size: clamp(2.05rem, 4.6vw, 3.1rem);
  line-height: 1.04; letter-spacing: -.033em; font-weight: 660;
  text-wrap: balance; max-width: 13ch;
}
.door-lead { margin: 0 0 40px; font-size: 1.06rem; color: var(--ink-soft); max-width: 44ch; }

.door-does { list-style: none; margin: 0; padding: 0; display: grid; gap: 15px; max-width: 42ch; }
.door-does li { display: flex; align-items: center; gap: 14px; }
.door-does b { font-weight: 600; }
.door-does span { color: var(--ink-soft); }
.door-ic {
  flex: 0 0 auto; width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--hairline);
  color: var(--accent-deep);
}
.door-ic svg { display: block; }

/* The one thing the eye should land on: the only element here with a shadow. */
.door .signin-card { margin: 0; width: 100%; max-width: 430px; }

@media (max-width: 900px) {
  .door { gap: 26px; padding-block: 32px; min-height: 0; }
  .door .signin-card { max-width: none; }
  /* The same on a phone: a background behind everything, not a strip above it. */
  .door-grid {
    -webkit-mask-image: radial-gradient(150% 100% at 50% 40%, #000 0%, #000 55%, transparent 94%);
    mask-image: radial-gradient(150% 100% at 50% 40%, #000 0%, #000 55%, transparent 94%);
  }
}

/* The moment between pressing and the server answering (granite#194). It looks
   like the step that is coming, rather than like nothing happening. */
.sending .choice { opacity: .55; }

/* ---------- coming back to a sleeping tab (granite#198) -------------------

   Blazor's default is a grey panel across the middle of the screen, which on a
   phone reads as something going wrong rather than as a view catching up. This
   is a strip at the top instead: visible if you look, invisible if you do not,
   and it never covers what somebody was reading.

   ⚠️ The classes are Blazor's own and it sets them itself. `-show` while it
   retries, `-failed` when the attempts ran out, `-rejected` when the circuit is
   gone — the last one reloads the page from the script in App.razor, so what is
   styled here is the first two. */

.reconnect {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 16px calc(9px + env(safe-area-inset-top, 0px));
  padding-top: calc(9px + env(safe-area-inset-top, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--hairline-strong);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .12);
  font-size: 0.88rem;
  color: var(--ink-soft);
  animation: reconnect-in var(--base) var(--ease);
}

.reconnect.components-reconnect-show,
.reconnect.components-reconnect-failed { display: flex; }

@keyframes reconnect-in { from { transform: translateY(-100%); } to { transform: none; } }

.reconnect-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-deep);
  animation: reconnect-pulse 1.1s var(--ease) infinite;
}
@keyframes reconnect-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.reconnect-what { flex: 1 1 auto; }

/* Only offered once retrying has stopped: before that it is a button that
   throws away a connection about to come back on its own. */
.reconnect-reload {
  display: none;
  appearance: none; border: 1px solid var(--hairline-strong);
  background: var(--surface-2); color: var(--ink);
  border-radius: var(--r-sm); padding: 5px 12px;
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.reconnect.components-reconnect-failed .reconnect-reload { display: block; }
.reconnect.components-reconnect-failed .reconnect-dot { animation: none; background: var(--missing); }

@media (prefers-reduced-motion: reduce) {
  .reconnect { animation: none; }
  .reconnect-dot { animation: none; }
}


/* ---------- the processing agreement (granite#214) ---------- */

/* ⚠️ Over everything, and no way round it but signing out. It is the one
   screen in this application that is allowed to be a wall: until the provider
   has agreed, AxEdge has no lawful basis to process anything on their behalf,
   so there is nothing underneath worth showing. */
.terms-gate {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(12, 9, 11, 0.55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.terms-card {
  width: min(760px, 100%); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; margin: 0;
}
.terms-body {
  flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
  margin-top: 12px; padding: 14px 16px;
  border: 1px solid var(--hairline); border-radius: var(--r);
  background: var(--surface-2); font-size: 0.9rem; line-height: 1.6;
}
.terms-body h3 { font-size: 1rem; margin: 18px 0 6px; }
.terms-body h4 { font-size: 0.92rem; margin: 14px 0 4px; }
.terms-body p { margin: 0 0 10px; }
.terms-body ul { margin: 0 0 10px; padding-left: 20px; }
.terms-body hr { border: 0; border-top: 1px solid var(--hairline); margin: 16px 0; }
.terms-body table { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 0.85rem; }
.terms-body th, .terms-body td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--hairline); vertical-align: top;
}
.terms-body th { color: var(--ink-faint); font-weight: 600; }
/* Under Hjälp the text is part of the page, not a box of its own (granite#409).
   With no height limit it has nothing to scroll, and `contain` kept the wheel
   from passing to the page: with the pointer over the text nothing moved. */
.terms-body.in-page { overflow: visible; overscroll-behavior: auto; }
/* What changed since the last version: its own surface with room around it,
   so the reader sees where it ends and the clauses begin. Same type size and
   weight as the rest — set apart, not louder. */
.terms-body .terms-changes {
  margin: 6px 0 26px; padding: 12px 14px 2px;
  border: 1px solid var(--hairline-strong); border-radius: var(--r);
  background: var(--new-wash);
}

/* The record of what was accepted, under Inställningar. */
.terms-record { display: grid; gap: 2px; font-size: 0.87rem; }
.terms-record .when { color: var(--ink-soft); }

/* ---------- staff meetings (granite#260) ---------- */

/* One rhythm for the whole form: a label, its control, and air before the
   next. The chips sat on top of the text box under them (Hans, 2026-09-30). */
.meeting-form { display: grid; gap: 18px; }
.meeting-form > h2 { margin: 0; }
.meeting-form .field { display: grid; gap: 10px; margin: 0; }
.meeting-form .field > .label { margin: 0; }
.meeting-form .segmented, .meeting-form .chips { justify-self: start; }
.meeting-form .form-grid { margin: 0; }
.meeting-form .note { margin: 0; }
.meeting-form .choices { margin: 0; }

.meeting-list { display: grid; gap: 0; }
.meeting-row { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--hairline); }
.meeting-row:first-child { border-top: 0; padding-top: 0; }
.meeting-row:last-child { padding-bottom: 0; }
.meeting-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.meeting-row .choices { margin: 6px 0 0; }
.meeting-who { display: grid; gap: 6px; margin-top: 4px; }

/* ---------- hours while planning (the provider, Hans 2026-10-02) ---------- */

/* A person in the month's rail: name and hours on one line, the contract on
   the next. Two lines on purpose — this chip carries two answers. */
.chip.person-hours {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px;
  width: 100%; border-radius: var(--r-sm); white-space: nowrap; align-items: baseline;
}
.chip-hours { font-variant-numeric: tabular-nums; }
/* L1 (Hans, 2026-10-02): the reading on the edge, the contract line folded
   until the person is being placed or chosen — or everybody is asked for. */
.chip.person-hours { border-left-width: 4px; }
.chip.person-hours.contract-on { border-left-color: var(--attested); }
.chip.person-hours.contract-near { border-left-color: var(--missing); }
.chip.person-hours.contract-under { border-left-color: var(--conflict); }
.chip.person-hours .chip-contract { display: none; }
.chip.person-hours.open .chip-contract { display: block; }
.rail-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chip-contract { grid-column: 1 / -1; font-size: 0.72rem; font-weight: 500; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; }
/* The readings of Mot avtal: green once the contract is reached. */
.chip.contract-on { border-color: var(--attested-line); }
.chip.contract-on .chip-contract { color: var(--attested); }
.chip.contract-near .chip-contract { color: var(--missing); }
.chip.contract-under .chip-contract { color: var(--conflict); font-weight: 600; }
.chip.picked .chip-contract { color: color-mix(in srgb, var(--on-accent) 78%, transparent); }
/* The template's one-line chips: the shortfall badge takes the colour. */
.chip.contract-near .chip-note { color: var(--missing); }
.chip.contract-under .chip-note { color: var(--conflict); }

.contract-key { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.contract-key li { display: flex; align-items: baseline; gap: 8px; }
.sw { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.sw.contract-on { background: var(--attested); }
.sw.contract-near { background: var(--missing); }
.sw.contract-under { background: var(--conflict); }
.sw.base { background: var(--accent-deep); }
.sw.beyond { background: var(--activity); }

/* Who to pick, in the colours beside the schedule (Hans, 2026-10-02).
   A native popup cannot be coloured on macOS, so the people pickers become a
   drawn list where the browser allows it. Elsewhere the list stays native and
   the words beside each name say the same thing. */
option.cand::before {
  content: ""; display: inline-block; flex: 0 0 auto;
  width: 10px; height: 10px; border-radius: 3px; margin-right: 8px;
  background: transparent;
}
option.cand.contract-on::before { background: var(--attested); }
option.cand.contract-near::before { background: var(--missing); }
option.cand.contract-under::before { background: var(--conflict); }
option.cand.cand-warn { color: var(--ink-soft); }
.sw.cand-warn { background: transparent; }

@supports (appearance: base-select) {
  select.people, select.people::picker(select) { appearance: base-select; }
  select.people::picker-icon { display: none; } /* our own chevron is drawn on the field */
  /* A drawn select lays its chosen option out like any box, from the top; the
     native one centred it. Centred again, so the name sits where it did. */
  select.people { display: flex; align-items: center; line-height: 1.25; }
  select.people::picker(select) {
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--hairline-strong); border-radius: var(--r-sm);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    padding: 4px; margin-top: 4px; max-height: min(60vh, 420px);
  }
  select.people option {
    display: flex; align-items: center;
    padding: 6px 10px; border-radius: var(--r-xs);
    font-size: 0.9rem; font-weight: 500; white-space: nowrap;
  }
  select.people option:hover, select.people option:focus-visible {
    background: var(--surface-hover); outline: none;
  }
  select.people option:checked { background: var(--surface-3); }
  select.people option::checkmark { display: none; }
  select.people optgroup { font-size: 0.78rem; color: var(--ink-faint); padding-top: 6px; }
  select.people optgroup option { color: var(--ink-soft); }
}

.plan-box { display: grid; gap: 10px; margin: 0; }
.plan-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.plan-head .rail-title { margin: 0; }
.plan-big { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan-bar { position: relative; display: flex; height: 12px; border-radius: 6px; background: var(--surface-3); }
.plan-bar .plan-base { background: var(--accent-deep); border-radius: 6px 0 0 6px; }
.plan-bar .plan-beyond { background: var(--activity); }
.plan-bar i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.plan-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink-soft); }
.plan-period { border-top: 1px solid var(--hairline); padding-top: 10px; }
.plan-period > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.plan-period > summary::-webkit-details-marker { display: none; }
.plan-period > summary::before { content: "›"; color: var(--ink-faint); transition: transform var(--fast) var(--ease); display: inline-block; }
.plan-period[open] > summary::before { transform: rotate(90deg); }
.plan-period-name { font-weight: 650; }
.plan-period > .meter, .plan-period > .figs { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .plan-period > summary::before { transition: none; } }


/* Decisions on Brukare och beslut (granite#269): one row each, the figure as
   granted, the half-years worked out beneath. */
.decisions { display: grid; gap: 8px; }
.decision {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px 14px; border: 1px solid var(--hairline-strong); border-radius: var(--r-sm);
  background: var(--surface-2);
}
.decision.in-force { border-color: var(--attested-line); }
.decision-hours { display: flex; align-items: baseline; gap: 8px; font-weight: 600; }
.decision-hours input { width: 7em; font-size: 1.1rem; font-weight: 650; }
.decision-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.board tr.current th, .board tr.current td { background: var(--accent-tint); }
.board tr.past th, .board tr.past td { color: var(--ink-faint); }
.link-button { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-ink); cursor: pointer; text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.board th.tabular, .board td.tabular { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The half-years a decision gives (granite#359): room between the columns,
   which ran into one another, and between the range and its "nu". */
.board.half-years th, .board.half-years td { padding: 7px 12px; }
.board.half-years th:first-child { padding-left: 8px; }
.board.half-years td:last-child, .board.half-years th:last-child { padding-left: 24px; }
.board.half-years .pill { margin-left: 8px; }

/* A help text: a note in the margin of what it explains (granite#347).
   Every one answers to the one switch, so none needs its own close button.

   ⚠️ Quiet on purpose (Hans 2026-10-30). As filled blue boxes, twenty at once
   on Inställningar drowned the page: the reader lost where they were. Now a
   thin blue rule and the page's own soft ink, close under the thing it is
   about, so it reads as a note on that and not as a thing of its own. */
.help {
  display: flex; gap: 7px; align-items: flex-start;
  font-size: 0.84rem; line-height: 1.5; color: var(--ink-soft);
  border-left: 2px solid color-mix(in srgb, var(--new) 30%, transparent);
  padding: 1px 0 1px 10px; margin: 6px 0 0;
}
/* A question mark on every note, as on the switch that shows them (Hans
   2026-10-30): it says the note belongs to the help. A ring, not a disc, so
   it marks the note without being the brightest thing on the page. */
.help::before {
  content: "?"; flex: 0 0 auto; width: 15px; height: 15px; margin-top: 2px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--new) 45%, transparent);
  color: color-mix(in srgb, var(--new) 70%, var(--ink-soft)); font-size: 0.62rem; font-weight: 600; line-height: 1;
  display: grid; place-items: center; box-sizing: border-box;
}
.help .help-text { flex: 1 1 auto; min-width: 0; }
.help .help-text + .help-text { margin-top: 4px; }
/* The phone's switch in the top bar: the menu's, as a round question mark. */
.help-switch {
  appearance: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 0.95rem;
  width: 36px; height: 36px; border-radius: 50%; margin-left: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--new-wash); color: var(--new); border: 1px solid color-mix(in srgb, var(--new) 30%, transparent);
}
.help-switch[aria-pressed="true"] { background: var(--new); color: var(--on-accent); border-color: var(--new); }
/* The blue dot (granite#286): on a menu item while something behind it is
   unseen, beside the new thing on the page, and in Nytt i AxAssist. */
.news-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: var(--new); box-shadow: 0 0 0 3px var(--new-wash); cursor: pointer; vertical-align: middle; margin-left: 6px; }
.news-dot:focus-visible { outline: 2px solid var(--new); outline-offset: 3px; }
/* Lit by Visa on Nytt i AxAssist (granite#287): a ring that grows from the
   dot a few times, then rests as an ordinary dot. */
.news-dot.lit { animation: news-lit 1.4s var(--ease) 4; }
@keyframes news-lit {
  0% { box-shadow: 0 0 0 3px var(--new-wash), 0 0 0 0 var(--new); }
  70% { box-shadow: 0 0 0 3px var(--new-wash), 0 0 0 14px transparent; }
  100% { box-shadow: 0 0 0 3px var(--new-wash), 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .news-dot.lit { animation: none; box-shadow: 0 0 0 6px var(--new-wash); } }
.news-dot.static { cursor: default; margin-left: 0; }
.news-anchor { display: inline-block; }
/* Placed against the window by granitePopover (granite#287): inside
   Löneunderlag's scrolling table an absolute box was either clipped or made
   the table give up its scrolling and spill out of its card. */
@media (min-width: 721px) {
  .pop:where(.fixed) { position: fixed; top: 0; left: 0; }
  /* Unseen until granitePopover has placed it: it opened at the window's
     corner for a frame, then jumped below its dot (Hans, 2026-10-06). */
  .pop:where(.fixed):not(.placed) { visibility: hidden; }
}
/* On a phone the box is the sheet like every other (OneSheetWinsOnPhonesTests). */
.news-anchor.corner { position: absolute; top: -5px; right: -5px; z-index: 2; }
.news-anchor.corner .news-dot { margin-left: 0; box-shadow: 0 0 0 2px var(--surface); }
/* A dot in a table heading lives under white-space:nowrap; its box must not. */
.news-anchor .pop { white-space: normal; font-weight: 400; text-transform: none; letter-spacing: normal; min-width: 260px; }
.news-when { margin: 0; color: var(--new); font-weight: 700; }
/* On the phone's tab bar, where the count sits (granite#293). */
.tab-dot { position: absolute; top: 4px; left: calc(50% + 8px); margin-left: 0; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--new); box-shadow: 0 0 0 3px var(--new-wash); margin-left: auto; flex: 0 0 auto; }
.nav-news { margin-left: auto; background: var(--new); color: #fff; border-radius: 999px; font-size: 0.72rem; font-weight: 700; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.news-list { display: grid; gap: 8px; }
.news-item { border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface-2); }
.news-item.unseen { border-color: var(--new); background: var(--new-wash); }
.news-item .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Blanketter's "Övriga uppgifter" folds (granite#347). Closed it is one row;
   when something deviates, the row says what, and only that. */
.statements { border: 1px solid var(--hairline); border-radius: var(--r-sm); margin: 4px 0 10px; }
.statements.deviates { border-color: color-mix(in srgb, var(--missing) 45%, transparent); background: var(--missing-wash); }
.statements-head {
  appearance: none; width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; background: transparent; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.statements-name { font-weight: 600; font-size: 0.9rem; }
.statements-deviation { margin-left: auto; color: var(--missing); font-weight: 700; font-size: 0.86rem; }
.statements-head[aria-expanded="true"] .fold-mark { transform: rotate(90deg); }
.statements-body { padding: 0 12px 10px 44px; }
/* Hidden all at once, from the sidebar, without a reload: the root carries
   hints-off, and what was written before the moment it was hidden goes. */
.hints-off .help.by-all { display: none; }

/* L2 (Hans, 2026-10-02): the summary as one line, the bar inside it. */
.plan-box .plan-head { align-items: center; }
.plan-bar.inline { flex: 1 1 160px; min-width: 120px; margin: 0; }
.plan-head .push { margin-left: auto; }
.plan-detail { display: grid; gap: 10px; border-top: 1px solid var(--hairline); padding-top: 10px; margin-top: 10px; }
.plan-detail .plan-legend { align-items: center; }
button.pill { font: inherit; font-size: 0.74rem; cursor: pointer; }
a.pill { text-decoration: none; }

/* ---------- an assistant's month against their base pattern (granite#293) ---------- */

/* What differs from the base pattern has an edge and a line in words; what
   is as usual has neither. One colour per kind, the same on the chip, the
   shift and the sheet. Extra borrows the activity teal: an activity's extra
   hands are extra time too. */
.my-layout { display: grid; gap: 14px; align-items: start; }
.my-days { display: grid; gap: 12px; min-width: 0; }
.pattern-aside { display: none; }
@media (min-width: 1000px) {
  .my-layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .pattern-aside { display: grid; gap: 12px; position: sticky; top: calc(var(--chrome-top) + 12px); }
  .scope .pattern-tab { display: none; }
}

.my-shift {
  display: grid; gap: 0; border: 1px solid transparent; border-radius: var(--r);
  margin: -6px -10px;
}
.my-shift:is(.mark-added, .mark-time, .mark-removed, .mark-swapped) { margin: 0; }
.my-shift-head {
  appearance: none; display: grid; gap: 3px; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: inherit; background: transparent; border: 0; border-radius: var(--r);
  padding: 6px 10px; transition: background-color var(--fast) var(--ease);
}
.my-shift-head:hover { background: var(--surface-2); }
.my-shift-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.my-shift-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.my-shift-line strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.my-shift-mark { font-size: 0.86rem; font-weight: 600; color: var(--mark, inherit); }
.struck { text-decoration: line-through; color: var(--ink-faint); }
/* A quiet chevron that turns when the shift is folded out. */
.my-chevron { width: 8px; height: 8px; border-right: 1.5px solid var(--ink-faint); border-bottom: 1.5px solid var(--ink-faint); transform: rotate(45deg); transition: transform var(--fast) var(--ease); margin-right: 4px; }
.my-shift.open .my-chevron { transform: rotate(-135deg); }
.my-more { display: grid; gap: 8px; padding: 4px 10px 10px; }
.my-summary { margin: 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; font-size: 0.95rem; }
.my-balance { color: var(--ink-soft); }
.my-balance.plus { color: var(--activity-ink); font-weight: 600; }
.my-balance.minus { color: var(--missing); font-weight: 600; }

.mark-added   { --mark: var(--activity-ink); --mark-line: var(--activity); --mark-wash: var(--activity-wash); }
.mark-time    { --mark: var(--missing); --mark-line: var(--missing-line); --mark-wash: var(--missing-wash); }
.mark-removed { --mark: var(--ink-soft); --mark-line: var(--hairline-strong); --mark-wash: transparent; }
/* A swap is neither more nor less: neutral, no brand pink (that marks what is chosen). */
.mark-swapped { --mark: var(--ink-soft); --mark-line: var(--hairline-strong); --mark-wash: var(--surface-2); }
.my-shift:is(.mark-added, .mark-time, .mark-removed, .mark-swapped) { border-color: var(--mark-line); background: var(--mark-wash); }

.my-crew { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; align-items: baseline; }

/* The base pattern itself: weeks by number, own shifts only. */
.pattern { display: grid; gap: 10px; }
.pattern-chip { font-size: 0.82rem; padding: 3px 10px; border-radius: var(--r-sm); background: var(--surface-3); }
.pattern-weeks { display: grid; gap: 8px; }
.pattern-week { border: 1px solid var(--hairline); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 6px; }
.pattern-week-head { display: flex; align-items: baseline; gap: 8px; }
.pattern-shift { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 8px; align-items: baseline; }

/* ---------- whom to ask first (granite#294) ---------- */

.ask { display: grid; gap: 8px; }
.ask-head { display: grid; gap: 2px; }
.ask-card { display: grid; gap: 6px; border: 1px solid var(--hairline-strong); border-radius: var(--r); padding: 10px 12px; background: var(--surface); }
.ask-card.picked { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ask-who { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ask-under { color: var(--missing); font-weight: 600; }
.ask-reach, .ask-answer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ask-answer .btn { flex: 1 1 0; }
.ask-fold { border: 1px solid var(--hairline); border-radius: var(--r); padding: 8px 12px; }
.ask-fold summary { cursor: pointer; }
.ask-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--hairline); }
.ask-said { display: grid; gap: 2px; }

/* A download under way (granite#318): the pressed button turns, the rest wait.
   currentColor, so it reads on a filled button and a secondary one alike. */
.working {
  display: inline-block;
  width: .85em; height: .85em;
  margin-right: 6px;
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: working-turn .8s linear infinite;
}
@keyframes working-turn { to { transform: rotate(360deg); } }
.btn[aria-busy="true"]:disabled { opacity: 1; cursor: progress; }
@media (prefers-reduced-motion: reduce) {
  .working { animation: reconnect-pulse 1.1s var(--ease) infinite; border-right-color: currentColor; }
}
