/* Colours: palette.css, generated from design/tokens/palette.json. Layout and motion below. */
:root {
  --pill-shadow:
    0 8px 28px rgba(0, 0, 0, .13),
    0 2px 6px rgba(0, 0, 0, .07);
  --night: 0;
  --track-inset: inset 0 1px 3px rgba(0, 0, 0, .14);
  --knob-shadow: 0 1px 3px rgba(0, 0, 0, .18), 0 0 1px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .7);
  --shadow-1: none;
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .05);
  --shadow-3: 0 16px 40px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .04);
  --glass-glow:   transparent;
  --glass-base:   transparent;
  --glass-blur:   none;
  --lens-blur:    none;
  --glass-shadow: none;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --gutter:   clamp(16px, 4.5vw, 22px);
  --page-max: 720px;
  --appbar-h: 56px;
  --tabbar-h: 76px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --tap: 48px;
  --ease:      cubic-bezier(.4, 0, .2, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --ease-snap: cubic-bezier(.34, 1.4, .64, 1);
  --dur-1: .12s;
  --dur-2: .2s;
  --dur-3: .34s;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pill-shadow:
      0 8px 28px rgba(0, 0, 0, .40),
      0 2px 6px rgba(0, 0, 0, .24);
    --night: 1;
    --track-inset: inset 0 1px 3px rgba(0, 0, 0, .45);
    --knob-shadow: 0 1px 3px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .10);
    --shadow-1: none;
    --shadow-2: 0 2px 10px rgba(0, 0, 0, .30);
    --shadow-3: 0 16px 40px rgba(0, 0, 0, .50);
    --glass-glow:   transparent;
    --glass-base:   transparent;
    --glass-blur:   none;
    --lens-blur:    none;
    --glass-shadow: none;
  }
}
:root[data-theme="dark"] {
  --pill-shadow:
    0 8px 28px rgba(0, 0, 0, .40),
    0 2px 6px rgba(0, 0, 0, .24);
  --night: 1;
  --track-inset: inset 0 1px 3px rgba(0, 0, 0, .45);
  --knob-shadow: 0 1px 3px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .10);
  --shadow-1: none;
  --shadow-2: 0 2px 10px rgba(0, 0, 0, .30);
  --shadow-3: 0 16px 40px rgba(0, 0, 0, .50);
  --glass-glow:   transparent;
  --glass-base:   transparent;
  --glass-blur:   none;
  --lens-blur:    none;
  --glass-shadow: none;
}
:root[data-theme="light"] { color-scheme: light; }
/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* No scrollbar drawn anywhere, as on a phone. Everything still scrolls — this
   takes away the bar, not the scrolling — and the room it used to occupy goes
   back to the page, so nothing shifts sideways when content grows past the
   fold. Firefox and old Edge want a property on the element itself; WebKit
   wants the pseudo-element, which needs no selector to reach the lot. */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
::-webkit-scrollbar { display: none; }

html {
  -webkit-text-size-adjust: 100%; /* stop iOS resizing text in landscape */
}

body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;       /* no rubber-band bounce behind fixed bars */
  -webkit-tap-highlight-color: transparent;
  /* A long unbroken string — a pasted product description, a workplace name
     with no spaces — must wrap rather than widen the page. Nothing here can
     use overflow-x: hidden, because that would break the sticky search bar. */
  overflow-wrap: break-word;
}

/* Every interactive element gets instant taps (no 300ms delay) */
a, button, summary, input, select, textarea, label[for] { touch-action: manipulation; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, p { margin: 0; }

img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --------------------------------------------------------------------------
   3. App shell
   -------------------------------------------------------------------------- */

/* The page column. Side padding is the gutter, or the notch's inset on a
   phone held sideways if that is bigger; the bottom keeps clear of the dock
   and the home indicator, so the last card can always be scrolled fully
   out from under them. */
.container {
  max-width: var(--page-max);
  margin: 0 auto;
  padding:
    var(--sp-4)
    max(var(--gutter), var(--safe-r))
    calc(var(--tabbar-h) + var(--safe-b) + var(--sp-6))
    max(var(--gutter), var(--safe-l));
}
/* Soft navigation hands focus to the page after a swap, for keyboards and
   screen readers. That is a place to start from, not a thing to outline. */
.container:focus { outline: none; }

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: var(--safe-t);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.appbar__inner {
  position: relative;
  height: var(--appbar-h);
  max-width: 980px;
  margin: 0 auto;
  padding: 0 max(var(--gutter), var(--safe-r)) 0 max(var(--gutter), var(--safe-l));
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* ---- The bar as a phone's navigation bar ------------------------------------

   Two things a native bar does that a web header does not, both filled in
   by app.js from the page itself (initAppBar).

   Back. A page with somewhere to return to — a shift, a form, the calendar
   of holidays — carries a .backlink of its own. On a phone that link is
   lifted into the bar's left corner, where a thumb expects it, and the
   brand steps aside for it; the page's own copy is hidden so the way back
   is said once. On a wide screen the bar keeps the brand and the tabs and
   the page keeps its link.

   Title. The page's big heading scrolls away with the page. Once it has,
   its words appear in the middle of the bar — small, and only then — so a
   long timesheet still says what it is however far down it you are. */
.appbar__back {
  display: none;
  align-items: center;
  gap: 2px;
  height: var(--tap);
  margin-left: -10px;
  margin-right: auto;
  padding: 0 10px 0 6px;
  border-radius: var(--r-pill);
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  max-width: 44%;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.appbar__back:hover { text-decoration: none; background: var(--brand-soft); }
.appbar__back:active { transform: scale(.96); }
.appbar__back svg { flex: none; width: 22px; height: 22px; }
.appbar__back-label { overflow: hidden; text-overflow: ellipsis; }

.appbar__title {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: 44%;
  transform: translate(-50%, calc(-50% + 6px));
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--text);
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-3) var(--ease-out);
}
.appbar.is-titled .appbar__title { opacity: 1; transform: translate(-50%, -50%); }

/* Phones: the back link replaces the brand, and the title needs the middle. */
@media (max-width: 767px) {
  .appbar.has-back .appbar__back { display: inline-flex; }
  .appbar.has-back .brand { display: none; }
  /* Room in the middle for the title: the brand keeps its mark and gives
     up its word, which the title now says better anyway. */
  .appbar.is-titled .brand__text,
  .appbar.is-titled .brand__section { display: none; }
  body.has-back .backlink { display: none; }
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -.01em;
  color: var(--text);
  margin-right: auto;
  min-width: 0;
}
.brand:hover { text-decoration: none; }

/* The mark carries its own tile and its own colour, so the square behind it
   is only there to be turned and lifted on hover. */
.brand__mark {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  transition: transform var(--dur-2) var(--ease-snap),
              box-shadow var(--dur-2) var(--ease);
}
.brand__mark svg { width: 100%; height: 100%; display: block; }
.brand:hover .brand__mark {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 40%, transparent);
}
.brand:active .brand__mark { transform: scale(.94); }

.brand__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- The bell -------------------------------------------------------------
   Alerts, in the corner where a phone keeps it: a round button the size of
   the face beside it, with the unread count on the bell's shoulder. It is
   the one place in the app that goes to the inbox, on every page. */
/* Desktop nav lives in the appbar; on phones the tab bar replaces it */
.appbar__nav { display: none; }

/* Small square icon button used in the appbar */
.icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---- Day and night — a switch ------------------------------------------------

   The knob carries the sun across a sky; on the far side the sky has gone to
   night, the stars have come out, and the sun has turned into a moon. Every
   part reads --night from §1 — 0 or 1 — so the same handful of rules draw
   both settings and the move between them, and the switch cannot sit on a
   side the page is not on.

   A switch rather than an icon because a switch shows both its sides: you
   can see what it is and which way it is set without having to work out
   whether a moon means "it is night" or "make it night". */
.daynight {
  --track-w: 52px;
  --track-h: 30px;
  --knob: 24px;
  --gap: 3px;
  /* How far the knob travels: the track less itself less the gap each side. */
  --travel: calc(var(--track-w) - var(--knob) - 2 * var(--gap));
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.daynight__track {
  position: relative;
  display: block;
  width: var(--track-w);
  height: var(--track-h);
  border-radius: 999px;
  overflow: hidden;
  /* Daytime: a sky, deeper at the top the way a sky is. */
  background: var(--surface-3);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, .28),
    0 1px 0 rgba(255, 255, 255, .5);
  transition: transform var(--dur-2) var(--ease-snap);
}
.daynight:active .daynight__track { transform: scale(.98); }
/* Held down, the knob lengthens toward where it is about to go — the way
   an iPhone's switch does — and lets go into the slide. From the night side
   it stretches back the other way, so the far edge stays put. */
.daynight:active .daynight__knob { width: calc(var(--knob) + 7px); }
.daynight[aria-checked="true"]:active .daynight__knob {
  transform: translateX(calc(var(--travel) - 7px));
}
/* A ring for the keyboard, on the track rather than the 48px hit area. */
.daynight:focus-visible { outline: none; }
.daynight:focus-visible .daynight__track {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Night is a second sky laid over the first, faded in rather than swapped:
   a gradient cannot transition, but its opacity can. */
.daynight__night {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
  opacity: var(--night);
  transition: opacity .45s var(--ease);
}

/* Five stars, each a tiny radial gradient, that drift in from the left as
   the sun leaves and are not there at all by day. */
.daynight__stars {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1.3px 1.3px at 11px 9px,  #fff 98%, transparent),
    radial-gradient(1px 1px at 19px 19px,     #fff 98%, transparent),
    radial-gradient(1.5px 1.5px at 27px 7px,  #fff 98%, transparent),
    radial-gradient(1px 1px at 8px 21px,      #fff 98%, transparent),
    radial-gradient(1.1px 1.1px at 22px 12px, #fff 98%, transparent);
  opacity: var(--night);
  transform: translateX(calc(-6px * (1 - var(--night))));
  transition: opacity .45s var(--ease), transform .55s var(--ease-out);
}

/* The knob: a warm disc by day that cools to moon-grey at night, sliding
   the length of the track on the same spring the rest of the app moves on. */
.daynight__knob {
  position: absolute;
  top: var(--gap);
  left: var(--gap);
  width: var(--knob);
  height: var(--knob);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, .35),
    inset 0 -1px 1px rgba(0, 0, 0, .08);
  transform: translateX(calc(var(--travel) * var(--night)));
  transition:
    transform .5s var(--ease-snap),
    width .18s var(--ease),
    background .45s var(--ease);
}

/* The sun sets and the moon rises inside the knob: each rolls over the
   horizon as it goes. */
.daynight__sun,
.daynight__moon {
  grid-area: 1 / 1;
  width: 15px;
  height: 15px;
  transition:
    opacity .3s var(--ease),
    transform .55s var(--ease-snap);
}
.daynight__sun {
  color: var(--warn);
  opacity: calc(1 - var(--night));
  transform: rotate(calc(-100deg * var(--night))) scale(calc(1 - .6 * var(--night)));
}
.daynight__moon {
  color: var(--text-2);
  opacity: var(--night);
  transform: rotate(calc(100deg * (1 - var(--night)))) scale(calc(.4 + .6 * var(--night)));
}

/* The switch itself: app.js asks the browser for a view transition, and this
   is how long the old palette takes to dissolve into the new. Slightly
   longer than the default quarter-second, so it reads as the room's light
   changing rather than a flicker. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .42s;
  animation-timing-function: var(--ease);
}
/* The switch is kept out of that crossfade. Snapshotted with the page, a
   ghost of the knob on its old side would fade out over the knob sliding
   to its new one; on its own, it is shown live from the first frame and
   the slide is the slide. */
.daynight { view-transition-name: daynight; }
::view-transition-old(daynight) { animation: none; opacity: 0; }
::view-transition-new(daynight) { animation: none; }

/* ---- §3b. The switch — every other yes-or-no in the app ---------------------

   The day-and-night control above is a switch with a sky in it. This is the
   same switch with the sky taken out: a track, a knob, and the brand colour
   filling the track when it is on. A form's checkbox ("use as my default
   workplace", "delete this break"), and push notifications on the inbox,
   all wear it — so the app has one way of saying on and off, and it is the
   one you already learned in the corner of the app bar.

   The checkbox is real. It lies invisibly over the whole row, so the row is
   the tap target (never smaller than 48px), a keyboard reaches it, and with
   no stylesheet at all it is still a checkbox that works. Everything visual
   hangs off :checked, :active and :focus-visible on that input. */
.switch {
  --track-w: 52px;
  --track-h: 30px;
  --knob: 24px;
  --gap: 3px;
  --travel: calc(var(--track-w) - var(--knob) - 2 * var(--gap));
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--tap);
  cursor: pointer;
  font-size: 15px;
  font-weight: 550;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  z-index: 1;
}
.switch__text { flex: 1 1 auto; min-width: 0; }

.switch__track {
  flex: none;
  position: relative;
  width: var(--track-w);
  height: var(--track-h);
  border-radius: 999px;
  background: var(--track);
  box-shadow: var(--track-inset);
  transition: background .3s var(--ease), box-shadow .3s var(--ease), transform var(--dur-2) var(--ease-snap);
}
.switch__knob {
  position: absolute;
  top: var(--gap);
  left: var(--gap);
  width: var(--knob);
  height: var(--knob);
  border-radius: 999px;
  background: var(--knob);
  box-shadow: var(--knob-shadow);
  transition:
    transform .5s var(--ease-snap),
    width .18s var(--ease),
    background .3s var(--ease);
}
/* Dark surfaces: the knob is lit, or it disappears into the track. */
.switch__knob { background: #fff; }

/* On: the track fills with the brand and the knob crosses it. */
.switch input:checked ~ .switch__track {
  background: var(--brand);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .18);
}
.switch input:checked ~ .switch__track .switch__knob {
  transform: translateX(var(--travel));
}
/* A destructive yes — "delete this break" — fills red instead. */
.switch--danger input:checked ~ .switch__track { background: var(--danger); }
.switch--danger input:checked ~ .switch__text { color: var(--danger); }

/* Under a finger the knob lengthens toward where it is going. */
.switch input:active ~ .switch__track { transform: scale(.98); }
.switch input:active ~ .switch__track .switch__knob { width: calc(var(--knob) + 7px); }
.switch input:checked:active ~ .switch__track .switch__knob {
  transform: translateX(calc(var(--travel) - 7px));
}

.switch input:focus-visible ~ .switch__track {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.switch input:disabled ~ .switch__track,
.switch input:disabled ~ .switch__text { opacity: .45; }
.switch input:disabled { cursor: default; }

/* A switch with nothing to say beside it: the words are elsewhere on the
   card, and this is only the control. */
.switch--bare { min-height: 0; gap: 0; }

/* --------------------------------------------------------------------------
   4. Bottom tab bar (phones) — a dock floating within thumb reach

   Not a bar across the foot of the screen but an object hovering over it:
   the page runs to the bottom edge underneath, and navigation is one
   frosted capsule you can reach without shifting your grip. Five places,
   the same five on every screen. Four of them are an icon; the one you are
   in is a tinted pill with its name beside the icon, so the bar says where
   you are in words and everywhere else in pictures — a dock, not a row of
   captions.

   It is made of frosted glass the way the chrome on a phone is: the page
   blurs through it as it scrolls past, a hairline of light catches the top
   edge, and a soft shadow falls underneath. That the page keeps moving
   behind it is the whole point — a solid bar looks pasted on top of the
   page, a frosted one looks like it is floating above it. And like the
   phone's, it shrinks while you scroll down and grows back as you scroll
   up (§4b). Nothing else: no streaks, no sheen — a dock is furniture, and
   furniture keeps still.
   -------------------------------------------------------------------------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-b) + var(--sp-3));
  z-index: 45;
  display: flex;
  justify-content: center;
  /* The page either side of the dock still belongs to the page. */
  pointer-events: none;
}

.tabbar__inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  /* As wide as its tabs and no wider — the pill under the current tab grows
     when you move, and the dock grows with it. Never past the screen's own
     margins. */
  max-width: calc(100% - 2 * var(--gutter));
  border-radius: var(--r-pill);
  background: var(--pill);
  border: 1px solid var(--pill-line);
  /* Cast below, lit above. The drop shadow puts the dock over the page; the
     inset hairline is the light catching its top edge, and the faint
     inner shadow under it is what makes the dock a track the pill sits in
     rather than a plate it sits on — the same sink the switches have. */
  box-shadow:
    var(--pill-shadow),
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 2px 6px -3px rgba(0, 0, 0, .18);
  /* More tabs than a narrow phone can hold slide rather than wrap. */
  overflow-x: auto;
  scrollbar-width: none;
  /* The shrink on scroll (§4b) grows back from the edge it shrank towards:
     the foot of the screen. A long, settling curve with no bounce — the
     dock is getting out of the way, not arriving. */
  transform-origin: 50% 100%;
  transition: transform .5s var(--ease-out);
}
.tabbar__inner::-webkit-scrollbar { display: none; }

/* Frosted, where the browser can frost — every version of iOS Safari can, and
   so can current Chrome and Firefox. All this swaps is the material: solid
   for translucent, plus a blur of whatever the page is showing behind it.

   saturate() is the part that matters. Blur alone drains the colour out of
   what's underneath and the bar goes grey; pushing saturation back up is how
   iOS keeps its chrome looking lit rather than fogged. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tabbar__inner {
    background: var(--pill-glass);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
  }
}

/* Asked for less of this at the system level — iOS calls it Reduce
   Transparency. Solid, and still a dock. */
@media (prefers-reduced-transparency: reduce) {
  .tabbar__inner {
    background: var(--pill);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

.tab {
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  background: none;
  border: 0;
  cursor: pointer;
  /* A tab is a control, not a link to hold down: no link preview, no
     selection, no grey flash. */
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.tab:hover { text-decoration: none; }
.tab svg { width: 22px; height: 22px; }

/* ---- The dock's own tabs -------------------------------------------------- */
.tabbar .tab {
  position: relative;
  z-index: 2;
  flex: none;
  height: 48px;
  min-width: 48px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-pill);
  color: var(--pill-ink);
  transition: color .3s var(--ease), transform var(--dur-1) var(--ease);
}
.tabbar .tab:hover { color: var(--text); }
.tabbar .tab:active { transform: scale(.94); }
.tabbar .tab svg { flex: none; width: 24px; height: 24px; }

/* The name, which only the current tab wears: the others are their icons.
   It arrives as the pill lands — and only then. .is-arriving is set by
   app.js on a tab the pill has just slid to; a page that opens with the
   pill already where it was does not replay the arrival. */
.tabbar .tab__label {
  display: none;
  font-size: 13px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.tabbar .tab.is-active .tab__label { display: block; }
/* Held back for the length of the stretch (§34), so the name appears as
   the pill snaps in under it rather than on bare glass ahead of it. */
.tabbar .tab.is-arriving .tab__label { animation: mw-tab-name .34s .19s var(--ease-out) both; }
@keyframes mw-tab-name {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}

/* Where you are: the knob. A solid pill of the brand colour, raised out of
   the track with a soft shadow, and the tab's icon and name in the brand's
   own ink on it — the one solid colour in the dock, the way the switch's
   track goes solid green when it is on. With JavaScript the pill is the
   travelling element in §34 and this background comes off; without it, the
   tab draws its own and nothing is lost but the slide. */
.tabbar .tab.is-active {
  padding: 0 16px 0 12px;
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 36%, transparent);
}
.tabbar .tab.is-active svg { stroke-width: 2.2; }
/* The pill reaches the tab before the icon shows: white ink on bare glass
   would be invisible, so the icon waits out the stretch (§34) and fades in
   as the pill snaps under it. */
.tabbar .tab.is-arriving svg { animation: mw-tab-in .3s .17s var(--ease) both; }
@keyframes mw-tab-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* The tab being left keeps the pill's ink for as long as the pill is still
   under it (app.js holds .is-leaving through the stretch), then greys. */
.tabbar .tab.is-leaving { color: var(--brand-ink); }
/* The count on Alerts, when Alerts is the pill: ringed in the pill's colour. */
.tabbar .tab.is-active .tab__badge { box-shadow: 0 0 0 2px var(--brand); }

/* Tapping the tab you are already on scrolls its page back to the top —
   app.js — and the icon gives a small nod to say it heard. */
.tabbar .tab.is-active:active svg { transform: translateY(-2px) scale(.92); }

/* The narrowest phones: five tabs and a name still fit inside a 320px
   screen's margins once the gaps close up a little. */
@media (max-width: 380px) {
  .tabbar__inner { gap: 2px; padding: 5px; max-width: calc(100% - 2 * var(--sp-3)); }
  .tabbar .tab { height: 46px; min-width: 44px; padding: 0 8px; }
  .tabbar .tab.is-active { padding: 0 12px 0 10px; gap: 6px; }
  .tabbar .tab__label { font-size: 12.5px; }
}

/* The icon and, on Alerts, the number riding on its shoulder. */
.tab__icon {
  position: relative;
  display: inline-grid;
  place-items: center;
}
.tab__badge {
  position: absolute;
  top: -5px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: var(--danger-ink);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0;
  /* A ring in the dock's own colour, so the badge reads as sitting on top
     of the icon rather than punched out of it. */
  box-shadow: 0 0 0 2px var(--pill);
  pointer-events: none;
}

/* ---- §4b. Shrunk: the dock while you scroll down ----------------------------

   An iPhone's tab bar gets out of the way of a long page: as you scroll down
   it shrinks, and the moment you scroll back up it is whole again. app.js
   sets .is-min from the scroll direction; the dock itself just has two
   sizes.

   Scaled rather than re-laid-out. The pill in §34 sits inside this box and
   is placed by measurement, so shrinking the tabs underneath it would leave
   it stranded mid-slide; scaling the whole box takes the pill with it, and
   costs one composited transform rather than a layout per frame. */
.tabbar.is-min .tabbar__inner {
  transform: scale(.86) translateY(6px);
}

/* ---- Segmented control: the places within one app, and List / Calendar ----

   The tab bar says which app you are in; this says where in it — Clock /
   Timesheet / More — and, on the timesheet, which view of it: List or
   Calendar. One control for both, and it is the switch again in a wider
   body: a track sunk into the page, and a knob raised out of it that slides
   to whichever segment you pick (the travelling element in §34). Without
   JavaScript the chosen segment draws the knob itself and the slide is all
   that goes.

   The same .tab markup as the bar, restyled — the shared _section_nav.html
   files render here and nowhere else. */
.segments {
  position: relative;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--track);
  box-shadow: var(--track-inset);
}
.segments::-webkit-scrollbar { display: none; }
.segments .tab {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px var(--sp-3);
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  transition: color .25s var(--ease), transform var(--dur-1) var(--ease);
}
.segments .tab:hover { color: var(--text); text-decoration: none; }
.segments .tab:active { transform: scale(.96); }
.segments .tab svg { flex: none; width: 16px; height: 16px; }
.segments .tab__label { overflow: hidden; text-overflow: ellipsis; }
.segments .tab.is-active {
  color: var(--text);
  background: var(--knob);
  box-shadow: var(--knob-shadow);
}
/* The icon nods into place when the knob arrives under it — set by app.js
   only when the knob actually moved. */
.segments .tab.is-arriving svg { animation: mw-pop var(--dur-3) var(--ease-snap) both; }

/* List / Calendar sits under the page title, before the content it switches.
   Two words do not need the whole width of a tablet. */
.segments--views { margin-bottom: var(--sp-4); }
@media (min-width: 600px) { .segments--views { max-width: 400px; } }

/* Three captioned segments across the narrowest phone: the icon goes, the
   words stay, because the words are the part that says where you are. */
@media (max-width: 360px) {
  .segments--places .tab svg { display: none; }
}

/* --------------------------------------------------------------------------
   5. Surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: var(--sp-4); }
.card__pad { padding: var(--sp-5); }

.card__head {
  padding: var(--sp-5) var(--sp-5) 0;
}

/* A large title, the way an iPhone screen opens: it scrolls away with the
   page, and the app bar picks its words up (§3) once it has gone. Sized to
   the screen, within reason — 28px on a small phone, 32px on a big one. */
.page-title {
  font-size: clamp(27px, 7.4vw, 32px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.page-sub {
  margin-top: var(--sp-1);
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.45;
}
/* A heading needs air under it more than it needs weight. */
.page-head { margin-bottom: var(--sp-4); padding-top: var(--sp-1); }

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.muted { color: var(--muted); }
.text-sm { font-size: 14px; }

hr.rule { border: 0; border-top: 1px solid var(--line); margin: var(--sp-4) 0; }

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  /* A pill, as in the app: the plain one is a filled surface with no rim. */
  min-height: 52px;
  padding: 0 var(--sp-6);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-1) var(--ease), background .12s ease, opacity .12s ease, box-shadow var(--dur-2) var(--ease);
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); }

.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); }

.btn--block { width: 100%; }
.btn--sm { min-height: 40px; font-size: 14px; padding: 0 var(--sp-4); }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   7. Forms
   -------------------------------------------------------------------------- */
.field { margin-bottom: var(--sp-4); }
.field:last-child { margin-bottom: 0; }

.label {
  display: block;
  font-size: 14px;
  font-weight: 550;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

/* Django renders bare <input>s, so style by element as well as class */
/* Every text-like input, named by what it is not. The list used to be spelled
   out type by type, and the first one anybody added — tel, for a phone
   number — came out as a raw browser box beside its styled neighbours. */
.input,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="hidden"]):not([type="range"]):not([type="color"]),
select,
textarea {
  /* Filled, with a quiet rim: in the mint palette the fill is within a shade
     of the card it sits on, so the fill alone no longer marks the box out —
     the hairline does, and the invalid state colours the same rim in. */
  width: 100%;
  min-height: 52px;
  padding: 13px var(--sp-4);
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;  /* 16px or larger stops iOS Safari zooming on focus */
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder, input::placeholder { color: var(--muted); }

/* A select with the browser's arrow taken off looked like a text box you
   could not type in. The arrow comes back, drawn in the muted ink, and the
   text keeps clear of it. */
select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
}
/* iOS draws date and time pickers as a bare value with no height of its
   own; giving the inner value a line box keeps them the same height as the
   fields beside them. */
input[type="date"], input[type="time"], input[type="datetime-local"] {
  min-height: var(--tap);
  line-height: 24px;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; min-height: 24px; }

.input:focus,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="hidden"]):not([type="range"]):not([type="color"]):focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

input[type="file"] { font-size: 15px; }

.help {
  margin-top: var(--sp-2);
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.help ul { margin: var(--sp-1) 0 0; padding-left: 18px; }
.help--error { color: var(--danger); }

/* A field the form is complaining about. The ring is the same one focus uses,
   in the same place, so the eye lands on the box rather than on the sentence
   underneath it — and it clears the moment the value changes. */
.field--invalid > .input,
.field--invalid > input,
.field--invalid > select,
.field--invalid > textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

/* --------------------------------------------------------------------------
   8. Messages / alerts
   -------------------------------------------------------------------------- */
.alerts { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  box-shadow: var(--shadow-1);
}
.alert--success { border-color: color-mix(in srgb, var(--brand) 40%, transparent); background: var(--brand-soft); }
.alert--error   { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); color: var(--danger); }
.alert--warning { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }

/* --------------------------------------------------------------------------
   9. Search
   -------------------------------------------------------------------------- */
/* Search stays in normal page flow; only an active query pins its controls. */
.search-page {
  padding-top: 0;
}
.search-page.is-idle {
  min-height: 0;
  display: block;
  padding-top: 0;
}

/* The search bar pins under the app bar so the field is always reachable */
.searchbar {
  position: sticky;
  top: calc(var(--appbar-h) + var(--safe-t) + 8px);
  z-index: 30;
  margin: 0 0 var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--surface);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  transition: border-color .15s ease;
}
.searchbar.is-stuck { border-bottom-color: var(--line); }

/* Relative positioning must not inherit the sticky bar's app-header offset:
   it shifts the idle form over the results without reserving any space. */
.search-page.is-idle .searchbar { position: relative; top: auto; }

.searchbar__row { display: flex; gap: 8px; }
.searchbar__row .searchbar__field { flex: 1; min-width: 0; }
.searchbar__row .searchbar__input { min-height: 54px; border-radius: 12px !important; font-size: 16px; }
.searchbar__submit { display: grid; place-items: center; flex: none; width: 48px; min-height: 54px; border: 0; border-radius: 12px; background: var(--brand); color: var(--brand-ink); cursor: pointer; }
.searchbar__submit svg { width: 22px; height: 22px; }
.searchbar .catalogue-picker { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 12px; color: var(--muted); font-weight: 500; }
.searchbar .catalogue-picker>span { flex: none; }
.searchbar .catalogue-picker .input { min-width: 0; flex: 1; min-height: 44px; font-size: 14px; padding-block: 8px; }
.searchbar .searchbar__meta { font-size: 12px; margin-top: 10px; }
.search-tools { margin-bottom: 22px; }
.search-tools .search-heading__actions { display: flex; flex-wrap: wrap; }
.search-tools .search-heading__actions .btn { flex: 1; }
.search-section { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.search-section h2 { margin: 0; font-size: 15px; font-weight: 700; }
.search-section>span { color: var(--muted); font-size: 12px; }
.search-result { display: flex; align-items: flex-start; gap: 16px; padding: 14px; font-size: 15px; line-height: 1.5; }
.search-result__number { flex: 0 1 88px; max-width: 35%; overflow-wrap: anywhere; color: var(--brand-strong); font-weight: 700; font-variant-numeric: tabular-nums; }
.search-result__description { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text); }

.searchbar__field {
  position: relative;
  display: flex;
  align-items: center;
}
.searchbar__icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
}
.searchbar__input {
  padding-left: 42px !important;
  padding-right: 50px !important;
  border-radius: var(--r-pill) !important;
}
.searchbar__input::-webkit-search-cancel-button { display: none; }

.searchbar__clear {
  position: absolute;
  right: 2px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  cursor: pointer;
  padding: 0;
}
.searchbar__clear svg { width: 15px; height: 15px; }
.searchbar__clear[hidden] { display: none; }

.searchbar__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}

/* --------------------------------------------------------------------------
   10. Result list — cards, not a table (tables don't fit a phone)
   -------------------------------------------------------------------------- */
.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.result-list > li + li { border-top: 1px solid var(--line); }

.result {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 62px;
  padding: var(--sp-3) var(--sp-4);
  color: var(--text);
}
.result:hover { background: var(--surface-2); text-decoration: none; }
.result:active { background: var(--surface-3); }

.plu-badge {
  flex: none;
  min-width: 58px;
  padding: var(--sp-2) var(--sp-2);
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
  text-align: center;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.plu-badge--muted { background: var(--surface-3); color: var(--muted); }

.result__body { min-width: 0; flex: 1; }
.result__title {
  font-size: 15px;
  font-weight: 550;
  line-height: 1.35;
  /* two lines max, then ellipsis — long cut descriptions stay tidy */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result__sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result__chev { flex: none; width: 18px; height: 18px; color: var(--line-strong); }

.result mark, .search-result mark {
  background: color-mix(in srgb, var(--brand) 26%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* --------------------------------------------------------------------------
   11. Empty / loading states
   -------------------------------------------------------------------------- */
.empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
}
.empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--sp-3);
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--surface-3);
  color: var(--muted);
}
.empty__icon svg { width: 26px; height: 26px; }
.empty__title { font-weight: 600; font-size: 16px; }
.empty__sub { margin-top: var(--sp-1); color: var(--muted); font-size: 14px; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -135% 0; } }

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--brand) 25%, transparent);
  border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
.spinner--lg { width: 40px; height: 40px; border-width: 3.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.overlay[hidden] { display: none; }
.overlay__box {
  width: min(340px, 100%);
  text-align: center;
  padding: var(--sp-6) var(--sp-5);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
}
.overlay__box .spinner { margin: 0 auto var(--sp-4); }

/* --------------------------------------------------------------------------
   12. Pagination
   -------------------------------------------------------------------------- */
/* The pager (templates/_pager.html): two thumb-sized buttons with the page
   count between them. On a phone the buttons take equal halves of the row
   and the count sits under them, so each is a wide target at the bottom of
   the screen where the thumb already is; wider up, they shrink to their
   words and the count moves between them. */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.pager__btn { flex: 1 1 0; min-width: 0; padding: 0 var(--sp-4); }
.pager__btn svg { flex: none; width: 18px; height: 18px; }
.pager__btn--prev { justify-content: flex-start; }
.pager__btn--next { justify-content: flex-end; }
.pager__label {
  flex: 1 1 100%;
  order: 1;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
@media (min-width: 480px) {
  .pager__btn { flex: none; min-width: 120px; }
  .pager__btn--prev, .pager__btn--next { justify-content: center; }
  .pager__label { flex: 1 1 auto; order: 0; }
}

/* --------------------------------------------------------------------------
   13. Detail page
   -------------------------------------------------------------------------- */
.detail-hero {
  text-align: center;
  padding: var(--sp-8) var(--sp-4) var(--sp-6);
  background: linear-gradient(170deg, var(--brand-soft), transparent 75%);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
}
.detail-hero__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
}
.detail-hero__plu {
  margin-top: var(--sp-1);
  font-size: 64px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.detail-hero__desc {
  margin-top: var(--sp-3);
  font-size: 18px;
  font-weight: 550;
  line-height: 1.35;
  color: var(--text-2);
}

.detail-actions { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }

/* Brief "Copied" confirmation, since there's no room for a toast stack */
.copied-flash {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--sp-4));
  transform: translate(-50%, 8px);
  z-index: 60;
  padding: 10px var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 550;
  box-shadow: var(--shadow-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.copied-flash.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   14. Photo search
   -------------------------------------------------------------------------- */
.dropzone {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--line-strong);
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropzone__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--sp-3);
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--brand);
}
.dropzone__icon svg { width: 26px; height: 26px; }
.dropzone__label { font-weight: 600; font-size: 16px; }
.dropzone__sub { margin-top: var(--sp-1); font-size: 13px; color: var(--muted); word-break: break-word; }
.dropzone__preview { max-height: 260px; border-radius: var(--r-md); margin: 0 auto; }
.dropzone__preview[hidden] { display: none; }

/* The real file input is hidden; the whole dropzone is its label */
.visually-hidden-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

/* --------------------------------------------------------------------------
   15. Auth pages
   -------------------------------------------------------------------------- */
.auth {
  max-width: 420px;
  margin: 0 auto;
  padding-top: var(--sp-6);
}
/* The mark brings its own tile and colour; this only sets how big it sits. */
.auth__logo {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--sp-4);
}
.auth__logo svg { width: 100%; height: 100%; display: block; }
.auth__title { text-align: center; font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.auth__sub { text-align: center; color: var(--muted); font-size: 14px; margin-top: var(--sp-1); margin-bottom: var(--sp-5); }
.auth__footer { text-align: center; margin-top: var(--sp-4); font-size: 14px; color: var(--muted); }
.auth__footer a { font-weight: 550; }

/* --------------------------------------------------------------------------
   16. Misc
   -------------------------------------------------------------------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
}
.stat {
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.stat__value { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat__label { font-size: 12px; color: var(--muted); margin-top: 2px; }

code, .code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text);
  word-break: break-word;
}

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --------------------------------------------------------------------------
   16b. Time clock — dashboard, timesheet, workplaces
   -------------------------------------------------------------------------- */
/* One column that may be narrower than what is in it: left to size itself,
   the grid's column took the row of workplace chips' full unwrapped width
   and pushed the whole clock off the side of a phone. */
.clock { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
/* A fieldset is as wide as its contents by default (min-width: min-content),
   so the chips inside could never scroll — the page stretched instead. */
fieldset.chips { min-width: 0; }

.clock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.status-pill { flex: none; }
/* The date gives way before the status does: it is the one of the two you
   already know. */
.clock__date { min-width: 0; font-size: 13px; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Status pill — the dot pulses only while something is actually running, so
   movement on screen always means the clock is moving too. */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px var(--sp-3);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .06em;
  background: var(--surface-3);
  color: var(--muted);
}
.status-pill--sm { padding: 3px var(--sp-2); font-size: 10.5px; }
.status-pill__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status-pill--working  { background: var(--brand-soft); color: var(--brand); }
.status-pill--on_break { background: var(--warn-soft);  color: var(--warn); }
.status-pill--completed{ background: var(--surface-3);  color: var(--muted); }

/* ---- The dial ---------------------------------------------------------- */
.dial {
  position: relative;
  width: min(280px, 78vw);
  aspect-ratio: 1;
  margin: var(--sp-2) auto;
  display: grid;
  place-items: center;
}

.dial__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);       /* start the sweep at 12 o'clock */
  overflow: visible;
}
.dial__track,
.dial__progress {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
}
.dial__track { stroke: var(--surface-3); }
.dial__progress {
  stroke: var(--brand);
  /* 2πr for r=52. JS moves the offset; the transition smooths each tick. */
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--brand) 45%, transparent));
}
.dial--on_break .dial__progress { stroke: var(--warn); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--warn) 45%, transparent)); }
.dial--idle .dial__progress     { stroke: var(--line-strong); filter: none; }

/* A soft halo behind the face that breathes while the clock runs */
.dial::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--brand-soft), transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease);
}
.dial--working::before  { opacity: 1; }
.dial--on_break::before { opacity: 1; background: radial-gradient(circle, var(--warn-soft), transparent 70%); }

.dial__face { position: relative; text-align: center; padding: 0 var(--sp-5); }
.dial__label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.dial__time {
  margin-top: var(--sp-1);
  font-size: clamp(30px, 10vw, 42px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.dial__time--clock { font-size: clamp(38px, 13vw, 54px); }
.dial__sub { margin-top: var(--sp-2); font-size: 13px; color: var(--muted); }

/* ---- Big actions ------------------------------------------------------- */
.clock__actions { display: grid; gap: var(--sp-3); }
.clock__actions--split { grid-template-columns: 1fr 1fr; }
.clock__actions--split form { display: flex; }

.big-btn {
  width: 100%;
  min-height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-5);
  border: 0;
  border-radius: var(--r-pill);
  font: inherit;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.01em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-2);
  transition: transform var(--dur-1) var(--ease), filter var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease);
}
.big-btn svg { width: 22px; height: 22px; flex: none; }
.big-btn:active { transform: scale(.97); }
.big-btn:hover { filter: brightness(1.06); text-decoration: none; }

.big-btn--go   { background: var(--brand); color: var(--brand-ink); }
.big-btn--stop { background: var(--danger); color: var(--danger-ink); }
.big-btn--soft { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-1); }

.clock__where {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: 15px;
  font-weight: 550;
  color: var(--text-2);
}
.clock__where svg { width: 17px; height: 17px; color: var(--muted); }

/* ---- Workplace chips --------------------------------------------------- */
.chips { border: 0; padding: 0; margin: 0; }
.chips legend { padding: 0; margin-bottom: var(--sp-2); }
.chips__scroll {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-1);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips__scroll::-webkit-scrollbar { display: none; }
.chips--filter { margin-bottom: var(--sp-4); }

.chip { flex: none; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }

.chip__body {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease),
              color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.chip:active .chip__body { transform: scale(.96); }
.chip input:checked + .chip__body,
.chip--link.is-on .chip__body {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.chip input:focus-visible + .chip__body { outline: 2px solid var(--brand); outline-offset: 2px; }
.chip--link:hover { text-decoration: none; }

.chip__tag {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
}

/* ---- Summary cards ------------------------------------------------------ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
}
/* Three-up on a narrow phone leaves each card about 110px, so the label and
   figure are pulled down a step to stop "This fortnight" / "29h 59m" wrapping
   onto two lines each. */
.summary-grid--3 { grid-template-columns: repeat(3, 1fr); }
.summary-grid--3 .summary-card { padding: var(--sp-3) var(--sp-2); }
.summary-grid--3 .summary-card__label { font-size: 10px; letter-spacing: .04em; }
.summary-grid--3 .summary-card__value { font-size: clamp(17px, 4.6vw, 24px); white-space: nowrap; }
.summary-grid--3 .summary-card__sub { font-size: 11px; }

.summary-card {
  padding: var(--sp-4) var(--sp-3);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.summary-card__label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.summary-card__value {
  margin-top: var(--sp-1);
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.summary-card__sub { margin-top: 2px; font-size: 12px; color: var(--muted); }

/* The money under the hours. Quiet by comparison — the hours are what the
   card is for, and the pay is what they came to. */
.summary-card__pay {
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* The pay-period card: a payslip you can hold the real one against. */
.pay-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.pay-head__title { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.pay-head__dates { flex: none; font-size: 12px; color: var(--muted); }
.pay-note { margin: var(--sp-3) 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

/* ---- Hours limit ------------------------------------------------------- */
.limit__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.limit__figure { margin-top: var(--sp-1); }
.limit__used {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.limit__cap { font-size: 14px; color: var(--muted); font-weight: 550; }

.limit__track {
  display: flex;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}
/* Two lengths, laid end to end: what a payment has already closed off, then
   what has been worked since. The track's own rounding clips both, so no
   segment needs corners of its own. */
.limit__fill {
  flex: none;
  height: 100%;
  width: var(--pct, 0%);
  background: var(--brand);
}
.limit__fill--settled { background: color-mix(in srgb, var(--brand) 26%, var(--surface-3)); }

.limit__note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  font-size: 13px;
  color: var(--muted);
}
.limit__note { flex-wrap: wrap; row-gap: 2px; }
.limit__note svg { width: 16px; height: 16px; flex: none; }
/* The dates the period runs between and the day the count starts again —
   what makes "this fortnight" a thing on the calendar rather than a word. */
.limit__until { font-size: 12px; opacity: .85; }

/* Where the count restarted, and what the restart does not excuse. */
.limit__reset {
  margin: var(--sp-2) 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.limit--close .limit__fill { background: var(--warn); }
.limit--close .limit__fill--settled { background: color-mix(in srgb, var(--warn) 26%, var(--surface-3)); }
.limit--close .limit__note { color: var(--warn); font-weight: 550; }
.limit--over  .limit__fill { background: var(--danger); }
.limit--over  .limit__fill--settled { background: color-mix(in srgb, var(--danger) 26%, var(--surface-3)); }
.limit--over  .limit__note { color: var(--danger); font-weight: 600; }
.limit--over  { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

/* ---- Timesheet list ---------------------------------------------------- */
/* Each day is a <details>: the header is the whole summary, so a shut day is
   still a readable line — date, how many shifts, how long — and opening one
   costs a tap and no page load. */
.day { margin-bottom: var(--sp-4); }

.day__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: var(--tap);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-2) var(--ease);
}
.day__head::-webkit-details-marker { display: none; }
.day__head:active { background: var(--surface-3); }
.day__head:hover { background: var(--surface-2); }
.day[open] .day__head { margin-bottom: var(--sp-1); }

.day__date { font-size: 14px; font-weight: 650; letter-spacing: .01em; }

.day__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
  color: var(--muted);
}
/* The count is what a shut day gains over an open one, so it steps back once
   the shifts it was standing in for are on screen. */
.day__count { font-size: 12px; transition: opacity var(--dur-2) var(--ease); }
/* Hidden, not removed — the total keeps its place instead of jumping left. */
.day[open] .day__count { opacity: 0; }

.day__total { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.day__chev {
  flex: none;
  width: 16px; height: 16px;
  color: var(--muted);
  transition: transform var(--dur-2) var(--ease);
}
.day[open] .day__chev { transform: rotate(180deg); }

/* Opening and shutting are animated by app.js (initAccordion), which grows the
   list to its height and eases it down; a day being shut turns its chevron
   back at once, not when the fold has finished. */
.day.is-closing .day__chev, .week.is-closing .week__chev { transform: none; }
.day.is-closing .day__count { opacity: 1; }

/* ---- A week behind the one being read -------------------------------------
   The current week is written out a day at a time. Everything older is folded
   a week at a time: the fold's head carries the dates, the shift count and the
   hours, which is enough to decide whether to open it without opening it. It
   reads heavier than a day's head because it holds days rather than shifts. */
.week { margin-bottom: var(--sp-3); }

.week__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: var(--tap);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  /* A panel, not a tint: --surface-2 against --bg is a single value apart and
     the row read as loose text rather than as something to open. */
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-2) var(--ease);
}
.week__head::-webkit-details-marker { display: none; }
.week__head:hover { background: var(--surface-2); }
.week__head:active { background: var(--surface-3); }
.week[open] .week__head { margin-bottom: var(--sp-2); }

.week__dates { font-size: 14px; font-weight: 650; letter-spacing: .01em; }

.week__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
  color: var(--muted);
}
.week__count { font-size: 12px; }
.week__total { font-size: 13px; font-variant-numeric: tabular-nums; }

.week__chev {
  flex: none;
  width: 16px; height: 16px;
  color: var(--muted);
  transition: transform var(--dur-2) var(--ease);
}
.week[open] .week__chev { transform: rotate(180deg); }

/* The days inside step in, so a day's head is never mistaken for a week's. */
.week__days {
  padding-left: var(--sp-3);
  animation: mw-rise var(--dur-3) var(--ease-out) both;
}
.week__days .day:last-child { margin-bottom: 0; }

.shift-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.shift-list > li + li { border-top: 1px solid var(--line); }

.shift {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) 0;
  color: var(--text);
  transition: background var(--dur-2) var(--ease);
}
.shift:hover { background: var(--surface-2); text-decoration: none; }
.shift:active { background: var(--surface-3); }

/* Colour stripe down the left, the way the reference cards mark each row */
.shift__bar { flex: none; width: 4px; align-self: stretch; min-height: 52px; border-radius: 0 3px 3px 0; background: var(--line-strong); }
.shift__bar--working  { background: var(--brand); }
.shift__bar--on_break { background: var(--warn); }
.shift__bar--completed{ background: color-mix(in srgb, var(--brand) 45%, var(--line-strong)); }

.shift__body { flex: 1; min-width: 0; }
.shift__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}
/* The workplace name, with its colour beside it. A flex row so the swatch
   keeps its size while a long name still truncates rather than pushing out. */
.shift__where {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
}
.shift__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shift__worked { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; flex: none; }
.shift__times {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.shift__arrow { opacity: .6; }
.shift__break { color: var(--warn); }

/* ---- Shift detail ------------------------------------------------------ */
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  margin: calc(var(--sp-2) * -1) 0 var(--sp-2) -6px;
  padding: 0 10px 0 6px;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--brand);
  transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-out);
}
.backlink:hover { background: var(--brand-soft); text-decoration: none; }
.backlink:active { transform: scale(.97); }
.backlink svg { width: 18px; height: 18px; }

.shift-hero {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, var(--brand-soft), transparent 78%);
}
.shift-hero--on_break { background: linear-gradient(170deg, var(--warn-soft), transparent 78%); }
.shift-hero__status { margin-bottom: var(--sp-3); }
.shift-hero__worked {
  font-size: clamp(40px, 13vw, 56px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.shift-hero__meta { margin-top: var(--sp-2); font-size: 14px; color: var(--text-2); }

.ledger { display: grid; gap: var(--sp-2); }
.ledger__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: 15px;
}
.ledger__val { font-weight: 600; font-variant-numeric: tabular-nums; }
.ledger__val--minus { color: var(--warn); }
.ledger__row--total {
  margin-top: var(--sp-1);
  padding-top: var(--sp-3);
  border-top: 2px solid var(--line);
  font-size: 17px;
  font-weight: 650;
}
.ledger__row--total .ledger__val { font-size: 20px; color: var(--brand); }
.ledger__row--faint { font-size: 13px; color: var(--muted); }
.ledger__row--faint .ledger__val { font-weight: 550; color: var(--muted); }

.break-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.break {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 14px;
}
.break--running { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.break__no {
  flex: none;
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 650;
}
.break__times { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.break__dur { font-weight: 650; font-variant-numeric: tabular-nums; }

.break-edit {
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  margin-bottom: var(--sp-3);
}
/* minmax(0, …) and not 1fr: a datetime-local box has an intrinsic width of
   ~250px in Chrome, and two of them in plain 1fr tracks widened the whole
   page on a phone (§23). */
.break-edit__grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.break-edit__grid .field { margin-bottom: 0; }

/* ---- Calendar ----------------------------------------------------------- */
.cal { overflow: hidden; }

.cal__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.cal__title { flex: 1; min-width: 0; text-align: center; }
.cal__month { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.cal__total { font-size: 12px; color: var(--muted); margin-top: 1px; }

.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: var(--sp-2);
}
.cal__grid--head {
  padding-bottom: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

/* Square-ish cells that stay tappable on the narrowest phone: 7 columns of a
   360px screen leaves ~46px each, which is close to the 48px target. */
.cal__day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  aspect-ratio: 1;
  padding: 4px 1px;
  border-radius: var(--r-sm);
  overflow: hidden;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  transition: background var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.cal__day.is-dim { opacity: .32; }
.cal__num { font-size: 12.5px; font-weight: 550; line-height: 1.1; }

.cal__day.is-today .cal__num {
  width: 20px; height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-weight: 650;
}

/* A worked day is tinted with whichever job took most of it — enough to pick
   the worked days out of the month at arm's length. The precise reading is
   the 24-hour line below; this is only the ground it sits on. */
a.cal__day.has-hours {
  color: var(--text);
  background: color-mix(in srgb, var(--wp-lead, var(--brand)) 14%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) a.cal__day.has-hours {
    background: color-mix(in srgb, var(--wp-lead, var(--brand)) 24%, transparent);
  }
}
:root[data-theme="dark"] a.cal__day.has-hours {
  background: color-mix(in srgb, var(--wp-lead, var(--brand)) 24%, transparent);
}
:root[data-theme="light"] a.cal__day.has-hours {
  background: color-mix(in srgb, var(--wp-lead, var(--brand)) 14%, transparent);
}

/* Everything written on the day sits above its colours. */
.cal__num,
.cal__hrs,
.cal__track { position: relative; z-index: 1; }
a.cal__day:hover { text-decoration: none; background: var(--surface-3); transform: scale(1.04); }
a.cal__day:active { transform: scale(.96); }
a.cal__day.is-picked {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  background: var(--brand-soft);
}

.cal__hrs {
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.02em;
  white-space: nowrap;
}

/* Relative-height bar pinned to the bottom of the cell: the month's shape
   reads at a glance without having to compare the numbers. */
/* ---- The day's work, split between its jobs -----------------------------
   One line per worked date, pinned along the foot of the cell and filled end
   to end: each workplace holds the share of it that it was worked for. A day
   at one job is one colour; a day split six hours to two is three quarters
   against one quarter. */
.cal__track {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 5px;
  border-radius: 3px;
  /* Rounds both ends of the line once, rather than every segment inside it —
     square segments meeting square segments is what makes a split read as one
     line divided rather than as separate bars laid near each other. */
  overflow: hidden;
}

.cal__seg {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--wp-css, var(--brand));
}

.day-shift {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3) var(--sp-2) 0;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  color: var(--text);
  transition: background var(--dur-2) var(--ease);
}
.day-shift:hover { background: var(--surface-3); text-decoration: none; }
.day-shift__body { flex: 1; min-width: 0; }
/* The workplace name, with its colour beside it. */
.day-shift__where {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}
.day-shift__worked { flex: none; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---- Workplaces --------------------------------------------------------- */
.workplace {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 68px;
  padding: var(--sp-3) var(--sp-4);
  color: var(--text);
  transition: background var(--dur-2) var(--ease);
}

.workplace__mark {
  flex: none;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 16px;
  transition: transform var(--dur-3) var(--ease-snap);
}

.workplace__body { flex: 1; min-width: 0; }
.workplace__name {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
}
/* A long workplace name truncates rather than wrapping under its own
   Default tag, which would push the row to two lines beside three buttons. */
.workplace__name > :first-child,
.workplace__name { overflow: hidden; }
.workplace__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.workplace__name .chip__tag { flex: none; }
.workplace__sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workplace__sub { display: flex; align-items: center; gap: 5px; }
.workplace__sub .chip__tag { flex: none; font-size: 9.5px; padding: 1px 6px; }
.workplace__actions { display: flex; gap: var(--sp-1); flex: none; }
.icon-btn--sm { width: 40px; height: 40px; border-radius: var(--r-sm); }
.icon-btn--sm svg { width: 17px; height: 17px; }
.icon-btn--danger { color: var(--danger); }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---- Friends -------------------------------------------------------------

   A row per person, the same shape as a workplace row — a mark, a name, and
   what you can do about them — with the mark being their actual face rather
   than a letter standing in for a place.
*/
.friend-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 68px;
  padding: var(--sp-3) var(--sp-4);
}
.friend-row__body { flex: 1; min-width: 0; }
.friend-row__name {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-row__sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}
.friend-row__actions { display: flex; gap: var(--sp-2); flex: none; }

.friend-tabs {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  overflow-x: auto;
  scrollbar-width: none;
}
.friend-tabs::-webkit-scrollbar { display: none; }
.friend-tabs__link {
  flex: none;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.friend-tabs__link:hover { text-decoration: none; background: var(--surface-3); }
.friend-tabs__count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 700;
}

/* ---- More: the TimeSheet's back rooms -----------------------------------

   Three ways in, each carrying the figure that answers it without being
   opened — what you are owed, how many places you work.

   The icon sits in a tinted container in its own colour rather than white on
   a solid block: three solid blocks read as three buttons shouting at once,
   where the tint says the same thing quietly and leaves the words the
   loudest part of the row. The colour is allowed to be strong in one place,
   which is the state layer under your finger.

   On a phone the three are one card with hairlines between them. From 640px
   they become tiles across the page, because three rows down the left of a
   wide screen is mostly empty screen.
   ------------------------------------------------------------------------- */
.more__label { margin: 0 0 var(--sp-2); }

.more {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.more__item + .more__item .more__row { border-top: 1px solid var(--line); }

.more__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 72px;
  padding: var(--sp-3) var(--sp-4);
  color: var(--text);
  text-decoration: none;
}
.more__row:hover { text-decoration: none; }

/* The state layer, over the whole row and under everything in it — hence the
   relative positioning on the pieces below, which would otherwise be under
   it rather than over. */
.more__row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tint, var(--brand));
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease);
}
.more__row:hover::after { opacity: .07; }
.more__row:active::after { opacity: .12; }

.more__icon {
  position: relative;
  flex: none;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tint, var(--brand)) 14%, transparent);
  color: var(--tint, var(--brand));
}
.more__icon svg { width: 21px; height: 21px; }

.more__body { position: relative; flex: 1; min-width: 0; }
.more__title { display: block; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.more__sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tabular, because these are figures that change under you on a refresh and
   a row that re-flows when 9 becomes 10 reads as a glitch. */
.more__value {
  position: relative;
  flex: none;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.more__chev {
  position: relative;
  flex: none;
  width: 18px; height: 18px;
  color: var(--line-strong);
  transition: transform var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.more__row:hover .more__chev { transform: translateX(3px); color: var(--tint, var(--brand)); }

/* One accent per way in. They are nobody's status — they only tell the three
   apart, which is why none of them is the brand. */
.more__row--violet { --tint: var(--violet); }
.more__row--orange { --tint: var(--orange); }
.more__row--blue   { --tint: var(--blue); }

/* ---- Wide enough for tiles ---- */

@media (min-width: 640px) {
  .more {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: var(--sp-3);
    background: none;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
  .more__item + .more__item .more__row { border-top: 0; }
  /* The item is the grid cell and the row is what is drawn, so the row has to
     be told to fill the cell — otherwise a tile with no figure in it is
     shorter than the two beside it. */
  .more__item { display: flex; }
  .more__row {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    min-height: 0;
    padding: var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
  }
  .more__icon { width: 48px; height: 48px; border-radius: 16px; }
  .more__icon svg { width: 23px; height: 23px; }
  .more__body { flex: none; margin-top: var(--sp-3); }
  /* Room to wrap: a tile is narrower than a row, and clipping a sentence
     that now has somewhere to go would be a worse read, not a tidier one. */
  .more__sub { white-space: normal; }
  /* Pushed to the bottom of the tile, so the three figures share a baseline
     however many lines the sentence above each of them ran to. */
  .more__value { margin-top: auto; padding-top: var(--sp-3); font-size: 15px; color: var(--tint, var(--brand)); }
  .more__chev { position: absolute; top: var(--sp-4); right: var(--sp-4); }
}

/* --------------------------------------------------------------------------
   17. Motion
   Interaction feedback only: things move when you touch them, hover them, or
   when they are reporting live state. Nothing animates just because a page
   loaded — content is simply there when it arrives.
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }

/* ---- Touch feedback: anything tappable dips under a finger -------------- */
.result {
  transition: background var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.result:active { transform: scale(.99); }

.tab {
  transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease),
              transform var(--dur-1) var(--ease);
}
.tab:active { transform: scale(.93); }
.tab svg { transition: stroke-width var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-snap); }

.icon-btn {
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease),
              transform var(--dur-1) var(--ease);
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { transition: transform var(--dur-3) var(--ease-snap); }
.icon-btn:hover svg { transform: rotate(15deg); }

.brand__mark { transition: transform var(--dur-3) var(--ease-snap); }
.brand:hover .brand__mark { transform: rotate(-6deg) scale(1.06); }

/* Row affordances: the chevron leads the eye toward where the tap goes. */
.plu-badge { transition: transform var(--dur-2) var(--ease-snap), background var(--dur-2) var(--ease); }
.result:hover .plu-badge { transform: scale(1.05); }

.result__chev { transition: transform var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease); }
.result:hover .result__chev,
.shift:hover .result__chev,

.searchbar__clear {
  transition: background var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.searchbar__clear:active { transform: scale(.9); }

.searchbar__meta { transition: color var(--dur-2) var(--ease); }

/* Inputs: the focus ring grows in rather than snapping on. */
.input,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="hidden"]):not([type="range"]):not([type="color"]),
select, textarea {
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease);
}

/* A break row added by tapping "Add a break" is the one case where new
   content earns an entrance: it confirms the tap did something. */
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.break-edit.is-new { animation: fade-up var(--dur-2) var(--ease-out) both; }

/* ---- Live state --------------------------------------------------------- */
/* The dot pulses only while the clock is actually running, so movement on
   screen always means time is being counted. */
.status-pill--working .status-pill__dot,
.status-pill--on_break .status-pill__dot {
  animation: pulse-dot 1.8s var(--ease) infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%      { box-shadow: 0 0 0 5px transparent; opacity: .55; }
}

/* The ring eases between values instead of jumping each time it repaints. */
.dial__progress {
  transition: stroke-dashoffset .6s var(--ease-out), stroke .3s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* --------------------------------------------------------------------------
   18. Hub — the app chooser you land on after signing in
   -------------------------------------------------------------------------- */

/* Which of KaamKoRecord's apps you're inside, shown next to the brand. Hidden on the
   narrowest phones, where the tab bar already answers the question. */
.brand__section {
  flex: none;
  padding: 3px var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
@media (max-width: 1023px) {
  .brand__section { display: none; }
}

.app-grid {
  display: grid;
  /* Two tiles, side by side at every width — the pair reads as one choice,
     and neither ever needs a scroll to reach. */
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 132px;
  padding: var(--sp-4) var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  color: var(--text);
  text-align: center;
  transition: transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease);
}
.app-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}
.app-card:active { transform: scale(.98); }

.app-card__icon {
  flex: none;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--brand);
  transition: transform var(--dur-2) var(--ease-snap);
}
.app-card:hover .app-card__icon { transform: scale(1.06); }
.app-card__icon svg { width: 24px; height: 24px; }

.app-card__title {
  display: block;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.app-card__sub {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.3;
}

/* Leaving the hub is not the reason you came here, so it sits apart and quiet. */

/* --------------------------------------------------------------------------
   19. Wider screens — the tabs move up into the app bar, the floating bar goes
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  :root { --tabbar-h: 0px; }

  .tabbar { display: none; }

  .appbar__nav {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
  }
  .appbar__nav .tab {
    flex: none;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: var(--sp-2);
    height: 40px;
    padding: 0 var(--sp-3);
    border-radius: var(--r-md);
    font-size: 14px;
    color: var(--text-2);
  }
  .appbar__nav .tab:hover { background: var(--surface-2); color: var(--text); }
  .appbar__nav .tab.is-active { background: var(--brand-soft); color: var(--brand); }
  .appbar__nav .tab svg { width: 18px; height: 18px; }
  /* The count rides the icon here too, ringed in the bar's own colour. */
  .appbar__nav .tab__badge { top: -6px; right: -8px; box-shadow: 0 0 0 2px var(--surface); }

  /* Three segments do not need a metre of track. */
  .segments--places { max-width: 520px; }
  .segments--views { max-width: 360px; }

  .container { padding-bottom: var(--sp-8); }

  .page-title { font-size: 32px; }

  .stat-row { grid-template-columns: repeat(4, 1fr); }

  .detail-actions { grid-template-columns: repeat(2, 1fr); }

  .copied-flash { bottom: var(--sp-6); }
}


/* --------------------------------------------------------------------------
   20. Motion — one vocabulary, used everywhere

   Three verbs and nothing else: things RISE in when they arrive, PRESS when
   you touch them, and PULSE while they're busy. Everything reuses the curves
   and durations from section 1, so the whole site moves like one object.
   The blanket prefers-reduced-motion rule in section 17 switches all of it
   off, which is why nothing below needs its own guard.
   -------------------------------------------------------------------------- */

@keyframes mw-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* A notification lands from above and settles, rather than rising into place. */
@keyframes mw-notify {
  from { opacity: 0; transform: translateY(-10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
/* The new-dot breathes, slowly enough to be noticed and not watched. */
@keyframes mw-ping {
  0%, 70%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--tint) 18%, transparent); }
  35%           { box-shadow: 0 0 0 7px color-mix(in srgb, var(--tint) 6%, transparent); }
}
@keyframes mw-pop  { 0% { opacity: 0; transform: scale(.9); } 60% { transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes mw-dots { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---- Arrival ------------------------------------------------------------
   Deliberately NOT applied to .searchbar: it is position: sticky, and an
   animated transform would make it a containing block and drop the stick. */
/* Nothing rises on its own when a page is first loaded: the content is
   simply there. What moves is the page as a whole when you go from one to
   the next (below) — the way a native app pushes the next screen in from
   the right, pops back to the left, and cross-fades between tabs. app.js
   writes which of the three on <body> as the new page lands; a full load
   has none and animates nothing. */
body[data-arrive="forward"] > .container { animation: mw-page-push .34s var(--ease-out) both; }
body[data-arrive="back"]    > .container { animation: mw-page-pop  .34s var(--ease-out) both; }
body[data-arrive="tab"]     > .container { animation: mw-page-tab  .24s var(--ease-out) both; }
@keyframes mw-page-push { from { opacity: 0; transform: translateX(32px); }  to { opacity: 1; transform: none; } }
@keyframes mw-page-pop  { from { opacity: 0; transform: translateX(-32px); } to { opacity: 1; transform: none; } }
@keyframes mw-page-tab  { from { opacity: 0; transform: translateY(8px); }   to { opacity: 1; transform: none; } }

/* Search results re-render on every keystroke, so the cascade has to be quick
   enough to keep up with typing — .24s, and only the first eight rows wait. */
.result-list > li { animation: mw-rise .24s var(--ease-out) both; }
.result-list > li:nth-child(1) { animation-delay: .00s; }
.result-list > li:nth-child(2) { animation-delay: .03s; }
.result-list > li:nth-child(3) { animation-delay: .06s; }
.result-list > li:nth-child(4) { animation-delay: .09s; }
.result-list > li:nth-child(5) { animation-delay: .12s; }
.result-list > li:nth-child(6) { animation-delay: .15s; }
.result-list > li:nth-child(7) { animation-delay: .18s; }
.result-list > li:nth-child(n+8) { animation-delay: .21s; }

.alert { animation: mw-rise var(--dur-2) var(--ease-out) both; }

/* ---- Press --------------------------------------------------------------
   A tap should feel like it depressed something. The ripple is drawn from the
   exact touch point (app.js sets --rx/--ry) so it reads as cause and effect. */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn__ripple {
  position: absolute;
  left: var(--rx, 50%);
  top: var(--ry, 50%);
  width: 0; height: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: .22;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
  animation: mw-ripple .5s var(--ease-out) forwards;
}
@keyframes mw-ripple {
  to { width: 260%; padding-bottom: 260%; opacity: 0; }
}

/* ---- Busy ---------------------------------------------------------------
   A button that submitted work keeps its size, swaps its label for a spinner,
   and stops accepting taps — so nothing double-submits. */
.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn--primary.is-loading::before { border-top-color: var(--brand-ink); }

/* The search bar grows a hairline of moving light while a request is open —
   quieter than a spinner, and it sits exactly where you are already looking. */
.searchbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  /* Travels by background-position, not transform: a transform would carry the
     bar outside the sticky header and widen the page on a phone. */
  background-image: linear-gradient(90deg, transparent, var(--brand), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  background-position: -45% 0;
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}
.searchbar.is-busy::after {
  opacity: 1;
  animation: mw-track 1.1s var(--ease) infinite;
}
@keyframes mw-track { to { background-position: 145% 0; } }

/* "Searching…" — the dots carry the waiting, so the text can stay still. */
.dot-flash { animation: mw-dots 1.2s var(--ease) infinite; }
.dot-flash:nth-child(2) { animation-delay: .16s; }
.dot-flash:nth-child(3) { animation-delay: .32s; }

/* ---- Surfaces that respond ---------------------------------------------- */
.result {
  transition: background var(--dur-1) var(--ease),
              transform var(--dur-1) var(--ease);
}
.result:active { transform: scale(.995); }

.tab svg { transition: transform var(--dur-2) var(--ease-snap); }
.tab:active svg { transform: scale(.88); }

.input, .searchbar__input {
  transition: border-color var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease);
}

.icon-btn { transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-snap); }
.icon-btn:active { transform: scale(.9); }


/* --------------------------------------------------------------------------
   22. Flow — one rhythm, so nothing ever sits flush against what's above it

   Cards, grids and lists each brought their own margins, which left gaps
   wherever two different kinds met (a summary row above a limit card, say).
   This sets a floor for every top-level block instead. Adjacent margins
   collapse, so anything that already spaces itself further apart keeps its
   own spacing — this only ever adds a gap, never doubles one.
   -------------------------------------------------------------------------- */
.container > * + *:not(.searchbar) { margin-top: var(--sp-5); }
/* The timesheet's filtered half is one element to the container but a stack
   of cards to the eye, so it keeps the same rhythm inside itself. */
.sheet > * + * { margin-top: var(--sp-5); }
.sheet > * { max-width: 100%; }


/* --------------------------------------------------------------------------
   23. No horizontal overflow, at any width

   `1fr` is `minmax(auto, 1fr)`: a long unbreakable figure in one cell widens
   the whole grid and pushes the page sideways. `minmax(0, 1fr)` lets the
   column shrink instead, which is what keeps these rows inside the screen on
   a 320px phone. Flex rows need the same permission via min-width.
   -------------------------------------------------------------------------- */
.summary-grid,
.stat-row,
.app-grid           { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Paid weekly, there is one figure worth showing and it gets the width. */
.summary-grid--1    { grid-template-columns: minmax(0, 1fr); }
.summary-grid--2    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-grid--3,
.tallies            { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cal__grid          { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.detail-actions > * { min-width: 0; }

@media (min-width: 768px) {
  .detail-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* The narrowest phone: three figures across is the tightest row in the app,
   so the value is allowed to shrink a step further before it would clip. */
.summary-grid--3 .summary-card__value { font-size: clamp(15px, 4.4vw, 24px); }

/* Flex rows whose text must be free to wrap or ellipsis rather than push.
   Everything added since this list was written belongs on it too — a new
   component that forgets is a page that scrolls sideways on one phone. */
.limit__head > div:first-child,
.results-head > *,
.day__head > *,
.panel__head > *,
.facts__row > *,
.shift__name,
.cal__key-item,
.cal__title { min-width: 0; }

/* Grid items too: a notice is a grid item of the board, and a grid track
   grows to a card's min-content width unless the card is allowed to be
   narrower than the names and counts on its tally line. */
.board > *,
.notices > .notice,
.notes > .note,
.notice > * { min-width: 0; }
.tally { overflow: hidden; }
.tally > a.tally__emoji { flex: 1 1 auto; }

/* A long workplace name heads its own limit bar — wrap it, don't widen it */
.limit .section-label { overflow-wrap: anywhere; }

/* Nothing inside the page may be wider than the page */
.container > * { max-width: 100%; }

/* A form control never widens its column: the browser gives date, time and
   file inputs an intrinsic width that a grid track or a flex item would
   otherwise grow to hold. */
input, select, textarea { min-width: 0; max-width: 100%; }

/* app.js hides the form rows that don't apply; nothing may override this. */
[hidden] { display: none !important; }


/* --------------------------------------------------------------------------
   24. Live data — figures arrive the way they were earned

   Totals count up to their value, bars fill to their share and the dial
   sweeps to its position, all from the real server-rendered number. Nothing
   here invents data: with JS off, or reduced motion on, every figure is
   simply the final value, printed.
   -------------------------------------------------------------------------- */
[data-tally] { font-variant-numeric: tabular-nums; }

.limit__fill { animation: mw-fill .9s var(--ease-out) both; }
@keyframes mw-fill {
  from { width: 0; }
  to   { width: var(--pct, 0%); }
}

/* Each shift draws itself onto the day's line rather than appearing on it. */
.cal__seg { animation: mw-grow .45s var(--ease-out) both; transform-origin: left center; }
@keyframes mw-grow {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: none; opacity: 1; }
}


/* The quiet way into "add a shift on this day" — a link, not a button, so the
   day panel stays a list of what happened. */
.daylink {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}
.daylink svg { width: 15px; height: 15px; }


/* --------------------------------------------------------------------------
   25. Notice board — the one surface everybody on KaamKoRecord shares

   Reads as a wall of short messages: a coloured initial for who wrote it, the
   words, and nothing else unless it's yours. The colour comes from the name
   itself (see Notice.hue), so a person is the same colour on every device
   without anything being assigned or stored.
   -------------------------------------------------------------------------- */
.board { display: grid; gap: var(--sp-3); }

.board__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.board__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.board__title svg { width: 18px; height: 18px; flex: none; color: var(--brand); }
.board__count { flex: none; font-size: 12px; color: var(--muted); }

.board__more {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  justify-self: start;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}
.board__more svg { width: 15px; height: 15px; }

/* ---- The initial beside every notice ----------------------------------- */
.avatar {
  flex: none;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 650;
  color: #fff;
  background: hsl(var(--hue, 210) 58% 50%);
  /* A pale name colour on a pale card still has to hold white text. */
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.avatar--me { background: var(--brand); color: var(--brand-ink); }

/* ---- Here now ----------------------------------------------------------
   A dot on the corner of somebody's face while they are using KaamKoRecord.

   It sits half outside the circle with a ring of the page behind it, which is
   what separates it from the face rather than making it look like part of the
   picture. The ring is --surface rather than a fixed white so it stays right
   on a tinted notice and in the dark theme.

   The soft halo is the same green at low opacity, breathing slowly. Slowly is
   the point: it should read as presence, not as an alert wanting something. */
.avatar { position: relative; }

.avatar__live {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--brand);
  box-shadow:
    0 0 0 var(--dot-ring) var(--surface),
    0 0 0 calc(var(--dot-ring) + 1px) color-mix(in srgb, var(--brand) 45%, transparent);
  animation: mw-here 3.2s var(--ease) infinite;
}

/* One dot, sized to the face it hangs off.

   Every avatar size names its own, rather than each one overriding width and
   height and the two rings again — otherwise the ring stops matching the dot
   the moment either changes, which is how it ends up looking stuck on. The
   default belongs to the 38px face the board is full of. */
.avatar     { --dot: 11px; --dot-ring: 2px; }
.avatar--sm { --dot: 8px;  --dot-ring: 2px; }
.avatar--md { --dot: 11px; --dot-ring: 2px; }
.avatar--xl { --dot: 20px; --dot-ring: 3px; }

/* The app bar's is the one avatar with a screen edge beside it, so its dot
   sits inside the circle rather than half out of it — hanging over the edge
   is how it gets clipped by the viewport. */
.avatar--btn { --dot: 9px; --dot-ring: 2px; right: 0; bottom: 0; }
.avatar--btn .avatar__live { right: 0; bottom: 0; }

/* Your own photo, on your own profile, already has a button in that corner
   for changing it. The dot moves to the opposite one rather than sitting
   under the camera — and it stays, because a face is a face and this is
   still the place you check that KaamKoRecord thinks you are here. */
.photo-menu .avatar__live { bottom: auto; top: 4px; right: 4px; }

@keyframes mw-here {
  0%, 100% { opacity: 1; }
  50%      { opacity: .72; }
}

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

/* A photo covers the letter but not the colour: the tinted circle stays
   underneath, so it is what you see while the image is still on its way and
   what shows through a transparent corner once it lands. */
.avatar__img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  /* The circle is already cropped square server-side; this is belt and
     braces for a photo saved before that, and for a browser mid-download. */
  display: block;
}

/* The sizes a face is drawn at. --sm and --lg are set with the board and the
   profile header they belong to; these two are the app bar's and the profile
   page's own. */
.avatar--btn { width: 32px; height: 32px; font-size: 13px; }
.avatar--md  { width: 40px; height: 40px; font-size: 16px; }
.avatar--xl  { width: 96px; height: 96px; font-size: 38px; }
/* The avatar and the name lead to a profile. They stay looking like a face
   and a name — a board of underlined blue names would read as a link list. */
a.avatar { text-decoration: none; transition: transform var(--dur-1) var(--ease-snap); }
a.avatar:hover { transform: scale(1.06); text-decoration: none; }

/* ---- Writing one -------------------------------------------------------- */
.compose {
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.compose:focus-within {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow: var(--shadow-2);
}
.compose__row { display: flex; align-items: flex-start; gap: var(--sp-3); }
.compose__field { flex: 1; min-width: 0; }

/* The box is a line high until there's something in it — app.js grows it as
   you type, so an empty board doesn't open with a wall of blank textarea. */
.compose textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: none;
  overflow: hidden;
}
.compose textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.compose textarea::placeholder { color: var(--muted); }

.compose__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}
.compose__count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.compose__count.is-close { color: var(--warn); font-weight: 600; }

/* ---- Who sees it — the compact audience pickers on a notice, an edit, a
   comment and a reply, and the badge that shows on the card afterwards.
   Small everywhere it appears, because the words are the point and the
   audience is one word of context beside them, not a form field to weigh. */
.vis-select {
  /* Every <select> on the site is styled full-width with a 52px minimum
     (see §7, "Django renders bare <input>s") — right for a form field,
     wrong for this: without opting out here explicitly, this pill grew to
     fill the whole row and pushed the send button off the edge of a phone
     screen. `!important` because a bare `select` tag selector and this
     class carry the same specificity, and this one must always win. */
  flex: none;
  width: auto !important;
  min-height: 0 !important;
  height: 30px;
  padding: 0 22px 0 8px !important;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background-color: var(--surface-2);
  background-size: 11px 11px;
  background-position: right 7px center;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text-2);
}
.vis-select:focus { outline: none; border-color: var(--brand); }
.reply__vis { margin-right: -2px; flex-shrink: 0; }
.reply--sm .vis-select { height: 26px; font-size: 11px; padding-right: 20px !important; }

.vis-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  color: var(--muted);
  vertical-align: -2px;
}
.vis-badge svg { width: 13px; height: 13px; }

/* The mark beside an admin's name (accounts/_admin_badge.html): a small
   brand-coloured pill, sized to sit inside a line of text of any weight. */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 16px;
  vertical-align: 2px;
  white-space: nowrap;
}
.admin-badge svg { width: 12px; height: 12px; }
.page-title .admin-badge, .profile-id__name .admin-badge, .profile__name .admin-badge { font-size: 12px; vertical-align: 5px; }
/* The notice head is a flex row with its own gap, so the pill needs no
   margin of its own there; in a comment bubble the name and the words run
   on in one line, so the mark sits between them at the words' size, with
   the name's own 6px before the text and none doubled up after the name. */
.notice__head .admin-badge { margin-left: 0; }
.comment__body .admin-badge {
  margin: 0 2px 0 0; /* the space in the markup makes up the rest */
  padding: 0 6px 0 4px;
  font-size: 10px;
  line-height: 15px;
  vertical-align: -1px;
}
.comment__body .admin-badge svg { width: 11px; height: 11px; }

/* ---- Reading them ------------------------------------------------------- */
/* Notices sit apart from each other the way notifications do, rather than
   stacking into one wall of text. */
.notices { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }

/* ---- One notice, arriving ----------------------------------------------
   Tinted in the colour of whoever sent it, lifted off the page, and dotted
   while it is still new. --hue comes off the author's name (see Notice.hue),
   so a person is the same colour on every device with nothing stored.

   This is the one place in KaamKoRecord that carries a shadow on purpose. The rule
   in section 1 is that only things which genuinely float cast one — and a
   notification is exactly that: something that arrived on top of the page
   rather than a piece of it.
   ---------------------------------------------------------------------- */
.notice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  /* Slides down and settles, one after another — the way a stack of
     notifications lands. Section 17 switches this off for anyone who has
     asked for less motion. */
  animation: mw-notify var(--dur-3) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

/* Sent by somebody else: the same plain card as any other — no wash of
   their colour, no tinted edge, no lift. The hue comes off the name (see
   hue_for) and shows only where it says something: their name and, while it
   is new, the dot. */
.notice--from {
  --tint: var(--brand);
  --tint-ink: var(--text);
}
.notice--from .notice__who { color: var(--tint-ink); }
.notice__dot {
  position: absolute;
  top: 16px; right: 16px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--tint);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tint) 18%, transparent);
  animation: mw-ping 2.6s var(--ease) infinite;
}

.notice__body { flex: 1; min-width: 0; }

.notice__head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.notice__who {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.notice__when { font-size: 12px; color: var(--muted); }

.notice__text {
  margin-top: 3px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-2);
  /* A pasted URL or an unbroken run of characters wraps instead of widening
     the card and, with it, the page. */
  overflow-wrap: anywhere;
}

/* On a dark card the name needs lifting rather than darkening. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .notice--from { --tint-ink: var(--text); }
}
:root[data-theme="dark"] .notice--from { --tint-ink: var(--text); }

.notices-empty {
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
.notices-empty .empty__icon { margin: 0 auto var(--sp-2); }

/* The hub's board is a section below the tiles; give it room to breathe. */
.app-grid + .board { margin-top: var(--sp-6); }


/* ---- The way in: one small button -------------------------------------- */
.board__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.board__bar .page-head { margin-bottom: 0; min-width: 0; }
.board__tools { display: flex; align-items: center; gap: var(--sp-3); flex: none; }

.post-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 40px;
  padding: 0 var(--sp-4) 0 12px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -.01em;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--brand) 34%, transparent);
  transition: transform var(--dur-1) var(--ease-snap), box-shadow var(--dur-2) var(--ease);
}
.post-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 42%, transparent);
}
.post-btn:active { transform: scale(.95); }
.post-btn svg { width: 15px; height: 15px; }

/* Past the narrowest phones the label is worth its width; below that the +
   says it on its own. */
@media (max-width: 380px) {
  .post-btn { width: 40px; padding: 0; justify-content: center; }
  .post-btn__label { display: none; }
}

/* ---- The composer, in a dialog ----------------------------------------- */
.modal {
  width: 100%;
  max-width: 520px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
}
.modal::backdrop {
  background: rgba(2, 6, 23, .5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: mw-veil var(--dur-2) var(--ease) both;
}
@keyframes mw-veil { from { opacity: 0; } to { opacity: 1; } }

.modal__box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  padding: var(--sp-4);
  animation: mw-modal .3s var(--ease-out) both;
  /* Taller than the screen — the composer with a video and its trimmer on
     a small phone — the box scrolls inside itself, so nothing below the
     fold is out of reach. The cap is the dialog's own, from the browser's
     stylesheet, which .modal's overflow: visible would otherwise let the
     box hang past. */
  max-height: calc(100vh - 6px - 2em);
  max-height: calc(100dvh - 6px - 2em);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@keyframes mw-modal {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* Leaving reverses the arrival, so the box goes back the way it came. */
.modal.is-closing .modal__box { animation: mw-modal-out .16s var(--ease) both; }
.modal.is-closing::backdrop { animation: mw-veil .16s var(--ease) reverse both; }
@keyframes mw-modal-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(8px) scale(.98); }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.modal__title { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
/* A sheet that is read rather than typed into — the names behind a tally —
   is solid: a list over a busy board is unreadable through glass. */
.modal--solid .modal__box {
  background: var(--surface);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.modal__heading { min-width: 0; }
.modal__sub { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.modal__sub:empty { display: none; }
/* A sheet that lists things scrolls inside itself past a screen's worth,
   so the head and the way out stay put. */
.modal__body { max-height: min(60vh, 520px); overflow-y: auto; overscroll-behavior: contain; }
/* While the list is on its way. */
.modal__wait {
  height: 52px;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: mw-shimmer 1.2s linear infinite;
}
@keyframes mw-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* On a phone it belongs at the bottom, in reach, and slides up like a sheet. */
@media (max-width: 559px) {
  .modal {
    max-width: none;
    margin: auto auto 0;
    /* Dialogs are centred by UA styles; this pins it to the bottom edge. */
    align-self: end;
  }
  .modal__box {
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding-bottom: calc(var(--sp-4) + var(--safe-b));
    animation-name: mw-sheet;
  }
  @keyframes mw-sheet {
    from { opacity: .4; transform: translateY(100%); }
    to   { opacity: 1; transform: none; }
  }
  .modal.is-closing .modal__box { animation: mw-sheet .18s var(--ease) reverse both; }
}

/* ---- Reactions and replies --------------------------------------------- */
/* The card is a column, and every row of it — the tally, the actions, the
   thread — is stretched to its width. Left to the flex default the rows
   shrink to their content: the actions wrap to two lines because the row
   they are in is only as wide as they were, and the reply box stops short
   of the edge the card reaches. */
.notice { flex-direction: column; align-items: stretch; gap: var(--sp-2); }
.notice__main { display: flex; align-items: flex-start; gap: var(--sp-3); width: 100%; }

.avatar--sm { width: 28px; height: 28px; font-size: 12px; }

/* ---- The faces ----------------------------------------------------------
   Each reaction is drawn by {% reaction %} (noticeboard/templatetags/
   reactions.py): a coloured disc with the face on it, the same picture on
   every phone. It is sized by whatever holds it, so one drawing serves the
   tally at 16px, the button at 18px and the picker at 40px. A reaction that
   is no longer on the menu falls back to its glyph, sized to match.
   -------------------------------------------------------------------------- */
.rx {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -.15em;
  font-size: inherit;
  line-height: 1;
}
.rx--glyph { text-align: center; }

/* The running tally, above the buttons — what everyone else made of it:
   the two or three faces most left, overlapped the way a social app stacks
   them, the count, and the names; the comment count at the far end. */
.tally {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 24px;
  padding: 2px 2px 0;
  font-size: 12.5px;
  color: var(--muted);
}
.tally[hidden] { display: none; }
.tally__emoji { display: inline-flex; align-items: center; min-width: 0; flex: 1 1 auto; }
.tally__pips { display: inline-flex; align-items: center; flex: none; }
.tally__pip {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  /* The ring is the card's own surface, so a face overlapping the one
     behind it is cut out of it cleanly rather than blurred into it. */
  box-shadow: 0 0 0 2px var(--surface);
  font-size: 18px;
  margin-right: -5px;
}
.tally__pip:last-child { margin-right: 0; }
.tally__n { margin-left: 8px; font-weight: 650; color: var(--text-2); }
.tally__comments { margin-left: auto; flex: none; white-space: nowrap; color: inherit; }
.tally__comments:hover { color: var(--text); text-decoration: underline; }

/* Who is behind the count. The names are the point — the tally is a link to
   the rest of them, so nobody has to guess whose the faces were. */
a.tally__emoji { color: inherit; }
a.tally__emoji:hover { color: var(--text); text-decoration: none; }
a.tally__emoji:hover .tally__who { text-decoration: underline; }
.tally__who {
  margin-left: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---- One row of actions -------------------------------------------------
   React and Comment on the left, Edit and Remove on the right, a rule above
   them. Every one is the same height and the same shape whether it is a
   link, a button or the summary of the picker, and the row never wraps:
   past the phone the two on the right carry their words, on it they are
   their icons alone, which is enough for a pencil and a bin.
   -------------------------------------------------------------------------- */
.acts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
  gap: 2px;
  padding-top: var(--sp-1);
  border-top: 1px solid var(--line);
}
/* The Remove form is laid out as though it were not there, so its button
   takes a cell like the links beside it. */
.acts__form { display: contents; }

.act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  min-height: 40px;
  min-width: 40px;
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              transform var(--dur-1) var(--ease-snap);
}
.act::-webkit-details-marker { display: none; }
.act:hover, .act:focus { text-decoration: none; }
/* Hover only where there is a pointer to hover with: on a phone the
   emulated hover outlives the tap and leaves a grey pill behind. */
@media (hover: hover) {
  .act:hover { background: var(--surface-2); color: var(--text); }
}
.act:active { transform: scale(.96); background: var(--surface-2); }
.act__icon { width: 16px; height: 16px; flex: none; }
.act .rx { font-size: 18px; animation: mw-pop var(--dur-3) var(--ease-snap) both; }
/* Each action fills its cell, so the whole cell is the tap target. */
.acts > .act, .acts > .react, .acts__form > .act { min-width: 0; width: 100%; }
.react > .act { width: 100%; }

/* Once you have reacted the button wears your face and its colour. */
.act.is-on { color: var(--brand); }
.act.is-on[data-kind="like"]  { color: var(--rx-like); }
.act.is-on[data-kind="love"]  { color: var(--rx-love); }
.act.is-on[data-kind="care"],
.act.is-on[data-kind="haha"],
.act.is-on[data-kind="wow"],
.act.is-on[data-kind="sad"]   { color: var(--rx-face); }
.act.is-on[data-kind="angry"] { color: var(--rx-angry); }

@media (hover: hover) {
  .act--danger:hover { color: var(--danger); background: var(--danger-soft, var(--surface-2)); }
}
/* Four cells on the narrowest phones leave no room for "Remove" beside its
   bin; the pencil and the bin say it on their own there. */
@media (max-width: 359px) {
  .act--quiet { padding: 0; }
  .act--quiet .act__label { display: none; }
}

/* An admin's row carries one more cell — Pin — which is five on their own
   notices. Five do not fit their words on a phone, so there the quiet ones
   (Edit, Remove, Report, Pin) are their icons, as they already are below
   360px for everyone. */
@media (max-width: 479px) {
  .acts--admin .act--quiet { padding: 0; min-width: 40px; }
  .acts--admin .act--quiet .act__label { display: none; }
  /* And the cells stop being equal: equal fifths squeeze "Comment" into
     the cell beside it, where React and Comment keep their words and the
     icons need only their own width. */
  .acts--admin { grid-auto-columns: auto; justify-content: space-between; }
}

/* ---- Pinned --------------------------------------------------------------
   A notice an admin is holding at the top: a line above the author saying
   so, and a thin brand ring round the card, so it reads as deliberate
   rather than as last week's notice that somehow never sank. A ring, not
   a rail: the rail down the left edge already means "yours". */
.notice__pinned {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--brand);
}
.notice__pinned svg { width: 14px; height: 14px; }
/* An outline rather than a shadow: the card's own shadow is a stack set
   further down (its glass look), and a ring added there is overwritten. */
.notice--pinned { outline: 1.5px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: -1.5px; }
.act--pin.is-on { color: var(--brand); }

/* ---- Editing in place ---------------------------------------------------
   Edit turns the words of your own notice into a box, in the card, where
   they were (app.js initEditing). The box takes the text's place and its
   size; Save and Cancel sit under it, small and to the right, so the card
   grows by one row and nothing else on the board moves.
   -------------------------------------------------------------------------- */
.notice__text[hidden] { display: none; }
.editor { margin-top: 3px; animation: mw-rise var(--dur-2) var(--ease-out) both; }
.editor[hidden] { display: none; }
.editor__box {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px var(--sp-3);
  border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--line));
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
}
.editor__box:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.editor__error { margin-top: var(--sp-1); }
.editor__error[hidden] { display: none; }
.editor__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.editor__foot .btn svg { width: 15px; height: 15px; }
/* Saved: the words come back with a brief ring, the same one a notice gets
   when you are returned to it. */
.notice.is-saved { animation: mw-flag 1.4s var(--ease) both; }

/* ---- The row of faces ---------------------------------------------------
   A white pill floating above the React button, the faces in a row, each
   one landing a beat after the one before it. On a mouse the one under the
   pointer rises and says its name; on a phone each is a 44px target and
   the tap itself is the feedback. While the row is open the faces move —
   the heart beats, the laugh shakes, the anger trembles — which is what
   makes them a row of faces rather than a row of stickers.
   -------------------------------------------------------------------------- */
.react { position: relative; }

.picker {
  position: absolute;
  bottom: calc(100% + 4px);
  /* Moved back inside the screen by app.js when it would hang over the
     right edge (initReactions). */
  left: calc(0px - var(--shift, 0px));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  transform-origin: left bottom;
  animation: mw-picker var(--dur-3) var(--ease-out) both;
}
@keyframes mw-picker {
  from { opacity: 0; transform: translateY(8px) scale(.85); }
  to   { opacity: 1; transform: none; }
}

.picker__btn {
  position: relative;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  /* Each face arrives a beat after the one before it, the way the row of
     reactions pops open on a phone. */
  animation: mw-face var(--dur-3) var(--ease-snap) both;
  animation-delay: calc(var(--i, 0) * .04s);
  transition: transform var(--dur-2) var(--ease-snap);
}
@keyframes mw-face {
  from { opacity: 0; transform: translateY(14px) scale(.4); }
  to   { opacity: 1; transform: none; }
}
.picker__btn:active { transform: scale(.9); }
/* The face already yours sits on a ring, so the row says which tap would
   take it back rather than leave a second. */
.picker__btn.is-on::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 2px var(--brand);
}
.picker__btn .rx { position: relative; transform-origin: 50% 80%; }

/* Its name, on hover only: a phone has no hover and the faces are their own
   names there, as they are on the app this row is borrowed from. */
.picker__btn::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  translate: -50% 0;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-1) var(--ease), translate var(--dur-2) var(--ease-snap);
}
@media (hover: hover) {
  .picker:hover .picker__btn { transform: scale(.9); }
  .picker__btn:hover { transform: scale(1.45) translateY(-9px); z-index: 1; }
  .picker__btn:hover::after { opacity: 1; translate: -50% -2px; }
  .picker__btn:hover .rx { animation-duration: .6s; }
}
.picker__btn:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* The faces, moving. Each has its own gesture; §17 stills them all. */
.picker .rx--like  { animation: rx-like  1.6s var(--ease) infinite; }
.picker .rx--love  { animation: rx-love  1.1s var(--ease) infinite; }
.picker .rx--care  { animation: rx-care  1.8s var(--ease) infinite; }
.picker .rx--haha  { animation: rx-haha  .9s  var(--ease) infinite; }
.picker .rx--wow   { animation: rx-wow   1.8s var(--ease) infinite; }
.picker .rx--sad   { animation: rx-sad   2.2s var(--ease) infinite; }
.picker .rx--angry { animation: rx-angry .5s  var(--ease) infinite; }
@keyframes rx-like  { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-14deg) translateY(-1px); } 60% { transform: rotate(4deg); } }
@keyframes rx-love  { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.14); } 45% { transform: scale(1); } 60% { transform: scale(1.1); } }
@keyframes rx-care  { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes rx-haha  { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-3px) rotate(-6deg); } 75% { transform: translateY(-3px) rotate(6deg); } }
@keyframes rx-wow   { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.06); } }
@keyframes rx-sad   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px) rotate(-3deg); } }
@keyframes rx-angry { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-1.5px) rotate(-3deg); } 75% { transform: translateX(1.5px) rotate(3deg); } }

/* ---- Comments ----------------------------------------------------------- */
.comment { display: flex; align-items: flex-start; gap: var(--sp-2); }
/* The bubble hugs what was written rather than filling the row — a two-word
   comment in a full-width block reads as an announcement, not a remark. */
.comment__body {
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.comment__col { flex: 1; min-width: 0; }
.comment__who { font-size: 12.5px; font-weight: 650; margin-right: 6px; color: inherit; }
a.comment__who:hover { color: var(--brand); text-decoration: none; }
.comment__text { font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.comment__foot {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}
/* ---- One line of actions under a comment --------------------------------
   Time, react, reply and delete read as one sentence of small print. They
   are laid out so they stay on that line: nothing in the row is allowed to
   grow, and the panels they open (the faces, the reply box) sit outside it.
   -------------------------------------------------------------------------- */
.comment__foot { flex-wrap: wrap; gap: var(--sp-3); }
.comment__foot form { margin: 0; display: inline-flex; }
.comment__foot .react { flex: none; }
.comment__time { flex: none; }

.comment__act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.comment__act::-webkit-details-marker { display: none; }
.comment__act:hover { color: var(--text); text-decoration: none; }
.comment__act.is-on { color: var(--brand); }
.comment__act.is-on[data-kind="like"]  { color: var(--rx-like); }
.comment__act.is-on[data-kind="love"]  { color: var(--rx-love); }
.comment__act.is-on[data-kind="care"],
.comment__act.is-on[data-kind="haha"],
.comment__act.is-on[data-kind="wow"],
.comment__act.is-on[data-kind="sad"]   { color: var(--rx-face); }
.comment__act.is-on[data-kind="angry"] { color: var(--rx-angry); }
.comment__act .act__icon { display: none; }
.comment__act .rx { font-size: 14px; animation: mw-pop var(--dur-3) var(--ease-snap) both; }

/* The count on the comment itself, tucked against the bubble the way a chat
   app hangs it there. The names behind it are one tap, or one hover, away. */
.comment__tally {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  padding: 1px 6px 1px 3px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  vertical-align: 1px;
}
.comment__tally[hidden] { display: none; }
.comment__tally:hover { color: var(--text); text-decoration: none; }
.comment__tally .tally__pip { width: 15px; height: 15px; font-size: 14px; margin-right: -4px; box-shadow: 0 0 0 1.5px var(--surface); }
.comment__tally .tally__pip:last-child { margin-right: 0; }
.comment__tally .tally__n { margin-left: 6px; }

/* ---- Replies ------------------------------------------------------------
   Stepped in once and no further — the model keeps threads one deep, so the
   fourth indent never has to exist.
   -------------------------------------------------------------------------- */
.replies {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  padding-left: var(--sp-3);
  border-left: 2px solid var(--line);
}

/* ---- Folds --------------------------------------------------------------
   "View 3 previous comments". A <details>, so several threads can be open at
   once and none of it needs script.
   -------------------------------------------------------------------------- */
.fold__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.fold__toggle::-webkit-details-marker { display: none; }
.fold__toggle::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--line-strong);
}
.fold__toggle:hover { color: var(--text); }
.fold__body {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  animation: mw-rise var(--dur-2) var(--ease-out) both;
}
/* One word swaps for the other, so the line always says what tapping does. */
.fold__less, .fold[open] .fold__more { display: none; }
.fold[open] .fold__less { display: inline; }

/* The board's own fold carries whole notices rather than a line of chat, so
   it reads as a control across the list instead of a note beside one. */
.fold--notices { margin-top: var(--sp-2); }
.fold--notices > .fold__toggle {
  justify-content: center;
  width: 100%;
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  font-size: 13.5px;
  color: var(--text-2);
}
.fold--notices > .fold__toggle::before { display: none; }
.fold--notices > .fold__toggle:hover { background: var(--surface-2); color: var(--text); }

/* The picker on a comment is the same row of faces, sized for a smaller row. */
.picker--sm { padding: 3px; }
.picker--sm .picker__btn { width: 40px; height: 40px; font-size: 30px; }

/* Seven faces at 44px is 316px of row: wider than the card on the smallest
   phones, so there the faces close up a little rather than hang off it. */
@media (max-width: 380px) {
  .picker__btn, .picker--sm .picker__btn { width: 40px; height: 40px; font-size: 32px; }
}
@media (max-width: 340px) {
  .picker { padding: 3px; }
  .picker__btn, .picker--sm .picker__btn { width: 38px; height: 38px; font-size: 30px; }
}

/* The thread under a notice: comments, then the box to add one. */
.thread {
  display: grid;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--line);
}
.comment__del {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.comment__del:hover { color: var(--danger); }

.reply { display: flex; align-items: center; gap: var(--sp-2); }
.reply__input {
  /* The same fight as .vis-select above: the generic `input {}` rule in §7
     has nine :not() clauses, which outweighs a single class by specificity
     and was winning outright — min-height:52px, padding:13px 16px — so
     this pill was rendering as a full 52px form field instead of the small
     one-line box it's meant to be. `!important` makes sure this always
     wins here. Font-size is deliberately left to that global rule rather
     than reset to something smaller: it's 16px specifically to stop iOS
     Safari zooming in on focus, and this box is tapped on a phone. */
  flex: 1;
  min-width: 0;
  height: 36px !important;
  min-height: 0 !important;
  padding: 0 var(--sp-3) !important;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text);
}
.reply__input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.reply__send {
  flex: none;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-snap), background var(--dur-1) var(--ease);
}
.reply__send:hover { background: var(--brand); color: var(--brand-ink); }
.reply__send:active { transform: scale(.92); }
.reply__send svg { width: 16px; height: 16px; }

/* ---- The reply box ------------------------------------------------------
   Folded away until its Reply is tapped. That's :target rather than script:
   the link is an ordinary anchor, so it works with JavaScript off, and only
   one box is ever open — which is what keeps a thread readable.
   -------------------------------------------------------------------------- */
.reply--sm { display: none; margin-top: var(--sp-2); }
.reply--sm:target { display: flex; animation: mw-rise var(--dur-2) var(--ease-out) both; }
.reply--sm .reply__input { height: 34px !important; }
.reply--sm .reply__send { width: 34px; height: 34px; }
.reply__cancel { flex: none; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.reply__cancel:hover { color: var(--danger); text-decoration: none; }


/* The notice being returned to after a reaction or reply says so briefly. */
.notice:target { animation: mw-flag 1.4s var(--ease) both; }
@keyframes mw-flag {
  0%, 60% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 55%, transparent), var(--shadow-1); }
  100%    { box-shadow: var(--shadow-1); }
}

/* ---- Arriving from a notification ---------------------------------------

   A different job from the flash above, and so a different mark. That one is
   for coming back to something you were already looking at: a blink is
   enough, because you know what you left. This one is for opening the app
   from a lock screen after being away, onto a board full of other people's
   notices, where the only question is which of them this was about.

   So it holds. Three seconds of a brand ring and a wash that fades out on its
   own, long enough to follow the scroll with your eyes and find the thing,
   short enough that the board is not left wearing a highlight nobody asked
   to keep. app.js hangs the class on and takes it off again.
   -------------------------------------------------------------------------- */
.notice.is-arrived {
  animation: mw-arrived 3.4s var(--ease) both;
}
@keyframes mw-arrived {
  0%, 70% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 75%, transparent), var(--shadow-2);
  }
  100% { box-shadow: var(--shadow-1); }
}


/* Reduced motion still gets the mark — it is information, not decoration.
   What it loses is the fade, which is the part that moves. */
@media (prefers-reduced-motion: reduce) {
  .notice.is-arrived {
    animation: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 70%, transparent), var(--shadow-2);
  }
}

/* ---- Who reacted, and who wrote it -------------------------------------
   Two pages behind the board: the list of names under a tally, and the
   person behind a name. Both are read once and left, so they are plain
   lists rather than anything that needs learning.
   ------------------------------------------------------------------------ */
.reactors { display: grid; gap: var(--sp-4); }
/* In the sheet the rows sit on the sheet's own surface, so they take the
   next tone rather than a hairline on white. */
.modal .reactors__row { background: var(--surface-2); border-color: transparent; }
.reactors__group { display: grid; gap: var(--sp-2); }
.reactors__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.reactors__emoji { font-size: 24px; line-height: 1; display: inline-flex; }
.reactors__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.reactors__row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.reactors__person {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  flex: 1;
  color: inherit;
}
.reactors__person:hover { text-decoration: none; }
.reactors__person:hover .reactors__name { color: var(--brand); }
.reactors__name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.reactors__you {
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.reactors__mark { flex: none; font-size: 22px; display: inline-flex; }

/* ---- A profile ---------------------------------------------------------- */
.profile {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.profile__id { min-width: 0; }
.profile__name {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.profile__you {
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.profile__since { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

/* The same tiles the apps use for their numbers — two by two on a phone,
   and in one row once there is room for four. */
.profile__stats { margin-bottom: var(--sp-5); }
@media (min-width: 560px) { .profile__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* The comment being returned to after a reply says so, the same way a notice
   does — otherwise a long thread comes back looking untouched. */
.comment:target > .comment__col > .comment__body {
  animation: mw-flag-soft 1.4s var(--ease) both;
}
@keyframes mw-flag-soft {
  0%, 60% { background: var(--brand-soft); }
  100%    { background: var(--surface-2); }
}

/* The same comment, arrived at from a notification rather than returned to.

   This has to sit *after* the :target rule above, and that is not an accident
   of where it was typed. Both selectors carry the same weight, and arriving
   from a notification means arriving at an anchor — so :target is always live
   at the same moment this is, and whichever is written last is the one that
   shows. Moving this block above the rule it is meant to override silently
   turns the mark back into the brief flash it is not.

   The ring goes round the bubble rather than the notice holding it. Ringing
   the whole card would point at the wrong thing entirely: the notice is the
   context, the comment is what you were told about.
   -------------------------------------------------------------------------- */
.comment.is-arrived > .comment__col > .comment__body {
  animation: mw-arrived-soft 3.4s var(--ease) both;
}
@keyframes mw-arrived-soft {
  /* Held flat to 70% rather than easing from the first frame: the mark has a
     job to do while your eye is still travelling down the page after the
     scroll, and a highlight that has begun fading before you have found it is
     a highlight that was never really there. */
  0%, 70% {
    background: color-mix(in srgb, var(--brand) 26%, var(--surface-2));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 70%, transparent);
  }
  100% { background: var(--surface-2); box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .comment.is-arrived > .comment__col > .comment__body {
    animation: none;
    background: color-mix(in srgb, var(--brand) 26%, var(--surface-2));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 70%, transparent);
  }
}

/* --------------------------------------------------------------------------
   26. Profile — one subject, and the rest folded away

   The page is a face, a name, and two lines you can open. Everything it can
   do to the photo hangs off the photo, so there is no second block down the
   page competing with the thing it acts on — and nothing here is on screen
   that you didn't ask to see.
   -------------------------------------------------------------------------- */

/* ---- Who you are --------------------------------------------------------
   Centred, and the only centred thing on the page: it is a portrait, and a
   portrait pushed against the left margin with a column of air beside it
   reads as a mistake rather than as a decision. */
.profile-id {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--sp-1);
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-5);
  text-align: center;
}

/* Small, quiet, and in the corner: editing is what you occasionally came for,
   not what the card is about. Absolute so it can't push the portrait off
   centre by the width of its own label. */
.profile-id__edit {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.profile-id__edit:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.profile-id__edit svg { width: 13px; height: 13px; }

.profile-id__name {
  margin-top: var(--sp-3);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-id__meta { font-size: 13px; color: var(--muted); }

.profile-id__note { margin-top: var(--sp-2); font-size: 12.5px; color: var(--text-2); }

/* ---- The photo, and what you can do to it -------------------------------
   The circle is the button. Tapping it opens the two decisions there are to
   make about a picture, next to the picture they are about. */
.photo-menu { position: relative; }

.photo-menu__btn {
  position: relative;
  display: block;
  border-radius: 50%;
  cursor: pointer;
  list-style: none;
  transition: transform var(--dur-2) var(--ease-snap);
}
.photo-menu__btn::-webkit-details-marker { display: none; }
.photo-menu__btn:hover { transform: scale(1.03); }
.photo-menu__btn:active { transform: scale(.97); }
.photo-menu__btn:focus-visible .avatar,
.photo-menu[open] .avatar {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand);
}

/* The camera on the rim: what says the circle is a control. Sat on the
   circle's own edge — the corner of the square it is drawn in is half a
   radius further out, and a badge left there floats away from the photo. */
.photo-menu__badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-1);
  pointer-events: none;
  transition: transform var(--dur-2) var(--ease-snap);
}
.photo-menu__badge svg { width: 15px; height: 15px; }
.photo-menu[open] .photo-menu__badge { transform: scale(.85); opacity: .7; }

.photo-menu__panel, .action-menu__panel {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: 50%;
  transform-origin: top center;
  translate: -50% 0;
  z-index: 40;
  width: max-content;
  min-width: 190px;
  /* Sized by its longest item, but never wider than the phone it opens on. */
  max-width: calc(100vw - var(--sp-6));
  padding: var(--sp-1);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  text-align: left;
  animation: mw-menu var(--dur-2) var(--ease-out) both;
}

.photo-menu__item, .action-menu__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 44px;
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
}
.photo-menu__item:hover, .action-menu__item:hover { background: var(--surface-2); }
.photo-menu__item svg, .action-menu__item svg { flex: none; width: 17px; height: 17px; color: var(--muted); }
.photo-menu__item--danger, .action-menu__item--danger { color: var(--danger); }
.action-menu__item--danger svg { color: currentColor; }
.photo-menu__item--danger:hover, .action-menu__item--danger:hover { background: var(--danger-soft); }
.photo-menu__item--danger svg { color: var(--danger); }

/* The real file input, laid invisible across its own menu row so the row is
   the picker — no JavaScript between the tap and the camera roll. */
.photo-menu__file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.photo-menu__item:focus-within { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--brand); }

/* The inbox's last line: why last month's are not there. */
.inbox__kept {
  margin: var(--sp-5) 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ---- The folded lines ---------------------------------------------------
   One row each, shut: a title, and the answer you would have opened it for.
   Opening one is then a choice rather than the only way to read the page. */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  padding: 0 var(--sp-4);
  cursor: pointer;
  list-style: none;
  transition: background var(--dur-2) var(--ease);
}
.panel__head::-webkit-details-marker { display: none; }
.panel__head:hover { background: var(--surface-2); }

.panel__title { font-size: 15px; font-weight: 600; }

/* The value the shut row is standing in for. It steps back once the panel is
   open and the real thing is on screen under it. */
.panel__hint {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity var(--dur-2) var(--ease);
}
.panel[open] .panel__hint { opacity: 0; }

.panel__chev {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform var(--dur-2) var(--ease);
}
.panel[open] .panel__chev { transform: rotate(180deg); }

.panel__body {
  display: grid;
  gap: var(--sp-2);
  padding: 0 var(--sp-4) var(--sp-4);
  animation: mw-rise var(--dur-3) var(--ease-out) both;
}

/* A fold inside a panel's body: a labelled row with a count, the list under
   it. The Friends lists are these, so a long list of everyone is not the
   price of opening your friends. The row reaches the panel's edges so its
   hover wash reads as the whole line, and a hairline keeps two shut ones
   from reading as one. */
.subfold { border-top: 1px solid var(--line); margin: 0 calc(-1 * var(--sp-4)); }
.subfold:last-child { margin-bottom: calc(-1 * var(--sp-4)); }

.subfold__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 var(--sp-4);
  cursor: pointer;
  list-style: none;
  transition: background var(--dur-2) var(--ease);
}
.subfold__head::-webkit-details-marker { display: none; }
.subfold__head:hover { background: var(--surface-2); }
.subfold__head:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.subfold__count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.subfold__chev {
  flex: none;
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--muted);
  transition: transform var(--dur-2) var(--ease);
}
.subfold[open] .subfold__chev { transform: rotate(180deg); }

.subfold__body {
  margin: 0 var(--sp-4) var(--sp-4);
  animation: mw-rise var(--dur-3) var(--ease-out) both;
}

/* The Profile page's folds open and shut the way the timesheet's days do
   (initAccordion in app.js grows and shrinks the body), so they drop the
   rise above; while one is shutting, its chevron and hint turn back with it. */
details[data-fold-group] > .panel__body,
.subfold__body { animation: none; }
.panel.is-closing .panel__chev,
.subfold.is-closing .subfold__chev { transform: none; }
.panel.is-closing .panel__hint { opacity: 1; }

/* Every other fold on the site moves the same way (initAccordion, which
   marks the page .js-folds): the box grows and the contents ease in, so
   the rises some bodies do on their own would only double it. While one
   is shutting, whatever it flipped on opening flips back with it. */
.js-folds details:not(.react):not([data-dismiss]) > :not(summary) { animation: none !important; }
.hmonth.is-closing .hmonth__chev,
.daily--joke.is-closing .daily__reveal svg { transform: none; }
.hmonth.is-closing .hmonth__count { opacity: 1; }
.fold.is-closing .fold__more { display: inline; }
.fold.is-closing .fold__less { display: none; }

/* ---- Your details -------------------------------------------------------
   A label and its value on one line, the labels in a column of their own so
   the values line up down the card and can be read without being hunted for.
   An empty one is an em dash rather than a blank: nothing there is a fact
   about you too, and a gap only looks like the page failed to load. */
.facts { overflow: hidden; }

.facts__row {
  display: grid;
  /* The label column sizes to its own longest word rather than to a number
     picked by eye, and the value gets everything left over — which on a
     320px phone is the difference between reading an address and not. */
  grid-template-columns: 20px auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-3);
  min-height: 52px;
  padding: var(--sp-2) var(--sp-4);
}
.facts__row + .facts__row { border-top: 1px solid var(--line); }

.facts__icon { color: var(--muted); }
.facts__icon svg { width: 17px; height: 17px; }

.facts__label { font-size: 13px; color: var(--muted); }

.facts__value {
  min-width: 0;
  text-align: right;
  font-size: 14.5px;
  font-weight: 550;
  /* Wrapping beats an ellipsis here: half an address is no use to anyone,
     and these rows are free to grow a line. */
  overflow-wrap: anywhere;
}

/* Four dashes explain nothing on their own, so the empty card says what to do
   about it — and stops saying it the moment anything is filled in. */
.facts__prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand);
}
.facts__prompt:hover { background: var(--surface-3); text-decoration: none; }
.facts__prompt svg { width: 14px; height: 14px; }

/* ---- Activity -----------------------------------------------------------
   One figure leads. Six numbers of identical weight is a table, and a table
   is read by nobody — so the hours this week are set at a size you take in
   without reading, and the counts sit under them in a grid where the eye can
   run across them instead of down six labelled rows. */
.lead-stat {
  padding: var(--sp-4) 0 var(--sp-4);
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.lead-stat__value {
  font-size: 44px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}
.lead-stat__unit {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-left: 2px;
}
.lead-stat__label {
  margin-top: var(--sp-2);
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: .02em;
  color: var(--muted);
}

/* The counts. Three across on a phone, five once there is room for them all
   on one line — never a stray tile on a row of its own. */
.tallies {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: var(--sp-3);
}

.tally {
  padding: var(--sp-2) var(--sp-1);
  text-align: center;
  min-width: 0;
}
/* A tally that links somewhere (Friends, off to its own page) reads the
   same as the others — the number is the point, not that it's a link. */
a.tally { color: inherit; border-radius: var(--r-sm); transition: background var(--dur-2) var(--ease); }
a.tally:hover { background: var(--surface-2); text-decoration: none; }
.tally__value {
  font-size: 19px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.tally__label {
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 560px) {
  .tallies { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lead-stat__value { font-size: 52px; }
}

/* The picker form wraps only the portrait, so it must not become a block of
   its own between the card's padding and the face inside it. */
.photo-form { display: contents; }

/* --------------------------------------------------------------------------
   27. Workplace colours — which job, at a glance

   Two jobs on one timesheet are two different things, and reading the name
   every time to tell which is which is work. Each workplace gets a hue, kept
   on the workplace itself, and everything that shows one draws it from there:
   the badge in the list, the swatch beside a shift, the wash behind a date.

   Held as a hue so one number can be a solid 40px badge here and a 20%-opacity
   wash there. `--wp-css` carries the finished colour to a swatch; the calendar
   builds its own gradient because the proportions are the server's to work out.
   -------------------------------------------------------------------------- */
.swatch {
  flex: none;
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 4px;
  background: var(--wp-css, var(--brand));
  /* Holds the shape against a card of nearly its own colour, in either theme. */
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .18);
}
.swatch--sm { width: 8px; height: 8px; border-radius: 3px; }
.swatch--lg { width: 32px; height: 32px; border-radius: 50%; }

/* The badge in the workplace list, in that workplace's own colour. */
.workplace__mark--wp {
  background: color-mix(in srgb, var(--wp-css) 16%, transparent);
  color: var(--wp-css);
}

/* ---- Picking one -------------------------------------------------------- */
.swatch-pick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.swatch-pick__opt {
  position: relative;
  display: grid;
  place-items: center;
  /* The tap target is the ring's outer edge, not the 32px circle inside it. */
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  cursor: pointer;
}
/* The radio is real and focusable, just invisible under its own swatch. */
.swatch-pick__opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  appearance: none;
}
.swatch-pick__opt .swatch {
  transition: transform var(--dur-2) var(--ease-snap), box-shadow var(--dur-2) var(--ease);
}
.swatch-pick__opt:hover .swatch { transform: scale(1.08); }
/* Chosen: ringed in its own colour, with the card's background as the gap, so
   the mark reads at a glance without a tick sitting on top of the colour. */
.swatch-pick__opt input:checked ~ .swatch {
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .18),
              0 0 0 3px var(--surface),
              0 0 0 5px var(--wp-css);
}
.swatch-pick__opt input:focus-visible ~ .swatch {
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .18),
              0 0 0 3px var(--surface),
              0 0 0 5px var(--text);
}

/* ---- The key under the calendar ----------------------------------------
   Without it the colours are decoration. Only the jobs actually worked this
   month are listed, so an eight-workplace account doesn't get an eight-line
   key under a month it spent at one of them. */
.cal__key {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-3) var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--line);
}
.cal__key-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  font-size: 12.5px;
}
.cal__key-name {
  font-weight: 550;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal__key-hrs {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   28. A day worked in more than one go

   One shift is a row. Two or three on the same date are a run: numbered in
   the order they happened, with the time off written into the join between
   them. The rows themselves don't change — what changes is that the day now
   reads as a sequence instead of as repeated rows that happen to be adjacent.
   -------------------------------------------------------------------------- */

/* Which shift of the day this is, in that job's own colour — so on a day
   split between two workplaces the numbers say the order and the colours say
   where, without a second mark for either. */
.shift__seq {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--wp-css, var(--text-2));
  background: color-mix(in srgb, var(--wp-css, var(--line-strong)) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wp-css, var(--line-strong)) 38%, transparent);
}

/* The numbered chip already carries the colour, so the swatch beside the name
   would be the same fact told twice. */
.shift-run .shift__where > .swatch,
.shift-run .day-shift__where > .swatch { display: none; }

/* The join: how long you were off between one shift and the next. Written
   into the rule rather than added as another row of its own, so a run of
   three still reads as one day and not as five things. */
.shift-gap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-4) var(--sp-1) var(--sp-3);
}
.shift-gap__rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.shift-gap__text {
  flex: none;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Inside the bordered timesheet list the joins replace the row rule, rather
   than adding a second line above and below themselves. */
.shift-list > li.shift-gap,
.shift-list > li.shift-gap + li { border-top: 0; }
.shift-list > li.shift-gap { background: var(--surface); }

/* The calendar's day panel spaces its rows instead of ruling them, so the
   join sits in that gap and needs none of its own. */
.break-list > li.shift-gap { padding: 0 var(--sp-1); }

/* --------------------------------------------------------------------------
   29. Skeletons — the shape of what's coming

   Shown only where something is genuinely being waited for: a search request
   in flight, a page that hasn't arrived yet. A skeleton over content that is
   already on screen isn't a loading state, it's a delay pretending to be one,
   so nothing here fires unless there is a real wait behind it.

   The blocks are the shape of the thing they stand in for — a row of results
   looks like a row of results — because a placeholder that doesn't match what
   replaces it makes the page jump at exactly the moment it should settle.
   -------------------------------------------------------------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

/* A light travelling across the block, rather than the whole block pulsing:
   it reads as "on its way" instead of "broken". */
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--text) 8%, transparent),
    transparent
  );
  animation: mw-shimmer 1.3s var(--ease) infinite;
}
@keyframes mw-shimmer { to { transform: translateX(100%); } }

/* The shapes. Widths vary down a stack so it reads as text rather than as a
   set of identical grey bars. */
.skeleton--line   { height: 11px; border-radius: 6px; }
.skeleton--title  { height: 17px; border-radius: 8px; }
.skeleton--circle { flex: none; width: 38px; height: 38px; border-radius: 50%; }
/* Sized off .plu-badge, so the row it stands in for is the height it will be. */
.skeleton--badge  { flex: none; width: 58px; height: 38px; border-radius: var(--r-sm); }
.skeleton--tile   { height: 62px; border-radius: var(--r-md); }

.skeleton--w40 { width: 40%; }
.skeleton--w55 { width: 55%; }
.skeleton--w70 { width: 70%; }
.skeleton--w85 { width: 85%; }

/* One placeholder row, shaped like a result: badge, two lines of text. */
.skeleton-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.skeleton-list > li + li { border-top: 1px solid var(--line); }

/* The same box as .result — same padding, same gap, same minimum height —
   so when the real rows arrive nothing below them moves. */
.skeleton-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 62px;
  padding: var(--sp-3) var(--sp-4);
}
.skeleton-row__body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 7px;
}

/* A card-shaped placeholder, for a page that hasn't landed yet. */
.skeleton-card {
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  display: grid;
  gap: var(--sp-3);
}

/* ---- The page ones ------------------------------------------------------
   One per kind of screen (app.js SKELETONS), each built from the blocks
   below in the shape of the page it stands in for — so a screen arrives
   into a layout that was already there rather than over one that was not.
   The sizes are the sizes of the real things: a button is 48px because
   .btn is, a day in the calendar the width a day is. */
.skeleton-page { display: grid; gap: var(--sp-4); }
.skeleton-page__head { display: grid; gap: var(--sp-2); }
.skeleton-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }

/* A few lines with no card around them; tight, for a label over its box. */
.skeleton-stack { display: grid; gap: var(--sp-3); }
.skeleton-stack--tight { gap: var(--sp-2); }
/* The search page: its box sits low, under a run of empty sky. */
.skeleton-stack--search { padding-top: 34vh; gap: var(--sp-2); }

/* A heading with a button on the end of the line, or a strip of controls. */
.skeleton-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.skeleton-bar > .skeleton--line { flex: 1 1 auto; }
.skeleton-chips { display: flex; gap: var(--sp-2); }
.skeleton-acts { display: flex; gap: var(--sp-6); padding-top: var(--sp-2); border-top: 1px solid var(--line); }

/* The blocks. */
.skeleton--big       { height: 34px; border-radius: 8px; }
.skeleton--btn       { display: block; width: 100%; height: 48px; border-radius: var(--r-md); background: var(--brand-soft); }
.skeleton--btn-plain { background: var(--surface-2); }
.skeleton--btn-sm    { flex: none; width: 84px; height: 40px; border-radius: var(--r-pill); }
.skeleton--field     { display: block; width: 100%; height: 48px; border-radius: var(--r-md); }
.skeleton--chip      { flex: none; width: 96px; height: 36px; border-radius: var(--r-pill); }
.skeleton--segments  { display: block; width: 100%; height: 44px; border-radius: var(--r-pill); }
.skeleton--avatar    { width: 40px; height: 40px; }
.skeleton--avatar-xl { width: 96px; height: 96px; margin: 0 auto; }
.skeleton--icon      { width: 44px; height: 44px; margin: 0 auto; }
.skeleton--icon-sm   { width: 36px; height: 36px; border-radius: var(--r-sm); }
.skeleton--dot       { width: 28px; height: 28px; }
.skeleton--square    { flex: none; width: 40px; height: 40px; border-radius: var(--r-sm); }
.skeleton--drop      { display: block; height: 180px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); background: none; }
.skeleton--drop::after { display: none; }
/* The clock's ring: hollow, so it is the dial and not a grey moon. */
.skeleton--ring {
  display: block;
  width: min(240px, 60vw);
  aspect-ratio: 1;
  margin: var(--sp-4) auto;
  border-radius: 50%;
  border: 14px solid var(--surface-2);
}
/* The calendar: seven a row, as many rows as a month needs. */
.skeleton-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.skeleton--day { aspect-ratio: 1; border-radius: var(--r-sm); }

/* Cards of particular shapes. */
.skeleton-card--tile   { min-height: 128px; justify-items: center; align-content: center; }
.skeleton-card--stat   { gap: var(--sp-2); }
.skeleton-card--centre { justify-items: center; }
.skeleton-card--tall   { min-height: 190px; align-content: center; }
/* A row inside a card is the card's own line, not a result row; a card of
   rows is a list, and its rows keep a list row's height and rule. */
.skeleton-card > .skeleton-row { padding: 0; min-height: 0; }
.skeleton-card > .skeleton-row .skeleton-row__body { gap: 6px; }
.skeleton-card--rows   { padding: 0 var(--sp-2); gap: 0; }
.skeleton-card--rows > .skeleton-row { min-height: 56px; padding: var(--sp-2); }
.skeleton-card--rows > .skeleton-row + .skeleton-row { border-top: 1px solid var(--line); }
.skeleton-page--person > .skeleton-row { padding: 0; }

/* The segmented control, copied from the page being left, stays where it
   was; it is a picture of the strip while the page is on its way. */
.skeleton-page > .segments { pointer-events: none; }

/* --------------------------------------------------------------------------
   30. Pay — what each job still owes

   One card per workplace, and the figure is the card. Everything else on it
   is context for that number: whose it is, how it was arrived at, and the one
   button that sets it back to zero.
   -------------------------------------------------------------------------- */
.owed + .owed { margin-top: var(--sp-4); }

.owed__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.owed__name {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The hours and what they come to, on one baseline: the money is the same
   fact in another unit, not a second figure to weigh against the first. */
.owed__figure {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
  flex-wrap: wrap;
}
.owed__hours {
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.owed__unit {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-left: 1px;
}
.owed__pay {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.owed__meta {
  margin-top: var(--sp-1);
  margin-bottom: var(--sp-4);
  font-size: 13px;
  color: var(--muted);
}

/* Settled up: the figure steps back rather than disappearing, so a job you
   are square with still shows you that you are square with it. */

/* The line under the card: what was last settled, and the way back out of it.
   Quiet, because undoing is the rare half of a rare action. */
.owed__last {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.owed__last > span { min-width: 0; }
.owed__last form { flex: none; }

.owed__undo {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--brand);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.owed__undo:hover { text-decoration: underline; }

/* ---- The runs ------------------------------------------------------------
   A job on a cycle owes a list, not a figure: each closed run is its own
   payment, arriving on its own day. One line each — the dates, when it is
   paid, what it comes to — with the run still going at the foot in grey,
   because nobody is late paying for a fortnight that has not finished. */
.runs {
  list-style: none;
  margin: 0 0 var(--sp-4);
  padding: 0;
  border-top: 1px solid var(--line);
}
.runs__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 48px;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line);
}
.runs__when {
  display: grid;
  gap: 1px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}
.runs__tag { font-size: 12px; font-weight: 500; color: var(--muted); }
.runs__tag--due { color: var(--warn); font-weight: 600; }
.runs__figure {
  flex: none;
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.runs__row--open .runs__when,
.runs__row--open .runs__figure { color: var(--muted); font-weight: 500; }

/* Which cycle this job is on, beside its name. */
.owed__cycle {
  flex: none;
  margin-left: auto;
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* ---- Saying you were paid ------------------------------------------------
   One form on the card: what the payment covered, the date box for when
   the answer is a day, and the button. The two fields sit closer than a
   form's usual rhythm, since they are one question. */
.settle { margin-top: var(--sp-2); }
.settle .field { margin-bottom: var(--sp-3); }
.settle__day[hidden] { display: none; }
.settle .help { margin-top: var(--sp-1); }

/* The span of dates a removal would take with it, said under its own row. */
.going__when { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

/* The workplace's colour beside its name in a page heading. */
.page-sub .swatch { margin-right: 6px; vertical-align: baseline; }

/* ---- Fill from a payslip, on the workplace form -------------------------
   One small button above the boxes, the file input hidden under it, and a
   list of what was read once it has been. A box the slip filled is tagged
   "From payslip" beside its label and ringed in the brand colour — the
   ring holds for ten seconds, then a quieter tint stays until the box is edited,
   so what the slip wrote and what the user wrote never look the same. */
.payslip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.payslip__btn { position: relative; overflow: hidden; flex: none; }
.payslip__btn.is-busy { opacity: .7; pointer-events: none; }
.payslip__btn:focus-within { box-shadow: 0 0 0 3px var(--brand-soft); }
/* The real input, over the whole button, invisible: the button is the
   tap target, and a keyboard still reaches it. */
.payslip__file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.payslip__hint {
  flex: 1 1 200px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.payslip__hint.help--error { color: var(--danger); }
.payslip__hint[hidden] { display: none; }

/* While a payslip is on its way (app.js, openReader): the file itself, a
   beam sweeping down it, a bar that is the bytes sent and then shimmers
   while the server reads, and the two steps. It takes the hint's place
   beside the button and, once read, settles into one ticked line. */
.reader {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  background: linear-gradient(135deg, var(--brand-soft), transparent 60%) var(--surface);
  animation: mw-rise var(--dur-3) var(--ease-out) both;
}
.reader__doc {
  position: relative;
  width: 56px;
  height: 72px;
  overflow: hidden;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: grid;
  place-items: center;
}
.reader__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reader__glyph {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--brand);
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--brand-soft);
}
/* A page torn corner, so the PDF card reads as a document. */
.reader__doc--pdf::before {
  content: "";
  position: absolute;
  top: -1px; right: -1px;
  width: 14px; height: 14px;
  background: linear-gradient(225deg, var(--surface) 50%, var(--line-strong) 50%);
  border-bottom-left-radius: 3px;
}
/* The beam: a soft band of brand light sweeping the height of the page,
   with a hairline at its leading edge. It runs only while there is reading
   going on, and never when motion is turned down. */
.reader__beam {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--brand) 22%, transparent) 45%, var(--brand) 50%, transparent 52%);
  background-size: 100% 60%;
  background-repeat: no-repeat;
  animation: mw-scan 1.6s var(--ease) infinite;
}
@keyframes mw-scan {
  from { background-position: 0 -60%; }
  to   { background-position: 0 160%; }
}
.reader[data-stage="done"] .reader__beam { display: none; }
.reader__body { min-width: 0; }
.reader__name {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.reader__name > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader__size { flex: none; font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.reader__bar {
  position: relative;
  height: 6px;
  margin: var(--sp-2) 0;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 16%, var(--surface-2));
}
.reader__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--brand);
  transition: width var(--dur-2) var(--ease);
}
/* Bytes all gone, server reading: the full bar carries a moving sheen. */
.reader[data-stage="read"] .reader__fill {
  background: linear-gradient(90deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 55%, #fff) 50%, var(--brand) 100%);
  background-size: 200% 100%;
  animation: mw-shimmer 1.1s linear infinite;
}
.reader__steps {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
}
.reader__step { display: flex; align-items: center; gap: 7px; }
.reader__step.is-live { color: var(--text); }
.reader__step.is-done { color: var(--text-2); }
.reader__pct { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--brand); }
/* The mark before each step: hollow to come, a spinner while live, a tick
   once done — drawn from one ring so it changes without jumping. */
.reader__mark {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  box-sizing: border-box;
  position: relative;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.reader__step.is-live .reader__mark {
  border-color: color-mix(in srgb, var(--brand) 25%, transparent);
  border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
.reader__step.is-done .reader__mark {
  border-color: var(--brand);
  background: var(--brand);
}
.reader__step.is-done .reader__mark::after {
  content: "";
  position: absolute;
  left: 3px; top: 0;
  width: 4px; height: 7px;
  border: solid var(--brand-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.reader__cancel {
  align-self: start;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.reader__cancel svg { width: 16px; height: 16px; }
.reader__cancel:hover { background: var(--surface-2); color: var(--text); }
/* Read: the bar has said its piece; the tick and the file are the story. */
.reader[data-stage="done"] { border-color: var(--line); background: var(--surface-2); animation: none; }
.reader[data-stage="done"] .reader__bar { display: none; }
.reader[data-stage="done"] .reader__doc { height: 56px; }
.reader[data-stage="done"] [data-step="upload"] { display: none; }
@media (max-width: 400px) {
  .reader { grid-template-columns: 48px 1fr auto; }
  .reader__doc { width: 48px; height: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  .reader, .reader__beam, .reader__fill, .reader__step.is-live .reader__mark { animation: none; }
  .reader__beam { display: none; }
}

/* ---- Photo search: the read, line by line ------------------------------
   The reading panel sits under the button while the photo is away; then
   each line of the list is a row — the PLU it was taken to mean, how sure
   that was as a small pill, and "Change" folding out the runners-up as
   chips and a box for a number. A row just put right flashes brand. */
.photo-status { margin-top: var(--sp-3); }
.photo-status[hidden] { display: none; }
.photo-status .reader { animation: mw-rise var(--dur-3) var(--ease-out) both; }
#photo-results { margin-top: var(--sp-4); }
#photo-results:empty { margin-top: 0; }
.results-head__title { font-weight: 700; }
.results-head__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.results-head__actions form { display: contents; }
.results-head__sub { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--muted); }

.sure {
  flex: none;
  align-self: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text-2);
}
.sure--sure, .sure--picked { background: var(--brand-soft); color: var(--brand); }
.sure--likely { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.sure--unsure { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.sure--none { background: var(--surface-3); color: var(--muted); }

.pick { position: relative; }
.pick__main { padding-right: var(--sp-3); }
.pick__main .plu-badge { text-decoration: none; }
.pick.is-busy { opacity: .55; pointer-events: none; }
.pick.is-going { overflow: hidden; height: 0 !important; opacity: 0; transition: height .26s var(--ease), opacity .2s var(--ease); }
.pick.is-changed > .pick__main { animation: mw-picked 1.4s var(--ease) both; }
@keyframes mw-picked {
  0%, 60% { background: var(--brand-soft); }
  100% { background: transparent; }
}
.pick__more { border-top: 1px dashed var(--line); }
.pick__change {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--sp-4);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
}
.pick__change::-webkit-details-marker { display: none; }
.pick__change svg { width: 15px; height: 15px; }
.pick__more[open] .pick__change { background: var(--surface-2); }
.pick__alts { padding: var(--sp-3) var(--sp-4) var(--sp-4); background: var(--surface-2); }
.pick__label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: var(--sp-2); }
.pick__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.pick__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 36px;
  padding: 0 var(--sp-3);
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.pick__chip b { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.pick__chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.pick__chip:active { transform: scale(.97); }
.pick__type { display: flex; gap: var(--sp-2); }
.pick__type .input { flex: 1 1 auto; min-width: 0; min-height: 40px; }
.pick__type .btn { flex: none; }
.pick__none {
  display: block;
  margin-top: var(--sp-3);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.pick__none:hover { color: var(--danger); }
.pick__error { margin-top: var(--sp-2); }
.payslip__read { flex: 1 1 100%; }
.payslip__list {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
  padding: var(--sp-3);
  list-style: none;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13px;
}
.payslip__list li { display: grid; grid-template-columns: 7.5em 1fr; column-gap: var(--sp-2); }
.payslip__list b { font-weight: 600; color: var(--text-2); }
.payslip__list small {
  grid-column: 2;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.payslip__note { margin: var(--sp-2) 0 0; font-size: 13px; line-height: 1.4; color: var(--warn); }

.field.is-filled > input,
.field.is-filled > select {
  border-color: var(--brand);
  background-color: var(--brand-soft);
  animation: mw-filled 10s var(--ease) both;
}
@keyframes mw-filled {
  0%   { box-shadow: 0 0 0 3px var(--brand-soft); }
  85%  { box-shadow: 0 0 0 3px var(--brand-soft); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.payslip__tag {
  display: inline-block;
  margin-left: var(--sp-2);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: 1px;
  animation: mw-pop var(--dur-3) var(--ease-snap) both;
}

/* ---- The statement form, on the profile ---------------------------------
   Two quick picks, two dates side by side, a job, and the button. */
.statement-form__quick { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.statement-form__quick .btn { flex: 1 1 0; }
.statement-form__dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3); }
.statement-form__dates input { min-width: 0; width: 100%; }
.statement-form .field { margin-bottom: var(--sp-3); }

/* Download a PDF: the same quiet link wherever a document is offered. */
.pdflink {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  margin-top: var(--sp-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.pdflink:hover { color: var(--brand); text-decoration: none; }
.pdflink svg { width: 15px; height: 15px; flex: none; }



/* --------------------------------------------------------------------------
   32. Glass — the material the app is made of

   Every panel on the page is one sheet of frosted glass over a lit background,
   the way a Control Center panel is: a translucent fill, a heavy blur of
   whatever is behind it, a semi-transparent white rim catching the light along
   the edge, and a soft shadow underneath holding it off the page.

   Three things make it work, and leaving any one out is what makes most
   attempts at this look like a grey box:

   1. Saturation. Blur on its own drains the colour out of what is underneath
      and the panel goes flat and dead. Pushing saturation back up past 100% is
      what keeps glass looking lit rather than fogged.
   2. Something behind it. Glass over a flat page is just a lighter flat page —
      there is nothing to see through it. Hence the ambient wash below.
   3. The rim. The white border is not decoration: an edge is where a real
      sheet of glass catches the most light, and without it the panel has no
      thickness and reads as painted on.

   The whole of it is inside @supports, and the plain surfaces defined earlier
   in this file are what a browser without backdrop-filter keeps. Glass or
   nothing — never a half-transparent panel with nothing blurred behind it,
   which is unreadable.
   -------------------------------------------------------------------------- */

/* The light behind the glass. Fixed rather than scrolled, so it behaves like
   the wallpaper it is standing in for: the page slides over it and the panels
   pick up a different part of it as they go, which is the whole reason the
   blur is worth paying for. Three washes only, well under the page, in the
   app's own brand green and two colours either side of it. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(74% 54% at 2% -4%,   var(--amb-1), transparent 72%),
    radial-gradient(68% 50% at 100% 4%,  var(--amb-2), transparent 74%),
    radial-gradient(58% 42% at 88% 58%,  var(--amb-2), transparent 76%),
    radial-gradient(84% 58% at 46% 100%, var(--amb-3), transparent 72%);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {

  /* One material, named once. Everything here is a panel in its own right —
     something that sits on the page rather than inside another panel. */
  .card,
  .app-card,
  .panel,
  .summary-card,
  .alert,
  .result-list,
  .shift-list,
  .notice,
  .modal__box,
  .fold--notices > .fold__toggle {
    background: var(--glass);
    border-color: var(--glass-line);
    /* The same edge the tab bar has, at panel scale: a lit rim along the top,
       a glow just inside it that reads as thickness seen edge-on, and the
       body of the material gathering along the bottom. Two hairlines made a
       flat card with a light line on it; this makes a slab of frosted glass. */
    box-shadow:
      var(--glass-shadow),
      inset 0 1px 0 var(--glass-hi),
      inset 0 7px 14px -9px var(--glass-glow),
      inset 0 -9px 16px -12px var(--glass-base);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
  }

  /* A dialog floats higher than a card does, and its shadow has to say so —
     it is over the page, not part of it. */
  .modal__box {
    box-shadow: var(--shadow-3), inset 0 1px 0 var(--glass-hi);
  }

  /* The two drop-down menus are solid, and have to be.

     An element with backdrop-filter becomes a backdrop root: a descendant's
     own backdrop-filter can only sample what is painted inside that root
     behind it. Both of these hang out of one — the app menu out of the
     frosted app bar, the photo menu out of a glass card — so the part of the
     menu that overhangs has nothing behind it to blur. The filter returns
     empty, the translucent fill composites over live page content, and the
     menu goes see-through with the page legible straight through it.

     No amount of tuning fixes that; the blur cannot run where these sit. So
     they take the opaque surface instead and keep the rim and the shadow,
     which is also the right answer on its own terms: a menu is something you
     have to read over content you don't control. iOS makes its context menus
     nearly opaque for the same reason.

     The dialog above is not affected — it renders in the top layer, where its
     own blurred ::backdrop is what sits behind it. */
  .photo-menu__panel {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow-3);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* Alerts keep their colour and take the glass underneath it, rather than
     losing the one thing that tells you which kind of alert it is. */
  .alert--success { background: color-mix(in srgb, var(--brand) 16%, var(--glass));  border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
  .alert--error   { background: color-mix(in srgb, var(--danger) 16%, var(--glass)); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
  .alert--warning { background: color-mix(in srgb, var(--warn) 16%, var(--glass));   border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

  /* Lifting a hub tile must not put the glass out: :hover outranks the rule
     above, so the lit edge has to be said again with the bigger shadow. */
  .app-card:hover {
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi);
    border-color: color-mix(in srgb, var(--brand) 40%, var(--glass-line));
  }

  /* Glass inside glass is mud: the inner sheet blurs an image that is already
     blurred and both stop looking like anything. A panel that sits inside
     another one goes back to being a plain surface — which is what the inner
     tiles of a Control Center panel are too. */
  .card .card,
  .card .panel,
  .card .summary-card,
  .card .result-list,
  .card .shift-list,
  .modal__box .card,
  .modal__box .panel,
  .modal__box .result-list {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow-1);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* A panel deliberately let into the card it sits in keeps having no edges
     of its own — it is a fold in the card, not a sheet on top of it. */
  .panel--flush {
    background: transparent;
    border-color: transparent;
    border-top-color: var(--line);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* A row under a finger. The solid grey these used on white would sit on the
     glass as a dull patch; a wash of white lifts the row out of the sheet
     instead, which is what the glass is doing to the page in the first place. */
  .result:hover,
  .shift:hover,
  .day__head:hover,
  .panel__head:hover,
  .photo-menu__item:hover {
    background: var(--glass-hover);
  }

  /* That one rule outranks three states declared earlier in the file that
     each mean something — which app you are in, the item that deletes
     things, and a row with a finger down on it — so they are said again
     here rather than quietly lost to a hover. */
  .photo-menu__item--danger:hover { background: var(--danger-soft); }
  .result:active,
  .shift:active {
    background: color-mix(in srgb, var(--glass-hover) 55%, var(--line-strong));
  }
}

/* Asked for less of this at the system level — iOS calls it Reduce
   Transparency, and it is the one setting that means it outright. Everything
   goes back to the solid surfaces defined earlier; the shape, the spacing and
   the rims stay exactly where they were. */
@media (prefers-reduced-transparency: reduce) {
  body::before { display: none; }

  .card,
  .app-card,
  .panel,
  .summary-card,
  .alert,
  .result-list,
  .shift-list,
  .notice,
  .modal__box,
  .fold--notices > .fold__toggle {
    background: var(--surface);
    border-color: var(--line);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* Said again, because the reset above is a later rule of equal weight and
     would otherwise take the colour off the things whose colour is the point
     of them. */
  .alert--success { background: var(--brand-soft); }
  .alert--error   { background: var(--danger-soft); }
  .alert--warning { background: var(--warn-soft); }
}

/* --------------------------------------------------------------------------
   33. Liquid glass — the app bar refracts what passes under it

   §32 makes every panel frosted. This goes one further on the one piece of
   chrome that floats over moving content: what scrolls beneath the app bar
   is bent as well as blurred, the way it would be through something with a
   thickness and a curve. (The dock at the foot of the screen is plain
   frosted glass — §4 — a dock is furniture, and furniture keeps still.)

   Three layers, in the order light meets them, and each one has to be its
   own box because they are filtered differently:

     ::before   the lens        blurs the backdrop, then refracts it
     ::after    tint + shine    the material's own colour, and the light
                                caught along its inside edge
     > *        the content     the brand and the buttons, which must not bend

   The element itself is left transparent and keeps only the border and the
   drop shadow. If it held a background, that background would sit inside the
   lens's backdrop and get bent along with the page, and the bar's edges would
   smear.

   Only here, deliberately. Refraction shows up where there is something
   moving behind to refract, and the app bar has the whole page sliding
   underneath it. A card sitting in the page flow has the ambient wash behind
   it and nothing else — it would pay for a filter per card and bend almost
   nothing. Apple applies its own version to floating controls for the same
   reason, not to the sheets of content between them.
   -------------------------------------------------------------------------- */

/* The filters live in an SVG in base.html; the element carrying them is not
   meant to be seen, only referenced. */
.glass-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {

  /* The wrapper gives up its fill and its blur to the layers below. It keeps
     the drop shadow, which belongs to the object rather than to the glass. */
  .appbar {
    position: relative;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .appbar::before,
  .appbar::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
  }

  /* 1. The lens. A light blur, not the frosting §32 uses.

     This is the whole trick, and it is counter-intuitive: refraction needs
     something left to refract. --glass-blur is 30px, and displacing a 30px
     blur moves a smooth wash around and changes nothing you can see — the
     detail the bend would have shown was already destroyed. Blurring barely
     at all leaves edges and colour in the backdrop for the map to push
     sideways, and the bend becomes the effect instead of the blur.

     Legibility then comes from the tint above rather than from the blur,
     which is why that layer is the more opaque of the two. */
  .appbar::before {
    z-index: 0;
    -webkit-backdrop-filter: var(--lens-blur);
    backdrop-filter: var(--lens-blur);
    filter: url(#glass-distortion-soft);
  }

  /* 2 + 3. The material's colour, and the light along its inside edge. */
  .appbar::after {
    z-index: 1;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    box-shadow: inset 0 -1px 0 var(--glass-hi);
  }

  /* 4. The content, which sits above all three and is not filtered. Bending
     the page behind a button is the effect; bending the button is a bug. */
  .appbar > * {
    position: relative;
    z-index: 2;
  }
}

/* Reduce Transparency takes the lens with everything else: no bend, no blur,
   and the bar goes back to solid chrome. */
@media (prefers-reduced-transparency: reduce) {
  .appbar::before { display: none; }
  .appbar::after  { background: var(--surface); }
}

/* --------------------------------------------------------------------------
   34. The dock's pill, which slides

   One tinted pill that travels between the tabs, instead of one disappearing
   from under the old tab while another appears under the new. Tapping a tab
   is still a plain link and the page still arrives; the slide happens in
   the gap before it does, and the page that arrives has drawn its pill
   already under the tab you chose, so the movement and the arrival meet
   rather than contradict each other. The tab it lands on grows a name as it
   lands (§4), and the pill grows with it.

   The pill is built by JavaScript, which is also what sets .has-slider on
   the bar. With no JavaScript neither exists, the rule below never matches,
   and the active tab keeps the background it has in §4 — the bar loses the
   animation and nothing else.
   -------------------------------------------------------------------------- */

/* The tint moved out of the tab and into the travelling element, so the tab
   keeps only its ink. */
.tabbar__inner.has-slider .tab.is-active {
  background: none;
}

.tabbar__inner > .tab-slider {
  position: absolute;
  top: 0;
  left: 0;
  /* Under the tabs: the knob is solid now, and the tab it carries paints
     its icon and name on top of it (the tabs are z-index 2 in §4). */
  z-index: 1;
  width: 0;
  height: 0;
  border-radius: var(--r-pill);
  opacity: 0;
  pointer-events: none;

  /* Exactly what the active tab draws for itself in §4: the knob. */
  background: var(--brand);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 36%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22);

  /* Its own compositor layer: the pill slides over a backdrop-filter, which
     is expensive to rasterise. Promoted, it is a texture the compositor
     moves on its own, and the frosting underneath stays cached. */
  will-change: transform;

  /* --ease-snap overshoots slightly and settles back, which is what makes a
     movement read as a thing with weight arriving rather than a value
     changing. It is the curve the rest of the app already springs on. */
  transition:
    transform .42s var(--ease-snap),
    width .42s var(--ease-snap),
    height .42s var(--ease-snap),
    scale .2s var(--ease),
    opacity var(--dur-2) var(--ease);
}

.tabbar__inner > .tab-slider.is-on { opacity: 1; }

/* Liquid. The dock's pill does not slide from one tab to the next; it
   flows. app.js (flowTo) first widens it so its far edge reaches the tab
   you tapped while its near edge stays put — a quick, accelerating reach,
   the way a drop of water leans before it lets go — and then, once it
   spans both tabs, sets it to the new tab alone: the trailing edge snaps
   in on the app's spring, overshooting a touch and settling. Two timings
   for the same two properties, chosen by which class is on. */
.tabbar__inner > .tab-slider.is-stretching {
  transition:
    transform .19s cubic-bezier(.45, 0, .85, .4),
    width .19s cubic-bezier(.45, 0, .85, .4),
    height .19s var(--ease);
}
.tabbar__inner > .tab-slider.is-snapping {
  transition:
    transform .34s var(--ease-snap),
    width .34s var(--ease-snap),
    height .34s var(--ease-snap);
}

/* The segmented control's knob slides, and stretches a little along its
   travel as it goes, rounding out again as it lands. app.js holds
   .is-moving for the first half of the slide. */
.segments > .tab-slider.is-moving { scale: 1.08 .94; }

/* The segmented control's capsule: the same element, the same slide, in the
   control's own material — a raised white segment. Everything about the
   movement is shared with the rule above. */
.segments.has-slider .tab.is-active {
  background: none;
  box-shadow: none;
}
.segments > .tab-slider {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 0;
  height: 0;
  border-radius: var(--r-pill);
  opacity: 0;
  pointer-events: none;
  background: var(--knob);
  box-shadow: var(--knob-shadow);
  will-change: transform;
  transition:
    transform .42s var(--ease-snap),
    width .42s var(--ease-snap),
    height .42s var(--ease-snap),
    scale .2s var(--ease),
    opacity var(--dur-2) var(--ease);
}
.segments > .tab-slider.is-on { opacity: 1; }
.segments > .tab-slider.is-instant { transition: none; }
.segments > .tab { position: relative; z-index: 1; }

/* Put in place rather than moved there: the first paint of a page, a window
   resize, a web font landing late. None of those are a choice the person
   made, so none of them should look like one. */
.tabbar__inner > .tab-slider.is-instant { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .tabbar__inner > .tab-slider,
  .segments > .tab-slider { transition: opacity var(--dur-1) var(--ease); }
  .tabbar .tab,
  .tabbar__inner,
  .tabbar .tab__label { transition: none; animation: none; }
}

/* --------------------------------------------------------------------------
   35. Notifications — the bell, and the list behind it
   -------------------------------------------------------------------------- */

/* The unread count rides on the Alerts tab in the shared navigation. */

/* ---- The switch at the top of the inbox --------------------------------- */

/* Hidden in the markup and shown by notifications.js once it knows what it
   can offer. A switch that appears a moment late is better than one that is
   there from the start and turns out to do nothing. */
.push-setup {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.push-setup__mark {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--surface-3);
  color: var(--muted);
}
.push-setup__mark svg { width: 19px; height: 19px; }
.push-setup.is-on .push-setup__mark {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.push-setup__text { flex: 1 1 auto; min-width: 0; }
.push-setup__title { font-weight: 600; font-size: 15px; }
.push-setup__status {
  margin-top: var(--sp-1);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.push-setup__switch { flex: none; align-self: center; }
/* Nothing to offer here — the browser cannot, or the server is not set up —
   so the card is a note and the switch is gone rather than greyed. */
.push-setup.is-static .push-setup__switch { display: none; }

/* The setup note nobody but staff sees: amber, because it is a job somebody
   has to do rather than a state of the app. */
.push-setup--todo {
  border-color: color-mix(in srgb, var(--warn) 30%, var(--line));
  background: color-mix(in srgb, var(--warn) 5%, var(--surface));
}
.push-setup--todo .push-setup__mark { background: var(--warn-soft); color: var(--warn); }
.push-setup--todo code {
  padding: 1px 5px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* On, and saying so in the one colour the app uses for "this is live". */
.push-setup.is-on { border-color: var(--brand-soft); }
.push-setup.is-on .push-setup__status { color: var(--brand-strong); }

/* ---- The list -----------------------------------------------------------

   A notification about a notice is dressed like the notice it is about: the
   colour of whoever caused it, a lift off the page, a dot while it is unread,
   and the same staggered arrival the board uses. The vocabulary is section
   24's (.notice), borrowed rather than reinvented — a person is one colour
   everywhere in KaamKoRecord, and two different-looking cards about the same event
   would be two things to learn instead of one.
   ---------------------------------------------------------------------- */

/* The day a run of notifications belongs to.

   Not sticky, and that was a mistake worth recording. A pill that follows you
   down the page needs something to sit against, and KaamKoRecord's app bar scrolls
   away with the content — so it had nothing to anchor to and simply hovered
   over whatever was underneath, landing square on the first face in the list.
   A label that obscures the thing it is labelling is worse than one you have
   to scroll back to find. It stays where it was written. */
.notes__day {
  width: max-content;
  margin: var(--sp-5) 0 var(--sp-2);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.notes__day:first-of-type { margin-top: var(--sp-2); }

.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }

.note {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  /* Lands rather than appears, one after another — the same arrival the
     board's notices use. Section 17 switches it off on request. */
  animation: mw-notify var(--dur-3) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

/* Unread, and from a person: washed in their colour. Read rows keep the plain
   surface — what you have already seen should stop asking for attention. */
.note--unread.note--from {
  --tint: var(--brand);
  --tint-ink: var(--text);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--tint) 32%, var(--line));
  box-shadow: var(--shadow-2);
}
.note--unread.note--from .note__title { color: var(--tint-ink); }
.note--unread.note--from .avatar {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 22%, transparent);
}

/* Nobody caused it — the app spoke. It takes the brand rather than borrowing
   somebody else's colour. */
.note--unread.note--app {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  box-shadow: var(--shadow-2);
}

.note__link {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  color: inherit;
  text-decoration: none;
}
.note__link:hover { text-decoration: none; }
.note:hover { border-color: var(--line-strong); }
.note__link:active { transform: scale(.995); }

/* ---- The face, and the badge on its corner ---- */

.note__face { position: relative; flex: none; }

/* What the app itself raises has no face to show, so it wears the app's own
   quiet mark in the same circle. */
.note__mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-3));
  color: var(--brand-strong);
}
.note__mark svg { width: 20px; height: 20px; }

/* Which kind of thing it is, small, on the corner of the face — the way a
   messaging app badges an avatar. The ring is the page's own background, so
   the badge reads as sitting on top of the face rather than cut into it. */
.note__kind {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--pill);
  color: var(--text-2);
  box-shadow: 0 0 0 2.5px var(--surface);
}
.note__kind svg { width: 11px; height: 11px; }

/* A reaction shows the face somebody actually left. No dark disc behind it:
   an emoji is already a picture, and a second circle around it only makes it
   smaller and harder to read. */
.note__kind--emoji {
  background: var(--surface);
  font-size: 16px;
  line-height: 1;
}
.note__kind--emoji .rx { vertical-align: 0; }

.note--unread.note--from .note__kind { background: var(--tint); color: var(--brand-ink); }
.note--unread.note--from .note__kind--emoji { background: var(--surface); }

/* ---- What it says ---- */

.note__body { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }

.note__title {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.35;
}

/* Two lines of what was written, then an ellipsis. The notification is the
   nudge; the thing it points at is where you read the rest. */
.note__text {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note__when { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Unread gets the board's own dot, pulse and all. Read gets a chevron in its
   place, so the row keeps its shape and the column does not jump. */
.note__dot {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--tint, var(--brand));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tint, var(--brand)) 18%, transparent);
  animation: mw-ping 2.6s var(--ease) infinite;
}
.note__chev { flex: none; width: 18px; height: 18px; margin-top: 5px; color: var(--line-strong); }

/* On a dark card the name lifts rather than darkens, and the wash needs a
   little more of itself to be seen at all — the same correction section 24
   makes for a notice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .note--unread.note--from {
    --tint-ink: var(--text);
    background: var(--surface);
  }
}
:root[data-theme="dark"] .note--unread.note--from {
  --tint-ink: var(--text);
  background: var(--surface);
}

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

/* ---- Nothing here yet ---------------------------------------------------
   An inbox is empty far longer than it is full, so this is the page, not a
   placeholder for one. Centred on a single column: a mark, a line that says
   what will arrive, and the way to the place it arrives from.

   Its own class rather than the board's `.notices-empty`, which is a dashed
   outline sized for sitting under a list of notices. This one stands alone.
   -------------------------------------------------------------------------- */
.blank {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-5);
}

.blank__icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  /* A wash rather than a fill: the mark is the quietest thing here, and a
     solid brand circle would read as a button to press. */
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-2));
  color: var(--brand-strong);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 6%, transparent);
}
.blank__icon svg { width: 28px; height: 28px; }

.blank__title {
  margin: var(--sp-1) 0 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.blank__text {
  /* Held to a short measure and centred: two tidy lines read as a sentence
     somebody wrote, where the same words across the full card read as a
     paragraph somebody forgot to finish. */
  max-width: 34ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.blank__act { margin-top: var(--sp-2); }

@media (max-width: 380px) {
  .blank { padding: var(--sp-6) var(--sp-4); }
  .blank__icon { width: 56px; height: 56px; }
  .blank__icon svg { width: 24px; height: 24px; }
}

/* ---- Phones -------------------------------------------------------------- */
@media (max-width: 480px) {
  /* The bell beside the words is decoration, and on a phone it is decoration
     that costs the sentence a whole extra line. The heading already says
     what the card is; the switch keeps its place at the right. */
  .push-setup__mark { display: none; }
}

/* ---- Narrow phones ------------------------------------------------------
   At 320px the title wraps twice and the text has nowhere to go. A smaller
   face and tighter padding buys back about thirty pixels of line, which is
   the difference between two lines and three. */
@media (max-width: 380px) {
  .note__link { padding: var(--sp-3); gap: var(--sp-2); }
  .note .avatar--md { width: 34px; height: 34px; font-size: 14px; }
  .note__mark { width: 34px; height: 34px; }
  .note__mark svg { width: 17px; height: 17px; }
  .note__kind { width: 17px; height: 17px; }
  .note__title { font-size: 14px; }
  .note__text { font-size: 13.5px; }
}

/* ---- iPad, and a phone turned on its side -------------------------------
   Once there is more width than a phone held upright, stacking the time under
   the text wastes the room and stretches every line across the whole slab.
   The time moves out to its own column — a list of times is read downward —
   and the words are held to a readable measure rather than running the full
   width of an iPad, which is about twice as far as an eye tracks comfortably.
   -------------------------------------------------------------------------- */
@media (min-width: 720px) {
  .note__link { padding: var(--sp-4) var(--sp-5); align-items: center; }

  .note__body {
    /* 66ch is the measure, not the column: the time is pushed to the far
       edge by the 1fr beside it, so the row still uses the whole width while
       the sentence stops where it becomes tiring. */
    grid-template-columns: minmax(0, 66ch) 1fr;
    grid-template-areas:
      "title when"
      "text  when";
    column-gap: var(--sp-5);
    align-items: baseline;
  }
  .note__title { grid-area: title; }
  .note__text  { grid-area: text; }
  .note__when  {
    grid-area: when;
    justify-self: end;
    margin-top: 0;
    align-self: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  /* With the row centred, the dot and chevron centre with it. */
  .note__dot, .note__chev { margin-top: 0; align-self: center; }
}

/* ---- A phone on its side ------------------------------------------------
   Three hundred and ninety pixels of height, and the heading, the back link
   and the switch between them took all of it: one notification on screen,
   and it was cut in half. Everything above the list is sized for a phone held
   upright, so in a short window it all gives back what it can.

   Scoped to .inbox rather than written against .page-head and .page-title,
   which belong to every screen in KaamKoRecord. This is a fix for one page in one
   shape of window, not a new opinion about headings.
   -------------------------------------------------------------------------- */
@media (max-height: 520px) and (orientation: landscape) {
  .inbox .backlink { margin-bottom: var(--sp-1); }
  .inbox .page-head { margin-bottom: var(--sp-3); padding-top: 0; }
  .inbox .page-title { font-size: 22px; }

  .inbox .push-setup { padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); }
  .inbox .push-setup__mark { display: none; }

  .inbox .notes__day { margin: var(--sp-3) 0 var(--sp-1); }
  .inbox .note__link { padding: var(--sp-3) var(--sp-4); }
  /* One line of the body rather than two: in this shape the list is being
     scanned for which notification to open, not read. */
  .inbox .note__text { -webkit-line-clamp: 1; }
}

/* --------------------------------------------------------------------------
   35b. A phone on its side — every page

   Three hundred and ninety pixels of height, and the app bar, the dock and
   the title between them were most of it. The dock sits lower and smaller,
   the bar loses a little height, and the big title is a normal heading.
   -------------------------------------------------------------------------- */
@media (max-height: 520px) and (orientation: landscape) and (max-width: 767px) {
  :root { --appbar-h: 48px; --tabbar-h: 62px; }
  .tabbar { bottom: calc(var(--safe-b) + 6px); }
  .tabbar .tab { height: 42px; }
  .page-title { font-size: 24px; }
  .page-head { margin-bottom: var(--sp-3); }
  .dial { width: min(200px, 40vh); }
}

/* --------------------------------------------------------------------------
   36. Public holidays — the next one, on the way in

   Two columns on one tinted panel: the day in words on the left, a drawing of
   it on the right. The words are the part that has to work — the month and
   the numeral together in a tile, the way every calendar and every ticket
   prints a date, and under it the name, the weekday and the number anybody
   actually came for, which is how many sleeps away it is.

   The drawing says nothing the words do not. It is there because this is the
   first thing on the hub and the one thing on it that is good news, and a
   card made of four fields and a chevron does not read that way. It bleeds
   off the right edge rather than sitting in a box of its own, and it gives up
   its width first: everything in it is decoration, and none of it is missed.
   -------------------------------------------------------------------------- */
.holiday {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}
.holiday:hover { text-decoration: none; }
.holiday:active { transform: scale(.995); }

.holiday__text { flex: 1 1 auto; min-width: 0; display: grid; gap: var(--sp-3); }

/* Pulled into the padding on three sides so the drawing meets the card's
   edges. clamp() is what keeps the words readable: the drawing never takes
   more than about a third, and never shrinks to a stamp. A third is also
   what leaves the kicker and the scope pill room to share one line on a
   360px phone, which they do with nothing to spare. */
.holiday__art {
  flex: none;
  width: clamp(112px, 36%, 180px);
  margin: calc(var(--sp-3) * -1) calc(var(--sp-4) * -1) calc(var(--sp-3) * -1) 0;
}

/* ---- The hub on a wide screen ----------------------------------------------
   From 1024px the hub stops being one phone column stretched wide. Two
   columns start together at the top: on the left the greeting and the
   small cards — the holiday, a thought for the day, a little laugh —
   staying put under the app bar; on the right the stories with the board
   — the thing you read — beneath them, at a width a line of text is
   still comfortable at. The holiday card stacks, drawing above words, to suit the narrow
   column; the stories row loses its gutter bleed, since inside the hub it
   is not at the page's edge. */

/* Below the wide breakpoint the greeting and the side column's copies of
   the extras do not exist — the app bar already says whose phone it is,
   and the extras are shown beside the stories instead (.hub__daily). */
.hub__head, .hub__wide { display: none; }
.hub__stories { margin-bottom: var(--sp-4); }

/* The thought and the laugh as a pair just under the stories: two small
   cards side by side, the same height, a glance each. The quotes are
   short (under a hundred characters) and the setups shorter, so half a
   phone is room enough; below 360px, where half is not, they stack. */
.hub__daily {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.hub__daily .card + .card { margin-top: 0; }
.hub__daily .card__pad { padding: var(--sp-4); }
.hub__daily .daily__kicker { font-size: 10.5px; letter-spacing: .3px; }
.hub__daily .daily__quote { font-size: 15px; line-height: 1.35; }
.hub__daily .daily__who { font-size: 12.5px; }
.hub__daily .daily__setup { font-size: 14.5px; line-height: 1.4; }
.hub__daily .daily__punchline { padding: 0 var(--sp-4) var(--sp-4); font-size: 14.5px; }
@media (max-width: 359px) {
  .hub__daily { grid-template-columns: minmax(0, 1fr); }
}

/* A thought for the day (hub/_quote.html). */
.daily__kicker { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--brand); }
.daily__kicker svg { width: 14px; height: 14px; }
.daily__quote { margin: var(--sp-2) 0 0; font-size: 17px; line-height: 1.4; font-weight: 600; letter-spacing: -.2px; }
.daily__who { margin-top: var(--sp-2); font-size: 13.5px; color: var(--muted); }

/* A little laugh (hub/_joke.html): the punchline is behind the tap, the
   way a joke is told. */
.daily--joke { padding: 0; }
.daily__summary { display: block; cursor: pointer; list-style: none; }
.daily__summary::-webkit-details-marker { display: none; }
.daily__setup { margin: var(--sp-2) 0 0; font-size: 15px; line-height: 1.45; font-weight: 600; }
.daily__reveal { display: inline-flex; align-items: center; gap: 3px; margin-top: var(--sp-2); font-size: 13px; font-weight: 700; color: var(--brand); }
.daily__reveal svg { width: 14px; height: 14px; transition: transform .15s ease; }
.daily--joke[open] .daily__reveal svg { transform: rotate(180deg); }
.daily__punchline { margin: calc(var(--sp-3) * -1) 0 0; padding: 0 var(--sp-5) var(--sp-5); font-size: 15px; line-height: 1.45; color: var(--text-2); }

@media (min-width: 1024px) {
  .container--hub { max-width: 1180px; }
  /* Two rows: the side column (greeting first) spans both on the left;
     the stories take the first and the board the second on the right —
     so both columns start at the very top. */
  .hub {
    display: grid;
    grid-template-columns: 336px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: var(--sp-7, 40px);
    align-items: start;
  }
  .hub__side { grid-column: 1; grid-row: 1 / span 2; }
  .hub__stories { grid-column: 2; grid-row: 1; }
  .hub__main { grid-column: 2; grid-row: 2; }

  .hub__head { display: block; padding-top: 2px; }
  .hub__hello { font-size: 15px; font-weight: 600; color: var(--muted); }
  .hub__name { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1.15; }
  .hub__today { margin-top: 6px; font-size: 15px; font-weight: 500; color: var(--muted); }

  .hub__stories { margin-bottom: var(--sp-4); }
  .hub__stories .stories { margin: 0; }
  .hub__stories .stories__row { padding-left: 0; padding-right: 0; scroll-padding-inline: 0; }

  .hub__side {
    position: sticky;
    top: calc(var(--appbar-h) + var(--safe-t, 0px) + var(--sp-4));
    display: grid;
    gap: var(--sp-4);
  }
  .hub__wide { display: block; }
  .hub__daily { display: none; }
  .hub__side .holiday { flex-direction: column-reverse; align-items: stretch; margin-bottom: 0; }
  .hub__side .holiday__art { width: 168px; margin: calc(var(--sp-4) * -1) calc(var(--sp-4) * -1) 0 auto; }
  .hub__main .board { margin-top: 0; }

}

/* ---- The line above: what this is, and whose it is ---- */

.holiday__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}
.holiday__kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.holiday__kicker svg { width: 13px; height: 13px; }

/* National in the brand colour, a state's own in amber: the difference
   matters on a board where not everybody is in the same state, and it is the
   kind of thing you want to catch without reading. */
.holiday__pill {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
}
.holiday__pill--national {
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--brand-strong);
}

/* ---- The date tile, and what it is ---- */

.holiday__body {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* Shared with the rows on the calendar page, which sit on a plain surface —
   hence the tint here, and the plain fill the card overrides it with below. */
.holiday__date {
  flex: none;
  width: 52px;
  padding: 5px 0 7px;
  display: grid;
  justify-items: center;
  gap: 1px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--brand) 9%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
}
.holiday__body .holiday__date {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
}
.holiday__month {
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
}
.holiday__day {
  /* Tabular so a 9 and a 25 sit on the same baseline width and the tile
     never changes shape between months. */
  font-size: 22px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.holiday__what { min-width: 0; display: grid; gap: 1px; }
.holiday__name {
  font-size: 19px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.holiday__weekday { color: var(--muted); font-size: 13px; }

/* ---- The line below: the countdown, and the way in ---- */

/* Allowed to become two lines, and usually is on a phone: the countdown
   first either way, because the button is only how you leave. */
.holiday__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
}
.holiday__countdown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12.5px;
  font-weight: 650;
}
.holiday__countdown svg { width: 13px; height: 13px; }
.holiday__more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}
.holiday__more svg { width: 14px; height: 14px; }

/* ---- The drawing (templates/holidays/_art.html) -------------------------

   Every colour is a token, so the dark theme takes it over without a second
   drawing: the paper goes to the dark surface, the band and the rings to the
   pale mint that reads as the accent there, and the cells are cut from the
   text colour, which is what keeps them visible either way round.
   ------------------------------------------------------------------------- */
.hart { width: 100%; height: auto; display: block; }
.hart__blob { fill: color-mix(in srgb, var(--brand) 13%, transparent); }
.hart__doodle {
  fill: none;
  stroke: color-mix(in srgb, var(--brand) 34%, transparent);
  stroke-width: 3.5;
  stroke-linecap: round;
}
.hart__dot { fill: color-mix(in srgb, var(--brand) 34%, transparent); }
.hart__sun { fill: var(--warn); }
.hart__ray { fill: none; stroke: var(--warn); stroke-width: 3.5; stroke-linecap: round; }
.hart__paper { fill: var(--surface); }
.hart__band,
.hart__ring { fill: var(--brand-strong); }
.hart__cell { fill: color-mix(in srgb, var(--text) 13%, transparent); }
.hart__disc { fill: var(--brand); }
.hart__tick {
  fill: none;
  stroke: var(--surface);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hart__leaf { fill: var(--brand); }
.hart__stem { fill: none; stroke: var(--brand-strong); stroke-width: 3.5; stroke-linecap: round; }
.hart__vein { fill: none; stroke: var(--surface); stroke-width: 2; stroke-linecap: round; opacity: .5; }

/* ---- The calendar behind it ---------------------------------------------

   Built for a phone held in one hand and nothing else. A year of one state's
   holidays is fifteen rows that all look alike, so the page folds into months
   and opens only the one you are in: the headings are the navigation, and
   everything below them is sized to a thumb rather than a mouse.
   ------------------------------------------------------------------------- */

/* The picker stacks on the narrowest phones — a label, a select and a 44px
   tap target do not fit on one line at 320px without shaving the select to
   nothing. */
.holiday-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.holiday-pick__label { flex: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.holiday-pick__select {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 44px;
}

/* ---- One month, folded ---- */

/* Months run together as one list, separated by a hairline rather than by
   air — the headings are the page's navigation, and navigation you have to
   scroll between is not navigation. */
.hmonths { display: grid; }
.hmonth { padding-bottom: var(--sp-1); }
.hmonth + .hmonth { padding-top: var(--sp-1); border-top: 1px solid var(--line); }

.hmonth__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  /* The whole heading is the tap target, and it clears 44px on its own. */
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-2) var(--ease);
}
.hmonth__head::-webkit-details-marker { display: none; }
.hmonth__head:hover { background: var(--surface-2); }
.hmonth__head:active { background: var(--surface-3); }
.hmonth[open] .hmonth__head { margin-bottom: var(--sp-1); }

.hmonth__name {
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}
/* The list crosses a new year somewhere in the middle, so the year is always
   written — quietly, because eleven of the twelve headings share one. */
.hmonth__year { margin-left: 5px; color: var(--muted); font-size: 13px; font-weight: 550; }

.hmonth__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: none;
  color: var(--muted);
}
/* The count is what a shut month gains over an open one, so it steps back
   once the dates it was standing in for are on screen. Hidden rather than
   removed, so the chevron keeps its place instead of jumping right. */
.hmonth__count { font-size: 12px; transition: opacity var(--dur-2) var(--ease); }
.hmonth[open] .hmonth__count { opacity: 0; }

.hmonth__chev {
  flex: none;
  width: 16px; height: 16px;
  transition: transform var(--dur-2) var(--ease);
}
.hmonth[open] .hmonth__chev { transform: rotate(180deg); }

/* Opening one drops its dates in rather than snapping them into place. */
.hmonth[open] .holidays { animation: mw-rise var(--dur-3) var(--ease-out) both; }

/* ---- The dates inside it ---- */

.holidays { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }

.holiday-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.holiday-row__what {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.holiday-row__name {
  font-weight: 650;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Weekday, countdown and scope on one line that is allowed to become two.
   A name like "Friday before the AFL Grand Final" eats a 320px row on its
   own; letting the pill wrap under it beats squeezing it to nothing. */
.holiday-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px var(--sp-2);
}
.holiday-row__when { color: var(--muted); font-size: 12.5px; }

/* The tile again, smaller, so a list of dates reads the same way the card
   does rather than inventing a second shape for the same thing. */
.holiday__date--sm { width: 48px; padding: 5px 0 7px; }
.holiday__date--sm .holiday__month { font-size: 9.5px; }
.holiday__date--sm .holiday__day { font-size: 19px; }

/* Tablets and up — the only place the year ahead gets more room, and all it
   buys is a slightly larger heading. Everything else was already right. */
@media (min-width: 720px) {
  .holiday { padding: var(--sp-5); }
  .holiday__name { font-size: 20px; }
  .hmonth__name { font-size: 16px; }
}

/* ==========================================================================
   Stories — the row above the notice board, and the viewer behind it
   ========================================================================== */

/* ---- The row ---------------------------------------------------------------
   Tall tiles, scrolled sideways with the thumb and snapped, the first one
   for posting your own. Each other tile is somebody's latest picture with
   their face ringed on top: brand-coloured until you have looked, then
   quiet. The row bleeds to the gutter edges so the scroll feels like the
   page's and not a box's. */
.stories { margin: 0 calc(-1 * var(--gutter)); }
.stories__row {
  display: flex;
  gap: var(--sp-2);
  padding: 2px var(--gutter) var(--sp-2);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.stories__row::-webkit-scrollbar { display: none; }
.story-tile {
  position: relative;
  flex: none;
  width: 104px;
  aspect-ratio: 9 / 16;
  scroll-snap-align: start;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  color: #fff;
  text-decoration: none;
  isolation: isolate;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease-snap);
}
.story-tile:hover { text-decoration: none; }
.story-tile:active { transform: scale(.97); }
.story-tile__bg { position: absolute; inset: 0; z-index: -1; background: var(--surface-3); }
.story-tile__bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-tile__bg--me { background: hsl(var(--hue, 160) 55% 50%); }
/* The name at the bottom, over a shade so it reads on any picture. */
.story-tile__name {
  position: absolute;
  z-index: 2;
  left: 8px; right: 8px; bottom: 8px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.story-tile::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 44px;
  background: rgba(0, 0, 0, .42);
  pointer-events: none;
}
.story-tile--new::after { display: none; }
/* The face, top-left, in a ring: brand while unseen, grey once seen. */
.story-tile__ring {
  position: absolute;
  z-index: 2;
  top: 8px; left: 8px;
  padding: 2px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 2.5px var(--line-strong);
}
.story-tile.is-unseen .story-tile__ring { box-shadow: 0 0 0 2.5px var(--brand); }
.story-tile.is-mine .story-tile__ring { box-shadow: 0 0 0 2.5px var(--brand); }
.story-tile__ring .avatar { width: 28px; height: 28px; font-size: 12px; }
.story-tile__ring .avatar__live { display: none; }
/* The create tile: your photo on top, a plus over the seam, the words in a
   white foot — the tile that is an action rather than a picture. */
.story-tile--new { color: var(--text); }
.story-tile--new .story-tile__bg { bottom: 34%; }
.story-tile--new .story-tile__foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 34%;
  display: grid;
  place-items: end center;
  padding-bottom: 8px;
  font-size: 12px;
  font-weight: 650;
  background: var(--surface);
  text-align: center;
}
.story-tile__plus {
  position: absolute;
  z-index: 2;
  left: 50%; top: 66%;
  width: 32px; height: 32px;
  margin: -16px 0 0 -16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 0 0 3px var(--surface);
}
.story-tile__plus svg { width: 18px; height: 18px; }
@media (min-width: 560px) {
  .story-tile { width: 118px; }
}

/* ---- The viewer -------------------------------------------------------------
   Full-screen on a phone; on anything wider a 9:16 stage in the middle of
   a dark backdrop with an arrow either side for the next person. The
   segments across the top are the stories, the one filling is the one up. */
/* Doubled selector: the container's own child-spacing rule outranks a
   class, and a dialog in the top layer must not inherit a page gap. */
.story-viewer.story-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
  overflow: hidden;
}
.story-viewer::backdrop { background: #000; }
.story-viewer__stage {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #111;
  /* Room for the browser's own bars on a phone. */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.story-viewer__bars {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  left: 10px; right: 10px;
  display: flex;
  gap: 4px;
  z-index: 3;
}
.story-viewer__bar {
  flex: 1 1 0;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .35);
  overflow: hidden;
}
.story-viewer__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}
.story-viewer__bar.is-done i { width: 100%; }
.story-viewer__head {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  left: 10px; right: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
}
.story-viewer__who .avatar { width: 36px; height: 36px; font-size: 14px; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.story-viewer__meta { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.story-viewer__meta b { font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-viewer__meta span { font-size: 13px; opacity: .85; }
.story-viewer__btn {
  flex: none;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .25);
  color: #fff;
  cursor: pointer;
}
.story-viewer__btn svg { width: 20px; height: 20px; }
.story-viewer.is-paused [data-pause] { background: rgba(255,255,255,.25); }
.story-viewer__pic {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.story-viewer__pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  animation: mw-veil var(--dur-3) var(--ease) both;
}
.story-viewer__pic.is-loading img { opacity: 0; animation: none; }
.story-viewer__pic.is-loading::after {
  content: "";
  position: absolute;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.story-viewer__caption {
  position: absolute;
  left: 16px; right: 16px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .45);
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.story-viewer__caption[hidden] { display: none; }
/* The two halves of the picture: tap left to go back, right to go on. */
.story-viewer__tap {
  position: absolute;
  top: 70px; bottom: 100px;
  width: 30%;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.story-viewer__tap--prev { left: 0; }
.story-viewer__tap--next { right: 0; width: 70%; }
.story-viewer__foot {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(12px + env(safe-area-inset-bottom));
  padding: 0 12px;
  z-index: 3;
  display: grid;
  gap: 10px;
}
/* The row of faces, for anyone else's story. */
.story-viewer__react {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.story-viewer__react[hidden] { display: none; }
.story-viewer__face {
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--dur-2) var(--ease-snap), background var(--dur-2) var(--ease);
}
.story-viewer__face svg, .story-viewer__face .reaction { width: 30px; height: 30px; }
.story-viewer__face:hover { transform: translateY(-3px) scale(1.12); }
.story-viewer__face.is-on { background: rgba(255, 255, 255, .35); box-shadow: 0 0 0 2px #fff; }
.story-viewer__face.is-on { animation: mw-pop var(--dur-3) var(--ease-snap) both; }
/* Your own: who looked, and the way to take it down. */
.story-viewer__own { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.story-viewer__own[hidden] { display: none; }
.story-viewer__seen, .story-viewer__delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.story-viewer__seen svg, .story-viewer__delete svg { width: 16px; height: 16px; }
.story-viewer__delete:hover { background: rgba(240, 40, 74, .6); }
.story-viewer__viewers {
  max-height: 40vh;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(20, 20, 20, .92);
  font-size: 14px;
}
.story-viewer__viewers[hidden] { display: none; }
.story-viewer__viewers h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; opacity: .7; }
.story-viewer__viewers ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.story-viewer__viewers li { display: flex; justify-content: space-between; gap: 10px; }
.story-viewer__viewers li span { opacity: .6; font-size: 12.5px; }
.story-viewer__viewers .story-viewer__tally { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.story-viewer__viewers .story-viewer__tally b { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.story-viewer__viewers .story-viewer__tally svg { width: 18px; height: 18px; }
.story-viewer__arrow { display: none; }
@media (min-width: 720px) {
  .story-viewer::backdrop { background: rgba(0, 0, 0, .92); }
  .story-viewer { background: transparent; }
  .story-viewer__stage {
    width: auto;
    height: min(92vh, 900px);
    aspect-ratio: 9 / 16;
    margin-top: 4vh;
    border-radius: var(--r-lg);
  }
  .story-viewer__arrow {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 48px; height: 48px;
    margin-top: -24px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    cursor: pointer;
  }
  .story-viewer__arrow svg { width: 26px; height: 26px; }
  .story-viewer__arrow:hover { background: rgba(255, 255, 255, .3); }
  .story-viewer__arrow[disabled] { opacity: .25; cursor: default; }
  .story-viewer__arrow--prev { left: calc(50% - min(46vh, 450px) * 1 - 70px); }
  .story-viewer__arrow--next { right: calc(50% - min(46vh, 450px) * 1 - 70px); }
}

/* ---- Composing one ---------------------------------------------------------
   The photo is the story, so the box is the picker: tap to choose, the
   picture fills it, a line of caption under, and Share. */
.story-compose { display: grid; gap: var(--sp-3); }
.story-compose__drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  max-height: 60vh;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--line-strong);
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
}
.story-compose__drop.has-photo { border-style: solid; background: #000; }
.story-compose__preview { width: 100%; max-height: 60vh; object-fit: contain; display: block; }
.story-compose__preview[hidden] { display: none; }
.story-compose__empty { display: grid; justify-items: center; padding: var(--sp-5); }
.story-compose__empty[hidden] { display: none; }
.story-compose__status[hidden] { display: none; }

/* The speaker: waves when there is sound, a cross over them when not. */
.story-viewer__btn .story-viewer__mute { display: none; }
.story-viewer__btn.is-muted .story-viewer__wave { display: none; }
.story-viewer__btn.is-muted .story-viewer__mute { display: block; }
.story-viewer__pic video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.story-viewer__pic video[hidden], .story-viewer__pic img[hidden] { display: none; }

/* ---- The photo editor, in the composer -------------------------------------
   The picture in a 9:16 frame, as it will be seen; drag it about, pinch or
   scroll to zoom, a slider for the same, and a row of tools beneath. */
.story-edit { display: grid; gap: var(--sp-3); }
.story-edit__frame {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #000;
  touch-action: none;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.story-edit__frame:active { cursor: grabbing; }
.story-edit__canvas { width: 100%; height: 100%; display: block; }
.story-edit__hint {
  position: absolute;
  left: 50%; bottom: 10px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 11.5px;
  white-space: nowrap;
  pointer-events: none;
  animation: mw-veil var(--dur-3) var(--ease) both;
}
.story-edit__hint[hidden] { display: none; }
.story-edit__tools {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.story-edit__tool {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 52px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.story-edit__tool svg { width: 20px; height: 20px; }
.story-edit__tool:hover { border-color: var(--brand); color: var(--text); }
.story-edit__tool.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.story-edit__zoom { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.story-edit__zoom input { width: 100%; accent-color: var(--brand); }
.story-edit__filters {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.story-edit__filters::-webkit-scrollbar { display: none; }
.story-edit__filter {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.story-edit__filter.is-on { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }

/* The clip, before it goes: shown at the same 9:16, with its length. */
.story-clip { display: grid; gap: var(--sp-2); }
.story-clip__video {
  width: min(100%, 300px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: var(--r-md);
  background: #000;
  object-fit: contain;
  display: block;
}
.story-clip__meta { text-align: center; font-size: 13px; color: var(--muted); }
/* With the trimmer under it, the preview gives up some height so the
   strip and Share are on screen together on a phone; still 9:16. */
.story-clip.is-trimming .story-clip__video { width: min(100%, 300px, 42vh * 9 / 16); }

/* Over sixty seconds: the trimmer. A strip of the clip's frames with a
   window over it — the part that goes — dimming the rest. The window is
   dragged by its body; its ends are the handles, thick enough for a
   thumb, with a grip line so they read as something to pull. */
.story-trim { display: grid; gap: var(--sp-2); }
.story-trim__track {
  position: relative;
  height: 64px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}
.story-trim__strip { display: flex; height: 100%; }
.story-trim__strip canvas { flex: 1 1 0; min-width: 0; height: 100%; display: block; }
.story-trim__window {
  position: absolute;
  top: 0; bottom: 0;
  box-sizing: border-box;
  border: 3px solid var(--brand);
  border-left-width: 16px;
  border-right-width: 16px;
  border-radius: var(--r-sm);
  /* The shade over what is left out, clipped by the track. */
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45);
  cursor: grab;
}
.story-trim__window:active { cursor: grabbing; }
.story-trim__handle {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 16px;
  cursor: ew-resize;
  touch-action: none;
}
.story-trim__handle--start { left: -16px; }
.story-trim__handle--end { right: -16px; }
.story-trim__handle::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 3px; height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 2px;
  background: var(--brand-ink);
  opacity: .9;
}
.story-trim__handle:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: -4px; }
.story-trim__hint { text-align: center; font-size: 12px; color: var(--muted); }
.story-trim[hidden] { display: none; }
.story-compose__actions { display: flex; gap: var(--sp-2); }
.story-compose__actions .btn { flex: 1 1 0; }
.story-compose__actions .btn[hidden] { display: none; }
.story-compose__drop[hidden], .story-edit[hidden], .story-clip[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Legal — the privacy policy. A document, not a screen: a summary first, a
   contents list, then numbered sections in a measured column of prose.
   -------------------------------------------------------------------------- */
.legal {
  max-width: 68ch;
  line-height: 1.65;
  font-size: 15.5px;
}
.legal section + section { margin-top: var(--sp-8); }
.legal h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 var(--sp-3);
}
.legal p { margin: 0 0 var(--sp-3); }
.legal p:last-child { margin-bottom: 0; }
.legal ul, .legal ol { margin: 0 0 var(--sp-3); padding-left: 1.25em; }
.legal li + li { margin-top: var(--sp-2); }
.legal a { text-decoration: underline; text-underline-offset: 2px; }

/* The short version, set apart in the brand tint so it is read first. */
.legal__summary {
  background: var(--brand-soft);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-6);
}
.legal__summary .section-label { margin-bottom: var(--sp-2); color: var(--brand-strong); }
.legal__summary ul { margin: 0; }

.legal__toc {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--sp-4) 0;
  margin-bottom: var(--sp-8);
  font-size: 14.5px;
}
.legal__toc ol {
  margin: 0;
  padding-left: 1.5em;
  columns: 2;
  column-gap: var(--sp-6);
}
.legal__toc li { break-inside: avoid; margin: 0; padding: 2px 0; }
.legal__toc a { text-decoration: none; color: var(--text-2); }
.legal__toc a:hover { color: var(--brand); text-decoration: underline; }

.legal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  margin: var(--sp-4) 0;
}
.legal__table th, .legal__table td {
  text-align: left;
  vertical-align: top;
  padding: var(--sp-3) var(--sp-3) var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}
.legal__table thead th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0;
}
.legal__table tbody th { font-weight: 600; white-space: nowrap; width: 1%; }
.legal__table tr:last-child td, .legal__table tr:last-child th { border-bottom: 0; }
.legal__opt {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* A phone has no room for three columns: each row becomes a small block,
   the name above and the two cells stacked under it. */
@media (max-width: 560px) {
  .legal__toc ol { columns: 1; }
  .legal__table, .legal__table tbody, .legal__table tr, .legal__table th, .legal__table td { display: block; }
  .legal__table thead { display: none; }
  .legal__table tr { padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
  .legal__table tr:last-child { border-bottom: 0; }
  .legal__table th, .legal__table td { padding: 0; border: 0; white-space: normal; width: auto; }
  .legal__table tbody th { margin-bottom: var(--sp-1); }
  .legal__table td + td { margin-top: var(--sp-1); color: var(--text-2); font-size: 14px; }
  .legal__table td + td::before { content: "Why: "; font-weight: 600; color: var(--muted); }
  .legal__opt { display: inline; margin-left: 6px; }
}

/* --------------------------------------------------------------------------
   Safety — reporting a post, and the people you have blocked.
   -------------------------------------------------------------------------- */
.report-reasons { display: flex; flex-direction: column; gap: var(--sp-2); }
.report-reason {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
}
.report-reason input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.report-reason:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.blocked-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); }
.blocked-row + .blocked-row { border-top: 1px solid var(--line); }
.person-safety { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: var(--sp-3) 0; }
.person-safety form { margin: 0; }
.story-viewer__react { flex-wrap: wrap; align-items: center; }
.story-viewer__report {
  margin-left: 6px;
  padding: 0 12px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

/* Private item catalogue: arbitrary headings and codes fit phone screens. */
.catalogue-preview { overflow-x: auto; max-width: 100%; margin: 1rem 0; }
.catalogue-preview table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.catalogue-preview th, .catalogue-preview td { padding: .65rem; text-align: left; border-bottom: 1px solid var(--line); min-width: 110px; max-width: 250px; overflow-wrap: anywhere; }
.catalogue-mapping { display: grid; gap: 1rem; margin: 1rem 0; }
.catalogue-mapping > label { display: grid; gap: .4rem; }
.catalogue-mapping fieldset { border: 0; padding: 0; min-width: 0; }
.catalogue-check { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem; }
.catalogue-fields dt { font-weight: 700; margin-top: 1rem; }
.catalogue-fields dd { margin: .3rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.catalogue-code { overflow-wrap: anywhere; max-width: 100%; }
.result .catalogue-code { max-width: 35%; white-space: normal; }
.detail-hero .catalogue-code { font-size: clamp(24px, 8vw, 64px); }

.catalogue-picker { display: grid; gap: .4rem; margin-bottom: 1rem; font-weight: 600; min-width: 0; }

/* Five primary destinations share readable labels and an unread badge. */
.tabbar__inner { width: min(440px, calc(100vw - 2 * var(--gutter))); }
.tabbar .tab { flex: 1; min-width: 0; flex-direction: column; gap: 4px; height: 58px; padding: 5px 8px; }
.tabbar .tab__label, .tabbar .tab.is-active .tab__label { display: block; font-size: 11px; }
.tabbar .tab.is-arriving .tab__label { animation: none; }
.clock-face { display: grid; justify-items: center; gap: var(--sp-4); margin: var(--sp-2) auto var(--sp-3); }
.analog-clock { display: block; width: min(280px, 72vw); height: auto; filter: drop-shadow(0 8px 12px rgba(25, 46, 31, .16)); }
.clock-face .dial__time { font-size: 34px; }
.clock-face .dial__time--clock { font-size: 28px; }
.shift-progress { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.shift-progress__fill { display: block; height: 100%; width: 0; background: var(--brand); transition: width 1s linear; }
.clock-settings { display: flex; justify-content: center; align-items: center; gap: var(--sp-2); color: var(--brand-strong); font-size: 14px; padding: var(--sp-3); }
.clock-settings svg { width: 18px; height: 18px; }
.items-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.catalogue-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.catalogue-tile { padding: var(--sp-5); display: flex; align-items: flex-start; gap: var(--sp-3); color: var(--text); }
.catalogue-tile__copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); overflow-wrap: anywhere; }
.catalogue-tile:has(.catalogue-menu[open]) { position: relative; z-index: 40; }
.catalogue-tile strong { font-size: 20px; }
.catalogue-tile span { color: var(--muted); font-size: 14px; }
.catalogue-menu, .notice-menu { position: relative; flex: none; }
.catalogue-menu[open], .notice-menu[open] { z-index: 40; }
.catalogue-menu>summary, .notice-menu>summary { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); cursor: pointer; list-style: none; color: var(--text-2); }
.catalogue-menu>summary::-webkit-details-marker, .notice-menu>summary::-webkit-details-marker { display: none; }
.catalogue-menu>summary svg, .notice-menu>summary svg { width: 22px; height: 22px; }
.catalogue-menu>summary:hover, .catalogue-menu[open]>summary, .notice-menu>summary:hover, .notice-menu[open]>summary { background: var(--surface-2); }
.catalogue-menu .action-menu__panel, .notice-menu .action-menu__panel { left: auto; right: 0; translate: none; transform-origin: top right; }
.upload-steps { display: flex; gap: var(--sp-3); list-style: none; padding: 0; margin: 0 0 var(--sp-5); }
.upload-steps li { flex: 1; color: var(--muted); font-size: 13px; font-weight: 650; border-bottom: 3px solid var(--line); padding-bottom: var(--sp-3); }
.upload-steps li[aria-current="step"] { color: var(--brand-strong); border-color: var(--brand); }
.catalogue-review { display: grid; gap: var(--sp-4); }
.catalogue-review p { white-space: pre-line; }
.catalogue-review[hidden], .catalogue-edit[hidden] { display: none; }

.appearance-setting { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.appearance-setting__title { font-size: 16px; margin: 0 0 var(--sp-1); }
.appearance-setting .help { margin: 0; }
.profile-signout { margin-top: var(--sp-4); }
.tabbar .tab { padding-inline: 4px; }
.tabbar .tab__label { font-size: 10.5px; }

/* The photo menu retains the shared menu entrance animation. */
@keyframes mw-menu { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; transform: none; } }

/* Home notices are read-only previews; the whole card opens its conversation. */
.notice.notice-preview { display: block; padding: 0; }
.notice-preview__link { display: block; padding: var(--sp-4); color: var(--text); border-radius: inherit; }
.notice-preview__link:hover { color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--brand) 4%, transparent); }
.notice-preview__link:focus-visible { outline-offset: 3px; }
.notice-preview__link .notice__pinned { margin-bottom: var(--sp-3); }
.notice-preview__link .notice__who { color: var(--text); }
.notice-preview__open { display: flex; justify-content: flex-end; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; margin-top: var(--sp-4); }
.notice-preview__open svg { width: 15px; height: 15px; }
.notice-preview__link:hover .notice-preview__open { color: var(--brand-strong); }

/* Notice management stays in one overflow menu beside the author. */
.notice .notice-menu { position: absolute; top: var(--sp-4); right: var(--sp-4); }
.notice:has(.notice-menu) .notice__head { padding-right: 44px; }
.notice:has(.notice-menu) .notice__dot { right: 70px; }
.notice:has(.notice-menu[open]) { z-index: 40; }

/* Search: destinations in tabs, catalogue tools beside the page heading. */
.segments--search { max-width:640px; }
.segments--search .tab { min-height:44px; height:auto; padding:9px 8px; }
.search-heading { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:20px; padding:8px 0 22px; margin-bottom:20px; border-bottom:1px solid var(--line); }
.search-heading__copy { flex:1; min-width:200px; }
.search-heading__eyebrow { margin:0 0 8px; color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.12em; }
.search-heading .page-title { margin:0; }
.search-heading .page-sub { margin:8px 0 0; max-width:480px; line-height:1.6; }
.search-heading__actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.search-heading__actions .btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:44px; padding:10px 14px; font-size:13px; white-space:normal; }
.search-heading__actions svg { flex:none; width:18px; height:18px; }
.search-heading.search-heading--compact { padding: 0; margin-bottom: 16px; border: 0; }
.search-heading--compact .page-title { font-size: 28px; }
.search-heading--compact .page-sub { margin-top: 4px; font-size: 14px; }
@media(max-width:600px) {
  .segments--search .tab { font-size:12px; padding:9px 4px; }
  .segments--search .tab__icon { display:none; }
  .search-heading { gap:16px; padding-top:4px; }
  .search-heading__actions { width:100%; }
  .search-heading__actions .btn { flex:1; }
}

/* A compact, illustrated festival scene with readable copy and continuous live objects. */
.festival-hero { margin: 0 0 24px; overflow: hidden; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); }
.festival-hero__scene { position: relative; min-height: 260px; overflow: hidden; background: #17362f; color: #fff; display: flex; align-items: center; }
.festival-hero__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; display: block; }
.festival-hero__scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(16,28,40,.72), rgba(16,28,40,.58) 65%, rgba(16,28,40,0)); }
.festival-hero__wish { position: relative; z-index: 2; width: 60%; padding: 36px 0 36px 32px; }
.festival-hero__wish>p { font-size: 10px; color: #ffe6b1; font-weight: 700; letter-spacing: .16em; margin: 0 0 10px; }
.festival-hero__wish h2 { margin: 0; color: #fffaf0; font-size: 40px; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; text-wrap: balance; overflow-wrap: anywhere; text-shadow: 0 1px 8px rgba(0,0,0,.3); }
.festival-hero__story { padding: 20px 24px; }
.festival-hero__story>span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.festival-hero__story>span::before { content: ""; flex: none; width: 4px; height: 12px; border-radius: 2px; background: var(--brand); }
.festival-hero__story>p { margin: 5px 0 0; max-width: 85ch; font-size: 14px; line-height: 1.65; color: var(--text-2); }
@media (max-width: 560px) {
  .festival-hero { margin-bottom: 20px; border-radius: 18px; }
  .festival-hero__scene { min-height: 104px; }
  .festival-hero__art { object-position: center bottom; }
  .festival-hero__wish { width: 60%; padding: 13px 0 13px 16px; }
  .festival-hero__wish>p { font-size: 9px; margin-bottom: 5px; line-height: 1.4; }
  .festival-hero__wish h2 { font-size: 24px; line-height: 27px; }
  .festival-hero__wish--long h2 { font-size: 19px; line-height: 23px; }
  .festival-hero__story { padding: 12px 16px; }
  .festival-hero__story>p { font-size: 12px; line-height: 18px; }
}
@media print { .festival-hero { display: none; } }
.festival-live { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.festival-kite { animation: festival-kite 5.5s ease-in-out infinite alternate; }
.festival-kite--gold { animation-delay: -2.3s; animation-duration: 7s; }
.festival-swing-seat { transform-origin: 865px 72px; transform-box: view-box; animation: festival-swing 3.6s ease-in-out infinite alternate; }
.festival-flame { transform-box: fill-box; transform-origin: center bottom; animation: festival-flame 1.8s ease-in-out infinite alternate; }
.festival-snow { animation: festival-snow 9s linear infinite; }
.festival-firework { transform-box: fill-box; transform-origin: center; animation: festival-firework 5s ease-out infinite; }
.festival-flags { transform-box: fill-box; transform-origin: center top; animation: festival-flags 3.4s ease-in-out infinite alternate; }
.festival-bell { transform-origin: 0 0; animation: festival-bell 5s ease-in-out infinite alternate; }
.festival-feather { animation: festival-kite 7s ease-in-out infinite alternate; }
.festival-powder { transform-box: fill-box; transform-origin: center; animation: festival-powder 4s ease-in-out infinite alternate; }
.festival-petals { animation: festival-petals 10s linear infinite; }
.festival-reflection { animation: festival-reflection 4s ease-in-out infinite alternate; }
.festival-butterfly { transform-box: fill-box; transform-origin: center; animation: festival-butterfly 3s ease-in-out infinite alternate; }
.festival-confetti { animation: festival-petals 8s linear infinite; }
.festival-stars, .festival-halo { animation: festival-glow 3s ease-in-out infinite alternate; }
.festival-incense { animation: festival-incense 6s ease-in-out infinite; }
.festival-thread { animation: festival-thread 5s ease-in-out infinite alternate; }
.festival-delay { animation-delay: -2.5s; }
.festival-live * { animation-play-state: paused; }
[data-motion-ready="true"]:not([data-motion-paused="true"]) .festival-live * { animation-play-state: running; }
@keyframes festival-kite { from { transform: translate(-7px, 8px) rotate(-7deg); } to { transform: translate(12px, -10px) rotate(8deg); } }
@keyframes festival-swing { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@keyframes festival-flame { from { transform: scale(.88, 1.06); opacity: .8; } to { transform: scale(1.1, .92); opacity: 1; } }
@keyframes festival-snow { from { transform: translate(0, -90px); opacity: 0; } 15%, 75% { opacity: .85; } to { transform: translate(-30px, 300px); opacity: 0; } }
@keyframes festival-firework { 0%, 100% { transform: scale(.2); opacity: 0; } 20% { opacity: .85; } 70% { transform: scale(1.2); opacity: 0; } }
@keyframes festival-flags { from { transform: skewX(-4deg) scaleY(.96); } to { transform: skewX(4deg) scaleY(1.03); } }
@keyframes festival-bell { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes festival-powder { from { transform: translate(0, 8px) scale(.85); opacity: .3; } to { transform: translate(-12px, -8px) scale(1.12); opacity: .7; } }
@keyframes festival-petals { from { transform: translate(8px, -80px); opacity: 0; } 15%, 75% { opacity: .85; } to { transform: translate(-45px, 320px); opacity: 0; } }
@keyframes festival-reflection { from { opacity: .3; transform: translateX(-5px); } to { opacity: .8; transform: translateX(7px); } }
@keyframes festival-butterfly { from { transform: translate(-12px, 5px) scaleX(.55) rotate(-10deg); } to { transform: translate(18px, -12px) scaleX(1) rotate(10deg); } }
@keyframes festival-glow { from { opacity: .5; } to { opacity: .95; } }
@keyframes festival-incense { 0%, 100% { opacity: 0; transform: translateY(8px); } 30%, 65% { opacity: .6; } 90% { opacity: 0; transform: translateY(-18px); } }
@keyframes festival-thread { from { transform: translateY(3px); } to { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .festival-live * { animation: none !important; } }

/* Workplace pay wallet: one selected job, with its own payment actions. */
.pay-dashboard { display: grid; gap: 24px; min-width: 0; }
/* The wallet: the app's bank cards (mobile/src/screens/Pay.tsx), straight on
   the page — no dark tray behind them — each on a gradient of its workplace's
   own hue, the chosen one sharp and full size,
   its neighbours a little smaller and softened as they peek in. */
.pay-wallet { min-width: 0; color: var(--text); }
.pay-wallet__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.pay-wallet__head>div { display: grid; gap: 2px; }
.pay-wallet__label { color: var(--muted); font-size: 10px; letter-spacing: .13em; font-weight: 700; }
.pay-wallet__total { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.pay-wallet__hint { margin: 0; color: var(--muted); font-size: 12px; }
.pay-wallet__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.pay-wallet__icon svg { width: 22px; height: 22px; }
.pay-wallet__rail { position: relative; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; padding: 10px 2px 14px; margin: 0 -2px 2px; }
.pay-wallet__rail::-webkit-scrollbar { display: none; }
.pay-wallet__rail::after { content: ""; flex: 0 0 14px; }
.pay-wallet__rail:has(>.pay-workplace:only-child)::after { display: none; }
.pay-workplace {
  position: relative; isolation: isolate; display: flex; flex: 0 0 min(calc(100% - 40px), 420px); min-width: 0; aspect-ratio: 1.586;
  min-height: 176px; flex-direction: column; justify-content: space-between; gap: 6px; padding: 20px; text-align: left; font: inherit; color: #fff;
  border: 0; border-radius: 20px; overflow: hidden; cursor: pointer; scroll-snap-align: start; scroll-snap-stop: always;
  background: linear-gradient(135deg, hsl(var(--wp-hue) 70% 20%), hsl(calc(var(--wp-hue) + 25) 68% 34%) 55%, hsl(calc(var(--wp-hue) + 50) 75% 50%));
  box-shadow: 0 10px 22px -10px hsl(var(--wp-hue) 70% 20% / .7);
  transform: scale(.92); filter: saturate(.75) blur(.6px); opacity: .7;
  transition: transform var(--dur-3) var(--ease-out), filter var(--dur-3) var(--ease), opacity var(--dur-3) var(--ease);
}
.pay-workplace[aria-selected="true"] { transform: none; filter: none; opacity: 1; }
.pay-workplace:only-child { flex-basis: 100%; max-width: 460px; }
/* The soft waves and the glow in the corner, as on the app's card. */
.pay-workplace::before, .pay-workplace::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.pay-workplace::before { width: 110%; height: 120%; top: -62%; right: -48%; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.pay-workplace::after { left: -10%; right: -10%; bottom: -38%; height: 70%; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.pay-wallet__rail:has(>.pay-workplace:only-child) { padding-right: 2px; }
.pay-workplace__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pay-workplace__kicker { min-width: 0; color: rgba(255, 255, 255, .82); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-workplace__mark { flex: none; font-size: 18px; font-weight: 900; font-style: italic; letter-spacing: .03em; }
.pay-workplace__chiprow { display: flex; align-items: center; justify-content: space-between; }
.pay-chip { width: 44px; height: 33px; flex: none; }
.pay-contactless { width: 22px; height: 22px; color: rgba(255, 255, 255, .85); }
.pay-workplace__amount { display: block; font-size: clamp(28px, 7vw, 34px); line-height: 1.15; font-weight: 900; letter-spacing: .015em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-workplace__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pay-workplace__field { display: grid; gap: 2px; min-width: 0; }
.pay-workplace__field--end { text-align: right; flex: none; }
.pay-workplace__field small { color: rgba(255, 255, 255, .7); font-size: 9.5px; font-weight: 700; letter-spacing: .12em; }
.pay-workplace__field b { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-wallet__controls { display: flex; align-items: center; justify-content: space-between; }
.pay-wallet__arrow { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--text-2); background: none; cursor: pointer; }
.pay-wallet__arrow:hover:not(:disabled) { background: var(--surface-2); }
.pay-wallet__arrow:disabled { opacity: .35; cursor: default; }
.pay-wallet__arrow svg { width: 18px; height: 18px; }
.pay-wallet__dots { display: flex; flex: 1; justify-content: center; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pay-wallet__dots button { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; background: none; cursor: pointer; }
.pay-wallet__dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: width var(--dur-2) var(--ease); }
.pay-wallet__dots button[aria-pressed="true"] span { width: 18px; background: var(--wp-css, var(--brand)); }
.pay-details { display: grid; gap: 16px; min-width: 0; }
.pay-details[hidden] { display: none; }
.pay-details__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pay-details__label { font-size: 11px; font-weight: 700; letter-spacing: .09em; color: var(--muted); }
.pay-details__head h2 { margin: 3px 0 0; font-size: 21px; font-weight: 800; overflow-wrap: anywhere; }
.pay-details__settings { flex: none; display: grid; place-items: center; width: 44px; height: 44px; background: var(--surface-2); border-radius: var(--r-md); color: var(--text-2); }
.pay-details__settings svg { width: 20px; height: 20px; }
.pay-record .settle { margin: 0; padding: 0; border: 0; }
.pay-coverage summary { min-height: 44px; color: var(--muted); font-size: 12px; cursor: pointer; list-style: none; }
.pay-coverage summary::-webkit-details-marker { display: none; }
.pay-coverage summary>span { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 14px; color: var(--text); font-weight: 600; }
.pay-coverage summary svg { width: 18px; height: 18px; flex: none; }
.pay-coverage[open] .field { margin-top: 12px; }
.pay-group { display: grid; gap: 8px; min-width: 0; }
.pay-group h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pay-activity { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.pay-activity>li, .pay-activity__row { display: flex; align-items: center; gap: 12px; padding: 16px; }
.pay-activity>li+li { border-top: 1px solid var(--line); }
.pay-activity__icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; color: var(--text-2); background: var(--surface-2); }
.pay-activity__icon svg { width: 19px; height: 19px; }
.pay-activity__icon--due { color: var(--warn); background: var(--warn-soft); }
.pay-activity__icon--paid { color: var(--brand-strong); background: var(--brand-soft); }
.pay-activity__copy { display: grid; flex: 1; min-width: 0; gap: 3px; }
.pay-activity__copy strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.pay-activity__copy>span { color: var(--muted); font-size: 12px; }
.pay-activity__figure { display: grid; gap: 3px; max-width: 40%; text-align: right; font-variant-numeric: tabular-nums; }
.pay-activity__figure strong { font-size: 15px; overflow-wrap: anywhere; }
.pay-activity__figure>span { font-size: 12px; color: var(--muted); }
.pay-activity__paid { max-width: 40%; color: var(--brand-strong); font-size: 15px; overflow-wrap: anywhere; }
.pay-activity__undo { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; border: 0; border-top: 1px solid var(--line); color: var(--text-2); background: none; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pay-activity__undo svg { width: 16px; height: 16px; }
.pay-clear { display: flex; align-items: center; gap: 12px; }
.pay-clear>svg { flex: none; width: 28px; height: 28px; color: var(--brand-strong); }
.pay-clear strong { font-size: 16px; }
.pay-clear p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }

/* Work section tabs switch immediately without a moving capsule or entrance. */
.segments[aria-label="Work"] .tab,
.segments[aria-label="Work"] .tab svg { animation: none; transition: none; transform: none; }


/* Profile and account preferences: restrained surfaces and generous touch targets. */
.profile-minimal, .profile-settings { width: 100%; max-width: 560px; margin-inline: auto; }
.profile-minimal { background: var(--surface); border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--float-1); }
/* Floating, but crisp: a tight contact shadow and one short lift — never a
   wide blurred glow. On the dark theme a shadow cannot be seen on black, so
   the hairline round each piece carries the lift there. */
:root { --float-1: 0 1px 2px rgba(0, 0, 0, .05), 0 10px 24px -14px rgba(0, 0, 0, .22); --float-2: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 14px -8px rgba(0, 0, 0, .25); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --float-1: none; --float-2: 0 6px 14px -8px rgba(0, 0, 0, .7); } }
:root[data-theme="dark"] { --float-1: none; --float-2: 0 6px 14px -8px rgba(0, 0, 0, .7); }
.profile-minimal .profile-id { padding: 0 20px 22px; gap: 2px; }
.profile-minimal .profile-id__name { white-space: normal; overflow-wrap: anywhere; margin-top: 10px; font-size: 22px; letter-spacing: -.025em; }
.profile-minimal .profile-id__meta { overflow-wrap: anywhere; max-width: 100%; font-size: 14px; }
.profile-minimal .photo-menu { position: relative; z-index: 1; margin-top: -50px; }
.profile-minimal .photo-menu__btn { padding: 0; }
.profile-minimal .photo-menu__btn .avatar { width: 96px; height: 96px; font-size: 38px; box-shadow: 0 0 0 4px var(--surface), var(--float-2); }
.profile-minimal .photo-menu__badge { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); right: -2px; bottom: 2px; box-shadow: var(--float-2); }
.profile-minimal .photo-menu .avatar__live { display: none; }

/* The cover: one flat soft-violet panel with two flat hills across it,
   floating inside the card — inset from its edges, rounded all round —
   with your face over its lower edge. Every fill is a flat colour — no
   gradients — and the dark theme takes the same shapes a shade down. */
.profile-cover {
  --cover: var(--surface-2);
  position: relative;
  justify-self: stretch;
  height: 132px;
  margin: 10px -10px 0;
  border-radius: 18px;
  background: var(--cover);
  overflow: hidden;
}
.profile-cover__art { position: absolute; inset: 0; width: 100%; height: 100%; }
.profile-cover__hill--back  { fill: var(--surface-3); }
.profile-cover__hill--front { fill: var(--line-strong); }
.profile-cover__since {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--float-2);
}
.profile-cover__edit {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--float-2);
}
.profile-cover__edit:hover { background: var(--surface-2); text-decoration: none; }
.profile-cover__edit svg { width: 14px; height: 14px; }

/* Three figures under the name — icon, number, word — on a tile of their
   own that floats a little off the card, split by hairlines. */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 380px;
  margin: 18px 0 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--float-2);
}
.profile-stats > li + li { border-left: 1px solid var(--line); }
.profile-stat {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
}
.profile-stat:hover { background: var(--surface-2); text-decoration: none; }
.profile-stat svg { width: 20px; height: 20px; color: var(--text-2); margin-bottom: 2px; }
.profile-stat strong { font-size: 19px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.profile-stat span { font-size: 13px; color: var(--muted); }
.profile-minimal__menu { padding: 18px 0 8px; }

/* ---- Inside an open section: easy to read ------------------------------
   What a section holds sits on a soft inset of its own under the head, so
   it reads as that section's and not as more of the card. Words a size up
   and a shade darker; the lists' heads in plain words rather than small
   capitals; Activity's counts as an even grid of tiles — the number big,
   the word under it — instead of a ragged run of figures. */
.profile-minimal .panel[open] > .panel__head .panel__title { font-weight: 600; color: var(--text); }
.profile-minimal .panel > .panel__body {
  margin: 0 14px 14px;
  padding: 16px;
  gap: 14px;
  border-radius: 18px;
  background: var(--surface-2);
}
.profile-minimal .panel__body > p.muted,
.profile-minimal .panel__body > .muted { margin: 0 !important; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.profile-minimal .panel__body .section-label { font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
.profile-minimal .panel__body .result-list { background: var(--surface); }
/* Fields and plain buttons are filled with the inset's own grey elsewhere;
   on the inset they take the card's colour, so they still stand out. */
.profile-minimal .panel__body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea),
.profile-minimal .panel__body .btn:not(.btn--primary):not(.btn--ghost):not(.btn--danger) { background-color: var(--surface) !important; }

.profile-minimal .subfold { margin: 0 -16px; border-top: 1px solid var(--line); }
.profile-minimal .subfold:last-child { margin-bottom: -16px; }
.profile-minimal .subfold__head { min-height: 52px; padding: 0 16px; border-radius: 0; }
.profile-minimal .subfold__head:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.profile-minimal .subfold:last-child:not([open]) > .subfold__head { border-radius: 0 0 18px 18px; }
.profile-minimal .subfold__count { background: var(--surface); }
.profile-minimal .subfold__body { margin: 0 16px 16px; }

.profile-minimal .panel__body .lead-stat { padding: 8px 0 4px; border-bottom: 0; }
.profile-minimal .panel__body .lead-stat__label { font-size: 13.5px; color: var(--text-2); }
.profile-minimal .panel__body .tallies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; }
.profile-minimal .panel__body .tally {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 12px 6px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  overflow: visible;
}
.profile-minimal .panel__body a.tally:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.profile-minimal .panel__body .tally__value { font-size: 21px; font-weight: 650; color: var(--text); }
.profile-minimal .panel__body .tally__label { margin: 0; font-size: 12.5px; color: var(--text-2); }
.profile-minimal__label, .profile-settings__label { font-size: 10px; letter-spacing: .14em; font-weight: 600; color: var(--muted); margin: 0; padding: 0 22px 6px; }
.profile-minimal__row, .profile-minimal .panel__head { display: flex; align-items: center; gap: 18px; min-height: 60px; padding: 16px 22px; color: var(--text-2); text-decoration: none; }
.profile-minimal__row:hover, .profile-minimal .panel__head:hover { background: var(--surface-2); }
.profile-minimal__row > svg, .profile-minimal .profile-minimal__icon { flex: none; width: 20px; height: 20px; color: var(--text-2); }
.profile-minimal__row > span, .profile-minimal .panel__title { flex: 1; min-width: 0; font-size: 15px; font-weight: 400; }
.profile-minimal__row small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.profile-minimal .panel { border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.profile-minimal .panel__hint { display: none; }
.profile-minimal .panel__body { padding: 4px 22px 20px; animation: none; }
.profile-minimal__divider { margin: 8px 22px 4px; height: 1px; background: var(--line); }
.profile-minimal__badge { min-width: 24px; height: 24px; padding: 0 7px; display: grid; place-items: center; border-radius: 12px; font-size: 12px; font-weight: 600; color: var(--brand-strong); background: var(--brand-soft); }
.profile-signout { margin-top: 0; }
.profile-minimal__logout { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; width: 100%; padding: 16px 22px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 15px; cursor: pointer; }
.profile-minimal__logout svg { width: 20px; height: 20px; }
.profile-minimal__logout:hover { color: var(--text); }
.profile-settings { display: grid; gap: 24px; }
.profile-settings__group { border-radius: 20px; background: var(--surface); overflow: hidden; }
.profile-settings__label { padding: 0 8px 8px; }
.profile-settings .appearance-setting { border: 0; border-radius: 0; box-shadow: none; padding: 16px 22px; }
.profile-settings .appearance-setting__title { font-size: 15px; font-weight: 400; }
.profile-settings .profile-minimal__row { min-height: 60px; }
.profile-settings__legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.profile-settings__legal a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 10px; font-size: 13px; color: var(--muted); }
.profile-settings__delete { color: var(--danger); text-align: center; min-height: 44px; display: flex; align-items: center; justify-content: center; font-size: 14px; }


/* ---- Earnings chart (timeclock/_trend.html, app.js initTrend) -------------
   The app's TrendChart on the site: a switch for the span, the total and how
   it compares, a soft line for this span over a thinner one for the span
   before, a bubble on the day being read and the days as pills underneath. */
.trend { overflow: hidden; padding-bottom: var(--sp-4); }
.card + .trend, .trend + .card { margin-top: var(--sp-4); }
.trend.is-loading .trend__plot { opacity: .55; transition: opacity var(--dur-2) var(--ease); }

.trend__switch { display: flex; gap: 2px; margin: var(--sp-4) var(--sp-4) var(--sp-3); padding: 3px; border-radius: var(--r-md); background: var(--surface-2); }
.trend__span {
  flex: 1 1 auto; min-width: 0; min-height: 36px; padding: 0 6px; border: 0; border-radius: calc(var(--r-md) - 3px);
  background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.trend__span:hover { color: var(--text); }
.trend__span.is-on { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }

.trend__kicker { padding: 0 var(--sp-5); color: var(--muted); font-size: 14px; font-weight: 500; }
.trend__amount-row { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-5); }
.trend__amount { font-size: 30px; font-weight: 800; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.trend__change { padding: 3px 8px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 700; }
.trend__change.is-up { background: var(--brand-soft); color: var(--brand); }
.trend__change.is-down { background: var(--warn-soft); color: var(--warn); }

.trend__legend { display: flex; gap: var(--sp-4); padding: 0 var(--sp-5); margin-top: var(--sp-2); color: var(--muted); font-size: 12.5px; }
.trend__key { display: inline-flex; align-items: center; gap: 6px; }
.trend__dot { width: 8px; height: 8px; border-radius: 50%; }
.trend__dot--now { background: var(--brand); }
.trend__dot--then { background: var(--muted); }

.trend__plot { position: relative; height: 178px; touch-action: pan-y; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.trend__svg { display: block; overflow: visible; }
.trend__grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 6; }
.trend__then { fill: none; stroke: var(--muted); stroke-dasharray: 5 4; stroke-width: 2; stroke-linecap: round; opacity: .9; }
.trend__now { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; }
.trend__pick { stroke: var(--brand); stroke-width: 1.2; stroke-dasharray: 4 4; }
.trend__ring { fill: var(--surface); }
.trend__point { fill: var(--brand); }
.trend__bubble, .trend__tail { position: absolute; background: var(--text); pointer-events: none; }
.trend__bubble { top: 4px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); color: var(--bg); font-size: 14px; font-weight: 700; line-height: 34px; white-space: nowrap; }
.trend__tail { top: 32px; width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); }

.trend__caption { margin: var(--sp-2) 0 0; padding: 0 var(--sp-4); color: var(--muted); font-size: 13px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend__pills { display: flex; padding: 0 12px; margin-top: var(--sp-3); }
.trend__pill {
  flex: 1; min-width: 0; padding: 9px 0; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent;
  color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: clip; white-space: nowrap;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.trend__pill:hover { background: var(--surface-2); }
.trend__pill.is-later { color: var(--muted); }
.trend__pill.is-on { background: var(--text); border-color: var(--text); color: var(--bg); }
.trend__pills.is-dense .trend__pill { font-size: 12px; padding: 7px 0; }

/* ---- Wide pages: two columns on a desktop ---------------------------------
   The timesheet (and the pay page) put their figures and their list side by
   side once there is room, the way a dashboard does, instead of one long
   strip down the middle of an empty window. The controls above them keep a
   single column's width. */
@media (min-width: 1024px) {
  .container--wide { max-width: 1180px; }
  .container--wide > .segments, .container--wide > .page-head, .container--wide > .chips { max-width: 676px; }
  .sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
  .sheet__figures, .sheet__shifts { min-width: 0; }
  .sheet__figures .summary-grid { margin-top: 0; }
}
.sheet__figures > * + *, .sheet__shifts > * + * { margin-top: var(--sp-4); }

/* ==========================================================================
   41. The website — iPad and desktop

   On a phone this is an app: a tab bar under the thumb, a pill switch at the
   top of a section, screens that slide in. From iPad width up it is a
   website instead: the five places are a menu in the header (§19), the
   header and the page share one frame, a section's own pages are a tab
   strip (iPad) or a sidebar (desktop), pages fade rather than slide, and a
   footer closes every page.
   ========================================================================== */

@keyframes mw-page-fade { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 768px) {
  :root { --gutter: 32px; }

  /* The footer stays at the foot of a short page. */
  body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
  body > .container { flex: 1 0 auto; width: 100%; }

  /* A page arriving is a page loading: a quick fade, no sideways slide. */
  body[data-arrive] > .container { animation: mw-page-fade .18s var(--ease) both; }

  /* A section's pages (Clock, Timesheets, Pay, Settings; Search,
     Catalogues) as a website's tab strip: words on an underline. */
  .segments--places,
  .segments--search {
    max-width: none;
    justify-content: flex-start;
    gap: var(--sp-2);
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    border-bottom: 1px solid var(--line);
  }
  .segments--places > .tab-slider { display: none; }
  .segments--places .tab,
  .segments--places.has-slider .tab.is-active {
    flex: none;
    min-height: 46px;
    height: auto;
    margin-bottom: -1px;
    padding: 10px 14px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    background: none;
    box-shadow: none;
    font-size: 14.5px;
    color: var(--muted);
  }
  .segments--places .tab:hover { color: var(--text); }
  .segments--places .tab:active { transform: none; }
  .segments--places .tab.is-active,
  .segments--places.has-slider .tab.is-active { color: var(--text); border-bottom-color: var(--brand); background: none; box-shadow: none; }
  .segments--places .tab svg { display: inline; }

  /* List / Calendar: a small button group, not a phone's capsule. */
  .segments--views,
  .container--wide > .segments--views { max-width: 360px; border-radius: 12px; }
  .segments--views .tab,
  .segments--views > .tab-slider { border-radius: 9px; }
  .segments--views .tab { min-height: 38px; }

  /* Pay: every workplace's card in view at once, in a grid — nothing cut off
     at the column's edge the way a phone's swipeable row peeks the next one.
     A click picks one (app.js initPayWallet); its details follow below. */
  .pay-wallet__rail {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--sp-4);
    overflow: visible;
    margin: 0;
    padding: 4px;
    scroll-snap-type: none;
  }
  .pay-wallet__rail::after,
  .pay-wallet__controls { display: none; }
  .pay-workplace,
  .pay-workplace:only-child {
    flex: none;
    width: auto;
    max-width: none;
    aspect-ratio: auto;
    min-height: 200px;
    transform: none;
    filter: none;
    opacity: .72;
    transition: opacity var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
  }
  .pay-workplace:hover { opacity: .92; }
  .pay-workplace[aria-selected="true"] { opacity: 1; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--brand); }
  .pay-workplace__amount { font-size: 32px; }

}

@media (min-width: 1024px) {
  /* One frame for the header and the page under it. */
  .appbar__inner,
  .container--hub { max-width: 1200px; }

  /* A section's pages: its tab strip becomes a sidebar beside the page, held
     in view while the page scrolls, headed with the section's name. */
  main.container:has(> .segments--places) {
    max-width: 1200px;
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr);
    column-gap: 48px;
    align-items: start;
  }
  main.container:has(> .segments--places) > * { grid-column: 2; }
  main.container:has(> .segments--places) > .segments--places + * { margin-top: 0; }
  main.container:has(> .segments--places) > .segments--places {
    grid-column: 1;
    grid-row: 1 / span 60;
    position: sticky;
    top: calc(var(--safe-t) + var(--appbar-h) + var(--sp-5));
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    overflow: visible;
    border-bottom: 0;
  }
  main.container:has(> .segments--places) > .segments--places::before {
    content: attr(aria-label);
    padding: 4px 12px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
  }
  main.container:has(> .segments--places) > .segments--places .tab {
    justify-content: flex-start;
    gap: 10px;
    min-height: 42px;
    margin: 0;
    padding: 9px 12px;
    border-bottom: 0;
    border-radius: 10px;
    color: var(--text-2);
  }
  main.container:has(> .segments--places) > .segments--places .tab:hover { background: var(--surface-2); color: var(--text); }
  main.container:has(> .segments--places) > .segments--places .tab.is-active { background: var(--brand-soft); color: var(--brand-strong); box-shadow: none; }
  main.container:has(> .segments--places) > .segments--places .tab svg { width: 18px; height: 18px; }

  /* The clock: the dial on one side, where you are and the buttons on the other. */
  .clock { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px; align-items: start; }
  .clock > * { grid-column: 2; }
  .clock > .clock__head,
  .clock > .alert,
  .clock > .card { grid-column: 1 / -1; }
  .clock > .clock-face { grid-column: 1; grid-row: span 6; margin: 0; }
  .clock > .clock-settings { justify-content: flex-start; padding-left: 0; }
  /* Every workplace in view at once: a desk has the room, and no thumb to swipe with. */
  .clock .chips__scroll { flex-wrap: wrap; overflow: visible; }

  /* The profile: who you are on the left, your space on the right. */
  main.container:has(> .profile-minimal) { max-width: 1000px; }
  .profile-minimal { max-width: none; display: grid; grid-template-columns: 300px minmax(0, 1fr); overflow: hidden; }
  .profile-minimal .profile-id { grid-column: 1; grid-row: 1 / span 2; align-self: stretch; align-content: start; padding: 0 24px 32px; border-right: 1px solid var(--line); }
  .profile-cover { margin: 12px -12px 0; border-radius: 18px; }
  .profile-minimal__menu { grid-column: 2; padding: 24px 0 16px; }
}

/* ==========================================================================
   42. The footer — on every page (templates/_footer.html)

   Who we are, where to go, the small print, and the app. On iPad and up
   each store has a QR code to scan from the screen; on a phone the codes
   give way to two buttons, since a phone cannot scan itself, and the
   footer keeps clear of the floating tab bar.
   ========================================================================== */
.site-footer {
  flex: none;
  margin-top: var(--sp-8);
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}
.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-7, 40px) max(var(--gutter), var(--safe-r)) calc(var(--tabbar-h) + var(--safe-b) + var(--sp-5)) max(var(--gutter), var(--safe-l));
}
.site-footer__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-6) var(--sp-5); }
.site-footer__about,
.site-footer__apps { grid-column: 1 / -1; }
.site-footer__brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.site-footer__brand:hover { text-decoration: none; }
.site-footer__mark { display: block; flex: none; }
.site-footer__mark svg { display: block; width: 100%; height: 100%; }
.site-footer__tagline { max-width: 34ch; margin: var(--sp-3) 0 0; line-height: 1.55; }
.site-footer__heading { margin: 0 0 var(--sp-3); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.site-footer__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.site-footer__list a { color: var(--text-2); }
.site-footer__list a:hover { color: var(--brand-strong); text-decoration: none; }
.site-footer__hint { display: none; margin: 0 0 var(--sp-3); }
.site-footer__stores { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.store {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.store:hover { text-decoration: none; }
/* A white tile in either theme: a code is read dark on light. */
.store__qr { display: none; width: 104px; height: 104px; padding: 6px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.store__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 16px 6px 12px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  transition: transform var(--dur-1) var(--ease), opacity var(--dur-1) var(--ease);
}
.store:hover .store__label { opacity: .88; }
.store:active .store__label { transform: scale(.97); }
.store__label svg { flex: none; width: 22px; height: 22px; }
.store__label > span { display: grid; font-size: 15px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.store__label small { font-size: 10.5px; font-weight: 500; letter-spacing: .02em; opacity: .8; }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-5);
  margin-top: var(--sp-7, 40px);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

/* On a phone the page's own bottom room is the footer's now. */
@media (max-width: 767px) {
  body > .container { padding-bottom: var(--sp-6); }
}

@media (min-width: 768px) {
  .site-footer__hint { display: block; }
  .store__qr { display: block; }
  .store__label { min-height: 44px; padding: 5px 14px 5px 10px; }
  .store__label > span { font-size: 14px; }
  .site-footer__stores { gap: var(--sp-5); }
  .site-footer__top { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .site-footer__about { grid-column: auto; }
  .site-footer__apps { grid-column: 1 / -1; }
}

@media (min-width: 1024px) {
  .site-footer__top { grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, .8fr) auto; gap: var(--sp-6) var(--sp-8); }
  .site-footer__apps { grid-column: auto; }
}


/* ==========================================================================
   43. Friend circles — above the notice board (accounts/_friend_stack.html)

   Your friends as a row of overlapping faces, each ringed in the page's own
   colour so one circle reads as sitting on the next. Just the faces — no
   count, no names. Only shown — not a button. The app draws the same row
   (mobile/src/ui/FriendStack.tsx).
   ========================================================================== */
.friend-stack {
  display: flex;
  align-items: center;
  margin-bottom: var(--sp-4);
  padding: 0 4px;
}
.friend-stack__faces { display: flex; align-items: center; flex: none; padding-left: 12px; }
.friend-stack__faces > .avatar {
  width: 46px;
  height: 46px;
  margin-left: -12px;
  box-shadow: 0 0 0 3px var(--bg);
  font-size: 17px;
}
.friend-stack__faces > .avatar .avatar__img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
/* Each face sits over the one after it, as in a hand of cards. */
.friend-stack__faces > :nth-child(1) { z-index: 6; }
.friend-stack__faces > :nth-child(2) { z-index: 5; }
.friend-stack__faces > :nth-child(3) { z-index: 4; }
.friend-stack__faces > :nth-child(4) { z-index: 3; }
.friend-stack__faces > :nth-child(5) { z-index: 2; }
.friend-stack__faces > :nth-child(6) { z-index: 1; }
@media (max-width: 480px) {
  .friend-stack__faces { padding-left: 11px; }
  .friend-stack__faces > .avatar { width: 40px; height: 40px; margin-left: -11px; font-size: 15px; }
}

/* ==========================================================================
   Show password — the eye inside a password box (registration/_credential_field.html)
   ========================================================================== */
.pw { position: relative; }
.pw > .input { padding-right: 52px; }
.pw__eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.pw__eye[hidden] { display: none; }
.pw__eye:hover { color: var(--text); background: var(--surface-3); }
.pw__eye:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pw__eye svg { width: 20px; height: 20px; }
.pw__eye .pw__hide, .pw__eye[aria-pressed="true"] .pw__show { display: none; }
.pw__eye[aria-pressed="true"] .pw__hide { display: block; }
