/* --- Tokens -----------------------------------------------------------------

   Two layers, and the split is what makes a second theme possible at all.

   The *roots* are the handful of colours a theme actually chooses: the brand,
   the ink, the two grounds, the four state hues and the chart hues.
   Everything else is *derived* from them with `color-mix`, so a wash is written
   once as "the brand at 5% of the surface" rather than as a hex that has to be
   recomputed by hand for every ground it might sit on. The dark theme at the
   foot of this file redefines the roots and nothing else.

   That also collapses a duplication this file used to carry: `--brand-tint`,
   `--row-band` and half a dozen inline `rgb(47 96 148 / 0.14)` borders were
   separate values of one blue, tuned separately and drifting apart, when they
   are stops on one scale. They are stops on one scale now.
   --------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* How far down the page a sticky element has to start to clear a fixed bar
     above it. Zero as the fallback; the public shell and the signed-in shell
     each set their own below. */
  --sticky-top: 0px;

  /* --- Roots ---------------------------------------------------------------

     The logo's blue. The mark itself is #769FCD on #B9D7EA, which is too pale
     to carry text: white on it measures 2.8:1, and so does it on white, against
     the 4.5:1 a label needs. So the interface takes the logo's *hue* (211°) at
     a step dark enough to be read - 6.5:1 on white - and the logo's own colours
     stay where they are only ever a fill. */
  --brand: #2f6094;
  /* A *darker* brand, for emphasis. On the dark theme this goes the other way:
     emphasis against a dark ground means brighter, so the two are mirror images
     rather than the same colour. */
  --brand-dark: #26527f;
  /* Text on a brand-filled control. White here; on the dark theme the brand is
     a pale blue and the text has to go the other way, which is why every such
     rule reads this token rather than saying `#fff`. */
  --on-brand: #ffffff;
  /* The mark's own two colours, for fills that carry no text. Deliberately not
     themed: they are the logo. */
  --logo-blue: #769fcd;
  --logo-blue-pale: #b9d7ea;

  --ink: #171e28;
  /* Darkened from #6c7a89 and #9aa7b4. Both were under AA on white before any
     row tint was under them - 4.0:1 and 2.6:1 - and everything wearing them is
     small text: the stat labels, the chart's scale, a table's dates and types.
     They needed the same 4.5:1 floor as any other prose, not the 3:1 a
     decorative rule gets. `--ink-faint` now sits close to `--ink-muted`; the
     hierarchy between them is carried by size and weight, which survives. */
  --ink-muted: #55636f;
  --ink-faint: #5e6a77;

  --surface: #ffffff;
  --canvas: #f6f7fb;
  /* The message bubble's fill (core/js/live.js). The light theme lifts it off
     a card with its shadow; on the dark one a shadow does not show, and a fill
     the card's own left only the border between them. */
  --bubble: #ffffff;
  /* A switch's knob. Not `--surface`: in the dark theme that is the card's own
     fill, and an off switch was a dark knob on a dark track on a dark card -
     no knob to be seen, under 2:1 against both. */
  --knob: #ffffff;

  /* The four state hues. Each is dark enough to be read as *text* on its own
     palest wash, which is what the badges and the row tints are made of - the
     whole scheme falls apart the moment a status has to be printed in a colour
     its own background swallows. Verified against the strongest tint each is
     used at; see "Row state" below for those strengths.

     `--warn` was #b45309, which measured 4.2:1 on its own chip and needed a
     second darker token (`--warn-ink`) beside it to print the word. One hue
     that can do both jobs is one hue; `--warn-ink` is kept as an alias so the
     rules that already name it keep working. */
  --ok: #167048;
  --warn: #8a5600;
  --danger: #b3261e;
  /* The fourth meaning: neither good, nor a warning, nor a failure - a count of
     something that simply happened. Downloads on the chart, and any category
     that needs a hue outside the traffic-light three. Violet also survives the
     two common colour deficiencies alongside red and green, which amber does
     not. */
  --alt: #5d3fa8;

  /* How strongly a chip, a wash and a hairline take their hue. One place, so
     the state and category surfaces below cannot drift apart from each other -
     and so the dark theme can lift all of them at once, which it has to: the
     same percentage of a hue reads far weaker against a dark ground. */
  --chip-mix: 12%;
  --hairline-mix: 26%;
  --tint-mix: 5%;
  --light-mix: 11%;
  /* A button's icon panel - see "Buttons". Laid over the button's own ground,
     so it has to read against a hovered ground as well as an idle one. */
  --panel-mix: 11%;

  /* How strongly a surface takes a state's hue. Three stops, here rather than
     at each rule because the dark theme has to lift all of them together.

     `--tint-1` is a table row carrying a state, and it is shallow on purpose:
     the badge in the status column is what *says* the state, and the wash is
     only there to make the rows findable without reading it. `--tint-2` is a
     whole tile going amber or red, which is a louder thing and the only one
     that is meant to be noticed from across the page.

     The quiet stop is lower than either and has to be: it is the only one mixed
     from the *ink* rather than from a hue, and near-black at 9% over white is a
     far heavier wash than 9% of a green is - heavy enough that the faint ink
     printed on it fell under AA. Measured, like the rest, in
     `apps/core/tests/test_palette.py`. */
  --tint-1: 4%;      --tint-1-hover: 8%;
  --tint-2: 9%;
  --tint-quiet: 4%;  --tint-quiet-hover: 7%;

  /* What a shadow is made of. A shadow on a light ground is the ink at a low
     alpha; on a dark one there is nothing darker than the ground to go to, so
     the dark theme swaps this for black and lifts the alphas. Every shadow in
     this file is written against it rather than repeating a colour. */
  --shadow-rgb: 16 24 40;

  /* --- Derived: the brand scale --------------------------------------------
     Five stops, one hue. The two opaque ones are grounds; the translucent ones
     are washes and edges that have to let whatever is under them show through -
     a banded row also carries a state wash of its own, and an opaque band would
     cover it on every second row, which is to say the table would report a menu
     as parked or not depending on where it landed in the list. */
  --brand-tint: color-mix(in srgb, var(--brand) var(--tint-mix), var(--surface));
  --brand-light: color-mix(in srgb, var(--brand) var(--light-mix), var(--surface));
  --row-band: color-mix(in srgb, var(--brand) 2.5%, transparent);
  --brand-wash: color-mix(in srgb, var(--brand) 8%, transparent);
  --brand-edge: color-mix(in srgb, var(--brand) 16%, transparent);
  --brand-edge-strong: color-mix(in srgb, var(--brand) 35%, transparent);

  /* --- Derived: rules ------------------------------------------------------ */
  /* --- Picked, hovered, neither ---------------------------------------------

     The three states of a segmented control - the theme switch, the language
     flags, the pager's page numbers - as an ordered ladder rather than three
     values that happened to be near each other.

     They were measured, and both themes were wrong in a different way. On light
     the hover ground was `--brand-tint`, 5% brand over *white*, which lands on
     #f5f7fa against a #f6f7fb track: a ratio of 1.00, an invisible hover. On
     dark the hover came out at 1.20x of the track while the *selected* pill -
     `--surface` on `--canvas` - was only 1.08x, so the state under the pointer
     shouted louder than the state that was chosen. That is not weak contrast,
     it is the hierarchy upside down.

     Now: idle is the bare track, hover is a wash of the brand on it, and picked
     is stronger again with the brand as an inset edge. Picked beats hover by
     1.42x on light and 1.48x on dark, which is the number that matters - a
     selected control is only selected relative to the others in its row.

     The two themes reach it differently and have to. Light keeps the raised
     white pill, on a track deepened 6% so white has something to be brighter
     than; dark cannot use that idiom at all, because `--surface` is 1.08x of
     `--canvas` and no shadow shows on a dark ground, so it takes a brand wash
     instead. Same three rules, different roots - which is the whole point of
     the token layer. */
  --pick-track: color-mix(in srgb, var(--ink) 6%, var(--canvas));
  --pick-hover: color-mix(in srgb, var(--brand) 12%, var(--pick-track));
  --pick-bg: var(--surface);
  --pick-edge: color-mix(in srgb, var(--brand) 45%, var(--surface));
  /* The darker brand: 8.09:1 on the white pill, where the plain brand is 6.5. */
  --pick-ink: var(--brand-dark);

  --line: color-mix(in srgb, var(--ink) 11%, var(--surface));
  --line-strong: color-mix(in srgb, var(--ink) 22%, var(--surface));
  /* A rule inside a banded table: the full `--line` between every pair of rows
     draws a grid, which is one visual system too many once the rows are
     striped. */
  --line-soft: color-mix(in srgb, var(--ink) 6%, var(--surface));

  /* --- Derived: one chip and one hairline per state -------------------------
     `-bg` is the badge chip: a step stronger than a row wash, so a badge sitting
     on a row of its own colour still reads as a chip on a ground. `-line` is its
     edge, which is what keeps the chip a chip once the row beneath it is tinted
     the same colour. */
  --ok-bg: color-mix(in srgb, var(--ok) var(--chip-mix), var(--surface));
  --ok-line: color-mix(in srgb, var(--ok) var(--hairline-mix), var(--surface));
  --warn-bg: color-mix(in srgb, var(--warn) var(--chip-mix), var(--surface));
  --warn-line: color-mix(in srgb, var(--warn) var(--hairline-mix), var(--surface));
  --danger-bg: color-mix(in srgb, var(--danger) var(--chip-mix), var(--surface));
  --danger-line: color-mix(in srgb, var(--danger) var(--hairline-mix), var(--surface));
  --alt-bg: color-mix(in srgb, var(--alt) var(--chip-mix), var(--surface));
  --alt-line: color-mix(in srgb, var(--alt) var(--hairline-mix), var(--surface));
  --info-bg: color-mix(in srgb, var(--brand) 9%, var(--surface));
  /* The stateless chip - a draft, an unset value. Grey rather than a hue,
     because it is the absence of a state rather than one of them. */
  --neutral-bg: color-mix(in srgb, var(--ink) 7%, var(--surface));
  --neutral-line: color-mix(in srgb, var(--ink) 16%, var(--surface));
  /* Kept as an alias: this was a second, darker amber that existed only because
     `--warn` could not be printed as text. It can now. */
  --warn-ink: var(--warn);

  /* --- The chart palette ---------------------------------------------------

     Two series on one plot - every visit, and the ones that came from a code -
     and this is the one place in the product where a colour is close to the
     only channel: two lines crossing in a 150px-tall plot, named once in a key
     above it. So these are the only colours here that were *searched for*
     rather than chosen, and `apps/core/tests/test_palette.py` holds them to
     what the search was asked for - at least dE2000 10 apart under normal
     vision and under protanopia, deuteranopia and tritanopia, and each at
     least 3:1 on the card, which is the floor for a 2px stroke and a 7px
     marker.

     Slot 1 is deliberately *not* `--brand`. The brand blue and the green
     collapse into one colour under tritanopia - blue and green differ only on
     the axis tritanopia removes, so the fix is to separate them in lightness,
     which is a thing a chart hue may do and a brand colour may not. */
  --viz-cat-1: #024e94;
  --viz-cat-2: #22794d;

  /* --- Paper ---------------------------------------------------------------

     A rendered code is a picture of something that will be printed, and a
     printed code is whatever colours it was built in - on a sheet that is white
     in either theme. That is why the look, frame and logo tiles sit on `--paper`
     and why the dark theme deliberately does *not* redefine it: inverting the
     ground under a QR tile would not be a dark mode, it would be a claim about
     the code. */
  --paper: #ffffff;
  /* What sits behind a code that has no background: the checkerboard every
     drawing program shows transparency with, in paper and one step down from
     it. Not themed, for paper's reason - and any single colour behind such a
     code would be read as its background, which is the one thing it has not
     got. `--see-through` is a whole `background` value. */
  --checker: #e3e6ec;
  --see-through: repeating-conic-gradient(var(--checker) 0 25%, var(--paper) 0 50%) 0 0 / 16px 16px;

  --radius: 12px;
  --radius-sm: 8px;
  --gap: 18px;
  --shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.04), 0 1px 3px rgb(var(--shadow-rgb) / 0.06);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}

h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 0; }
h3 { font-size: 1rem; margin: 0 0 4px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 10px; }

.muted { color: var(--ink-muted); }
.tiny { font-size: 0.8rem; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.break { word-break: break-all; }
.mono { font-family: var(--mono); font-size: 0.94em; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }

/* --- Icons ------------------------------------------------------------------
   overflow: visible is not decoration. Most Bootstrap glyphs are drawn flush to
   the edge of their 0 0 16 16 viewBox, and an <svg> clips at its viewport by
   default - so at a fractional em size the outermost sliver of a circle is cut
   rather than antialiased, and a ring loses its bottom edge. */
.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex: none;
  vertical-align: -0.125em;
  overflow: visible;
}
/* --- Brand -------------------------------------------------------------------
   The lockup is one image, so it is sized by height and left to work out its own
   width - the three files have different aspect ratios and hard-coding a width
   would squash whichever one is used next. */
.brand-logo { display: block; height: 40px; width: auto; max-width: 100%; }
.sidebar-brand .brand-logo { height: 38px; }
.auth-shell .brand-logo { height: 44px; margin: 0 auto; }
@media (max-width: 720px) { .brand-logo { height: 32px; } }

/* --- Buttons ----------------------------------------------------------------
   The padding is two custom properties rather than a `padding` declaration,
   because the icon panel below has to know it. A size or a context that wants
   a different padding sets `--btn-py`/`--btn-px`, and the panel follows. */
.btn {
  --btn-py: 9px;
  --btn-px: 16px;
  /* The icon panel: near-square at this size, and laid *over* the button's own
     ground as a translucent wash of its hue, so it follows that ground through
     hover and through the primary's gradient with no rule per state. */
  --btn-panel-w: calc(1em + 24px);
  --btn-panel: color-mix(in srgb, var(--brand) var(--panel-mix), transparent);
  --btn-panel-ink: var(--brand);
  /* The panel's right-hand corners. Square where the button's edge closes the
     panel off; a ghost button has no edge, so its panel rounds into a tile. */
  --btn-panel-round: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: var(--btn-py) var(--btn-px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.89rem;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  /* `background-color`, never the `background` shorthand. The primary's ground
     is a gradient, and a gradient is an image: it cannot be interpolated, so it
     vanished on the first frame of the hover while the colour beneath it faded
     in from transparent - and for 120ms the page showed through the button.
     That was the blink. Every hover below changes the colour alone. */
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
/* `--brand-light` rather than `--brand-tint`, and the border moves with it. The
   tint is 5% of the brand over the button's own white, which is a 1.07x change
   on light and 1.11x on dark - a hover you have to look for to confirm. The
   light stop is 1.17x and 1.27x, and the edge picking up the brand is what
   makes a small button read as hovered at a glance rather than on inspection. */
.btn:hover {
  background-color: var(--brand-light);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line-strong));
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
/* Both ends of the gradient clear 6.5:1 against the white label, so the sheen
   costs nothing in legibility. The colour under it is the hover's colour, so
   the hover only drops the image and has nothing to fade in. */
.btn-primary {
  background-color: var(--brand-dark);
  background-image: linear-gradient(180deg, var(--brand), var(--brand-dark));
  border-color: var(--brand-dark); color: var(--on-brand);
  /* Towards the ink: darker on light, brighter on dark - in both the direction
     that lifts the icon off its ground. */
  --btn-panel: color-mix(in srgb, var(--ink) 16%, transparent);
  --btn-panel-ink: var(--on-brand);
}
.btn-primary:hover {
  background-color: var(--brand-dark); background-image: none;
  border-color: var(--brand-dark);
}
.btn-ghost {
  border-color: transparent; background: transparent;
  --btn-panel-round: calc(var(--radius-sm) - 1px);
}
/* The border is restated on hover: left to `.btn:hover`, a red button took the
   brand's blue edge under the pointer. */
.btn-danger {
  color: var(--danger); border-color: var(--danger-line);
  --btn-panel: color-mix(in srgb, var(--danger) var(--panel-mix), transparent);
  --btn-panel-ink: var(--danger);
}
.btn-danger:hover {
  background-color: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line-strong));
}
.btn-block { width: 100%; }
.btn-sm { --btn-py: 5px; --btn-px: 10px; --btn-panel-w: calc(1em + 18px); font-size: 0.82rem; }

/* The icon panel. A button that leads with an icon *and* shows a label gets the
   icon in a block of its own along the left edge, full height, with the label
   centred in what is left. Positioned rather than laid out, so a full-width
   button keeps its panel at the edge instead of centring it with the label,
   and so the panel is the button's height whatever the line height is.

   Which buttons have a label cannot be read from the markup - the label is a
   bare text node - so the two ways a button says it has none are excluded:
   `.btn-icon`, and a `.visually-hidden` label. Not an `aria-label`: the menu
   editor's header puts one on buttons that also show their words, so that
   they stay named on a phone where the words are dropped. Wrapped in :where()
   so it weighs one class, and the context rules further down - a crowded
   header on a phone, the add bar - still win over it. `overflow: hidden` is
   what rounds the panel's outer corners to whatever radius the button has. */
.btn:where(:has(> .icon:first-child):not(.btn-icon, :has(> .visually-hidden))) {
  padding-left: calc(var(--btn-panel-w) + var(--btn-px));
  overflow: hidden;
}
.btn:where(:has(> .icon:first-child):not(.btn-icon, :has(> .visually-hidden))) > .icon:where(:first-child) {
  position: absolute; top: 0; left: 0;
  box-sizing: border-box;
  width: var(--btn-panel-w); height: 100%;
  padding: 0 calc((var(--btn-panel-w) - 1em) / 2);
  border-radius: 0 var(--btn-panel-round) var(--btn-panel-round) 0;
  background: var(--btn-panel);
  color: var(--btn-panel-ink);
}
.btn-icon {
  padding: 6px; width: 30px; height: 30px;
  color: var(--ink-muted); border-color: transparent; background: transparent;
}
.btn-icon:hover {
  background: var(--brand-light); color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line-strong));
}
.btn-icon-danger:hover {
  background: var(--danger-bg); color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line-strong));
}
.row-actions { display: inline-flex; gap: 2px; align-items: center; }

/* --- Cookie notice ----------------------------------------------------------
   A bar across the bottom until a choice is made. Both buttons are the same
   size and weight: an "accept" three times the size of a "reject", or a reject
   hidden behind a second screen, is the pattern regulators object to, and the
   only reason to build the gate in `core.consent` was to mean it.

   Sticky, not fixed - the invoicing project's fix for the same bug. Fixed, the
   bar lay over the last 250px of every page on a phone until it was answered,
   and at the end of a page there was nowhere left to scroll: the sign-in, sign-up
   and join buttons all sat underneath it, so a first visit on a phone could not
   be finished without answering the notice first. Sticky, it follows the bottom
   of the screen the same way while there is page left below, and at the end
   takes its own room after the content. It is the last thing in <body>, so its
   place in the flow is the end. Still above everything except a modal. */
.cookie-notice {
  position: sticky; bottom: 0; z-index: 60;
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -6px 28px rgb(var(--shadow-rgb) / 0.09);
}
.cookie-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
}
.cookie-text strong { display: block; font-size: 0.92rem; margin-bottom: 2px; }
/* Capped in characters rather than pixels: it is a paragraph, and a line of
   more than about 70 characters is one nobody finishes. */
.cookie-text p { margin: 0; font-size: 0.84rem; color: var(--ink-muted); max-width: 68ch; }
.cookie-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.cookie-actions form { display: flex; gap: 8px; margin: 0; }

/* --- The privacy card on that bar -------------------------------------------
   The short version of the notice, without leaving the page. */
.privacy-hover { position: relative; }
.privacy-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit; font-size: 0.84rem; color: var(--ink-muted);
  cursor: pointer; white-space: nowrap;
}
.privacy-trigger:hover { color: var(--brand); border-color: var(--brand); }
.privacy-trigger:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.privacy-trigger .icon { width: 13px; height: 13px; }

/* Anchored to the trigger's *right* edge, not its left. The trigger sits at the
   right end of the bar, so a 420px card opening rightwards runs off the side of
   the window - which is a poor thing for a privacy notice to do. Opening
   leftwards puts it over the page, where there is room. The narrow-screen rule
   further down stops anchoring it to the trigger at all. */
.privacy-card {
  position: absolute; bottom: calc(100% + 10px); right: 0; left: auto;
  width: min(420px, calc(100vw - 40px));
  max-height: min(60vh, 520px); overflow-y: auto;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 18px 44px rgb(var(--shadow-rgb) / 0.16);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}
/* Hover for a mouse, focus-within for a keyboard or a tap. Hover alone leaves
   the card unreachable for both. */
.privacy-hover:hover .privacy-card,
.privacy-hover:focus-within .privacy-card {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.privacy-card h3 { font-size: 0.95rem; margin: 0 0 12px; }
.privacy-card dl { margin: 0; }
.privacy-card dt {
  font-size: 0.78rem; font-weight: 680; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--ink-faint); margin-top: 12px;
}
.privacy-card dt:first-of-type { margin-top: 0; }
.privacy-card dd { margin: 3px 0 0; font-size: 0.85rem; line-height: 1.5; }
.privacy-foot {
  margin: 14px 0 0; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem; color: var(--ink-faint);
}

@media (max-width: 760px) {
  /* The bar stacks: on a phone the paragraph needs the whole width, and the
     two buttons need to be big enough to hit. */
  .cookie-inner { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
  .cookie-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .cookie-actions form { flex: 1 1 100%; }
  /* Equal halves, and full height: a reject that is harder to hit than an
     accept is the same dark pattern as one that is harder to find. */
  .cookie-actions form .btn { flex: 1 1 0; justify-content: center; min-height: 42px; }
  .privacy-trigger { width: 100%; justify-content: center; min-height: 40px; }

  /* The card spans the bar rather than hanging off its trigger. Anchored to the
     trigger it would run off the side of a narrow screen - half a privacy
     notice being a poor thing for a privacy notice to be. `.privacy-hover`
     gives up `position: relative`, which hands the containing block to
     `.cookie-notice`: itself sticky and full width, so these gutters are gutters
     against the viewport, and `bottom: 100%` clears the whole bar however many
     rows it has wrapped to. */
  .privacy-hover { position: static; }
  .privacy-card {
    left: 12px; right: 12px; width: auto;
    bottom: calc(100% + 10px);
    /* Shorter, because the bar under it is taller once it stacks. The card
       scrolls inside itself, so this trims what is visible, not what is there. */
    max-height: 50vh;
  }
}

/* --- Layout ----------------------------------------------------------------- */
/* The shell's top bar is sticky, so whatever is scrolled to inside the shell
   has to stop below it - see `--sticky-top`. */
/* The sidebar's width and the bar's height as tokens, so the two numbers the
   shell is built from are named rather than repeated. The height is the logo
   corner's, rule included: 16px of padding around the 38px logo. */
:root { --sidebar-width: 232px; --topbar-height: 71px; }
.shell {
  --sticky-top: var(--topbar-height);
  display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh;
}
/* What an address or a save points at - `#item-5` in the editor - is scrolled
   to just under the bar rather than behind it, and so is a field that takes the
   focus; the message bubble points at it there (core/js/live.js). */
.shell [id] { scroll-margin-top: calc(var(--sticky-top) + 12px); }
/* A page arrived at with a fragment leaves room above it for the bubble, two
   lines of it, so the bubble does not have to go under the row and lie on the
   next one - on a phone the row would otherwise land right under the bar. */
.shell :target { scroll-margin-top: calc(var(--sticky-top) + 84px); }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
/* The one corner of the column that is not a list, so it takes the same ruled
   grain the stat tiles and the plan cards carry - faded from the corner
   outwards, over nothing anybody has to read. */
.sidebar-brand {
  position: relative; overflow: hidden;
  display: flex; align-items: center; min-height: var(--topbar-height);
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--brand-tint), var(--surface) 78%);
}
.sidebar-brand::after {
  content: ""; position: absolute; inset: 0 0 auto auto; width: 120px; height: 120px;
  background-image: repeating-linear-gradient(135deg, var(--brand-wash) 0 1px, transparent 1px 7px);
  -webkit-mask-image: radial-gradient(88px 88px at 100% 0, #000 6%, transparent 66%);
  mask-image: radial-gradient(88px 88px at 100% 0, #000 6%, transparent 66%);
  pointer-events: none;
}
.sidebar-brand > * { position: relative; z-index: 1; }
.sidebar-brand a { display: block; }
/* The switch that folds the column away on a narrow screen - see "Narrow
   screens" below. Above that width there is nothing to fold, so neither half of
   it exists, and the checkbox takes no Tab. */
.sidebar-toggle-input, .sidebar-toggle { display: none; }

.sidebar-nav { padding: 8px 12px 16px; flex: 1; overflow-y: auto; }

/* A rule above each group but the first, so the column reads as two groups
   rather than as one list with a word dropped into it. The rule belongs to the
   heading rather than to the link under it, because the heading is what moves
   if a group is ever added. */
.nav-section {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-faint); padding: 10px 8px 8px; font-weight: 650;
}
.nav-section:not(:first-child) {
  margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}

.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 5px 10px 5px 8px; border-radius: 9px;
  color: var(--ink-muted); font-size: 0.92rem; font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.14s ease, color 0.14s ease;
}

/* The glyph's chip. Transparent at rest so the column stays quiet, tinted under
   the pointer, and filled on the page you are on - which is what lets the
   active row be obvious without the whole strip going solid. It also gives the
   column a left edge of evenly spaced squares to read down, instead of four
   glyphs of four different widths. */
.nav-ico {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; border-radius: 8px; background: transparent;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav-text { min-width: 0; }
/* A page the plan does not include stays a link, because the page says which
   plan does; the lock at the end of the row is what says so here. */
.nav-lock { display: inline-flex; margin-left: auto; color: var(--ink-faint); }
.nav-link .nav-lock .icon { width: 13px; height: 13px; }
.nav-link .icon { flex: none; width: 15px; height: 15px; opacity: 1; }

.nav-link:hover { background: var(--brand-tint); color: var(--brand); text-decoration: none; }
.nav-link:hover .nav-ico { background: var(--brand-light); color: var(--brand); }
.nav-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.nav-link.is-active { background: var(--brand-light); color: var(--brand); font-weight: 650; }
.nav-link.is-active .nav-ico { background: var(--brand); color: var(--on-brand); }

/* The marker for the page you are on, in the same language the tables use for a
   row's state: a short accent bar on the leading edge. Drawn into the sidebar's
   own padding so it sits against the column edge rather than inside the pill. */
.nav-link.is-active::before {
  content: ""; position: absolute; left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.main { display: flex; flex-direction: column; min-width: 0; }
/* Sticky, because it now carries the plan and the way out. Above the date
   picker's popup, which is the only other thing on a page that floats -
   messages are in the flow of the page and float over nothing.

   Whatever is scrolled to has to stop below it, so the bar's height is a
   variable rather than a number buried in two places. The logo's corner beside it is the same
   height, so the two bottom rules run as one line: the bar's own row is 38px,
   and it was 8px short of the corner. */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: var(--topbar-height); padding: 12px 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-title { font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* --- Command palette ---------------------------------------------------------
   Ctrl K / Cmd K, or the Search pill in the bar - see core/js/palette.js. A
   native <dialog>, so focus is trapped, Esc closes it and the page behind is
   inert without any of that being written here. Ported from the invoicing
   project's, with this shell's tokens. */
.palette-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 5px 0 11px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--canvas); color: var(--ink-faint);
  font: inherit; font-size: 0.84rem; cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.palette-trigger[hidden] { display: none; }
.palette-trigger:hover { color: var(--ink); border-color: var(--ink-faint); }
.palette-trigger:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.palette-trigger .icon { width: 14px; height: 14px; }

.palette-trigger kbd,
.palette kbd {
  font-family: inherit; font-size: 0.7rem; font-weight: 600;
  padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-muted);
}

.palette {
  width: min(620px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  margin: 12vh auto auto; padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 18px 48px rgb(var(--shadow-rgb) / 0.22), 0 2px 6px rgb(var(--shadow-rgb) / 0.10);
  overflow: hidden;
}
.palette[open] { display: flex; flex-direction: column; }
.palette::backdrop { background: rgb(10 15 22 / 0.45); backdrop-filter: blur(2px); }

.palette-field {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.palette-field .icon { flex: none; width: 17px; height: 17px; color: var(--ink-faint); }
/* The shared input rule draws a box and a focus ring; this field is the
   dialog's whole first row and is drawn by the row. */
.palette-input,
.palette-input:focus {
  flex: 1; min-width: 0; width: auto; height: auto;
  padding: 4px 0; border: none; outline: none; box-shadow: none;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 1rem;
}

/* The way out. On a desktop it is the Esc chip, which answers a click as well
   as the key. A phone has no Esc key and the dialog all but fills its width,
   so there is little backdrop to tap either: there the chip gives way to an X
   with a target a thumb can find. The pointer query is for a tablet, which is
   wider than a phone and just as keyless. */
.palette-close {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: 999px;
  background: transparent; color: var(--ink-faint);
  font: inherit; cursor: pointer;
}
.palette-close .icon { display: none; color: inherit; }
.palette-close:hover kbd { color: var(--ink); border-color: var(--line-strong); }
.palette-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 720px), (pointer: coarse) {
  .palette-close {
    width: 36px; height: 36px;
    /* Into the row's padding, so the bigger target does not make the row taller. */
    margin: -6px -10px -6px 0;
  }
  .palette-close kbd { display: none; }
  .palette-close .icon { display: block; width: 16px; height: 16px; }
  .palette-close:hover { color: var(--ink); background: var(--pick-hover); }
  /* No keyboard to press the shortcut on. */
  .palette-trigger kbd { display: none; }
  .palette-trigger { padding-right: 11px; }
}

.palette-list { flex: 1; margin: 0; padding: 6px; list-style: none; overflow-y: auto; }
.palette-group {
  padding: 10px 10px 4px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint);
}
.palette-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink); cursor: pointer;
}
.palette-item .icon { flex: none; width: 15px; height: 15px; color: var(--ink-faint); }
.palette-item.is-active { background: var(--pick-hover); }
.palette-item.is-active .icon { color: var(--brand); }
.palette-label { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-detail {
  margin-left: auto; padding-left: 12px;
  font-size: 0.82rem; color: var(--ink-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.palette-empty { padding: 22px 10px; text-align: center; font-size: 0.9rem; color: var(--ink-muted); }
.palette-foot {
  padding: 9px 16px; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 2.5%, var(--surface));
  font-size: 0.76rem; color: var(--ink-faint);
}
@media (max-width: 720px), (pointer: coarse) { .palette-foot { display: none; } }

/* --- Two-step sign-in -----------------------------------------------------------
   The enrolment page and the recovery codes, ported from the invoicing project.
   Three things a page of digits needs: the QR at a size a phone can read, the
   secret and the codes in a monospace face so an O is not read as a 0, and the
   codes in columns so ten of them are one block rather than a scroll. */
.qr-holder {
  display: inline-block; margin: 10px 0; padding: 10px;
  background: #fff;           /* a QR must be dark-on-light whatever the theme */
  border: 1px solid var(--line); border-radius: 8px;
}
.qr-holder svg { display: block; width: 180px; height: 180px; }
.secret-key,
.recovery-codes code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}
.secret-key {
  display: inline-block; margin-top: 6px; padding: 6px 10px;
  background: var(--canvas); border-radius: 6px; word-break: break-all;
}
.recovery-codes {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px; margin: 0; padding: 0; list-style: none;
}
.recovery-codes code { font-size: 1.05em; }
ol.steps { margin: 0; padding-left: 20px; }
ol.steps > li { margin-bottom: 18px; }
ol.steps > li:last-child { margin-bottom: 0; }
.two-factor-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0 0; }
.two-factor-facts dt { color: var(--ink-muted); }
.two-factor-facts dd { margin: 0; font-weight: 600; }

/* --- API keys and webhooks -----------------------------------------------------
   Ported from the invoicing project. A key or a secret is monospace and selected
   in one go - it is copied into a config file, and a key broken across a line by
   wrapping is a key that gets pasted wrong. */
.api-key, .api-example {
  margin: 8px 0 0; padding: 10px 12px;
  background: var(--canvas); border: 1px solid var(--line); border-radius: 6px;
  overflow-x: auto; white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82em;
  user-select: all;
}
.api-example { user-select: text; }
.api-keys { margin: 0 0 12px; padding: 0; list-style: none; }
.api-key-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.api-key-row:last-child { border-bottom: 0; }
.api-key-row.is-revoked { opacity: 0.55; }
.api-key-who { min-width: 0; flex: 1 1 220px; }
.api-url { overflow-wrap: anywhere; }
.api-key-form { margin-top: 8px; }
/* The last few webhook attempts, inline under the endpoint: a health indicator,
   so a row of red is noticed without anybody going looking for it. */
.webhook-recent { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.webhook-attempt { padding: 1px 6px; border-radius: 10px; background: var(--canvas); font-variant-numeric: tabular-nums; }
.webhook-sent { background: var(--ok-bg); color: var(--ok); }
.webhook-queued { background: var(--warn-bg); color: var(--warn-ink); }
.webhook-failed { background: var(--danger-bg); color: var(--danger); }

/* --- API reference ----------------------------------------------------------
   Ported from the invoicing project, less what a read-only API never shows
   (the write badge, the colours of POST, PATCH and DELETE). One <details> per
   endpoint, in the manner of Swagger UI: the method as a coloured block, the
   path in mono, the row washed in the method's hue. Hues are the state tokens,
   so the dark theme gets them for free; the badge text is `--surface` rather
   than white, which keeps it readable on the paler dark-theme hues too. */
.api-json { max-height: 360px; overflow: auto; }

.api-basics {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0 0 16px;
  font-size: 0.9rem;
}
.api-basics dt { font-weight: 600; }
.api-basics dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.api-group { margin: 22px 0 8px; font-size: 1rem; }

.api-op {
  --op: var(--brand);
  border: 1px solid color-mix(in srgb, var(--op) 30%, var(--surface));
  border-radius: 6px;
  background: color-mix(in srgb, var(--op) 6%, var(--surface));
  margin-bottom: 8px;
}
.api-op-errors { --op: var(--warn); }

/* The code examples: the same row, closed until opened, in a neutral hue -
   they are scripts, not endpoints. One pill width for both languages so the
   file names line up, and the caret pushed to the end, there being no summary
   to push it. The copy button sits above the code, at the right. */
.api-example-op { --op: var(--ink-muted); }
.api-example-op .api-method { min-width: 92px; }
.api-example-op .api-caret { margin-left: auto; }
.api-example-tools { display: flex; justify-content: flex-end; margin: 10px 0 8px; }
/* `.btn`'s `display` beats the browser's own `[hidden]`: until the script
   shows it, there is no button. */
.api-example-tools .btn[hidden] { display: none; }

.api-op > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  cursor: pointer;
  list-style: none;
  flex-wrap: wrap;
}
.api-op > summary::-webkit-details-marker { display: none; }
.api-op > summary::marker { content: ""; }
.api-op > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.api-op > summary:hover {
  background: color-mix(in srgb, var(--op) 12%, var(--surface));
  border-radius: 5px;
}
.api-op[open] > summary:hover { border-radius: 5px 5px 0 0; }

.api-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  /* The errors row's pill holds an icon, not a word: as tall as the others. */
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--op);
  color: var(--surface);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.api-path { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.api-summary { flex: 1 1 160px; min-width: 0; color: var(--ink-muted); font-size: 0.9rem; }
.api-caret { display: inline-flex; color: var(--ink-faint); }
.api-caret .icon { transition: transform 0.15s; }
.api-op[open] > summary .api-caret .icon { transform: rotate(180deg); }

.api-op-body {
  padding: 4px 14px 14px;
  border-top: 1px solid color-mix(in srgb, var(--op) 30%, var(--surface));
  background: var(--surface);
  border-radius: 0 0 6px 6px;
  min-width: 0;
}
.api-op-body h4 {
  margin: 14px 0 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.api-op-body > p { margin: 10px 0 0; font-size: 0.88rem; }

.api-params { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.api-params li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.api-params li:last-child { border-bottom: 0; }
.api-param-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.api-param-head code { font-weight: 600; overflow-wrap: anywhere; }
.api-param-type { font-family: var(--mono); font-size: 0.78rem; color: var(--alt); }
.api-required { font-size: 0.72rem; color: var(--danger); font-weight: 600; }
.api-param-help { color: var(--ink-muted); margin-top: 2px; }
/* A parameter's accepted values, each as a chip: some hold commas
   themselves, so as plain words in a list they could not be told apart. */
.api-param-help code {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--ink);
  background: var(--neutral-bg);
  border-radius: 4px;
  padding: 0 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
/* There is no site-wide rule for `code` here, so the reference sets its own. */
.api-op code, .api-basics code { font-family: var(--mono); }
.api-status {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--neutral-bg);
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

/* A phone: the label above its value in the basics, so the base URL and the
   header stay on one line; a slimmer pill and a smaller path, so a long path
   still fits beside the pill rather than dropping under it; and the JSON at
   its full height, since a row is only opened to read it. */
@media (max-width: 560px) {
  .api-basics { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .api-basics dd { margin-bottom: 8px; }
  .api-op > summary { column-gap: 8px; row-gap: 4px; }
  .api-method { min-width: 56px; padding-inline: 6px; }
  .api-path { font-size: 0.78rem; max-width: calc(100% - 64px); }
  .api-op-body { padding: 4px 10px 10px; }
  .api-json { max-height: none; }
}

/* --- The team -----------------------------------------------------------------
   One row per login: who, and the one thing that can be done to it. */
.team-list { list-style: none; margin: 0; padding: 0; }
.team-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: none; }
.team-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.team-who > * { overflow-wrap: anywhere; }
.account-who > span + span { display: block; }

/* --- The activity log --------------------------------------------------------
   One row per entry: a coloured mark for what kind of act it was, the act and
   what it was done to, and who, when and from where underneath. */
/* At the card's right, as a form's button is. */
.audit-filter {
  display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; width: 100%;
}
/* A control like every other, at the small button's size beside it: as the
   browser drew it, it was a thin black box 19px tall. As tall as the button,
   whichever is the taller. */
.audit-filter select {
  flex: 1 1 200px; max-width: 320px; align-self: stretch; padding: 5px 9px; font-size: 0.82rem;
}
.audit { list-style: none; margin: 0; padding: 0; }
.audit-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: none; }
.audit-mark {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--canvas); color: var(--ink-muted);
}
.audit-ok { background: var(--ok-bg); color: var(--ok); }
.audit-warn { background: var(--warn-bg); color: var(--warn-ink); }
.audit-danger { background: var(--danger-bg); color: var(--danger); }
.audit-body { min-width: 0; }
.audit-what { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.audit-target { color: var(--ink-muted); overflow-wrap: anywhere; }
.audit-when { margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; }

/* --- The account menu --------------------------------------------------------
   Who, which tier, and the way out - folded into one control, because a bar
   carrying all three side by side is three things to read before the page. */
.account { position: relative; }
.account > summary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 9px 5px 5px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); cursor: pointer; list-style: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}
/* Safari and Chrome each draw their own marker on a <summary>; both are the
   wrong triangle in the wrong place next to a caret of our own. */
.account > summary::-webkit-details-marker { display: none; }
.account > summary::marker { content: ""; }
.account > summary:hover { background: var(--brand-tint); border-color: var(--brand-light); }
.account[open] > summary { background: var(--brand-tint); border-color: var(--brand-edge-strong); }
.account > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* The initial, which is identity enough at this size - an address in a bar is
   read once and then only ever takes up room. It is in the panel below. */
.account-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: var(--on-brand); font-size: 0.78rem; font-weight: 650;
}
.account-plan { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.account-caret { width: 11px; height: 11px; color: var(--ink-faint); }
.account[open] .account-caret { transform: rotate(180deg); }

.account-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  min-width: 244px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: 0 12px 28px rgb(var(--shadow-rgb) / 0.16);
}
.account-who {
  display: grid; gap: 1px; padding: 9px 10px 11px;
  border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.account-who strong { font-size: 0.9rem; }
.account-who .tiny { overflow: hidden; text-overflow: ellipsis; }
.account-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: none; border-radius: var(--radius-sm);
  background: none; color: var(--ink); font: inherit; font-size: 0.88rem;
  text-align: left; cursor: pointer;
}
.account-item:hover { background: var(--brand-tint); text-decoration: none; }
/* Where you are. The sidebar used to say it; these three pages left it when
   they moved into this menu, and a menu that opens on the page you are already
   looking at should admit as much. */
.account-item.is-active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.account-item.is-active .icon { color: var(--brand); }
.account-item .icon { color: var(--ink-faint); flex: none; }
.account-item:hover .icon { color: var(--brand); }
/* The tier sits at the end of its own row, so the row reads as a fact with a
   link on it rather than as a menu entry that happens to have a word after. */
.account-value { margin-left: auto; color: var(--brand); }
.account-signout { border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: 6px; padding-top: 11px; }
.account-signout:hover { background: var(--danger-bg); color: var(--danger); }
.account-signout:hover .icon { color: var(--danger); }

/* On a phone the tier drops off the button; the initial and the caret are
   enough to say what it opens, and the panel still names it. */
@media (max-width: 720px) { .account-plan { display: none; } }
/* The signed-in content column is capped, not stretched. Copied from the
   invoices project, including the two widths and the left alignment: a table or
   a four-card pricing row pulled across a 2560px monitor puts the row label and
   its number so far apart that reading one off the other needs a ruler.

   Which cap a page gets is chosen by `content_class` in core/base_app.html -
   wide for anything with a table or a grid, narrow for a single form. */
.content { padding: 24px; min-width: 0; }
.content-wide { max-width: 1200px; }
.content-narrow { max-width: 780px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head h1 .icon { color: var(--ink-faint); }
.page-head .sub { color: var(--ink-muted); font-size: 0.9rem; }
/* Which subset of a list is on screen, and the way back to all of it. */
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--brand-tint); border: 1px solid var(--brand-edge);
  color: var(--brand); font-size: 0.82rem; font-weight: 550;
}
.filter-clear { margin-left: 10px; font-size: 0.82rem; }
.page-actions { display: flex; gap: 8px; }

/* --- Cards and grids -------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: var(--gap); }
/* Capped, but not centred: inside the shell a narrow card floated in the middle
   of the column with its own page heading still hard against the left, which
   reads as two pages. The sign-in and sign-up cards are unaffected - they sit
   in `.auth-shell`, which is what centres them there. A head over one is capped
   with it, or the head's button ends 320px past the card it belongs to. */
.card.narrow, .page-head.narrow { max-width: 460px; }
/* The head takes a wash of the brand, fading out before the border. Shallow on
   purpose: it is there to separate the head from the body without a second
   line, not to be a coloured bar. */
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--brand-tint), var(--surface));
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* A card that opens and closes. Only where one is written as a `<details>` -
   every other card on the site keeps a `<div class="card-head">` and none of
   these rules reach it, which is why they are scoped to the element rather than
   added to `.card-head` itself.

   The head was already a labelled strip over a panel, so it needs nothing to
   become the strip you click: the caret and the pointer are the whole change.
   See the menu editor, where the right-hand column is three of these. */
details.card > .card-head {
  cursor: pointer; list-style: none;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: background 0.15s ease;
}
details.card > .card-head::-webkit-details-marker { display: none; }
details.card > .card-head:hover { background: linear-gradient(180deg, var(--brand-light), var(--brand-tint)); }
details.card > .card-head:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
/* Closed, the head *is* the card, so its lower corners have to be the card's -
   and the rule under it is the card's own border drawn twice. */
details.card:not([open]) > .card-head { border-bottom: none; border-radius: var(--radius); }
.card-caret {
  flex: none; width: 15px; height: 15px; color: var(--ink-faint);
  transition: transform 0.18s ease;
}
details.card[open] > .card-head .card-caret { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  details.card > .card-head, .card-caret, .group-title, .group-caret { transition: none; }
}

.grid { display: grid; gap: var(--gap); }
/* minmax(0, 1fr) rather than an implicit `auto` column: an auto column will not
   shrink below its content's minimum, so a card holding a wide table grows past
   the page instead of letting .table-wrap scroll inside it. */
.grid-1 { grid-template-columns: minmax(0, 1fr); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .card + .card { margin-top: 0; }

/* --- Stats ------------------------------------------------------------------ */
/* A tile carries one number, so everything else in it is kept quiet: a tinted
   chip for the icon, a wash that fades out before it reaches the figure, and
   the QR checkerboard from the plan cards in the corner. The texture is the one
   piece of decoration, at the same weight it has there - it should register as
   grain, not as a pattern anybody tries to read. */
.stat {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
  background: linear-gradient(180deg, var(--brand-tint), var(--surface) 62%);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
/* The tiles are links to the rows they counted, so they inherit the page's ink
   rather than the link colour - the number is the subject and a card of blue
   figures reads as a menu. The lift on hover was already here and is now doing
   a second job: saying the tile can be followed. */
.stat { display: block; color: inherit; text-decoration: none; }
/* No underline on hover either: `a:hover` underlines every link on the page,
   which on a card means a line under the label and another under the note. The
   lift and the border are the hover state here. */
.stat:hover { text-decoration: none; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgb(var(--shadow-rgb) / 0.08); border-color: var(--brand); }
.stat:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.stat::after {
  content: ""; position: absolute; inset: 0 0 auto auto; width: 132px; height: 132px;
  background-image: repeating-conic-gradient(var(--brand-wash) 0% 25%, transparent 0% 50%);
  background-size: 9px 9px;
  /* Faded from the corner outwards, so the pattern has reached nothing by the
     time it meets an edge - a linear fade leaves it looking like a pasted
     rectangle. Same mask as `.plan-card .card-head::after`. */
  -webkit-mask-image: radial-gradient(96px 96px at 100% 0, #000 6%, transparent 66%);
  mask-image: radial-gradient(96px 96px at 100% 0, #000 6%, transparent 66%);
  pointer-events: none;
}
/* Everything real sits over the texture. */
.stat > * { position: relative; z-index: 1; }

.stat-label {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-faint);
}
.stat-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--brand-light); color: var(--brand);
}
.stat-icon .icon { width: 15px; height: 15px; opacity: 1; }
.stat-value { font-size: 1.8rem; font-weight: 650; margin: 6px 0 2px; }
.stat-value .of-limit { font-size: 1rem; color: var(--ink-faint); font-weight: 500; }
.stat-note { font-size: 0.8rem; color: var(--ink-muted); }

/* The track is a lighter step of the fill's own colour rather than a grey, so
   the whole bar reads as one scale in whichever state it is in. */
/* The usage meter on the dashboard's menus tile. Thicker than it was, inset so the empty part reads as a
   channel rather than as a pale line, and the fill carries a gradient along its
   own length - which is what makes a bar look like a level rather than a rule.
   The rounded cap on the fill means a tiny value still draws as a mark instead
   of a sliver, so `min-width` keeps it from becoming a dot. */
.meter {
  height: 9px; border-radius: 999px; margin: 10px 0 8px;
  background: var(--brand-light); overflow: hidden;
  box-shadow: inset 0 1px 2px rgb(var(--shadow-rgb) / 0.12);
}
.meter span {
  display: block; height: 100%; min-width: 9px; border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 72%, white), var(--brand));
  box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.18);
  transition: width 0.35s ease;
}

/* Nearly out, and out. Only this tile ever takes them, and it takes the chip
   and the meter together - a warning in one of the two reads as a mistake. */
.stat.is-high { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--warn) var(--tint-2), transparent), var(--surface) 62%); }
.stat.is-high .stat-icon { background: var(--warn-bg); color: var(--warn); }
.stat.is-high .meter { background: color-mix(in srgb, var(--warn) 15%, transparent); }
.stat.is-high .meter span {
  background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 70%, white), var(--warn));
}
.stat.is-high::after { background-image: repeating-conic-gradient(color-mix(in srgb, var(--warn) var(--chip-mix), transparent) 0% 25%, transparent 0% 50%); }

.stat.is-full { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: linear-gradient(180deg, var(--danger-bg), var(--surface) 62%); }
.stat.is-full .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat.is-full .stat-value { color: var(--danger); }
.stat.is-full .meter { background: color-mix(in srgb, var(--danger) 15%, transparent); }
.stat.is-full .meter span {
  background: linear-gradient(90deg, color-mix(in srgb, var(--danger) 70%, white), var(--danger));
}
.stat.is-full::after { background-image: repeating-conic-gradient(color-mix(in srgb, var(--danger) var(--chip-mix), transparent) 0% 25%, transparent 0% 50%); }
.public-actions form { display: inline-flex; }

/* --- Date picker -------------------------------------------------------------
   The popup for `core/js/datepicker.js`. Anchored to the field rather than the
   page, so it follows the input inside a scrolling step; `z-index` clears the
   fields under it and nothing else. */
.datepicker-wrap { position: relative; }
/* The calendar button, inside the field's own box. `pointer-events` stay on it
   alone - the input keeps the rest of the width, so clicking the text still
   puts the caret where it was clicked. */
.datepicker-wrap .control { padding-right: 38px; }
.datepicker-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-faint); cursor: pointer;
}
.datepicker-toggle:hover { background: var(--brand-light); color: var(--brand); }
.datepicker-toggle .icon { width: 16px; height: 16px; }
.datepicker {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20;
  width: 268px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: 0 10px 26px rgb(var(--shadow-rgb) / 0.14);
}
.datepicker-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px; font-size: 0.9rem;
}
.datepicker-head strong { text-transform: capitalize; }
/* Two steps each side: a month, and a year. The year arrows are the double
   chevrons, which is the one pairing people already read as "further". */
.datepicker-navs { display: inline-flex; gap: 2px; }
.datepicker-nav {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-muted);
  width: 26px; height: 26px; border-radius: var(--radius-sm);
  font: inherit; line-height: 1; cursor: pointer;
}
.datepicker-nav .icon { width: 13px; height: 13px; }
.datepicker-nav:hover { background: var(--brand-tint); color: var(--brand); border-color: var(--brand-light); }

/* Seven columns, so the weekday row and the days share one grid and a month
   that starts on a Thursday cannot drift out of line with its own header. */
.datepicker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.datepicker-weekday {
  text-align: center; padding: 4px 0; font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-faint);
}
.datepicker-day {
  padding: 6px 0; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink); font: inherit; font-size: 0.82rem;
  cursor: pointer; font-variant-numeric: tabular-nums;
}
.datepicker-day:hover { background: var(--brand-tint); }
/* Today is outlined, the chosen day is filled: one is a reference point and the
   other is an answer, and they have to be told apart when they are the same day. */
.datepicker-day.is-today { box-shadow: inset 0 0 0 1px var(--line-strong); }
.datepicker-day.is-chosen { background: var(--brand); color: var(--on-brand); font-weight: 600; }

.datepicker-time {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.datepicker-time select {
  flex: 1; padding: 6px 8px; font: inherit; font-size: 0.85rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.datepicker-colon { color: var(--ink-faint); }
.datepicker-time > .icon { color: var(--ink-faint); flex: none; }
/* One button, and it confirms. Emptying the field is what the keyboard is for
   - a Clear beside a Done is a second decision on a row that has one. */
.datepicker-done {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; padding: 0;
}
.datepicker-done .icon { width: 15px; height: 15px; }
.datepicker-time select { min-width: 0; }

/* --- Charts ------------------------------------------------------------------
   Two shapes: a line over twelve months, and a ranked bar per row. All of it is
   HTML apart from the line itself, which is one stretched <svg>. The
   percentages come from `core.services.dashboard`; everything about how big the
   result is lives here.

   One colour throughout. Both charts plot a single thing - a count - so a
   second hue would be decoration, and shading each bar by its own size would
   encode the length twice while saying nothing the length does not. Marks stay
   thin and the rules stay a step off the surface, so the data is the only part
   of the picture with any weight. */
.chart { --plot: 150px; --gutter: 30px; position: relative; padding-left: var(--gutter); }

/* The plot: the scale, and the line drawn over it. Sized and placed once here,
   so the SVG and the markers in the columns below share one coordinate space -
   both are positioned in percentages of this box.

   `z-index` is doing real work. The hover band is the background of a
   `.chart-slot`, and a slot is `position: relative` - so it is a positioned
   element that comes *after* this one in the document and was painting on top
   of it. An opaque band over the plot meant that hovering a month rubbed that
   month's slice of the chart out: both gridlines and both series lines
   disappeared for as long as the pointer was there. The lines belong above the
   band, so the plot is lifted over it and the dots are lifted over the plot
   (see `.chart-dot`).

   Lifting it makes `pointer-events` necessary rather than optional: the plot
   covers every column exactly, so above them it would swallow the pointer and
   no column would ever see a hover at all. Nothing here needs the pointer - the
   whole thing is `aria-hidden` scenery. */
.chart-plot {
  position: absolute; left: var(--gutter); right: 0; top: 0; height: var(--plot);
  z-index: 1;
  pointer-events: none;
}
/* Each rule is a zero-height box pinned by its `bottom`, so the border lands
   exactly on the value it stands for; the figure hangs in the gutter beside it. */
.chart-rule { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.chart-rule.is-baseline { bottom: 0; border-top-color: var(--line-strong); }
.chart-rule b {
  position: absolute; right: calc(100% + 8px); top: -0.75em;
  font-size: 0.68rem; font-weight: 500; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* The line itself, and the wash under it. The wash is a tenth-opacity fill
   rather than a paler colour of its own, so it stays the line's own hue however
   the brand colour is changed. */
.chart-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* Two series on one plot: every visit to the account's menus, and the ones that
   came from a code. The colours are set once here and read by the line, its dot,
   the key and the readout through `data-series`, so they cannot drift apart -
   and the template names no colour at all. Scans are `--viz-cat-1` and the rest
   `--viz-cat-2` here and in the editor's chart below, so a scan is one colour
   across the product. */
.chart, .chart-key {
  --series-visits: var(--viz-cat-2);
  --series-scans: var(--viz-cat-1);
}

.chart-stroke {
  fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
}
.chart-stroke[data-series="visits"] { stroke: var(--series-visits); }
.chart-stroke[data-series="scans"]  { stroke: var(--series-scans); }

/* Scans are a part of the visits, and the two lines sit on top of one another
   whenever every guest came from a code. Dashed, the one underneath still
   reads. */
.chart-stroke[data-series="scans"] { stroke-dasharray: 5 3; }

/* --- The key ----------------------------------------------------------------
   Above the plot: the lines need naming before they are read, not after. */
/* A grid, not a row. Each entry is a name over a line of explanation, which in
   a flex row either overflowed the card or wrapped at a random word. `auto-fit`
   puts both across a wide card and one over the other on a phone, without a
   breakpoint. */
.chart-key {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 10px 20px;
  list-style: none; margin: 0 0 16px; padding: 0;
  font-size: 0.8rem; color: var(--ink-muted);
}
/* The mark sits on the *name's* line rather than centred against a two-line
   block, which would leave it floating between the name and the gloss. */
.chart-key-item { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.chart-key-text { display: grid; gap: 1px; min-width: 0; }
.chart-key-name { display: flex; align-items: baseline; gap: 7px; color: var(--ink); }
.chart-key-name b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* The gloss. A step down and in the faint ink, because it is read once to learn
   what the line is and never again - the name and the figure are what the eye
   comes back to. */
.chart-key-hint {
  font-size: 0.72rem; line-height: 1.35; color: var(--ink-faint);
}
.chart-key-mark { width: 14px; height: 3px; border-radius: 2px; flex: none; margin-top: 0.55em; }
.chart-key-item[data-series="visits"] .chart-key-mark { background: var(--series-visits); }
.chart-key-item[data-series="scans"] .chart-key-mark  { background: var(--series-scans); }

/* No gap between the columns: they are hover targets sitting under the line,
   and a gap would shift each column's centre away from the point the line was
   drawn through. */
.chart-cols { display: flex; align-items: flex-end; list-style: none; margin: 0; padding: 0; }
/* `position: relative` so the month's readout can be placed against its own
   column rather than against the plot. */
.chart-col { flex: 1; min-width: 0; text-align: center; position: relative; }
/* `display: block` is load-bearing: the slot is a <span>, and height does
   nothing to an inline box - left inline it collapses, the months ride up over
   the plot and the line spills out of the card. */
.chart-slot { display: block; position: relative; height: var(--plot); }
/* The hit target is the whole month, not the marker - a marker is seven pixels
   across and seven pixels is not something to ask anyone to aim at. The band is
   what makes the target visible once the pointer is inside it.

   `--brand-light`, not `--brand-tint`. The tint measures 1.07 against the card
   in the light theme, which over a 150px block is not a highlight, it is a
   rumour; this is the same step the active sidebar entry wears. It can afford
   to be that strong now only because it sits *behind* the plot - before that it
   was covering the lines, and the fix for a band that hides the chart is not a
   fainter band. */
.chart-col:hover .chart-slot { background: var(--brand-light); }
.chart-col:hover .chart-dot { transform: translate(-50%, 50%) scale(1.35); }
/* The month under the band, so the highlight and its label read as one thing
   rather than as a stripe that happens to be above a word. */
.chart-col:hover .chart-tick { color: var(--brand); font-weight: 600; }
/* Pinned by its `bottom` in the same percentages the line was drawn from, then
   pulled back by half its own size so the point - not its corner - lands on the
   value. The ring is the surface colour: it keeps the marker legible where the
   line runs under it, and is what stops twelve dots reading as beads on a
   string. */
/* Small, because both markers land on the same column and on the same point
   whenever every visit was a scan. The ring in the surface colour is what keeps
   two that overlap readable as two. */
.chart-dot {
  position: absolute; left: 50%; width: 7px; height: 7px;
  transform: translate(-50%, 50%);
  border-radius: 50%; box-shadow: 0 0 0 2px var(--surface);
  transition: transform 0.12s ease;
  /* Above the plot, which is itself above the hover band. A marker sits *on* its
     line, and the ring that keeps two overlapping markers readable as two only
     works if the line is not drawn across it. */
  z-index: 2;
}
.chart-dot[data-series="visits"] { background: var(--series-visits); }
.chart-dot[data-series="scans"]  { background: var(--series-scans); }
.chart-tick {
  padding-top: 6px; font-size: 0.68rem; color: var(--ink-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* --- What a month actually says ----------------------------------------------

   Every series for the month under the pointer, at once - the same reading the
   invoices project's chart gives, built in CSS rather than by a script. That is
   not a shortcut: this chart is server-rendered so that a dashboard's main
   picture does not vanish when a script fails, and putting the *numbers* behind
   a script would reintroduce that failure one layer down.

   It replaces a `title` attribute, which is the worst available place for the
   figures: about a second of delay before it appears, no styling, no theming,
   the wrong font, and the values run together on one line.

   Faded rather than hidden - `opacity`, not `visibility` or `display` - so the
   figures stay in the accessibility tree. A chart whose only text alternative
   is removed from the tree is a chart with no text alternative. */
.chart-tip {
  position: absolute;
  bottom: calc(100% - var(--plot) + 10px);
  z-index: 5;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 3px 8px;
  width: max-content;
  max-width: 15rem;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 8px 22px rgb(var(--shadow-rgb) / 0.18);
  text-align: left;
  font-size: 0.78rem;
  /* Never a hit target of its own: the column is what is being hovered, and a
     tooltip that can itself be hovered flickers at its own edge. */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.chart-col:hover .chart-tip { opacity: 1; }

/* Centred on its column, and pulled inside the card at the two ends - a
   centred readout on January hangs off the left of the chart, and on the newest
   month off the right, which is the one everybody looks at first. This is the
   CSS version of the flip the invoices tooltip does against the cursor. */
.chart-tip { left: 50%; transform: translateX(-50%); }
.chart-col:nth-child(-n+3) .chart-tip { left: 0; transform: none; }
.chart-col:nth-last-child(-n+3) .chart-tip { left: auto; right: 0; transform: none; }

.chart-tip-month {
  grid-column: 1 / -1;
  font-weight: 650; color: var(--ink);
  padding-bottom: 4px; margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
}
/* Each row is three cells of the parent grid, so the labels and the figures
   line up in columns instead of each row setting its own widths. */
.chart-tip-row { display: contents; }
.chart-tip-mark { width: 12px; height: 3px; border-radius: 2px; }
.chart-tip-label { color: var(--ink-muted); white-space: nowrap; }
.chart-tip-value {
  justify-self: end; color: var(--ink);
  font-variant-numeric: tabular-nums; font-weight: 650;
}
/* The same `data-series` mechanism the key and the strokes use, so the swatch
   in the readout cannot drift from the line it names. */
.chart-tip-row[data-series="visits"] .chart-tip-mark { background: var(--series-visits); }
.chart-tip-row[data-series="scans"] .chart-tip-mark  { background: var(--series-scans); }

/* --- Visits by day, on the statistics page -----------------------------------
   The plot, rules, columns and readout above, with bars where the dashboard
   has lines: a period's days of one count. Each bar is a day's visits, the scans
   at its foot and the other visits stacked on them, so the stack adds up to
   the height and the split says how the guests came. */
.visits-chart { --plot: 120px; }
.visits-key, .visits-chart {
  --series-scans: var(--viz-cat-1);
  --series-others: var(--viz-cat-2);
}
/* Top-aligned: the dates under the bars are only on Mondays, and columns of
   two heights aligned at the bottom put the slots out of line with the plot. */
.visits-chart .chart-cols { align-items: flex-start; }
/* Thin, centred in the column with surface on each side, so even ninety bars
   have a gap between each two where there is room; capped so a wide card does
   not make them blocks, a week's seven above all. At a phone's width ninety
   columns are under 4px, so the gap goes first (below). Above the plot, so the
   rules run behind the bars rather than across them. */
.visits-bar {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(calc(100% - 2px), 16px);
  display: flex; flex-direction: column; gap: 2px;
  z-index: 2;
}
.visits-part { flex: none; }
.visits-part[data-series="others"] { flex: 1 1 auto; min-height: 0; background: var(--series-others); }
.visits-part[data-series="scans"] { background: var(--series-scans); }
/* The data end rounded; the end on the baseline square. */
.visits-bar > :first-child { border-radius: 3px 3px 0 0; }
.chart-key-item[data-series="others"] .chart-key-mark,
.chart-tip-row[data-series="others"] .chart-tip-mark { background: var(--series-others); }
/* A Monday's date centred under its bar and free to run over the columns
   either side, which a flex box centres both ways and a text box does not. */
.visits-chart .chart-tick { display: flex; justify-content: center; overflow: visible; }
/* The day's total under a rule and with no swatch: it is the bar, not a part. */
.chart-tip-row.is-total > * { margin-top: 2px; padding-top: 5px; border-top: 1px solid var(--line); }
.chart-tip-row.is-total .chart-tip-mark { height: auto; align-self: stretch; border-radius: 0; }
.chart-tip-note { grid-column: 1 / -1; color: var(--ink-muted); white-space: nowrap; }
/* The readout is about 170px wide, so how many columns from each end it has to
   be pinned for depends on how narrow they are: a quarter of a month's, about
   the same part of a season's, and of a week's the two at each end. Listed one
   period at a time because a selector counting from one end also matches the
   columns the other end needs. */
.visits-chart[data-days="7"] .chart-col:nth-child(-n+2) .chart-tip,
.visits-chart[data-days="30"] .chart-col:nth-child(-n+8) .chart-tip,
.visits-chart[data-days="90"] .chart-col:nth-child(-n+24) .chart-tip { left: 0; right: auto; transform: none; }
.visits-chart[data-days="7"] .chart-col:nth-last-child(-n+2) .chart-tip,
.visits-chart[data-days="30"] .chart-col:nth-last-child(-n+8) .chart-tip,
.visits-chart[data-days="90"] .chart-col:nth-last-child(-n+24) .chart-tip { left: auto; right: 0; transform: none; }
/* The middle of a week is not near either end, and the rule above pins nothing
   there; `.chart-col:nth-child(-n+3)` from the dashboard's chart would. */
.visits-chart[data-days="7"] .chart-col:nth-child(3) .chart-tip,
.visits-chart[data-days="7"] .chart-col:nth-last-child(3) .chart-tip { left: 50%; right: auto; transform: translateX(-50%); }
@media (max-width: 560px) {
  .visits-chart[data-days="90"] .visits-bar { width: 100%; }
  .visits-chart[data-days="90"] .visits-bar > :first-child { border-radius: 1px 1px 0 0; }
}
.visits-since { margin: 10px 0 0; }
/* The statistics page's two controls, on one line where they fit. Both are in
   the address, and the list is only as wide as the menu names need. */
.statistics-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; }
.statistics-menu { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; }
.statistics-menu label, .statistics-menu span { flex: none; font-size: 0.82rem; font-weight: 600; color: var(--ink-muted); }
.statistics-menu b { min-width: 0; overflow-wrap: anywhere; }
.statistics-menu .control { width: auto; min-width: min(220px, 100%); max-width: 100%; }
.statistics-head-end { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 12px; }
.statistics-note { margin: -8px 0 16px; }
/* A change beside its figure, in the ink and not in green or red: more visits
   is not always good news to a reader and the sign says which way it went. */
.stat-change { margin-left: 8px; font-size: 0.82rem; font-weight: 600; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
/* The card that stands for the figures: on the dashboard it fills the tiles'
   row beside the allowance, which keeps its own column. */
.grid-stats > .statistics-locked { grid-column: span 3; }
.statistics-locked-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.statistics-locked-head h2 { margin: 0; }
.statistics-locked p { margin: 0 0 12px; }
.statistics-locked p:last-child { margin-bottom: 0; }

/* What guests picked. One measure in one colour, so the bars take the chart's
   first and the figures stay in the ink. Each list has its own scale, and the
   headings theirs, across the width above the two. */
.picks-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; margin: 0 0 20px; }
.picks-totals dt { font-size: 0.8rem; color: var(--ink-muted); }
.picks-totals dd { margin: 0; font-size: 1.4rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.picks-totals dd.picks-hint { font-size: 0.72rem; font-weight: 400; line-height: 1.35; color: var(--ink-faint); }
.picks-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.picks-blocks .is-wide { grid-column: 1 / -1; }
.picks-blocks h3 { display: flex; align-items: center; gap: 7px; font-size: 0.86rem; margin: 0 0 10px; }
.picks-blocks h3 .icon { color: var(--ink-faint); }
.picks-count { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.picks-rows { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.picks-rows.is-split { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px 28px; }
.picks-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; align-items: baseline; font-size: 0.88rem; }
.picks-name { overflow-wrap: anywhere; color: var(--ink); }
/* The figure at a fixed width and the change before it, so both stand in
   columns down a long list. */
.picks-figures { display: inline-flex; align-items: baseline; gap: 10px; }
.picks-value { min-width: 2.5ch; text-align: right; font-variant-numeric: tabular-nums; }
.picks-change { font-size: 0.76rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.picks-mark { margin-left: 4px; vertical-align: 1px; }
.picks-rows.is-plain { gap: 9px; }
.picks-left-out { margin: 12px 0 0; }
.picks-place { grid-column: 1 / -1; font-size: 0.72rem; line-height: 1.35; color: var(--ink-faint); }
.picks-bar { grid-column: 1 / -1; display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.picks-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--viz-cat-1); }
.picks-note { margin: 18px 0 0; }
@media (max-width: 560px) {
  .picks-blocks { grid-template-columns: minmax(0, 1fr); }
  .picks-totals { grid-template-columns: minmax(0, 1fr); }
}
/* The places a menu's codes are put: the closed days' list and its form, with
   the name and its button on one line where they fit. */
#places { scroll-margin-top: calc(var(--sticky-top) + 12px); }
#places .rate-list { margin-bottom: 16px; }
#places > .field-help { margin-bottom: 16px; }
/* Sized against itself and not the screen: the card is half the page on a
   computer, as narrow as a phone on a small one. */
.place-add { container-type: inline-size; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 12px; }
.place-add .field { flex: 1 1 240px; min-width: 0; }
/* As tall as the box and level with it: under the label's line (13px type on
   1.5) and its 5px, whether or not an error is under the box. */
.place-add > .btn { min-height: 42px; margin-top: calc(0.82rem * 1.5 + 5px); }
/* Too narrow for both: on a row of its own, which it fills. */
@container (max-width: 430px) {
  .place-add > .btn { flex: 1 1 100%; margin-top: 0; }
}

/* A ranked list: label, bar, count. The bar is scaled against the largest row,
   so the longest one always fills its track and the rest are read against it. */
.rank { list-style: none; margin: 0; padding: 0; }
.rank-row {
  display: grid; grid-template-columns: minmax(90px, 8rem) minmax(40px, 1fr) auto;
  align-items: center; gap: 12px; padding: 7px 0;
}
.rank-row + .rank-row { border-top: 1px solid var(--line); }
.rank-label {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 0.88rem; color: var(--ink-muted);
}
.rank-label .icon { flex: none; opacity: 0.55; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A lighter step of the same colour as the bar, so an empty track still reads
   as part of the same scale rather than as a separate grey object. */
/* The same treatment on the ranked bars, so a bar is a bar wherever it appears:
   an inset channel, a fill lit along its length, and a cap that keeps the
   smallest row visible. */
.rank-track {
  display: block; height: 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--brand) var(--light-mix), var(--surface));
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgb(var(--shadow-rgb) / 0.10);
}
.rank-label .icon { color: var(--brand); opacity: 0.85; }
.rank-bar {
  display: block; height: 100%; min-width: 10px; border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 66%, white), var(--brand));
  box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.16);
}
/* The longest row is the scale everything else is read against, so it gets the
   full colour - the rows under it are the same ramp, only shorter. */
.rank-row:first-child .rank-bar {
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 80%, black));
}
.rank-value { font-size: 0.88rem; font-variant-numeric: tabular-nums; }

/* --- Tables ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th .icon { opacity: 0.5; margin-right: 6px; vertical-align: -0.15em; }
table.data th {
  text-align: left; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--brand); padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--brand-light), var(--brand-tint));
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
/* Banded, so the eye can carry a value across a wide row without losing the
   line it is on. The band is very slight on purpose - a stripe strong enough to
   read as a colour turns the table into a pattern, and the hover state has to
   stay visible on top of it. */
/* The band is a translucent *image*, not a colour, and that is load-bearing.

   A row also carries a wash of its own state - see "Row state" - and the two
   have to be able to sit on one row. Painted as `background-color` the band
   would replace that wash on every second row, which is to say the table would
   report a menu as published or parked depending on where it happened to land
   in the list. As an image it lies over the colour, and both read. */
table.data tbody tr:nth-child(even) {
  background-image: linear-gradient(var(--row-band), var(--row-band));
}
/* A row lights up under the pointer, which is also what tells anyone the row is
   a thing rather than five separate cells. Stronger than the band, and it wins
   on both kinds of row - `background-color`, so it does not knock the band out
   from under itself. */
table.data tbody tr { transition: background-color 0.12s ease; }
table.data tbody tr:hover { background-color: var(--brand-tint); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .shrink { width: 1%; white-space: nowrap; }

/* --- What a cell is, said in the type ----------------------------------------
   Every column used to be the same 0.9rem grey, so a table read as a wall and
   the one value somebody came for had to be hunted. Three weights now:

   the subject   - the name of the thing, the only link in the row, in ink
   the figures   - counts and money, tabular and heavier, so a column of them
                   lines up digit under digit and reads as a column
   the rest      - type, style, dates: context, in muted ink, and dates a size
                   down because they are the same shape in every row anyway
*/
table.data td .strong,
table.data td a.strong { font-weight: 650; color: var(--ink); }
table.data tbody tr:hover td a.strong { color: var(--brand); }
table.data .num {
  text-align: right; font-variant-numeric: tabular-nums;
  font-weight: 600; color: var(--ink);
}
/* A number column's head is a head like the others, not one of its figures:
   `.num` above outweighed `table.data th` and drew it in the ink. */
table.data th.num { color: var(--brand); font-weight: bold; }
/* A zero is not news. It stays in the column but steps back, so the rows that
   do have a number are the ones the eye lands on. */
table.data .num.is-zero { font-weight: 500; color: var(--ink-faint); }
table.data td.nowrap { font-variant-numeric: tabular-nums; font-size: 0.85rem; }

/* An empty state is the first thing a new account sees, so it gets a ground of
   its own rather than being a grey glyph on white. The icon sits in the same
   tinted chip the stat tiles use. */
.empty {
  text-align: center; padding: 44px 20px;
  background: radial-gradient(120% 90% at 50% 0, var(--brand-tint), transparent 70%);
}
.empty-icon {
  box-sizing: content-box; width: 30px; height: 30px; padding: 13px; margin-bottom: 12px;
  border-radius: 50%; background: var(--brand-light); color: var(--brand);
}

/* --- Forms ------------------------------------------------------------------ */
.field { margin-bottom: 14px; }
/* The field's own label, and only that one. Left as `.field label` this reached
   every label *inside* a control as well - the flag picker is built from radios
   with a label each, and each of them was picking up the 5px bottom margin
   meant to separate a caption from its input. That margin sat inside the
   picker's border, under the row and not over it, which is what left the
   control looking bottom-heavy. Both `.field` markups put the caption directly
   inside the wrapper, so the child combinator costs nothing. */
.field > label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 600; color: var(--ink-muted); margin-bottom: 5px;
}
.field .req { color: var(--danger); margin-left: -2px; }
.field-icon { opacity: 0.55; }
.control, .field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 0.92rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
/* --- Colour controls ---------------------------------------------------------
   A swatch, the hex beside it, and the palette under both. The native input is
   still the control - it is the only picker that needs no script - but a
   full-width bar of colour reads as a banner rather than as a value, and gives
   no way to type a brand colour in. */
.colour-control {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden;
}
.colour-control:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
/* `appearance: none` is what removes the browser's own frame; without it the
   swatch keeps a chrome border and inset that no padding here can reach. */
.field .colour-swatch {
  appearance: none; -webkit-appearance: none;
  width: 46px; height: 38px; flex: none; padding: 0;
  border: none; border-right: 1px solid var(--line); border-radius: 0;
  background: none; cursor: pointer;
}
.colour-swatch::-webkit-color-swatch-wrapper { padding: 5px; }
.colour-swatch::-webkit-color-swatch { border: 1px solid rgb(var(--shadow-rgb) / 0.18); border-radius: 5px; }
.colour-swatch::-moz-color-swatch { border: 1px solid rgb(var(--shadow-rgb) / 0.18); border-radius: 5px; }
.field .colour-hex {
  flex: 1; min-width: 0; width: auto; height: 38px; padding: 0 10px;
  border: none; border-radius: 0; background: none;
  font: inherit; font-family: var(--mono); font-size: 0.84rem; color: var(--ink);
  text-transform: lowercase;
}
.field .colour-hex:focus { outline: none; box-shadow: none; }
.field .colour-hex.is-invalid { color: var(--danger); }
.field .colour-swatch[disabled], .field .colour-hex[disabled] { cursor: not-allowed; opacity: 0.55; }

/* The quick picks. Small, round and quiet: they are shortcuts, and a row of
   large blocks would outweigh the value they set. */
.colour-dots { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.colour-dot {
  width: 17px; height: 17px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgb(var(--shadow-rgb) / 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.colour-dot:hover { transform: scale(1.18); box-shadow: 0 1px 4px rgb(var(--shadow-rgb) / 0.25); }
.colour-dot:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* A checkbox stretched to the width of the column is a horizontal rule with a
   tick at one end. */
.field input[type="checkbox"] { width: auto; height: 16px; accent-color: var(--brand); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light);
}
.field input[disabled], .field select[disabled] { background: var(--canvas); cursor: not-allowed; }
/* The file box. The browser draws its own "Choose file" button inside it: a
   grey pill half the box's height, the same grey on both themes, which beside
   a `.btn` looked like a control from another site. Here it is the icon panel
   instead - flush with the left edge, full height, the same translucent wash
   and ink - so the box and the camera button beside a row's picture read as
   one family. The box's own padding goes and the button carries it, so the
   box is exactly as tall as a text box. The words in the button are the
   browser's, in the browser's language; nothing here can reach them. */
.field input[type="file"] { padding: 0; overflow: hidden; color: var(--ink-muted); }
/* Not on a disabled one: this would outweigh `.field input[disabled]`'s
   `not-allowed` above, and an unavailable box would offer a hand. */
.field input[type="file"]:not([disabled]) { cursor: pointer; }
.field input[type="file"]::file-selector-button {
  margin: 0 11px 0 0; padding: 9px 14px;
  border: none; border-right: 1px solid var(--line); border-radius: 0;
  background-color: color-mix(in srgb, var(--brand) var(--panel-mix), transparent);
  color: var(--brand);
  font: inherit; font-weight: 550;
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.field input[type="file"]:hover:not([disabled])::file-selector-button {
  background-color: color-mix(in srgb, var(--brand) calc(var(--panel-mix) * 2), transparent);
}
.field input[type="file"][disabled]::file-selector-button {
  background-color: transparent; color: var(--ink-muted); cursor: not-allowed;
}
.field-help { font-size: 0.78rem; color: var(--ink-muted); margin: 4px 0 0; }
/* One line shared by a pair of fields - see `parameter_groups`. It belongs to
   the row above it, so it sits close under the pair and keeps the full gap
   before whatever comes next. Written after `.field-help` on purpose: the two
   have the same weight, and this one has to win. */
.field-row.is-tight .field { margin-bottom: 5px; }
.field-help.field-help-row { margin: 0 0 14px; }
.field-error {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.78rem; color: var(--danger); margin: 4px 0 0;
}
.field.has-error .control { border-color: var(--danger); }
/* Focused, a field in error keeps its red border, which outranks the blue one
   above - and the pale halo left alone is all but invisible on a card. A ring
   in the error's own colour, clear of the border, marks it instead. */
.has-error .control:focus { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--danger); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* A form's own button ends at the right, under the fields it sends, as a
   dialog's does - not at the left with the rest of the row empty beside it, 350
   to 540px of a card on a computer. The forms that are a block or a grid rather
   than a row make it a box of its own width pushed over by its margin. On a
   phone it fills the row instead (see "On a phone"). */
.form-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 16px; }
.batch-upload > .btn, .batch-confirm > .btn, .api-key-form > .btn {
  display: flex; width: fit-content; margin-left: auto;
}

.alert {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 12px 14px; border-radius: var(--radius-sm); margin-top: 16px;
}
.alert-error { background: var(--danger-bg); color: var(--danger); }
/* Amber text on amber: `--warn` itself only reaches 4.2:1 there, which is why
   `--warn-ink` exists and is used here rather than the border colour. */
.alert-warning { background: var(--warn-bg); color: var(--warn-ink); }
.alert-warning .icon { color: var(--warn); }
/* Neither a failure nor a warning: a statement of where something stands. */
.alert-info { background: var(--brand-tint); color: var(--ink); border: 1px solid var(--brand-light); }
.alert-info .icon { color: var(--brand); }
.alert .icon { margin-top: 0.15em; }
/* The unproven-address banner: the sentence, and the button to send the link
   again pushed to the end - under the sentence once a phone runs out of room. */
.verify-banner { align-items: center; flex-wrap: wrap; margin-top: 0; margin-bottom: 18px; }
.verify-banner > span { flex: 1 1 260px; }
.verify-banner > .icon { align-self: flex-start; margin-top: 0.3em; }
.verify-banner form { margin-left: auto; }

/* --- The public bar --------------------------------------------------------- */
/* The public bar stays put.

   It carries the two controls a visitor is most likely to want *while reading*
   - the language and the theme - and both were at the top of a page that runs
   to several screens of pricing, use cases and FAQ. Somebody four sections down
   who wanted the page in Bosnian had to scroll back to the top for it, which is
   the same as not having it.

   A translucent ground with a blur behind it, so the page reads as continuing
   underneath rather than as being cut off - with an opaque fallback declared
   first, because without one the bar is simply see-through on a browser that
   does not do `backdrop-filter` and the page runs through the words in it.

   Wraps rather than overflows. On a phone the mark, three flags, three theme
   buttons and a button come to well over the width of the screen, and a header
   that does not wrap does not get narrower, it takes the whole page sideways
   with it. */
.public-head {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px 16px; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .public-head {
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

/* Whatever a public page scrolls to - a section of the landing page, a
   question in the FAQ - has to stop below the bar rather than behind it.

   The four numbers are measured off the rendered bar at each breakpoint, not
   worked out from the padding - the bar wraps, and what is tallest inside it
   changes when the lockup goes. `:has()` is what scopes them to pages that
   actually carry the bar; the signed-in shell sets `--sticky-top` from its own
   bar on `.shell` instead. */
:root:has(.public-head) { --sticky-top: 69px; }

.public-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); }
.public-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
@media (max-width: 720px) { :root:has(.public-head) { --sticky-top: 61px; } }
@media (max-width: 560px) {
  .public-head { padding: 12px 16px; }
  :root:has(.public-head) { --sticky-top: 57px; }
  /* The two calls to action stay; the second one loses its words rather than
     the row losing the button. */
  .public-actions .btn { --btn-py: 8px; --btn-px: 11px; }
}

/* Under 500px the lockup goes.

   It is 240x54 of artwork whose only job on this bar is to be the way back to
   the front page, and at that width it was taking the whole first line to
   itself and pushing the language and theme controls onto a second - which
   doubled the height of a bar that is now sticky, so the cost was paid on every
   screen of the page rather than once at the top.

   The link is hidden rather than removed, so the markup is the same one bar in
   every language and at every width; the footer carries the mark and the way
   home on the pages this bar is on. */
@media (max-width: 499px) {
  .public-head .public-brand { display: none; }
  /* With the brand gone the bar has one child, and `space-between` would leave
     the controls hard against the left. */
  .public-head { justify-content: flex-end; padding: 10px 14px; }
  :root:has(.public-head) { --sticky-top: 52px; }
}

/* --- A picker's label ------------------------------------------------------
   The name over a row of choices - a badge's mark, an offer's days - where
   there is no single control for a <label> to point at. */
.picker-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 600; color: var(--ink-muted); margin-bottom: 5px;
}
.picker-label .req { color: var(--danger); }
/* --- Chips ------------------------------------------------------------------
   A rounded chip: a filter to click - the languages on the translation page -
   or a choice with its box in it - the days of an offer, a dish's allergens. */
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 0.82rem; font-weight: 550;
  text-decoration: none; white-space: nowrap;
}
.tag-chip:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line-strong)); text-decoration: none; }
.tag-chip.is-active {
  background: var(--pick-bg); color: var(--pick-ink); font-weight: 650;
  box-shadow: inset 0 0 0 1px var(--pick-edge);
}
.tag-count { color: var(--ink-faint); font-size: 0.9em; font-variant-numeric: tabular-nums; }
.tag-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
/* Choosing them: a chip with its box in it. */
.tag-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
/* Chips with only their help under them - the days of an offer, a dish's
   allergens - sit as a text field does: 5px under the label, 4px over the help. */
.field > .tag-picks:has(+ .field-help) { margin: 5px 0 0; }
/* An event's days and last date, only while it repeats: read off the checked
   radio, so no script. A browser without `:has` shows them always, which is
   harmless - `EventForm.clean` empties both for an event on once. */
.repeat-fields:has(input[name="repeat_every"][value="0"]:checked) .repeat-only { display: none; }
.repeat-fields:has(input[name="repeat_every"][value="4"]:checked) .repeat-days { display: none; }
/* The repeat mark before a repeating event's date in the editor's tree. */
.tree-repeat { display: inline-flex; vertical-align: -2px; margin-right: 3px; color: var(--muted); }
.tree-repeat .icon { width: 13px; height: 13px; }
.tag-pick {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 0.84rem; cursor: pointer;
}
.tag-pick:has(input:checked) {
  background: var(--pick-bg); color: var(--pick-ink); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--pick-edge);
}
.tag-pick input { margin: 0; }

/* --- Importing from a file -------------------------------------------------
   Dishes from a spreadsheet - see apps.menus.views_import. The columns a file
   may have, as chips, and the review's table, where a refused row says why in
   its last cell. */
.column-chip {
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--canvas); font-size: 0.78rem; color: var(--ink-muted);
}
.column-chip.is-required { border-color: var(--line-strong); color: var(--ink); font-weight: 650; }
.batch-upload { display: grid; gap: 10px; justify-items: start; }
.batch-upload .field { width: 100%; margin: 0; }
.batch-blocker {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 10px 0 0; color: var(--warn-ink); font-size: 0.86rem;
}
.batch-blocker .icon { flex: none; margin-top: 0.15em; }
.batch-rows tr.is-refused td { background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.batch-ok { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-size: 0.82rem; }
.batch-errors { margin: 0; padding-left: 1.1em; color: var(--danger); font-size: 0.8rem; }
.batch-confirm { display: grid; gap: 12px; justify-items: start; }
.batch-confirm .field { width: 100%; max-width: 32em; margin: 0; }

/* The PDF's width, under the download buttons: a number, its unit, the button. */
.pdf-form { margin-top: 12px; text-align: left; }
.pdf-form > label { font-size: 0.85rem; font-weight: 600; }
.pdf-row { display: flex; gap: 8px; margin-top: 6px; }
.pdf-row input { flex: 1 1 auto; min-width: 0; }
.pdf-row select { flex: none; width: auto; }
.pdf-row .btn { flex: none; }
.pdf-form .tiny { margin: 6px 0 0; }

/* --- Print size -------------------------------------------------------------
   How big to print a code - see apps.codes.services.print_size. A file tag
   beside each width says whether the PNG is still sharp there or it is the
   SVG's job; the box under the table is the visitor's own distance. */
.print-table td:first-child { color: var(--ink); }
.print-file {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 650; letter-spacing: 0.03em;
  background: var(--ok-bg); color: var(--ok);
}
.print-file.is-svg { background: var(--warn-bg); color: var(--warn-ink); }
.print-own {
  margin-top: 14px; padding: 12px 14px;
  background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.print-own > label { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; }
.print-own-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; }
.print-input { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.print-input input { width: 6.5em; }
.print-own-row .print-arrow { color: var(--ink-faint); }
/* On a phone the answer drops under the box, and an arrow left at the end of
   the line above points at nothing. */
@media (max-width: 560px) { .print-own-row .print-arrow { display: none; } .print-result { flex-basis: 100%; } }
.print-result { font-size: 0.9rem; color: var(--ink-muted); }
.print-result strong { color: var(--ink); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.print-png {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 10px 0 0; font-size: 0.8rem; color: var(--ok); line-height: 1.35;
}
.print-png .icon { flex: none; margin-top: 0.15em; }
.print-png.is-short { color: var(--warn-ink); }
.print-png[hidden] { display: none; }
.print-meta { margin: 10px 0 0; }

/* --- A code's picture ---------------------------------------------------------
   The code on its own page, and the buttons that hand it over. */
/* A 1024px download shown at 280px is a four-fold reduction, and doing that
   by nearest neighbour drops three pixels in four. */
.code-image { max-width: 280px; width: 100%; height: auto; image-rendering: auto; }
/* A picture of a code with no background drawn over the checkerboard, so that
   a white code is not invisible on paper and a dark one is not lost on the dark
   theme. On the <img> itself, so the checks stop where the picture does. */
img.see-through { background: var(--see-through); }
.download-row { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }

.detail-meta .row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.detail-meta .row:last-child { border-bottom: none; }
.detail-meta .row > span:first-child {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-muted); font-size: 0.85rem; white-space: nowrap;
}
.detail-meta .row > span:first-child .icon { opacity: 0.5; }

/* The heading and the period switch are centred over the four cards - there is
   nothing else on this page to align them to the left of. The column itself is
   left where `.content-wide` puts it on every other page; only what sits above
   the grid moves. */
.plan-page .page-head { justify-content: center; text-align: center; }
.plan-page .page-head h1 { justify-content: center; }
/* Column flex rather than `text-align`, which would centre every feature row
   inside all four cards. The grid takes its full width back, since a column
   flex would otherwise shrink it to its content. */
.plan-page .plan-periods { display: flex; flex-direction: column; align-items: center; }
.plan-page .plan-periods > .grid { width: 100%; }

/* A column, so the action can be pinned to the bottom of whichever card is
   tallest - see .plan-features below. Without it the four buttons sit wherever
   their own feature list happens to end, which is what made the row ragged. */
.plan-card {
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.plan-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgb(var(--shadow-rgb) / 0.09); }
.plan-card .card-body { display: flex; flex-direction: column; flex: 1; }
.plan-card .card-head { position: relative; }

/* A quiet checkerboard behind the tier name - a menu here is reached through a
   QR code, and a pricing table for it may as well look like it knows that. Kept under 6%
   opacity: it should register as texture, not as a pattern to read. */
.plan-card .card-head::after {
  content: ""; position: absolute; inset: 0 0 0 auto; width: 150px;
  background-image: repeating-conic-gradient(color-mix(in srgb, var(--ink) 6%, transparent) 0% 25%, transparent 0% 50%);
  background-size: 10px 10px;
  /* Faded from the top-right corner outwards rather than sideways. A linear
     fade leaves the pattern with a hard edge along the top, the right and the
     header's own bottom border, which reads as a pasted rectangle instead of
     texture. The radius is set so it has reached zero by the time it meets
     that border. */
  -webkit-mask-image: radial-gradient(105px 105px at 100% 0, #000 8%, transparent 66%);
  mask-image: radial-gradient(105px 105px at 100% 0, #000 8%, transparent 66%);
  pointer-events: none;
}

.plan-card.is-current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.plan-card.is-current:hover { box-shadow: 0 0 0 3px var(--brand-light), 0 10px 24px rgb(var(--shadow-rgb) / 0.09); }

/* The one tier the table argues for. A rule across the top, a warmer ground
   behind the name, and a solid button - three small signals rather than one
   loud one. */
.plan-card.is-recommended { border-color: var(--line-strong); }
.plan-card.is-recommended::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; z-index: 1;
  background: linear-gradient(90deg, var(--brand), var(--logo-blue) 55%, var(--brand-dark));
}
.plan-card.is-recommended .card-head { background: var(--brand-tint); }
.plan-card.is-recommended .card-head h2 { color: var(--brand); }
.plan-card.is-recommended .card-head::after {
  background-image: repeating-conic-gradient(color-mix(in srgb, var(--brand) 13%, transparent) 0% 25%, transparent 0% 50%);
}
.plan-flag {
  display: inline-flex; align-items: center; gap: 5px; position: relative; z-index: 1;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 1px 3px color-mix(in srgb, var(--brand-dark) 35%, transparent);
  color: var(--on-brand);
  font-size: 0.68rem; font-weight: 650; letter-spacing: 0.03em; text-transform: uppercase;
}
.plan-flag .icon { width: 12px; height: 12px; }

.plan-price { font-size: 1.6rem; font-weight: 650; margin-bottom: 10px; }
.plan-per { font-size: 0.8rem; font-weight: 500; color: var(--ink-muted); margin-left: 4px; }
/* Beside the price, not under it. On its own line the badge pushes the feature
   list of the two tiers that have one out of line with the two that do not, and
   the four cards stop reading as a row. */
.plan-save {
  display: inline-flex; align-items: center; margin-left: 8px;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--brand-light); color: var(--brand);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em;
  vertical-align: 3px;
}
.plan-save .icon { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }

/* The monthly/yearly switch. Every rule below hangs off `:checked ~`, so the
   two inputs have to remain siblings of the switch and the grid - see the
   comment in plan.html. Hidden with clip rather than display:none, because a
   radio that is not rendered is a radio the keyboard cannot reach. */
.plan-period-input {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
}
.plan-switch {
  display: inline-flex; gap: 4px; margin-bottom: 18px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--canvas);
}
.plan-switch label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; color: var(--ink-muted);
  cursor: pointer; user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.plan-switch label:hover { color: var(--ink); }
.plan-switch label .icon { width: 14px; height: 14px; opacity: 0.6; }
#plan-period-monthly:checked ~ .plan-switch label[for="plan-period-monthly"],
#plan-period-yearly:checked ~ .plan-switch label[for="plan-period-yearly"] {
  background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.08);
}
#plan-period-monthly:checked ~ .plan-switch label[for="plan-period-monthly"] .icon,
#plan-period-yearly:checked ~ .plan-switch label[for="plan-period-yearly"] .icon { opacity: 1; }
/* The group takes the focus ring, since the radio itself is clipped away. */
.plan-period-input:focus-visible ~ .plan-switch { outline: 2px solid var(--brand); outline-offset: 2px; }

/* The euro restatement, under the figure rather than beside it: the mark price
   is what is charged and has to stay the largest thing in the card. The two
   spans inside it are caught by the same `:checked ~ .grid` rules below, which
   are descendant selectors and so reach a nested one. */
.plan-price-eur {
  font-size: 0.78rem; font-weight: 500; color: var(--ink-faint);
  /* Held open on the two tiers that have no euro figure, or their feature lists
     start a line above the other two and the row of four comes out ragged. */
  margin-top: -4px; min-height: 1.15em;
}

/* One price is shown, the other is removed. `.plan-save` belongs to yearly.

   Two containers, because the switch drives the plan page's `.grid` and the
   landing page's `.pricing-grid`, which are different layouts showing the same
   table. The ids are shared on purpose - the two pages are never on screen
   together, and a second set of names would mean a second set of these rules to
   keep in step. */
#plan-period-monthly:checked ~ .grid .price-yearly,
#plan-period-monthly:checked ~ .grid .plan-save,
#plan-period-yearly:checked ~ .grid .price-monthly,
#plan-period-monthly:checked ~ .pricing-grid .price-yearly,
#plan-period-monthly:checked ~ .pricing-grid .plan-save,
#plan-period-yearly:checked ~ .pricing-grid .price-monthly { display: none; }
/* flex:1 so the list absorbs the slack in a short card and the action below it
   lands on the same line in all four. */
.plan-features { list-style: none; margin: 0 0 16px; padding: 0; font-size: 0.88rem; flex: 1; }
.plan-features li {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--line);
}
/* The tick or dash, in its own slot so every label starts on the same column
   whichever of the two it is - the glyphs are not the same width. */
.plan-feature-mark { display: inline-flex; flex: none; width: 16px; justify-content: center; }
.plan-features li .icon { flex: none; color: var(--ok); }
.plan-feature-label { min-width: 0; }
.plan-features li.is-excluded { color: var(--ink-faint); }
.plan-features li.is-excluded .icon { color: var(--ink-faint); }
.plan-features li.is-excluded strong { font-weight: 550; color: inherit; }

/* --- What paying here means, under a price ----------------------------------
   Shared by the plan page and the landing page's price block - see
   core/_pay_terms.html.

   A card, not a centred column of small print. The first version of this was
   the marks and two sentences centred under the grid with no ground of their
   own, which read as loose text somebody had left there rather than as the
   payment terms: nothing bounded it, the long currency sentence set its own
   ragged measure, and the policy links wrapped into a third centred line. */
/* Full width of whatever column it is in, so its edges line up with the price
   cards above it. Capped and centred it read as a separate narrower thing
   floating under the grid rather than as the last row of it. */
.pay-terms { margin-top: 26px; }
.pay-terms.is-flush { border: none; background: none; box-shadow: none; }
.pay-terms .legal-callout { margin: 0; }

/* The marks at one end and the policy links at the other, stacking when there
   is no room for both. */
.pay-terms-row {
  display: flex; flex-wrap: wrap;
  align-items: flex-start; justify-content: space-between;
  gap: 14px 24px; margin-top: 14px;
}

.pay-terms-links {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin: 0; padding: 0; list-style: none; font-size: 0.86rem;
}
.pay-terms-links li { display: inline-flex; align-items: center; gap: 7px; }
.pay-terms-links .icon { color: var(--ink-faint); flex: none; }

/* The landing page's arrangement of the same facts: no card, stacked and
   centred under the price grid, the policies as one sentence. It sits at the
   foot of a centred section rather than inside a column of content, and a
   bordered box there reads as a fifth card in a row of four. */
.pay-terms.is-centred {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; text-align: center;
}
.pay-terms.is-centred .legal-callout { max-width: 78ch; text-align: left; }
.pay-terms.is-centred .card-marks { align-items: center; }
.pay-terms-read { margin: 0; max-width: 86ch; }
/* A policy name is one thing to click, so it wraps as one - the line broke
   between "Payment" and "security" and left half a link on its own. */
.pay-terms-read a { white-space: nowrap; }

/* Directly under the block above, and to the same edges. */
.pay-terms-note { margin-top: 12px; }
.plan-features li.is-excluded .icon { color: var(--ink-faint); }

/* The current-plan marker is sized as a button, not as a badge: it stands in
   the same slot as one, and matching its box is what keeps the bottom of the
   four cards on one line. Borrowed metrics from .btn - padding, radius, weight
   - so the two stay the same height if either is ever restyled. */
.plan-action { margin-top: auto; }
.plan-current {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 9px 16px;
  border: 1px dashed var(--brand); border-radius: var(--radius-sm);
  background: var(--brand-light); color: var(--brand);
  font-size: 0.89rem; font-weight: 600;
}
/* A badge always has a ground. Without one the plain variant was bare text in a
   column of pills, which reads as a missing value rather than a state. */
/* A badge always has a ground, and the plain one is the stateless case - a
   draft, an unset value. Grey rather than a hue, because it is the absence of a
   state rather than one of them; without a ground it was bare text in a column
   of pills, which reads as a missing value. */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  background: var(--neutral-bg); color: var(--ink-muted);
  border: 1px solid var(--neutral-line);
}
/* One chip, one hairline and one ink per state, all derived from the hue in the
   tokens - so a badge on a row already tinted its own colour still reads as a
   chip on a ground, which is what the `-line` edge is for. */
.badge-ok, .badge-current {
  background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line);
}
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.badge-info { background: var(--info-bg); color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) var(--hairline-mix), var(--surface)); }
.badge-alt { background: var(--alt-bg); color: var(--alt); border-color: var(--alt-line); }

/* --- The logo on the menu settings ------------------------------------------
   The file that is on the menu now, and the way to take it off. Shown as the
   thing itself rather than as "Currently: menu-logos/a8f3.png", which is a path
   nobody chose and cannot recognise. */
.logo-current {
  display: flex; align-items: center; gap: 14px;
  margin: 2px 0 10px; padding: 10px 12px;
  background: var(--canvas);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.logo-current img {
  flex: none; width: 64px; height: 64px; object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 5px;
}
.logo-current-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }

/* --- The picture on a line, an offer or an event -----------------------------
   Built on `.logo-current` above, which is the same idea one field over: show
   the thing itself rather than the path it is stored at, and put the way to
   remove it beside it. Square here rather than `contain`, because every picture
   on a menu is a square by construction - see `menus/services/images.py`. */
.shot-current img {
  flex: none; width: 72px; height: 72px; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
}
.shot-current {
  display: flex; align-items: center; gap: 14px;
  margin: 2px 0 10px; padding: 10px 12px;
  background: var(--canvas);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
/* The square that has just been cropped and is waiting for Save. Tinted, and
   the one difference that matters: a control that looked unchanged after
   somebody spent twenty seconds framing a photograph is a control they will use
   twice and then post twice. */
.shot-picked {
  background: var(--brand-tint);
  border-color: color-mix(in srgb, var(--brand) var(--hairline-mix), var(--surface));
}
/* The `hidden` attribute has to be said again here, and this is not belt and
   braces. `hidden` works through a `display: none` rule in the *browser's* own
   stylesheet, and any author rule that sets `display` beats it whatever its
   specificity - so `.shot-current { display: flex }` above quietly un-hid this
   panel, and every row's page opened with an empty "just cropped" card on it.
   Anything carrying both a `display` and a `hidden` attribute needs this pair. */
.shot-picked[hidden] { display: none; }

/* The file box and, on a phone or a tablet, the camera beside it - or under it,
   where there is no room for both. Side by side on a phone, the browser's own
   "Choose file" button filled the box and its "No file chosen" came out as
   "N…". */
.shot-sources { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.shot-sources input[type="file"] { flex: 1 1 15rem; min-width: 0; }
.shot-camera { flex: none; }
/* The same pair as `.shot-picked[hidden]`: `.btn` sets `display`. */
.shot-camera[hidden] { display: none; }
/* A computer ignores `capture` and opens a file browser, so the button would
   be a second way to do what the box beside it already does. A phone or a
   tablet has no hover and a coarse pointer; anything with a mouse has both. */
@media (hover: hover) and (pointer: fine) {
  .shot-camera { display: none; }
}

/* --- The cropper -------------------------------------------------------------
   One per page, opened by whichever picture field was used. A <dialog>, like
   the confirmation below it, so the focus trap, Esc and the backdrop are the
   browser's job.

   Wider than the confirmation dialog because its subject is a picture rather
   than a sentence, and capped so the frame is never bigger than a phone's
   screen is tall - the zoom slider and the two buttons have to be reachable
   without scrolling a dialog. */
.crop {
  border: none; padding: 0;
  width: calc(100% - 24px); max-width: 420px;
  border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 18px 44px rgb(var(--shadow-rgb) / 0.22), 0 2px 8px rgb(var(--shadow-rgb) / 0.10);
}
.crop::backdrop { background: rgb(var(--shadow-rgb) / 0.6); }

.crop-head { display: flex; align-items: center; gap: 11px; padding: 16px 18px 10px; }
.crop-head h3 { margin: 0; font-size: 1.02rem; }
.crop-mark {
  flex: none; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--brand-light); color: var(--brand);
}

/* The frame *is* the canvas: what is inside it is exactly what will be saved.
   No dashed rectangle floating over a larger picture - "the part outside the
   box is being thrown away" is something to be read, and "this is the picture"
   is something to be seen.

   The chequer underneath is what shows through where a zoomed-out picture has
   nothing: the crop pads with transparency rather than with a colour, and this
   is the one convention everybody already reads as "there is nothing here". */
.crop-stage { padding: 0 18px; }
.crop-canvas {
  display: block; width: 100%; aspect-ratio: 1;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  cursor: grab;
  /* A drag on it moves the picture; without this the browser scrolls the page
     instead and the frame cannot be panned on a phone at all. */
  touch-action: none;
  background-color: var(--canvas);
  background-image:
    linear-gradient(45deg, var(--line-soft) 25%, transparent 25%),
    linear-gradient(-45deg, var(--line-soft) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--line-soft) 75%),
    linear-gradient(-45deg, transparent 75%, var(--line-soft) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
/* The menu's cover: a 5:2 band rather than a square, in a dialog wide enough
   that the band is not a strip. Set by `imagecrop.js` before it opens. */
.crop[data-shape="wide"] { max-width: 640px; }
.crop[data-shape="wide"] .crop-canvas { aspect-ratio: 5 / 2; }
.crop-canvas:active { cursor: grabbing; }
.crop-canvas:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.crop-help {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 10px 18px 0; color: var(--ink-muted); font-size: 0.82rem;
}
.crop-help .icon { flex: none; width: 14px; height: 14px; }

.crop-zoom { display: flex; align-items: center; gap: 10px; padding: 10px 18px 4px; }
.crop-range { flex: 1; min-width: 0; accent-color: var(--brand); }

.crop-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin-top: 12px; padding: 12px 18px;
  border-top: 1px solid var(--line); background: var(--brand-tint);
  border-radius: 0 0 var(--radius) var(--radius);
}
/* What will actually be stored, in pixels. Pushed to the left so it reads as a
   fact about the frame rather than as a third button. Zooming into a small
   picture makes a smaller square - nothing here invents pixels that were not
   photographed - and this is where that becomes visible rather than
   surprising. */
.crop-size {
  margin-right: auto; color: var(--ink-muted);
  font-size: 0.78rem; font-weight: 600; font-variant-numeric: tabular-nums;
}

/* --- The confirmation dialog -------------------------------------------------
   One per page, filled in by whichever trigger opened it. A <dialog>, so the
   focus trap, Esc and the backdrop are the browser's job rather than ours. */
.modal {
  border: none; padding: 0;
  max-width: 440px; width: calc(100% - 32px);
  border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 18px 44px rgb(var(--shadow-rgb) / 0.22), 0 2px 8px rgb(var(--shadow-rgb) / 0.10);
}
.modal::backdrop { background: rgb(var(--shadow-rgb) / 0.55); }

.modal-head { display: flex; align-items: center; gap: 11px; padding: 18px 20px 0; }
.modal-head h3 { margin: 0; font-size: 1.05rem; }

.modal-icon {
  flex: none; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--brand-light); color: var(--brand);
}
/* Red only when the thing being confirmed cannot be undone. A warning triangle
   on every question teaches people to click through it. */
.modal.is-danger .modal-icon { background: var(--danger-bg); color: var(--danger); }

.modal-body {
  margin: 0; padding: 12px 20px 20px;
  color: var(--ink-muted); font-size: 0.93rem; line-height: 1.5;
}

.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--line);
  background: var(--brand-tint);
  border-radius: 0 0 var(--radius) var(--radius);
}
.modal.is-danger .modal-foot { background: var(--danger-bg); }

/* The accept button is filled here, unlike `.btn-danger` elsewhere in the app.
   Outlined, it sits on a foot of the same tint and reads as the quieter of the
   two - and the quieter of the two is Cancel, which is already the one with
   focus. The dialog asks a question; the button that answers it has to look
   like the answer. */
.modal-foot .btn-danger {
  background: var(--danger); border-color: var(--danger); color: var(--on-brand);
  --btn-panel: color-mix(in srgb, var(--ink) 16%, transparent);
  --btn-panel-ink: var(--on-brand);
}
.modal-foot .btn-danger:hover { background-color: color-mix(in srgb, var(--danger) 82%, var(--ink)); border-color: color-mix(in srgb, var(--danger) 82%, var(--ink)); }
.modal-foot .btn-danger .icon { color: currentColor; }

/* A row's own page - a dish, an offer, a currency - over the editor, as a
   sheet: see core/js/live.js. The page as it is, head and card, on the page's
   own ground, scrolled inside itself; the card's foot stays at the bottom of
   it, so Save under a long dish is always in reach. The whole screen on a
   phone, where a card with a margin round it is a card with less room. */
.sheet {
  border: none; padding: 20px;
  width: calc(100% - 32px); max-width: 780px;
  max-height: calc(100dvh - 48px);
  overflow: auto; overscroll-behavior: contain;
  border-radius: var(--radius);
  background: var(--canvas); color: var(--ink);
  box-shadow: 0 18px 44px rgb(var(--shadow-rgb) / 0.22), 0 2px 8px rgb(var(--shadow-rgb) / 0.10);
}
.sheet::backdrop { background: rgb(var(--shadow-rgb) / 0.55); }
.sheet .card-foot { position: sticky; bottom: 0; z-index: 1; }
@media (max-width: 560px) {
  .sheet { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 16px; border-radius: 0; }
}
/* Its page on the way, after a press. */
a[data-live-sheet][aria-busy="true"] { cursor: progress; opacity: 0.6; }

/* --- The signed-out shell ----------------------------------------------------
   One centred column on the canvas, shared by sign-in, sign-up and the four
   screens of the forgotten-password flow - see core/base_auth.html.

   `min-height: 100dvh` rather than `100vh`: on a phone the browser's own bars
   are counted into `vh`, so a card centred in it sits low enough that the
   footer link falls under the address bar.

   The column used to be a fixed 460px cap with a 60px top margin, which put the
   card near the top of a tall window and gave the wider screens - the sign-up
   form and the two-box reset form - no way to ask for more room. The width is a
   block each page overrides now. */
.auth-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--canvas);
}

.auth-column { width: 100%; }

/* The mark and the language, with the switcher under the logo rather than
   beside it - the column is 520px at its widest and the two do not share a line
   comfortably in every language. */
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.auth-brand .brand-logo { margin: 0 auto; max-width: 210px; height: auto; }
/* The two controls under the mark, on one row. They wrap on a narrow screen
   rather than squeezing, because a flag squeezed to nothing is not a flag. */
.auth-switches { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* The gap under the heading belongs to the heading, because three of these
   screens have no lede at all - sign in, and the two that only report a result.
   With the gap on the lede instead, "Sign in" sat directly on the first label. */
.auth-title { font-size: 1.32rem; margin: 0 0 16px; }
/* The lede then pulls back up against it. A negative margin under a *heading* is
   safe in a way one under a field is not: a heading's height is its own line and
   does not grow, whereas a field grows by however many errors it has. */
.auth-lede { color: var(--ink-muted); font-size: 0.88rem; margin: -12px 0 16px; }

/* The two screens that only report a result have no form to align to, so the
   heading is centred over the text rather than left above it. */
.card-body.is-centred { text-align: center; }

.auth-foot {
  margin-top: 18px;
  display: flex; justify-content: center; align-items: center;
  gap: 6px; flex-wrap: wrap;
}
/* The icon and its words are one label. Without this the arrow on "Back to sign
   in" is welded to the B. */
.auth-foot a { display: inline-flex; align-items: center; gap: 6px; }

/* The way out of a refused password, at the end of the row it belongs to. */
.login-forgot { margin: -2px 0 0; text-align: right; }

/* The two screens that only report: a link is on its way, and the password has
   been changed. No form on either, so the icon carries the state and the text
   is centred under it rather than set as a paragraph. */
.reset-sent { text-align: center; }
.reset-sent p { margin-bottom: 8px; }
.reset-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 1.3rem;
}
.reset-icon.is-done { background: var(--ok-bg); color: var(--ok); }

@media (max-width: 480px) {
  /* Top-aligned rather than centred, and a tighter gutter. Vertically centred
     on a short screen the card starts below the fold, so the first thing on
     screen is empty canvas. */
  .auth-shell { align-items: flex-start; padding: 24px 14px 40px; }
}

/* --- Password requirements ---------------------------------------------------
   Stated once under both password boxes rather than as help text on one of
   them, which made the two columns of the field row different heights - see
   core/_password_rules.html and QuietHelpMixin. */
.password-rules {
  /* Positive top margin, deliberately. A negative one tucks the block under the
     field row until a password is rejected: the validator messages render
     inside the field above, and the block would be pulled up over them. Nothing
     that sits below a field may use negative margin - the field's height is not
     fixed, it grows by however many errors it has. */
  margin: 10px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--brand-tint);
}

.password-rules-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink-muted);
  margin-bottom: 7px;
}

/* Two columns where there is room: four stacked lines read as a wall of
   conditions, which is the thing being avoided. */
.password-rules ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 520px) {
  .password-rules ul { grid-template-columns: 1fr; }
}

.password-rules li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.password-rules li .icon { color: var(--brand); margin-top: 0.22em; font-size: 0.85em; }

/* --- Card acceptance marks, and the callouts on the policy pages -------------
   In main.css rather than landing.css because the plan page carries them too,
   and that one is inside the signed-in shell. */
.card-marks { display: flex; flex-direction: column; gap: 8px; }
.card-mark-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card-mark-list img { display: block; width: 42px; height: 28px; }
.card-marks-note { margin: 0; font-size: 0.78rem; color: var(--ink-faint); }

/* The one sentence in a section that answers the requirement the section exists
   for - the currency, the refund route, the fact that no card number arrives
   here. Set apart so a reviewer working down a checklist finds it without
   reading the paragraph around it. */
.legal-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--brand-tint);
  color: var(--ink);
  line-height: 1.55;
}
.legal-callout .icon { flex: none; margin-top: 0.15em; color: var(--brand); }
/* --- Theme switcher ----------------------------------------------------------
   Three buttons in a track - System, Light, Dark - built to the same shape as
   the language switcher beside it, because they are the same kind of control:
   a small set of exclusive choices, all of them on screen, the current one
   raised out of the track. Nothing here is theme-specific; every colour is a
   token, so the control themes itself along with the page it changes. */
.theme-switch { display: inline-flex; align-items: center; }
.theme-options {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; background: var(--pick-track);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.theme-option {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 25px; padding: 0;
  border: none; border-radius: 5px;
  background: transparent; color: var(--ink-muted);
  font: inherit; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.theme-option .icon { width: 14px; height: 14px; }
.theme-option:hover { background: var(--pick-hover); color: var(--ink); }
.theme-option:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.theme-option.is-active {
  background: var(--pick-bg); color: var(--pick-ink);
  /* The edge is an inset shadow rather than a border: these options declare
     `border: none`, and giving one of three a real border would move the other
     two by a pixel every time the choice changed. */
  box-shadow: inset 0 0 0 1px var(--pick-edge), 0 1px 2px rgb(var(--shadow-rgb) / 0.16);
}

/* --- Language switcher ------------------------------------------------------
   Three flag buttons. The flag is 20x14, not square like an .icon glyph, so it
   gets its own rule rather than borrowing that one. */
.lang-switch { display: inline-flex; align-items: center; }
.lang-options {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; background: var(--pick-track);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.lang-option {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 5px; border: none; border-radius: 5px;
  background: transparent; color: var(--ink-muted);
  font: inherit; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  cursor: pointer;
}
.lang-option:hover { background: var(--pick-hover); color: var(--ink); }
.lang-option:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.lang-option.is-active {
  background: var(--pick-bg); color: var(--pick-ink); font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--pick-edge), 0 1px 2px rgb(var(--shadow-rgb) / 0.16);
}
/* In the signed-in bar the flag is the whole label, at every width, and each
   option is the theme switch's 27x25 so the two controls read as a pair. The
   name stays in the button for a screen reader and in `title` for a pointer.
   The public pages keep flag and code. */
.topbar .lang-option { width: 27px; height: 25px; padding: 0; justify-content: center; }
.topbar .lang-code { display: none; }
/* Inside a form the picker is a control like any other, so it takes the whole
   width and the three options share it. `inline-flex` is right in the toolbar,
   where it sits beside other things, but in a column of full-width inputs it
   left a short box floating at one end. It also sat on the parent's baseline as
   an inline box, which put a sliver of line-box descender under it that the top
   did not have - the gap under the row read as tighter than the gap over it for
   that reason rather than any padding. `flex` is block-level and has no
   baseline to sit on. */
.field .lang-options { display: flex; width: 100%; }
.field .lang-option { flex: 1; justify-content: center; padding: 8px 7px; }

/* The same control built from radios, for the copy on the profile form - see
   core/_language_field.html - and for every radio group core/field.html draws.
   The input is clipped, so the label carries both the appearance and the focus
   ring. Picked is the pick tokens, as `.is-active` is: `--surface` and the
   page's shadow was the old pill, which on the dark track was fainter than
   the hover beside it. */
.lang-radio:checked + .lang-option {
  background: var(--pick-bg); color: var(--pick-ink); font-weight: 650;
  box-shadow: inset 0 0 0 1px var(--pick-edge), 0 1px 2px rgb(var(--shadow-rgb) / 0.16);
}
.lang-radio:checked + .lang-option .lang-name { font-weight: 650; }
/* A plain choice in a form - a role, a scope. Its words are the whole option,
   with no flag or code beside them, so they are set at the size of the text
   in the boxes above and below, and the row is as tall as those boxes. */
.field .choice-options .lang-option { padding: 8px 10px; font-size: 0.86rem; }
.lang-radio:focus-visible + .lang-option { outline: 2px solid var(--brand); outline-offset: 1px; }
/* An option that cannot be picked yet - the card on the checkout, until a
   gateway is switched on. Faded and inert, hover included, and never on its
   own: the label carries an `.option-soon` tag that says why. */
.lang-radio:disabled + .lang-option,
.lang-radio:disabled + .lang-option:hover {
  background: transparent; color: var(--ink-faint); cursor: not-allowed;
}
/* `--line-strong` and a surface fill, because `--line` on the grey track all
   but vanished in the light theme and the tag read as loose bold text. Weight
   500 keeps it from outshouting the name beside it, which shares its colour. */
.option-soon {
  padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface);
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.02em; white-space: nowrap;
}

/* The checkout's period pills wear the plan page switch's icons, as faint. */
.checkout-form .lang-option .icon { width: 14px; height: 14px; opacity: 0.6; }
.checkout-form .lang-radio:checked + .lang-option .icon { opacity: 1; }
/* The way-to-pay pills: the card's icon, name and "coming soon" chip outgrew
   half the row on a phone, and a flex item will not shrink below its content,
   so the pair went unequal and German's "Überweisung" pushed past the track.
   Shrinkable pills, the chip free to take a second line, the two kept equally
   tall, and a little less padding where every pixel counts. */
.checkout-form .choice-options:has(.option-soon) { align-items: stretch; }
.checkout-form .choice-options:has(.option-soon) > .lang-option { min-width: 0; }
.checkout-form .lang-option:has(.option-soon) { flex-wrap: wrap; row-gap: 3px; }
@media (max-width: 420px) {
  .checkout-form .field .choice-options .lang-option { padding-inline: 8px; }
  .checkout-form .option-soon { padding-inline: 5px; }
}
/* On a phone the yearly line wraps, so "Amount" sits on the first line rather
   than centred across both; the price and its "/year" are one unbreakable
   piece, since German broke "/Jahr" off on its own. The badge is a hair
   shorter than the line, so switching period does not nudge the page. */
.checkout-form .detail-meta .row { align-items: baseline; }
/* The label leads with its icon, so its baseline was the icon's foot and the
   word sat 2-3px above the price; the word's own baseline lines up instead. */
.checkout-form .detail-meta .row > span:first-child { align-items: baseline; }
.checkout-form .detail-meta .row > span:first-child .icon { align-self: center; }
.checkout-prices { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; }
.checkout-price { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 0 4px; }
.checkout-amount { white-space: nowrap; }
.checkout-price .plan-save { margin: 0 6px 0 0; padding: 2px 9px; vertical-align: 0; align-self: center; }
/* On a phone the badge drops its icon, so "Sie sparen 17%" and the yearly
   price still share a line instead of the badge wrapping off on its own. */
@media (max-width: 420px) { .checkout-price .plan-save .icon { display: none; } }
/* The amount follows the period switch: every period's price is in the page
   and the ones not picked are removed - see billing/checkout.html. One line
   per period, because CSS cannot match a value across elements. */
.checkout-form:has(input[name="period"][value="monthly"]:checked) .checkout-price:not([data-period="monthly"]),
.checkout-form:has(input[name="period"][value="yearly"]:checked) .checkout-price:not([data-period="yearly"]) { display: none; }
/* Room to spell the language out, since this one is not squeezed into a
   toolbar and "BS" is not a word anybody has to guess at. */
.lang-options .lang-name { font-weight: 500; letter-spacing: 0; text-transform: none; }
/* The compact form: flag and code, like the toolbar. For a picker that shares a
   row with another field, where three spelled-out names would wrap. The name is
   still in the markup for a screen reader, which has no flag to read. */
.lang-options.is-compact .lang-name {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden; white-space: nowrap;
  clip-path: inset(50%);
}

.lang-option .flag {
  width: 17px; height: 12px; display: block; flex: none;
  border-radius: 2px;
  /* The flags are flat colour to the edge, and several are pale at one corner;
     without this they dissolve into a light toolbar. */
  box-shadow: 0 0 0 1px rgb(var(--shadow-rgb) / 0.15);
}

/* Present for screen readers and for nothing else - the flag and the two-letter
   code are the visible label, and neither says "language" out loud. */
/* Off the screen but still in the accessibility tree. The second selector is
   not a duplicate: `.field input` sets `width: 100%` and outweighs a single
   class, so a clipped radio inside a form was 390px wide and pushed the whole
   page sideways on a phone - the language picker on the profile did exactly
   that. A utility whose one job is to take up no room has to win. */
.visually-hidden,
.field .visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* What the month's allowance has taken, under the Generate button. Amber the
   moment the next code would be refused, because the button above it is about
   to send somebody to the plans page and this is the only warning before it. */
.quota-line { color: var(--ink-muted); margin: 0; }
.quota-figure { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.quota-line.is-full { color: var(--warn-ink); }
.quota-line.is-full .quota-figure { color: var(--warn-ink); }

/* --- The menu editor --------------------------------------------------------
   A tree of small forms: tabs, the headings inside them, the lines inside those.
   Indented rather than boxed, because four nested cards is a set of frames with
   a menu somewhere inside it. */
/* A tab, and everything under it - closed until it is opened. A ground a shade
   off the card rather than an outline on white: outlined, four tabs on one
   white card read as one long form with some rules drawn on it, and the eye has
   to follow a 1px line to work out where one tab ends. A filled block is
   spotted rather than traced.

   `overflow: hidden` so the strip's corners are the block's corners; the
   padding that used to be here is on `.tree-body`, because a strip that stops
   12px short of the edge is not a strip. */
.tree-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  margin-bottom: 12px;
  overflow: hidden;
}

/* The headings inside it go back to white, so the nesting reads as depth: the
   card is white, the tab is grey, the heading inside it is white again. Three
   levels, two colours, alternating - which is the one place alternation earns
   its keep, because it is saying "inside", not "next". */
.tree-category {
  margin: 10px 0 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tree-section > .tree-body { padding: 12px; }
.tree-category > .tree-body { padding: 8px 12px 10px; }

/* --- The strip you click ----------------------------------------------------
   Drawn as the cards on the right of this page are drawn - a shallow wash of
   the brand fading out before the edge, with the name in it - because that is
   what it now is: a labelled head over a panel, at one more level of nesting.

   It carries a name, a count and a caret and nothing else. Everything you can
   *do* to the tab is in the panel below, and that is forced as much as chosen:
   `<summary>` takes phrasing content, a `<form>` is not phrasing content, and a
   text box on the strip that opens the tab is a text box nobody can click
   into. */
.tree-head {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px; cursor: pointer;
  background: linear-gradient(180deg, var(--brand-tint), var(--surface));
  /* The browser's own disclosure triangle, removed in both dialects - the
     caret below replaces it, at the end of the strip where the eye finishes
     reading rather than where it starts. */
  list-style: none;
  transition: background 0.15s ease;
}
.tree-head::-webkit-details-marker { display: none; }
.tree-head:hover { background: linear-gradient(180deg, var(--brand-light), var(--brand-tint)); }
.tree-head:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.tree-section[open] > .tree-head, .tree-category[open] > .tree-head {
  border-bottom: 1px solid var(--line);
}
/* A heading's strip is quieter than a tab's: it is one level in, and two heads
   of the same weight stacked read as two tabs rather than as one inside the
   other. */
.tree-category > .tree-head { padding: 8px 11px; background: var(--surface); }
.tree-category > .tree-head:hover { background: var(--brand-tint); }

.tree-name {
  flex: 1 1 auto; min-width: 0; font-weight: 650; font-size: 0.95rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tree-category > .tree-head .tree-name { font-size: 0.9rem; font-weight: 600; }
/* A heading's note, on the strip beside its name - it is the one thing about a
   closed heading that is not its name, and it is already typed in. */
.tree-subnote {
  flex: 0 1 auto; min-width: 0; color: var(--ink-faint); font-size: 0.8rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* How much is inside, so a closed strip answers rather than asks. */
.tree-count {
  flex: none; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--neutral-bg); color: var(--ink-muted);
  border: 1px solid var(--neutral-line);
  font-size: 0.72rem; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums;
}
.tree-caret {
  flex: none; width: 14px; height: 14px; color: var(--ink-faint);
  transition: transform 0.18s ease;
}
.tree-section[open] > .tree-head .tree-caret,
.tree-category[open] > .tree-head .tree-caret { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .tree-caret, .tree-head { transition: none; }
}

/* The one-line add forms sit on the tab's own ground, so they take the card
   colour to stay legible as inputs rather than as part of the block. */
.tree-section > .tree-body > .tree-add,
.tree-category > .tree-body > .tree-add { background: var(--surface); }

/* Renaming the row, and moving or deleting it. On its own line at the top of
   the panel now that the strip above carries only the name. */
.tree-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
}
/* `min-width: 0`, or the form is as wide as its boxes' own width: a heading's
   name and note came to 478px in a 386px panel, and the save button was cut
   off past the card's edge. */
.tree-rename { display: flex; align-items: center; gap: 6px; flex: 1 1 240px; min-width: 0; margin: 0; }
.tree-rename input {
  flex: 1 1 auto; min-width: 0; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 0.9rem;
}
/* The lone icon buttons on this page take a real edge for the same reason the
   groups above do - the save beside a rename box, and the two at the top of the
   page. A tint as well as an outline: on the tab's own grey ground an outlined
   white box is a box, and a wash of the brand is a button. The "?" to the guide
   in the head of a dish's, offer's, event's, badge's or rate's own page is the
   same button, or it reads as a stray glyph beside Back. So is the percent
   beside Service mode in the head of the menu's content, which bare was a
   glyph floating next to a bordered button. */
.tree-rename .btn-icon,
.menu-head .page-actions .btn-icon,
.page-actions .guide-help-button,
#menu-content .card-head-end .btn-icon {
  border-color: var(--line-strong);
  background: var(--brand-tint);
  color: var(--brand);
}
.menu-head .page-actions .btn-icon-danger { background: var(--danger-bg); color: var(--danger); }
.tree-section > .tree-body > .tree-tools .tree-rename input { font-weight: 650; }
/* --- The buttons on a row ---------------------------------------------------
   Edit, up, down, delete - drawn as one segmented control rather than as four
   bare glyphs in a row.

   `.btn-icon` is transparent with no edge everywhere else in the product, and
   that is right where there is a column of them in a table: forty outlined
   boxes down a page is a grid nobody asked for. It is wrong here. These sit at
   the end of a line of text, on a tinted ground, next to other glyphs that are
   *not* buttons - the kind mark on a tab, the thumbnail on a row - and a glyph
   with nothing around it reads as a label rather than as something to press.

   Every rule below is scoped to the editor's own containers. Nothing outside
   this page changes.

   The frame is on the group and the dividers are between the buttons, so four
   controls cost one outline instead of four - and the set reads as one thing
   you do to this row, which is what it is. */
.tree-actions, .rate-actions {
  display: inline-flex; align-items: center; gap: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  /* The dividers and the buttons' own hover fill stop at the rounded corners. */
  overflow: hidden;
}
.tree-actions form, .rate-actions form { margin: 0; }
.tree-actions .btn, .rate-actions .btn {
  border: none; border-radius: 0; background: transparent;
  width: 30px; height: 30px;
}
/* A hairline between one button and the next. Two selectors because the group's
   children are a mix: the edit link is a `.btn` itself, and each of the other
   three is a one-button `<form>` - a POST that changes data cannot share a form
   with two others, so they cannot be flattened into one. */
.tree-actions > * + * .btn, .tree-actions > * + .btn,
.rate-actions > * + * .btn, .rate-actions > * + .btn,
.row-moves > * + * .btn {
  border-left: 1px solid var(--line);
}
/* The two arrows, held together only so the focus can pass from one to the
   other - see `menus/_row_actions.html`. No box of its own. */
.row-moves { display: contents; }
/* The arrow a row at the end has no use for: there, but plainly not to press. */
.tree-actions .btn[disabled],
.tree-actions .btn[disabled]:hover { opacity: 0.35; background: transparent; color: var(--ink-muted); }

.tree-items { list-style: none; margin: 8px 0; padding: 0; }
.tree-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-top: 1px solid var(--line-soft);
}
.tree-item:first-child { border-top: none; }
/* Truncated rather than allowed to run on: `min-width: 0` lets the box shrink,
   but without this the text itself spills straight over the price beside it -
   "Ćevapi€9.50" on a phone, and on any name long enough at any width. */
.tree-item-name {
  flex: 1 1 7em; min-width: 0; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* On a phone a dish row has more in it than fits - picture, name, badge dots,
   price, four buttons - and the button group, which clips its contents for its
   rounded corners, was the thing that gave: "Plj…" with half an arrow. The row
   wraps instead, and the buttons drop to a line of their own at the right.
   `.tree-item >` so a category's own buttons stay where they are. */
.tree-item { flex-wrap: wrap; }
.tree-item > .tree-actions { flex: none; margin-left: auto; }
/* Six 38px buttons on a phone come to 230px, which a 360px phone's row had
   207px for - the heading clipped the delete off its end (see the phone
   rules for the room made for them). Narrower than that, the group wraps
   rather than losing a button. */
.tree-item > .tree-actions { max-width: 100%; flex-wrap: wrap; justify-content: flex-end; }
.tree-item-price { font-variant-numeric: tabular-nums; color: var(--ink-muted); }
/* The handle a dish or an offer is dragged by, made by `menus/js/editor.js` -
   a page with no script has none. Two columns of three dots, drawn rather than
   an icon because the script makes it and the sprite is the template's. The
   dots are 12 by 18; the padding makes it a target a finger can find, and the
   negative margin gives the room back to the row. */
.tree-grip {
  flex: none; box-sizing: content-box; width: 12px; height: 18px;
  padding: 10px 4px; margin: -10px -4px;
  background: radial-gradient(circle, var(--ink-faint) 1.4px, transparent 1.9px) 0 0 / 6px 6px;
  background-origin: content-box; background-clip: content-box;
  cursor: grab; touch-action: none;
}
.tree-grip:hover { background-image: radial-gradient(circle, var(--ink-muted) 1.4px, transparent 1.9px); }
/* The room around a lifted row is a ring of its own tint outside its box, not
   padding, so the rows around it do not shift while it is carried. */
.tree-item.is-dragging {
  position: relative; z-index: 1;
  border-radius: 8px;
  background: var(--brand-tint);
  box-shadow: 0 0 0 5px var(--brand-tint), 0 0 0 6px var(--line-strong), 0 8px 22px rgb(0 0 0 / 0.14);
  /* The line between rows, which on a lifted row is a second edge inside the ring. */
  border-top-color: transparent;
}
html.is-sorting, html.is-sorting * { cursor: grabbing !important; user-select: none; }
/* A closed heading a dish is held over: let go and it goes to the end of it,
   hold on and it opens. */
.tree-category.is-drop-target > .tree-head {
  background: var(--brand-tint);
  box-shadow: inset 0 0 0 2px var(--brand);
}
/* Sold out, in the editor as on the menu: still in its place, plainly off. */
.tree-item.is-out .tree-item-name { text-decoration: line-through; color: var(--ink-faint); }
/* An offer or event a guest cannot see is dimmed rather than struck through:
   it is not withdrawn, it is out of its window or switched off, and the reason
   is spelled out in the column beside it. */
/* The buttons stay at full strength: a dimmed button reads as one that is off,
   and on a sold-out dish the one that brings it back is the button wanted. */
.tree-item.is-out > :not(.tree-actions) { opacity: 0.62; }
.tree-item.is-out .tree-item-price { font-style: italic; }
/* The sold-out button on a dish that is sold out: pressed, in the warning colour,
   so the struck-through row says why and the button says how to undo it. */
.tree-actions .tree-sold[aria-pressed="true"] { color: var(--warn-ink); background: var(--warn-bg); }
/* A heading or a dish past what the plan serves: kept and edited here, not
   shown to a guest - see `access.served`. The chip keeps its width; the name
   beside it is what gives way on a narrow row. */
.tree-unserved { flex: none; }
/* Where a sold-out press or a copy comes back to, clear of the sticky top bar. */
.tree-item, .tree-category { scroll-margin-top: calc(var(--sticky-top) + 12px); }

/* The picture a row already has, in front of its name. Small on purpose - it is
   an answer to "which of these forty lines has a photograph", not a preview.
   Without it the only way to find out is to open each of them in turn. */
.tree-shot {
  flex: none; width: 26px; height: 26px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--canvas);
}

/* The glyph in front of a tab's name, saying what it holds. Not editable and
   not a control - the kind is fixed once the tab exists. */
.tree-kind {
  display: inline-flex; flex: none; color: var(--ink-muted);
  padding: 0 2px;
}
/* A tab's glyph, here, on the picker's button and in its tiles, at a size of
   its own and not the text's 1em. They are Lucide outlines, drawn for 24px
   with a 2px line: at the 12-15px of the words around them the line came out
   near 1px, and in the faint grey of the rest of the strip it washed out. 18px
   keeps the line at 1.5px. */
.tree-kind .icon,
.glyph-pick > summary .icon { width: 18px; height: 18px; }
.glyph-groups .badge-icon .icon { width: 20px; height: 20px; }
/* The venue's own chip - "1+1", "-30%" - beside an offer's name in the tree, so
   the list reads the way the public page does. */
.tree-chip {
  display: inline-block; margin-left: 7px; padding: 1px 7px;
  border-radius: 999px; background: var(--brand-light); color: var(--brand);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; vertical-align: 1px;
}
.tree-empty { padding: 6px 0; font-size: 0.85rem; }

/* --- What a guest needs: hours, sizes, allergens ------------------------------
   The week on the hours card, a day to a row: the name in a fixed column so
   the boxes line up under each other, as they would on the door. The same rows
   carry each tab's serving time below it. */
.hours-help { margin: 0 0 12px; }
.hours-week { display: grid; gap: 6px; margin: 0 0 14px; }
.hours-day {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); align-items: center; gap: 4px 10px;
}
.hours-day > label { font-size: 0.86rem; font-weight: 600; color: var(--ink-muted); overflow-wrap: anywhere; }
.hours-day .control { padding: 7px 10px; font-variant-numeric: tabular-nums; }
.hours-day > .field-error { grid-column: 2; margin: 0; }
.hours-day.has-error .control { border-color: var(--danger); }
/* The closed days, under the week's Save: a body of their own with a rule
   above it, the list as the currencies draw theirs, and the two dates side by
   side - each fits a d.m.Y date with room over, and stacking them on a phone
   would put "to" a screen away from "from". */
.hours-closures { border-top: 1px solid var(--line); }
.closure-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.closure-foot { display: flex; justify-content: flex-end; }
#closed-days { scroll-margin-top: calc(var(--sticky-top) + 12px); }
#closed-days .rate-list { margin-bottom: 16px; }
/* A dish's sizes: a name and a price per row, and the bin for a saved one -
   an empty cell of the same width on the blank rows, so the boxes line up. */
.variants { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.variants > legend { padding: 0; }
.variant-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 8rem 34px; align-items: center;
  gap: 4px 8px; margin-bottom: 6px;
}
.variant-row .control { padding: 7px 10px; }
.variant-row .control[type="number"] { font-variant-numeric: tabular-nums; }
.variant-row > .field-error { grid-column: 1 / -1; margin: 0; }
.variant-row.has-error .control { border-color: var(--danger); }
.variant-drop {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm); color: var(--ink-faint); cursor: pointer;
}
/* The tick box is the whole bin, clipped out of sight: ticked, the bin turns
   red and the row fades, which is what "this goes when you save" looks like. */
.variant-drop input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.variant-drop:hover { color: var(--danger); }
.variant-drop:has(input:checked) { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.variant-row:has(.variant-drop input:checked) .control { opacity: 0.45; text-decoration: line-through; }
.variant-drop:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 1px; }
/* The fourteen allergens, each a pick with its pictogram and number in front,
   drawn as `menu.css` draws them beside the dish: the ring 60% toward the
   ink, the number 50%, on a disc over the ring's lower right. The chip makes
   room on the right for the number that hangs off. */
.allergen-pick { gap: 11px; }
.allergen {
  position: relative; display: inline-flex; flex: none;
  color: color-mix(in oklab, var(--allergen) 60%, var(--ink));
}
.allergen .icon { width: 20px; height: 20px; }
.allergen-number {
  position: absolute; right: -5px; bottom: -4px;
  min-width: 14px; height: 14px; padding: 0 2px; border-radius: 999px;
  color: color-mix(in oklab, var(--allergen) 50%, var(--ink));
  background: var(--surface); box-shadow: inset 0 0 0 1px currentColor;
  font-size: 0.6rem; font-weight: 700; line-height: 14px; text-align: center;
  font-variant-numeric: tabular-nums;
}
/* "+2" after a dish's price in the tree: how many sizes it has besides. */
.tree-sizes { margin-left: 4px; font-size: 0.75rem; font-weight: 700; color: var(--ink-faint); }
@media (max-width: 520px) {
  .hours-day { grid-template-columns: minmax(0, 1fr); }
  .hours-day > .field-error { grid-column: 1; }
  .variant-row { grid-template-columns: minmax(0, 1fr) 5rem 34px; }
}

/* --- Service mode ------------------------------------------------------------
   Every dish with one switch, for a phone during service - see
   `menus/service.html`. A dish's whole line is the button: the name and price
   on the left, the switch's word and track on the right, 52px tall for a
   thumb. */
.service-note { margin: 0 0 12px; font-size: 0.9rem; }
/* The tabs are radio buttons in the segmented track, and the checked one shows
   its panel - no script, as on the public menu. Wrapping rather than
   scrolling sideways, so every tab is in sight on a phone. One rule per
   position, as there: twelve is more tabs than a service page has. */
.segmented.service-tabs { display: flex; flex-wrap: wrap; border-radius: 18px; margin-bottom: 16px; }
.service-tabs .segmented-option { min-height: 36px; padding: 8px 14px; font-size: 0.9rem; cursor: pointer; }
.service-tabs .segmented-option:has(> input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 1px; }
.service-panes:has(.service-tabs input:checked) .service-tab { display: none; }
.service-panes:has(.segmented-option:nth-of-type(1) > input:checked) .service-tab:nth-of-type(1),
.service-panes:has(.segmented-option:nth-of-type(2) > input:checked) .service-tab:nth-of-type(2),
.service-panes:has(.segmented-option:nth-of-type(3) > input:checked) .service-tab:nth-of-type(3),
.service-panes:has(.segmented-option:nth-of-type(4) > input:checked) .service-tab:nth-of-type(4),
.service-panes:has(.segmented-option:nth-of-type(5) > input:checked) .service-tab:nth-of-type(5),
.service-panes:has(.segmented-option:nth-of-type(6) > input:checked) .service-tab:nth-of-type(6),
.service-panes:has(.segmented-option:nth-of-type(7) > input:checked) .service-tab:nth-of-type(7),
.service-panes:has(.segmented-option:nth-of-type(8) > input:checked) .service-tab:nth-of-type(8),
.service-panes:has(.segmented-option:nth-of-type(9) > input:checked) .service-tab:nth-of-type(9),
.service-panes:has(.segmented-option:nth-of-type(10) > input:checked) .service-tab:nth-of-type(10),
.service-panes:has(.segmented-option:nth-of-type(11) > input:checked) .service-tab:nth-of-type(11),
.service-panes:has(.segmented-option:nth-of-type(12) > input:checked) .service-tab:nth-of-type(12) { display: block; }
.service-heading {
  margin: 18px 0 4px; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted);
}
.service-heading:first-child { margin-top: 0; }
.service-list { list-style: none; margin: 0; padding: 0; }
.service-row { border-bottom: 1px solid var(--line-soft); scroll-margin-top: calc(var(--sticky-top) + 12px); }
.service-row:last-child { border-bottom: none; }
.service-row form { margin: 0; }
/* Both classes, because `.switch` comes later in this file and would otherwise
   win back its grey and its 4px. */
.switch.service-switch {
  width: 100%; min-height: 52px; padding: 6px 0;
  text-align: left; color: var(--ink);
}
.service-name { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.service-price { margin-left: 6px; font-weight: 400; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.service-switch .switch-label { flex: none; }
.service-switch .switch-track { flex: none; }
/* Off is said in the warning colour, not only by the knob's side: across a
   room, "Sold out" is what has to be seen. */
/* The dish's name alone is struck, not the space after it or the price. */
.service-row.is-out .service-dish { text-decoration: line-through; }
.service-row.is-out .service-name { color: var(--ink-faint); }
.service-row.is-out .switch-label { color: var(--danger); }
.service-switch:hover .service-name { color: var(--brand); }
.service-row.is-out .service-switch:hover .service-name { color: var(--ink-muted); }
.service-all { display: flex; justify-content: flex-end; margin: 4px 0 16px; }
@media (max-width: 640px) {
  .service-all .btn { width: 100%; justify-content: center; }
}

/* --- Every price at once -----------------------------------------------------
   `menus/prices.html`: the change asked for, then each new price beside the
   old one, which is struck through so the column to read is the new one. */
.price-note { margin: 0 0 14px; font-size: 0.9rem; }
.price-dish { font-weight: 600; }
.price-heading { font-size: 0.8rem; color: var(--ink-muted); }
table.data .price-old { font-weight: 400; color: var(--ink-faint); text-decoration: line-through; }
.price-none { margin: 0; }
.price-refused {
  display: flex; align-items: flex-start; gap: 8px; margin: 0;
  padding: 12px 18px; border-top: 1px solid var(--warn-line);
  background: var(--warn-bg); color: var(--warn); font-size: 0.9rem;
}
.price-refused .icon { flex: none; margin-top: 0.15em; }
/* The first and last columns on the card's own 18px, so the dish names line
   up under the heading and the new prices end where the Save button does. */
.price-table th:first-child, .price-table td:first-child { padding-left: 18px; }
.price-table th:last-child, .price-table td:last-child { padding-right: 18px; }
/* The rounding pills share the row and stretch to one height: "No rounding"
   wraps onto two lines on a phone in all three languages, and beside three
   one-line amounts it looked like a pill that had broken. Only here - the
   change's two halves stay equal. */
.price-rounding .choice-options { align-items: stretch; }
.price-rounding .choice-options .lang-option { flex: 1 1 auto; text-align: center; }
/* Where the editor opens once they are written, clear of the sticky bar. */
#menu-content { scroll-margin-top: calc(var(--sticky-top) + 12px); }
/* Its head carries two buttons as well as the heading and the "?", which at
   360px broke "The menu" over two lines. The buttons go under it instead,
   at the right; at 390px and up all of it still fits on one row. The percent
   is a square twin to Service mode beside it, which is 32px tall on a desktop;
   on a phone the 38px minimum every icon button takes applies. */
#menu-content > .card-head { flex-wrap: wrap; row-gap: 10px; }
#menu-content > .card-head h2 { white-space: nowrap; }
#menu-content > .card-head .card-head-end { margin-left: auto; }
#menu-content .card-head-end .btn-icon { width: 32px; height: 32px; }

/* --- Dishes from a file ------------------------------------------------------
   `menus/import.html`: each column with what goes in it, then every row under
   the tab and heading it would go into, as the editor's tree names them. The
   rest is the upload form (`.batch-*`) and the price list (`.price-*`). */
.import-columns {
  display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px;
  align-items: baseline; margin: 12px 0 0; font-size: 0.86rem;
}
.import-columns dt, .import-columns dd { margin: 0; }
.import-columns dd { color: var(--ink-muted); }
@media (max-width: 480px) {
  .import-columns { grid-template-columns: 1fr; gap: 2px; }
  .import-columns dd { margin-bottom: 8px; }
}
/* The venue's own spelling, not the table head's capitals. */
.import-rows .import-place th {
  padding-top: 14px; background: var(--canvas);
  font-size: 0.82rem; font-weight: 650; text-align: left; color: var(--ink);
  text-transform: none; letter-spacing: normal;
}
.import-rows td { vertical-align: top; }
.import-rows .import-place .badge { vertical-align: 1px; margin-left: 2px; padding: 1px 7px; }
.import-place-sep { margin: 0 6px; color: var(--ink-faint); }
.import-description { margin-top: 2px; font-size: 0.8rem; color: var(--ink-muted); }
.import-rows tr.is-known td { color: var(--ink-faint); }
.import-known { font-size: 0.82rem; color: var(--ink-muted); }
.import-ready { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.import-ready .badge { white-space: nowrap; }
/* Four columns do not fit a phone: 9px over at 390 and 39px at 360, with the
   check cut off in a table that scrolled with nothing to say so. The check
   goes under the dish instead, across the name and price. */
@media (max-width: 480px) {
  .import-rows thead { display: none; }
  .import-rows, .import-rows tbody, .import-rows .import-place, .import-rows .import-place th { display: block; }
  .import-rows tr:not(.import-place) {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    border-bottom: 1px solid var(--line-soft);
  }
  .import-rows tbody tr:last-child { border-bottom: none; }
  .import-rows tr:not(.import-place) td { padding: 10px 8px; border-bottom: none; }
  /* Down both rows: a refused row's wash is on its cells, and a number cell
     one row tall left the space under it white beside the pink. */
  .import-rows tr:not(.import-place) td:first-child { grid-row: span 2; padding-left: 14px; }
  .import-rows tr:not(.import-place) td:nth-child(3) { padding-right: 14px; }
  .import-rows tr:not(.import-place) td:last-child { grid-column: 2 / -1; padding: 0 14px 10px 8px; }
}
/* --- A whole menu from a file ------------------------------------------------
   `menus/menu_file.html`: what goes first, then what is added and changed,
   each under the kind of row it is, as `.import-rows` heads its tabs. Two
   columns, which a phone keeps side by side. */
.file-review-note { margin: 0; padding: 12px 16px 4px; }
.file-review-title { display: flex; align-items: center; gap: 8px; }
.file-rows .import-place th {
  padding-top: 14px; background: var(--canvas);
  font-size: 0.82rem; font-weight: 650; text-align: left; color: var(--ink);
  text-transform: none; letter-spacing: normal;
}
.file-rows .import-place .badge { vertical-align: 1px; margin-left: 2px; padding: 1px 7px; }
.file-rows td { vertical-align: top; }
.file-rows tr.is-removed .price-dish { text-decoration: line-through; text-decoration-color: var(--ink-faint); }
/* The editor's card for the same: download, read in, copy, and a draft's way live. */
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.file-actions form { display: contents; }
.go-live { margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line-soft); }
.go-live .file-actions { margin-top: 8px; }
.tree-import { margin: 12px 0 0; font-size: 0.85rem; }
/* The icon on the first line when the words wrap, not between two. */
.tree-import a, .file-sample { display: inline-flex; align-items: flex-start; gap: 6px; }
.tree-import .icon, .file-sample .icon { flex: none; margin-top: 0.2em; }

/* --- A menu's own badges ------------------------------------------------------
   The chip as a guest sees it - filled with the venue's colour, lettered in
   white or near-black by `MenuBadge.ink` - wherever the editor shows one: the
   list in its card, the picker on a dish's page. Not `.badge`, which is the
   product's own status pill. */
.badge-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px 2px 8px; border-radius: 999px;
  background: var(--badge); color: var(--badge-ink, #fff);
  font-size: 0.78rem; font-weight: 700; line-height: 1.5; white-space: nowrap;
  /* An edge for a colour close to the card's own - pale yellow on white, navy
     in dark mode. */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent);
}
.badge-chip .icon { width: 13px; height: 13px; color: currentColor; }
.badge-row { display: inline-flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
/* On a dish's page the chip sits inside the pick, so the pick needs no fill of
   its own when ticked - the chip already has one. */
.badge-pick { padding: 3px 4px 3px 8px; }
.badge-pick:has(input:checked) { background: var(--pick-bg); }
/* The add bar: the name, the colour as a swatch the height of the bar, the
   button. The icons go under it as a row of their own. */
.badge-add .badge-swatch {
  flex: none; width: 44px; height: auto; padding: 4px; cursor: pointer;
  background: transparent; border: none; border-left: 1px solid var(--line) !important;
}
.badge-add .tree-add > input[type="text"] { flex: 1 1 auto; min-width: 0; }
/* The icon picker: the glyphs themselves, each a radio. One row always - the
   cells give up a few pixels each on a phone rather than leave the last icon
   alone on a second line. The ticked one is tinted with the brand: the other
   pickers in the product mark the choice with white on a grey track, and this
   one has no track, so white would be the same as not ticked. */
.badge-icons {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 34px);
  gap: 4px; justify-content: start; margin: 8px 0 0;
}
.badge-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-muted);
  cursor: pointer;
}
.badge-icon input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.badge-icon .icon { width: 16px; height: 16px; }
.badge-icon:hover { border-color: var(--line-strong); color: var(--ink); }
.badge-icon:has(input:checked) {
  background: color-mix(in srgb, var(--brand) 12%, var(--pick-bg)); color: var(--pick-ink);
  border-color: var(--pick-edge); box-shadow: inset 0 0 0 1px var(--pick-edge);
}
.badge-icon:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
/* "No icon": a slashed ring, the usual sign for nothing. */
.badge-icon-none {
  width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor;
  background: linear-gradient(135deg, transparent 45%, currentColor 45% 55%, transparent 55%);
}
/* A tab's glyph, in front of its name in the rename row: a neutral box with
   the glyph the guests see, which opens the choice - see `_tab_icons.html`.
   The choice is a row of its own under the name and Save, in the flow, not a
   panel over the page: the tab's block is `overflow: hidden` for its corners,
   and a new tab is too short to hold one. The `<details>` holds only the
   button; the choice is its sibling, shown while it is open. */
.glyph-pick { flex: none; }
.glyph-pick > summary { list-style: none; cursor: pointer; }
.glyph-pick > summary::-webkit-details-marker { display: none; }
.glyph-pick > summary::marker { content: ""; }
.tree-rename .glyph-pick > summary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.tree-rename .glyph-pick > summary:hover,
.tree-rename .glyph-pick[open] > summary {
  border-color: var(--pick-edge); background: var(--brand-tint); color: var(--brand);
}
.tree-rename:has(> .glyph-pick) { flex-wrap: wrap; }
.glyph-panel { display: none; flex: 1 1 100%; min-width: 0; }
.glyph-pick[open] ~ .glyph-panel { display: block; }
/* The open choice makes the form tall; the move and delete buttons stay level
   with the name rather than drop to its middle. */
.tree-tools:has(.glyph-pick[open]) { align-items: flex-start; }
.glyph-groups {
  display: grid; gap: 8px; margin-top: 2px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.glyph-group-name {
  display: block; margin-bottom: 4px;
  font-size: 0.7rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-faint);
}
.glyph-row { display: flex; flex-wrap: wrap; gap: 4px; }
.glyph-row .badge-icon { width: 34px; }

/* A dish's badges in the tree, as dots in their colours - see edit.html. */
.tree-badges { display: inline-flex; flex: none; gap: 3px; }
.tree-badge {
  width: 9px; height: 9px; border-radius: 50%; background: var(--badge);
  box-shadow: 0 0 0 1px rgb(var(--shadow-rgb) / 0.15);
}
/* The end of a card's head: a status pill before the caret. */
.card-head-end { display: inline-flex; align-items: center; gap: 10px; flex: none; }
/* The "?" after a card's or a band's heading in the menu editor, to the part
   of the menu guide about it - see `menus/_guide_help.html`. Its auto margin
   takes the room after the heading, so the pill and the caret stay at the
   end. It reaches further than it is drawn, for a thumb, but not as far as
   the heading: a tap on the words still opens the card. */
.guide-help {
  position: relative; display: inline-flex; flex: none; margin-right: auto;
  color: var(--ink-faint); transition: color 0.15s ease;
}
.guide-help .icon { width: 16px; height: 16px; }
.guide-help::after { content: ""; position: absolute; inset: -10px -8px; }
.group-title .guide-help { color: var(--brand); }
.guide-help:hover, .guide-help:focus-visible { color: var(--brand-dark); }
/* Level with Back, as in the editor's head, not with the top of it. */
.page-actions:has(> .guide-help-button) { align-items: center; }
/* The tint above would outweigh `.btn-icon:hover` and leave it dead. */
.page-actions .guide-help-button:hover,
#menu-content .card-head-end .btn-icon:hover {
  background: var(--brand-light);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line-strong));
}

/* An input group: the fields run together and the button is attached at the
   right-hand end of them, so the row reads as one control. Enter submits it,
   because it is a form with a single submit button - the button is there for
   the people who reach for a button. */
.tree-add {
  display: flex; align-items: stretch; margin: 8px 0 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden;
}
.tree-add > input, .tree-add > select { border: none !important; border-radius: 0 !important; }
.tree-add > input + input, .tree-add > select + input { border-left: 1px solid var(--line) !important; }
/* The end of an add bar is where the row is actually created, and it was the
   same white as the three inputs leading up to it - a strip of boxes with the
   word "Add" at the end of it. Tinted, the bar reads as what it is: type into
   the fields, press the coloured end. */
.tree-add > .btn {
  border-radius: 0; border: none; border-left: 1px solid var(--line);
  white-space: nowrap;
  background: var(--brand-tint); color: var(--brand); font-weight: 600;
  /* The inputs give way, not the button: shrunk, its label slid under the
     icon panel and off its own right edge. */
  flex: none;
  /* The same wash whatever the button was before it came here - the add-a-tab
     bar's is a `.btn-primary`, and kept the primary's ink panel, a grey square
     on a pale blue button. */
  --btn-panel: color-mix(in srgb, var(--brand) var(--panel-mix), transparent);
}
.tree-add > .btn:hover { background: var(--brand-light); }
.tree-add > .btn .icon { color: currentColor; }
.tree-add input, .tree-add select {
  padding: 6px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 0.88rem;
}
.tree-add input[type="text"] { flex: 1 1 140px; min-width: 0; }
.tree-add input[type="number"] { width: 110px; }

/* A date field inside the group. `datepicker.js` wraps its input in a
   positioning div, and that wrapper - not the input - becomes the flex child,
   which breaks the group two ways and broke the events row both of them:

   - the `> input` rules above stop matching, so the field kept its own border
     and rounded corners and sat inside the group as a second box;
   - the calendar is drawn *under* the field, and `overflow: hidden` - which is
     what rounds the group's ends - cut all of it off. The picker opened on
     every click and was never visible, which reads as a control that does
     nothing.

   So the wrapper takes over the flex sizing and the seam. Lifting the clip is
   the other half, and it is the same rule the network dropdown already needed
   - see `.tree-add:has(.net-picker)` further down, where both are written
   once. */
.tree-add > .datepicker-wrap { display: flex; flex: 1 1 150px; min-width: 0; }
.tree-add > .datepicker-wrap > input {
  flex: 1 1 auto; min-width: 0; padding-right: 34px;
  border: none !important; border-radius: 0 !important;
}
.tree-add > input + .datepicker-wrap > input,
.tree-add > select + .datepicker-wrap > input { border-left: 1px solid var(--line) !important; }
.tree-add > .datepicker-wrap + input, .tree-add > .datepicker-wrap + select {
  border-left: 1px solid var(--line) !important;
}
.tree-add-section { margin-top: 4px; }

/* The five looks, drawn in their own colours: a swatch of the page it makes. */
/* Twenty looks. As a wrapping grid they were a wall six rows deep that pushed
   every other setting on the card off the screen, so they are two fixed rows
   that scroll sideways instead - the shape a picker of many similar things
   wants, and the one that keeps the card the same height whatever the count.

   `grid-auto-flow: column` fills down then across, so reading order matches the
   order in `styles.TEMPLATES`. The columns are a fixed width rather than a
   fraction: `1fr` in a scrolling track resolves against the *visible* width and
   would squeeze all twenty into it. */
.menu-templates {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: 92px;
  gap: 12px 10px;
  margin-bottom: 14px;
  overflow-x: auto;
  /* Room for the focus ring and the selected preset's outline, which would
     otherwise be clipped by the scroll container on the first and last column. */
  padding: 3px 3px 10px;
  /* The same 3px for the snap: without it the first tile snaps to the very
     edge, which scrolls that room away - and a row that overflows sat 3px left
     of one that does not. */
  scroll-padding-inline: 3px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}
.menu-template { scroll-snap-align: start; }

/* A thin track rather than the platform's default, which on a desktop is a
   16px bar across a card that is only 190px tall. */
.menu-templates::-webkit-scrollbar { height: 8px; }
.menu-templates::-webkit-scrollbar-track { background: var(--canvas); border-radius: 999px; }
.menu-templates::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 999px;
}
.menu-templates::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
/* Firefox, which takes no pseudo-elements for this. */
.menu-templates { scrollbar-width: thin; scrollbar-color: var(--line-strong) var(--canvas); }
/* Each preset is a submit button now, not a label with a radio in it: the
   choice saves itself, so there is nothing for a radio to hold. */
.menu-template {
  display: block; position: relative; text-align: center; cursor: pointer;
  padding: 0; border: none; background: none; font: inherit; color: inherit;
}
.menu-presets { padding-bottom: 4px; }
/* A heading inside a card, for a card that answers two questions. Small and in
   the label's own colour, so it separates without competing with the card's
   own title above it. */
/* --- Row state ---------------------------------------------------------------

   A table row is coloured by what the row *is*, not by where it landed in the
   list. The wash goes under the band rather than over it - `--row-band` is
   translucent and laid over the row as an image for exactly this reason - so a
   published menu reads as published on the odd rows and on the even ones alike.

   Strengths come from the `--tint-*` ladder in the tokens, so the dark theme
   lifts every one of them together: the same percentage of a hue reads far
   weaker against a dark ground.

   Three states here, and only two of them take a hue. A draft is the ordinary
   case and takes none - if every row is coloured, nothing is - and the ladder
   is kept shallow because these tables are read as lists of names, not as a
   picture. The badge in the status column is what *says* the state; the wash
   only makes the rows findable without reading it. */
table.data tbody tr.is-published { background-color: color-mix(in srgb, var(--ok) var(--tint-1), transparent); }
table.data tbody tr.is-published:hover {
  background-color: color-mix(in srgb, var(--ok) var(--tint-1-hover), transparent);
}

/* A menu the tier no longer carries: still listed, plainly inactive.

   This was `opacity: 0.6` on every cell, which is not a state, it is a way of
   making a row harder to read - and on a dark ground it takes the text with it,
   because there is no white underneath to fade towards. A quiet grey wash and
   faint ink say the same thing and stay legible in either theme. */
table.data tbody tr.is-parked { background-color: color-mix(in srgb, var(--ink) var(--tint-quiet), transparent); }
table.data tbody tr.is-parked:hover {
  background-color: color-mix(in srgb, var(--ink) var(--tint-quiet-hover), transparent);
}
table.data tbody tr.is-parked td { color: var(--ink-faint); }
table.data tbody tr.is-parked td .strong { color: var(--ink-muted); font-weight: 600; }

/* A band across the whole card, not a line of small grey text.

   The settings card asks four separate questions - what the place is called,
   what its menu looks like, how to reach it, what it charges in - and as four
   faint captions between forty inputs, none of them registered: the card read
   as one long column of fields. Full-bleed, so the band is the width of the
   card and the eye reads it as a divider rather than as another label.

   The negative inline margin is the card body's own padding, given back as
   padding on the band. Any change to `.card-body` has to be made here too;
   there is no way to say "ignore my parent's padding" in CSS. */
/* The band is a `<summary>` in the menu editor and an `<h3>` everywhere else,
   and both want the same look - so the rules stay on the class and only the
   handful that are about *clicking* are scoped to the element below. */
.group-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 22px -18px 14px;
  padding: 9px 18px;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--brand);
  /* Left to right, strong to nothing. A flat fill reads as a table header and
     would compete with the card's own head above it; a gradient that runs out
     reads as a rule with a label on it. */
  background: linear-gradient(
    90deg,
    var(--brand-light) 0%,
    var(--brand-tint) 42%,
    transparent 100%
  );
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  /* The mark at the start of the band, in the brand proper - the one saturated
     thing on it, so the row has somewhere to begin. */
  box-shadow: inset 3px 0 0 var(--brand);
}
/* The first band sits flush against the top of the body it opens, so it needs
   no rule above it and no gap - see `.pt-0`, which is on that body. */
.card-body > .group-title:first-child { margin-top: 0; border-top: none; }
/* A `<details>` wrapping the band takes the margin the band used to carry, or
   the negative inline margin would be measured against the wrapper and the band
   would stop short of the card's edge. */
.group { margin: 22px 0 14px; }
.group > .group-title {
  margin: 0 -18px 14px; cursor: pointer; list-style: none;
  transition: filter 0.15s ease;
}
.group > .group-title::-webkit-details-marker { display: none; }
.group > .group-title:hover { filter: brightness(0.97); }
.group > .group-title:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
/* Closed, the band has nothing under it, so the space below it is the space
   between it and the next band rather than a gap over an empty panel. */
.group:not([open]) > .group-title { margin-bottom: 0; }
.group-caret {
  flex: none; width: 13px; height: 13px; color: var(--brand);
  transition: transform 0.18s ease;
}
.group[open] > .group-title .group-caret { transform: rotate(180deg); }
/* The menu's starter names still in another language, each beside what it
   becomes, over the button that renames them - see `menus/edit.html`. */
.starter-leftovers {
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.starter-leftovers > .field-help { margin: 0 0 8px; }
.starter-leftovers-list {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin: 0 0 12px; padding: 0; list-style: none; font-size: 0.86rem;
}
.starter-leftovers-list li { display: inline-flex; align-items: center; gap: 6px; }
.starter-leftovers-list li > span:first-child { color: var(--ink-muted); }
.starter-leftovers-list .icon { width: 12px; height: 12px; color: var(--ink-muted); }
/* Each other language the menu is offered in, how much of it is typed, and
   the ways to type the rest and to see it - see `menus/edit.html`. */
.menu-translations { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.menu-translations li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 8px 10px 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.menu-translations-name { font-weight: 600; }
.menu-translations-count {
  margin-right: auto; color: var(--ink-muted); font-size: 0.86rem; font-variant-numeric: tabular-nums;
}
.menu-translations-count.is-done { color: var(--ok); font-weight: 600; }
/* The translate page: the menu's own words beside the box for the other
   language, stacked on a phone - see `menus/translate.html`. */
.translate-group {
  margin: 20px 0 4px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.95rem;
}
.translate-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.translate-row {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px 16px;
  align-items: start; padding: 8px 0;
}
.translate-original {
  display: flex; flex-direction: column; gap: 1px; padding-top: 2px;
  font-size: 0.92rem; white-space: pre-line; overflow-wrap: anywhere;
}
.translate-label { color: var(--ink-muted); font-size: 0.76rem; font-weight: 600; }
.translate-row .field { margin: 0; }
@media (max-width: 640px) { .translate-row { grid-template-columns: minmax(0, 1fr); } }
.pt-0 { padding-top: 0 !important; }
.menu-swatch {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  height: 62px; padding: 8px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); overflow: hidden;
}
.menu-swatch-bar { height: 8px; width: 46%; border-radius: 999px; }
.menu-swatch-line { height: 5px; width: 100%; border-radius: 999px; opacity: 0.85; }
.menu-swatch-line.short { width: 62%; }
/* `:has` rather than a class from the server: the swatch has to answer the
   click, not the next page load. The server class stays for the first render. */
.menu-template.is-selected .menu-swatch,
.menu-template:has(input:checked) .menu-swatch { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.menu-template:focus-visible .menu-swatch { outline: 2px solid var(--brand); outline-offset: 2px; }
.menu-template:hover .menu-swatch { border-color: var(--brand); }
/* The radio was `pointer-events: none` and off in the corner of the page; kept
   inside its own label, so the whole tile is the target. */
.menu-template input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.menu-template-name { display: block; font-size: 0.76rem; color: var(--ink-muted); margin-top: 5px; }
/* A radio inside a tile is focused, not the tile - the kits on the create page. */
.menu-template:has(input:focus-visible) .menu-swatch { outline: 2px solid var(--brand); outline-offset: 2px; }

/* --- The rest of a menu's look -----------------------------------------------
   Three more pickers under the presets - typeface, layout, texture - built on
   the presets' own tiles: the same button, swatch box and selected ring. Each
   is drawn in the menu's colours, handed down from the form as `--sw-*`, so a
   tile is a small piece of this menu rather than of the editor. */
.menu-picker-label {
  margin: 2px 0 8px; font-size: 0.78rem; font-weight: 600; color: var(--ink-muted);
}
/* Four layouts and six textures: one row, not the presets' two. */
.menu-templates-row { grid-template-rows: auto; }
.menu-face, .menu-sketch, .menu-grain { background: var(--sw-surface); color: var(--sw-ink); }

/* The face set in itself: the heading face large in the accent, the body face
   under it on a price, which is the body text a guest reads most. */
.menu-face { justify-content: center; align-items: center; gap: 3px; }
.menu-face-head { font-size: 1.45rem; line-height: 1; color: var(--sw-accent); }
.menu-face-body { font-size: 0.72rem; line-height: 1; color: var(--sw-muted); }

/* The layout as a sketch of the page, out of six bare <i>s - each layout uses
   the ones it needs and hides the rest. */
.menu-sketch { justify-content: center; gap: 4px; }
.menu-sketch i {
  display: block; height: 2px; border-radius: 999px;
  background: color-mix(in srgb, var(--sw-ink) 45%, transparent);
}
.menu-sketch[data-sketch="blocks"] i,
.menu-sketch[data-sketch="grid"] i {
  height: 10px; border-radius: 3px;
  background: color-mix(in srgb, var(--sw-ink) 6%, var(--sw-surface));
  border: 1px solid color-mix(in srgb, var(--sw-ink) 22%, transparent);
}
.menu-sketch[data-sketch="blocks"] i:first-child { border-color: var(--sw-accent); }
.menu-sketch[data-sketch="blocks"] i:nth-child(n+4) { display: none; }
.menu-sketch[data-sketch="classic"] i { width: 78%; align-self: center; }
.menu-sketch[data-sketch="classic"] i:nth-child(1) { width: 50%; height: 3px; background: var(--sw-accent); }
.menu-sketch[data-sketch="classic"] i:nth-child(2) { width: 22%; height: 1px; background: var(--sw-accent); margin-bottom: 2px; }
.menu-sketch[data-sketch="compact"] { gap: 3px; }
.menu-sketch[data-sketch="compact"] i:nth-child(1) { width: 46%; height: 3px; background: var(--sw-accent); }
.menu-sketch[data-sketch="compact"] i:nth-child(2) { height: 1px; background: var(--sw-accent); margin-bottom: 2px; }
.menu-sketch[data-sketch="grid"] {
  display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 4px;
}
.menu-sketch[data-sketch="grid"] i { height: 19px; }
.menu-sketch[data-sketch="grid"] i:nth-child(n+5) { display: none; }

/* The texture over a sketch of the page. The same masks as `menu.css`, at
   about five times the strength: the real one is never more than 6% of the
   ink, which on a 92px tile is nothing at all. */
.menu-grain { position: relative; isolation: isolate; }
.menu-grain .menu-swatch-bar { background: var(--sw-accent); }
.menu-grain .menu-swatch-line { background: var(--sw-ink); }
.menu-grain .menu-swatch-line.short { background: var(--sw-muted); }
.menu-grain::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--sw-ink); opacity: 0.3;
}
.menu-grain[data-grain="none"]::before { content: none; }
.menu-grain[data-grain="paper"]::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.2 0 0 0 -.75'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 220px 220px repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.2 0 0 0 -.75'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 220px 220px repeat;
}
.menu-grain[data-grain="chalk"]::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006 .03' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.6 0 0 0 -1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 480px 480px repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006 .03' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.6 0 0 0 -1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 480px 480px repeat;
}
.menu-grain[data-grain="linen"]::before {
  -webkit-mask:
    repeating-linear-gradient(0deg, #000 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgb(0 0 0 / 0.6) 0 1px, transparent 1px 3px);
  mask:
    repeating-linear-gradient(0deg, #000 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgb(0 0 0 / 0.6) 0 1px, transparent 1px 3px);
}
.menu-grain[data-grain="dots"]::before {
  -webkit-mask: radial-gradient(circle, #000 0 1.3px, transparent 1.8px) 0 0 / 14px 14px repeat;
  mask: radial-gradient(circle, #000 0 1.3px, transparent 1.8px) 0 0 / 14px 14px repeat;
}
.menu-grain[data-grain="stripes"]::before {
  -webkit-mask: repeating-linear-gradient(135deg, #000 0 2px, transparent 2px 12px);
  mask: repeating-linear-gradient(135deg, #000 0 2px, transparent 2px 12px);
}

/* The cover on the settings card: the band itself, wider than a dish's square,
   with its buttons under it where a phone has no room beside it. */
.cover-field .shot-current { flex-wrap: wrap; }
.cover-field .shot-current img { width: 180px; height: 72px; }
/* The portrait in the circle the menu shows it in. */
.portrait-field .shot-current img { border-radius: 50%; }

/* The kits on the create page: a grid rather than the presets' scrolling rows,
   because eight is few enough to see at once and the choice is the page's
   main question after the name. Each is the kit's name in its own heading face
   on its own colours. */
.menu-kits {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px; padding: 3px;
}
.menu-kit .menu-swatch { height: 76px; justify-content: center; }
.menu-kit-name {
  margin-bottom: 4px; font-size: 1.05rem; line-height: 1.15;
  text-align: left; overflow-wrap: anywhere;
}

/* A menu's header: name, address, whether it is live, and every action, on one
   line. Two blocks - a heading with buttons, then a card with the switch and
   more buttons - was two rows of chrome above a page whose subject is the menu
   underneath. It wraps rather than shrinking, so a narrow window gets two tidy
   rows instead of a cramped one. */
.menu-head { align-items: center; gap: 14px; flex-wrap: wrap; }
.menu-head-title { flex: 1 1 240px; min-width: 0; }
.menu-head-title h1 { margin: 0; }
.menu-head-url {
  display: inline-block; margin-top: 2px; font-size: 0.85rem;
  color: var(--ink-muted); word-break: break-all;
}
.menu-head-url:hover { color: var(--brand); }
.menu-head .page-actions { align-items: center; }
.menu-head .page-actions form { margin: 0; }

/* A switch that is a submit button: one bit, saved the instant it is flipped,
   with no checkbox and no Save beside it. The button carries the state, so it
   works with no JavaScript - which a checkbox that saves on change would not. */
.switch-form { margin: 0; }
.switch {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px; border: none; background: none; cursor: pointer;
  font: inherit; color: var(--ink-muted);
}
/* Held back - a menu cannot go live until the account's address is proven. */
.switch[disabled] { cursor: not-allowed; opacity: 0.55; }
.switch-track {
  position: relative; display: block; width: 46px; height: 26px;
  border-radius: 999px; background: var(--line-strong);
  transition: background 0.18s ease;
}
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--knob);
  box-shadow: 0 1px 3px rgb(var(--shadow-rgb) / 0.3);
  transition: transform 0.18s ease;
}
.switch-label { font-size: 0.85rem; font-weight: 650; }
.switch.is-on .switch-track { background: var(--ok); }
.switch.is-on .switch-knob { transform: translateX(20px); }
.switch.is-on .switch-label { color: var(--ok); }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 999px; }

/* The four colours of a menu, on one line: they are one palette. */
/* Two across, not four. Four columns leave each field 114px, and twelve quick
   picks need 213px at a size anybody can hit - so four columns means either a
   scroller or dots too small to aim at. Two columns give each palette its own
   line at full size, and the four boxes still read as one row of a palette
   rather than as four separate questions. */
.colour-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.colour-row .field { margin-bottom: 10px; }
/* Four colour boxes side by side leave a quarter of the width each, and the
   twelve quick picks under one of them do not fit at the size they are in a
   full-width field. They are shrunk to fit rather than made to scroll: a
   shortcut somebody has to drag sideways is not a shortcut, and all twelve have
   to be one click away. */
.colour-row .colour-dots { flex-wrap: nowrap; gap: 3px; }
.colour-row .colour-dot { flex: none; width: 16px; height: 16px; }
@media (max-width: 640px) { .colour-row { grid-template-columns: minmax(0, 1fr); } }

.rate-list { list-style: none; margin: 0 0 10px; padding: 0; }
.rate-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.rate-list form { margin: 0; }
/* A long line of text - a closed day's note - gives way and wraps; the
   buttons keep their width. They shrank under it, and the frame's
   `overflow: hidden` cut the delete button in half. */
.rate-list li > :first-child { min-width: 0; }
.rate-list .rate-actions { flex: none; }
/* A card's footer: the row a form's own button sits in. It had no rules at all,
   so the button sat flush against the card's right and bottom edges. */
.card-foot {
  padding: 14px 18px; border-top: 1px solid var(--line);
  background: var(--canvas); border-radius: 0 0 var(--radius) var(--radius);
}
/* The gap is for two buttons side by side - "Take it down" and "Save" under a
   notice were drawn touching. */
.card-foot-end { display: flex; justify-content: flex-end; gap: 8px; }
/* Back at one end, the next step at the other - the checkout and an order. */
.card-foot-split { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-foot-split form { margin: 0; }
.rate-actions { display: flex; align-items: center; gap: 6px; }
/* Where to find today's rate: a dropdown and a link into a search, in a row. */
.rate-lookup { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rate-lookup label { font-size: 0.8rem; color: var(--ink-muted); }
.rate-lookup select {
  padding: 6px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 0.88rem;
}
.rate-actions form { margin: 0; }

/* A date and time is not a headline number; it keeps the tile's shape without
   pretending to be a count. */
.stat-value.tiny-value { font-size: 1.05rem; }

/* --- Pager -------------------------------------------------------------------
   Under every list, and the same one under each: the size control on the left,
   what is on screen in the middle, the way through the pages on the right. It
   sits inside the card's own padding rather than under it, so the table and its
   controls read as one object. */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px 16px;
  padding: 12px 16px; border-top: 1px solid var(--line);
  font-size: 0.85rem; color: var(--ink-muted);
}
.pager-size { display: flex; align-items: center; gap: 10px; }
.pager-size-label { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); }
/* A segmented control: one track, four numbers, the current one raised out of
   it. The set is small and fixed, so showing all of it costs a few pixels and
   saves opening anything - and the raised tile is the state, which a select
   only shows once it is closed again. */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--pick-track); border: 1px solid var(--line); border-radius: 999px;
}
.segmented-option {
  min-width: 34px; padding: 4px 10px; border-radius: 999px;
  color: var(--ink-muted); font-size: 0.82rem; font-weight: 600;
  font-variant-numeric: tabular-nums; text-align: center; text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.segmented-option:hover { background: var(--pick-hover); color: var(--ink); text-decoration: none; }
.segmented-option.is-active,
.segmented-option:has(> input:checked) {
  background: var(--pick-bg); color: var(--pick-ink); font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--pick-edge), 0 1px 2px rgb(var(--shadow-rgb) / 0.16);
}
.segmented-option:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pager-range { font-variant-numeric: tabular-nums; }
.pager-links { display: flex; align-items: center; gap: 4px; }
/* Round, because they are one glyph each and a rounded rectangle round a single
   chevron reads as a button with something missing from it. */
.pager-links .btn-icon {
  width: 30px; height: 30px; padding: 0; border-radius: 50%;
}
.pager-page {
  padding: 0 10px; font-size: 0.85rem; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* The ends of the list keep their buttons in place rather than removing them,
   so the row does not shuffle sideways as somebody pages through it. */
.pager-links .is-disabled { opacity: 0.35; pointer-events: none; }

/* --- Toasts ----------------------------------------------------------------- */
/* In the flow, directly under the page's navigation - not fixed to a corner of
   the window. Three arrangements were tried: the top right corner is beside
   whatever somebody was looking at rather than in front of it, and on a wide
   screen it is the better part of a metre from the button that produced it;
   floated over the content it covered the first thing they were about to read.
   Taking up room pushes the page down instead, which is what makes a message
   impossible to miss and impossible to be in the way of.

   Each page includes the block itself, under its own header - see
   core/messages.html and the note in core/base.html. */
/* A public page's content is centred under a 1120px cap with 24px of padding,
   and this matches it, so a message shares the cards' own edges. */
.toasts {
  display: grid; gap: 8px;
  width: 100%; max-width: 1120px; margin: 16px auto 0; padding: 0 24px;
}
/* In the signed-in shell the content column is capped at 1200 and left aligned
   under it, with the same padding. */
.shell .toasts { max-width: 1200px; margin: 16px 0 0; }
/* The auth pages are a single narrow column that already has its own padding. */
.auth-shell .toasts { max-width: none; margin: 0 0 16px; padding: 0; }
/* The wash carries the same colour as the border and the glyph, fading out
   before it reaches the words - so the toast is tinted by its state without any
   text ever sitting on colour. */
.toast {
  display: flex; align-items: center; gap: 12px;
  /* The whole strip dismisses it, so it has to look like something to click. */
  cursor: pointer;
  border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); padding: 11px 14px;
  box-shadow: 0 4px 14px rgb(var(--shadow-rgb) / 0.1);
  /* Colour underneath, wash on top of it - two properties rather than one
     gradient ending in `--surface`. The wash is translucent at its coloured
     end, and now that these sit over the page rather than in an empty corner,
     that let the heading underneath show through the left of the toast. */
  background-color: var(--surface);
  background-image: linear-gradient(90deg, var(--brand-light), transparent 52%);
}
.toast-success { border-left-color: var(--ok); background-image: linear-gradient(90deg, var(--ok-bg), transparent 52%); }
.toast-warning { border-left-color: var(--warn); background-image: linear-gradient(90deg, var(--warn-bg), transparent 52%); }
.toast-error { border-left-color: var(--danger); background-image: linear-gradient(90deg, var(--danger-bg), transparent 52%); }
.toast-close {
  display: inline-flex; border: none; background: none; padding: 2px;
  font-size: 0.8rem; cursor: pointer; color: var(--ink-faint);
}
.toast-close:hover { color: var(--ink); }
/* Leaving, rather than blinking out: 200ms, which is what `shell.js` waits for
   before it takes the element out of the page. */
.toast { transition: opacity 0.2s ease, transform 0.2s ease; }
.toast.is-leaving { opacity: 0; transform: translateY(-6px); }
/* The glyph repeats the border colour, which is the point - the border
   alone is the kind of signal a red-green colour blindness erases. */
.toast-icon { flex: none; font-size: 1.05rem; color: var(--brand); }
.toast-success .toast-icon { color: var(--ok); }
.toast-warning .toast-icon { color: var(--warn); }
.toast-error .toast-icon { color: var(--danger); }
.toast span { flex: 1; }
/* The signed-in shell says its messages in a bubble instead (below), and
   core/js/live.js takes the block out of the page. Until it has, the block takes
   no room, so the page does not jump up when it goes; the gaps between the
   messages let the clicks through. */
@media (scripting: enabled) {
  .shell .toasts {
    position: sticky; top: calc(var(--sticky-top, 0px) + 8px); z-index: 25;
    height: 0; margin-top: 0; margin-bottom: 0;
    pointer-events: none;
  }
  .shell .toasts .toast { pointer-events: auto; }
}

/* --- The bubble --------------------------------------------------------------
   What a save in the signed-in shell says, at the button that was pressed
   (core/js/live.js). A block under the header pushed the page down, and the
   pressed button with it, 62px out from under the pointer as it showed its
   tick - and pulled it back when the message closed itself. Lying over the
   page instead, the block covered the heading a screen away from the button,
   where nobody who had just pressed it was looking. The bubble is beside the
   button and over everything, in the top layer as a popover, so nothing on the
   page moves for it.

   The script places it, above the button or below it when the header is in the
   way, and points the arrow at it from `--arrow`. With nothing to point at it
   sits under the header with no arrow (`.is-free`), and while what it points at
   is scrolled out of sight it is hidden (`.is-away`). */
.bubble {
  /* A popover's own place and frame from the browser, put back to ours. The
     z-index is for a browser with no top layer: over the cookie notice. */
  position: fixed; inset: auto; left: 0; top: 0; z-index: 70;
  margin: 0; overflow: visible;
  display: flex; align-items: flex-start; gap: 10px;
  width: max-content; max-width: min(360px, calc(100vw - 16px));
  padding: 10px 12px;
  color: var(--ink); background: var(--bubble);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgb(var(--shadow-rgb) / 0.18), 0 2px 6px rgb(var(--shadow-rgb) / 0.08);
  font-size: 0.875rem; line-height: 1.4;
  /* All of it closes it, as a message block does. */
  cursor: pointer;
  /* Comes in from the side it points at. One animation for both sides: a new
     name when it flips would start it again, and it blinked as the page was
     scrolled across the point where it flips. */
  --rise: 4px;
  animation: bubble-in 0.18s ease-out;
  transition: opacity 0.2s ease;
}
/* A square turned on its corner, half inside the bubble so it covers the
   border where they meet. */
.bubble::after {
  content: ""; position: absolute; top: 100%; left: var(--arrow, 50%);
  width: 10px; height: 10px; margin: -5px 0 0 -5px;
  background: var(--bubble);
  border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.bubble.is-below { --rise: -4px; }
.bubble.is-below::after { top: auto; bottom: 100%; margin: 0 0 -5px -5px; transform: rotate(225deg); }
.bubble.is-free::after { display: none; }
.bubble.is-away { visibility: hidden; }
/* 200ms, which is what the script waits for before it takes it out. */
.bubble.is-leaving { opacity: 0; }
.bubble-lines { display: grid; gap: 6px; }
.bubble-line { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
/* The glyph says the state, as on a message block; the words never sit on
   colour. */
.bubble-icon { flex: none; font-size: 1rem; margin-top: 0.1em; color: var(--brand); }
.bubble-success .bubble-icon { color: var(--ok); }
.bubble-warning .bubble-icon { color: var(--warn); }
.bubble-error .bubble-icon { color: var(--danger); }
.bubble-close {
  display: inline-flex; flex: none; margin: 1px -4px 0 0;
  border: none; background: none; padding: 2px;
  font-size: 0.75rem; cursor: pointer; color: var(--ink-faint);
}
.bubble-close:hover { color: var(--ink); }
@keyframes bubble-in { from { opacity: 0; transform: translateY(var(--rise)); } }
@keyframes bubble-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bubble { animation-name: bubble-fade; }
}

/* --- Saving in place ---------------------------------------------------------
   The button a save went from (core/js/live.js): a ring while it is on its way,
   a tick when it is saved. Both are drawn in a mark laid over the button's face,
   which is hidden but keeps its width, so nothing beside the button moves.

   The ring waits a fifth of a second. Most saves are back before then, and show
   the tick alone rather than a flicker of both. */
[aria-busy="true"], .is-busy { cursor: progress; }
.btn > .live-mark {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
  color: var(--ink-muted);
}
.btn.is-done > .live-mark { color: var(--ok); }
.btn-primary > .live-mark, .btn-primary.is-done > .live-mark { color: var(--on-brand); }
/* The words are a bare text node, so they go with the colour; everything else
   on the face - the icon and its panel - goes with `visibility`. */
.btn.is-busy { animation: live-mute 0s 0.2s forwards; }
.btn.is-busy > :not(.live-mark) { animation: live-hide 0s 0.2s forwards; }
.btn.is-done { color: transparent; }
.btn.is-done > :not(.live-mark) { visibility: hidden; }
.btn.is-busy > .live-mark::before {
  content: ""; width: 1em; height: 1em; box-sizing: border-box;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  opacity: 0;
  animation: live-show 0s 0.2s forwards, live-spin 0.7s linear infinite;
}
.btn.is-done > .live-mark .icon { font-size: 1.1em; animation: live-pop 0.24s ease-out; }
@keyframes live-mute { to { color: transparent; } }
@keyframes live-hide { to { visibility: hidden; } }
@keyframes live-show { to { opacity: 1; } }
@keyframes live-spin { to { transform: rotate(360deg); } }
@keyframes live-pop { from { opacity: 0; transform: scale(0.6); } }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
/* Still a sign that something is going on, without the turning: the ring
   breathes instead, and the tick is simply there. */
@media (prefers-reduced-motion: reduce) {
  .btn.is-busy > .live-mark::before { animation: live-pulse 1.4s ease-in-out 0.2s infinite; }
  .btn.is-done > .live-mark .icon { animation: none; }
}

/* --- Narrow screens ---------------------------------------------------------
   Every multi-column grid collapses to one. minmax(0, 1fr) throughout, for the
   reason given at .grid-1: fixed columns cannot shrink, .table-wrap's
   overflow-x never engages, and the whole page scrolls sideways instead of the
   table. */
@media (max-width: 980px) {
  /* The rows sized too. The shell is at least a screen tall, and on a page
     shorter than that a grid shares the spare height between its rows - so the
     folded column below grew to 237px around a 62px logo, and an empty code
     list began under a blank band. */
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); }

  /* Stacked above the page, the column was a dozen links to scroll past before
     every page began. It folds behind three lines at the right of the logo's
     row, a checkbox and these rules (see core/base_app.html). The checkbox is
     off-screen rather than gone, so it keeps its place in the keyboard's order.
     The logo row's rule moves to the top of the open list: folded, it sat one
     pixel above the column's own and drew a double line. Gutters as the bar's
     below, so the button lines up with the account button under it. Stacked,
     the two no longer sit side by side, so neither keeps the shared height. */
  .sidebar-brand {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 0; padding: 12px 24px; border-bottom: none;
  }
  .topbar { min-height: 0; }
  /* The bar's own height once it no longer matches the logo's corner: its 38px
     row, the padding and the rule. What sticks under it starts there, not 8px
     lower with the page showing through the gap. */
  .shell { --sticky-top: 63px; }
  .sidebar-brand a { min-width: 0; }
  .sidebar-toggle-input {
    display: block; position: absolute; width: 1px; height: 1px; opacity: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .sidebar-toggle {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: 10px;
    background-color: var(--surface); color: var(--ink-muted); cursor: pointer;
    transition: background-color 0.12s ease;
  }
  .sidebar-toggle .icon { width: 20px; height: 20px; }
  /* Only where a pointer can hover: a finger leaves :hover behind on what it
     tapped, and the button would stay lit after closing the list. */
  @media (hover: hover) {
    .sidebar-toggle:hover { background-color: var(--brand-tint); }
  }
  .sidebar-toggle .sidebar-toggle-close { display: none; }
  .sidebar-toggle-input:focus-visible ~ .sidebar-brand .sidebar-toggle {
    outline: 2px solid var(--brand); outline-offset: 2px;
  }
  .sidebar-toggle-input:checked ~ .sidebar-brand .sidebar-toggle {
    background-color: var(--brand-tint); border-color: var(--brand-edge-strong); color: var(--brand);
  }
  .sidebar-toggle-input:checked ~ .sidebar-brand .sidebar-toggle-open { display: none; }
  .sidebar-toggle-input:checked ~ .sidebar-brand .sidebar-toggle-close { display: block; }
  .sidebar-nav { display: none; }
  .sidebar-toggle-input:checked ~ .sidebar-nav { display: block; border-top: 1px solid var(--line); }

  /* A page's heading and its buttons share a row only while both fit; past
     that the buttons go under the heading rather than past the edge. A staff
     code's "Back" and "Open in admin" pushed a phone 42px sideways, and while
     this stopped at 640 a code with a long title pushed a tablet 68px. A
     heading that is one long word, which a code's title often is (it is the
     URL), breaks rather than widening the page. The buttons end at the right
     on whichever line they land. An empty row is not drawn: a heading that
     fills its line wrapped it onto a line of its own, which opened the head's
     gap under the heading for nothing. */
  .page-head { flex-wrap: wrap; }
  .page-head > :first-child { min-width: 0; }
  .page-head h1 { overflow-wrap: anywhere; }
  .page-actions { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
  .page-actions:not(:has(> *)) { display: none; }

  /* A head marked `.page-head-label` is one whose words only name the page -
     "Dashboard", "API keys" - which the bar and the links above already say,
     and on a phone they stood between the bar and the page's one button. It
     keeps its buttons and drops the words: clipped rather than removed, so a
     screen reader still finds the page's h1. Only while there are buttons to
     keep, or the head would be a gap; and never on a head whose heading is a
     thing's own name, a menu's, which is why it is a class and not every
     head. */
  .page-head-label:has(> .page-actions > *) > :first-child {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  /* The buttons then have the row to themselves. One with words grows into the
     row; a lone glyph keeps its size, so icons stay a cluster at the end. A
     row only as wide as its buttons - beside a code's title on a tablet - has
     nothing to grow into, and there the second rule does nothing. */
  .page-head-label > .page-actions { flex: 1 1 100%; }
  .page-actions > .btn:not(.btn-icon) { flex: 1 1 auto; }

  .grid-2, .grid-4, .grid-stats { grid-template-columns: minmax(0, 1fr); }
  .grid-stats > .statistics-locked { grid-column: auto; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
}

/* --- On a phone --------------------------------------------------------------
   Three things that only go wrong at this width, all of them a row of controls
   that has more in it than fits. */
@media (max-width: 640px) {
  /* The tree's nesting is a third of a phone: a tab's padding, a heading's
     indent and its padding again took 153px of a 360px screen, and a dish
     row was left 207px for a name, a price and six 38px buttons. The
     heading's border still says what is inside what. */
  .tree-section > .tree-body { padding: 10px 8px; }
  .tree-category { margin-left: 0; }
  .tree-category > .tree-body { padding: 8px 8px 10px; }

  /* The shell's bar keeps its controls and drops its title. Title, three theme
     buttons, three languages and the account button come to about 380px, and a
     390px phone has 342 between the bar's gutters - so every signed-in page
     scrolled sideways by the difference, which the browser smoke tests caught
     on their first run. The title is the page's own heading said again, and the
     heading is right below it. 16px gutters, as on the public pages. */
  .topbar { padding-left: 16px; padding-right: 16px; }
  .sidebar-brand { padding-left: 16px; padding-right: 16px; }
  .topbar-title { display: none; }
  .topbar-actions { margin-left: auto; gap: 6px; }
  /* And to fit the search button beside them, even at 360px: the search keeps
     its glass and drops its word. The languages are already flags alone. */
  .palette-trigger { width: 32px; padding: 0; justify-content: center; }
  .palette-trigger-text { display: none; }

  /* Buttons that keep their words take a row of their own under the heading
     and fill it (the stretch is in "Narrow screens"). A crowded row, below,
     has dropped its words and is a cluster of glyphs: it stays beside whatever
     leaves it room - the menu editor's Published switch - rather than costing
     the head a line, which made that head 50px taller. */
  .page-actions:not(:has(> :nth-child(3))) { flex: 1 1 100%; }

  /* And a form's button fills its row, as the head's do, and the code page's
     PNG, SVG and PDF share theirs. */
  .form-actions > .btn { flex: 1 1 auto; }
  /* A split foot's own submit - Continue to payment, Turn on, Turn off - takes
     what its line leaves: the rest of the row beside a short Cancel, or all of
     it once it wraps under Back, where it sat at its own width at the left. */
  .card-foot-split > button[type="submit"] { flex: 1 1 auto; }
  .batch-upload > .btn, .batch-confirm > .btn, .api-key-form > .btn { width: 100%; }
  .download-row > .btn { flex: 1 1 0; }

  /* A crowded action row drops its words and keeps its icons. Only crowded
     ones: a page whose header holds a single "New menu" has room for the label,
     and a lone icon there would be a guess. Three or more controls is what does
     not fit, which is why this hangs off :has() rather than being blanket.
     The label stays in the markup - the button is still named for a screen
     reader, and `title` names it for a pointer. */
  .page-actions:has(> :nth-child(3)) .btn-text {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  /* And it keeps its size: a glyph stretched across a third of the row is not
     a button anyone reads as one. */
  .page-actions:has(> :nth-child(3)) .btn { flex: none; padding-left: 10px; padding-right: 10px; }
  /* With its word gone the button is a lone glyph, and a panel would be a
     tinted square beside nothing - so the icon goes back to being inline. */
  .page-actions:has(> :nth-child(3)) .btn .icon {
    position: static; width: 1em; height: 1em; padding: 0; margin: 0;
    background: none; color: inherit;
  }
  /* The menu editor's View button opens the address printed under the menu's
     name, in the same new tab, and Back is the sidebar's Menu editor. They are the
     two that row can spare. Five glyphs beside the Published switch did not
     fit on a 390px line, and four left German's "Veröffentlicht" 18px short at
     360px, so the buttons dropped to a row of their own whenever the menu was
     live. The guide's book goes too: it is also in the sidebar, under the
     three lines. So does the statistics' chart, the sidebar's Menu statistics. */
  .menu-head .menu-head-view,
  .menu-head .menu-head-back,
  .menu-head .menu-head-statistics,
  .menu-head .menu-head-guide { display: none; }
  /* The owner's Upgrade on a draft keeps its words, and wraps them rather than
     send Delete to a row of its own: German's "Zum Veröffentlichen upgraden"
     and the bin came to 318px on a 360px phone's 312px row. A flex row breaks
     by an item's widest size, not its narrowest, so the cap is the row less
     the bin and the gap before it. */
  .menu-head-upgrade { white-space: normal; text-align: left; max-width: calc(100% - 52px); }
  /* A draft's Go live is a form's button, and the form is the row's item: a
     cap measured against the form - only as wide as the button in it - squeezed
     "Go live" onto two lines. The cap goes on the form instead. */
  .menu-head form:has(> .menu-head-upgrade) { max-width: calc(100% - 52px); }
  .menu-head form > .menu-head-upgrade { max-width: none; }

  /* The add-a-row forms stack instead of sharing one line. Four controls across
     390px left the two text boxes about eight pixels wide each - present, and
     impossible to type in. The group keeps its single border; the children lose
     the vertical rules that only make sense side by side. */
  .tree-add, .tree-rename { flex-wrap: wrap; }
  .tree-add > input, .tree-add > select, .tree-add > .net-picker,
  .tree-rename > input {
    flex: 1 1 100%; min-width: 0;
    border-left: none !important;
    border-bottom: 1px solid var(--line) !important;
  }
  .tree-add > .btn { flex: 1 1 100%; border-left: none; }
  /* The rename form's Save is a lone icon; full width it sits marooned in the
     middle of a row of its own. It keeps its size and goes to the end. */
  .tree-rename > .btn { flex: 0 0 auto; margin-left: auto; border-left: none; }
  .tree-add > :last-child, .tree-rename > :last-child { border-bottom: none !important; }
  /* A tab's rename row has its glyph in front: the three stay on one line, as
     a heading's name and Save would not, and only the choice goes under them.
     The name keeps its whole edge there - it is a box between two buttons, not
     a line in a stack. */
  .tree-rename:has(> .glyph-pick) > input {
    flex: 1 1 0; border: 1px solid var(--line) !important;
  }

  /* A tap target is a finger, not a mouse pointer. The move, delete and edit
     buttons came out at 30px squares, the small buttons at 30px tall, and the
     colour swatches at 16px - all of them fine under a cursor and a guess under
     a thumb. */
  .btn-icon { min-width: 38px; min-height: 38px; }
  .btn-sm, .audit-filter select { min-height: 38px; }
  .lang-option { padding: 4px 5px; }
  .colour-dot { width: 24px; height: 24px; }
  /* The quick-pick row keeps all twelve on one line and shrinks them to 16px to
     do it - which is a cursor-sized target. On a phone each colour has the
     card's width to itself, so the row gets the bigger dots and wraps them:
     twelve 24px dots need 321px, and a 360px phone gives the field 274, which
     pushed the last of them past the card and the page sideways. */
  .colour-row .colour-dots { flex-wrap: wrap; }
  .colour-row .colour-dot { width: 24px; height: 24px; }
}

.landing-footer .brand-logo { height: 34px; }

/* --- Picking a network -------------------------------------------------------
   A dropdown that can carry a mark, which a native <select> cannot. The real
   <select> is still in the markup and is what submits; the script hides it and
   shows this instead, so the page works either way.

   Each mark is drawn in the network's own colour, pulled 30% toward the app's
   ink for the same reason the public menu does it: WhatsApp's green measures
   1.9:1 against a white card and is a logo you have to hunt for. */
/* The input group clips its children so its corners stay rounded, which also
   clips away anything that opens *below* the row - this dropdown to nothing,
   and the date calendar in the offers and events rows to nothing. Both are the
   same bug and take the same rule, so it is written once: a row carrying a
   popup stops clipping and rounds its two end children itself.

   `overflow-x: clip` is not a shortcut past this. It keeps the corners and
   still cuts the calendar off at the row's right-hand edge. */
.tree-add:has(.net-picker), .tree-add:has(.datepicker-wrap) { overflow: visible; }
.tree-add:has(.net-picker) > :first-child,
.tree-add:has(.datepicker-wrap) > :first-child {
  border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm);
}
.tree-add:has(.net-picker) > :last-child,
.tree-add:has(.datepicker-wrap) > :last-child {
  border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm);
}

.net-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; flex: none;
  color: color-mix(in oklab, var(--net, currentColor) 70%, var(--ink));
}
.net-mark .icon { width: 15px; height: 15px; }
.net-row { display: inline-flex; align-items: center; gap: 8px; }

.net-picker { position: relative; display: flex; min-width: 168px; }
.net-picker select { flex: 1 1 auto; min-width: 0; }
.net-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 9px; border: none; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 0.88rem;
  text-align: left; cursor: pointer;
}
.net-toggle:hover { background: var(--brand-light); }
.net-name { flex: 1 1 auto; }
.net-caret { width: 12px; height: 12px; color: var(--ink-faint); }
.net-menu {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0;
  min-width: 100%; margin: 0; padding: 4px; list-style: none;
  max-height: 280px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: 0 10px 24px rgb(var(--shadow-rgb) / 0.14);
}
.net-menu li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 0.88rem; cursor: pointer; white-space: nowrap;
}
.net-menu li:hover, .net-menu li.is-active { background: var(--brand-light); }
.net-menu li[aria-selected="true"] { font-weight: 600; }

/* --- Dark theme -------------------------------------------------------------

   Three states, and only two palettes. "System" is the absence of a choice: no
   `data-theme` attribute is written, and the media query below decides. Light
   and Dark write the attribute and win over the device either way, which is what
   makes the switch worth having for somebody whose laptop is dark and whose eyes
   are not. See `apps/core/theme.py`.

   Only the *roots* are redeclared. Everything else in this file derives from
   them through `color-mix`, so one block of a few dozen values re-colours the
   whole product - which is the only reason a second theme was a day's work
   rather than a rewrite.

   Not redeclared, and deliberately: `--paper`. A look tile, a frame tile and a
   logo tile are pictures of a code that will be printed, and a printed code is
   on white in either theme - the same reason a PDF viewer keeps its sheet white
   on a dark chrome. Inverting the ground under a QR tile would not be a dark
   mode, it would be a claim about the code. `--logo-blue` stays too: it is the
   mark.

   The two blocks below are identical by necessity and are maintained as such.
   CSS has no way to say "these two selectors share a body", and a dark theme
   that is only right when the device agrees with the toggle is the kind of bug
   nobody reports. `apps/core/tests/test_theme.py` fails if they ever drift.
   --------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;

  --brand: #5c9ded;
  /* In the light theme this is a *darker* brand, for emphasis. Emphasis against
     a dark ground means brighter, so the two are mirror images rather than the
     same colour. */
  --brand-dark: #8fbdf5;
  --on-brand: #0d1620;

  --ink: #e4ebf2;
  --ink-muted: #9aabbd;
  --ink-faint: #93a4b6;

  --surface: #171d26;
  --canvas: #10151c;
  --bubble: #242b35;
  --knob: #e4ebf2;

  /* The picked/hovered ladder, reached the other way round - see the note in
     the light palette. A raised white pill is the light theme's idiom and
     cannot be this one's: `--surface` is 1.08x of `--canvas` and a drop shadow
     is invisible on a dark ground, so the selected state is a brand wash with a
     brand edge instead. The track needs no deepening because it is already the
     darkest thing here. Picked is 1.82x of the track and 1.48x of hover, and
     the ink on it reads 8.37:1. */
  --pick-track: var(--canvas);
  --pick-hover: color-mix(in srgb, var(--brand) 14%, var(--pick-track));
  --pick-bg: color-mix(in srgb, var(--brand) 30%, var(--surface));
  --pick-edge: color-mix(in srgb, var(--brand) 65%, var(--surface));
  /* Not the brand: brand on a 30% brand wash is 3.60:1 and fails AA. */
  --pick-ink: var(--ink);

  /* The four state hues, lifted rather than inverted: the same four meanings, at
     the lightness a dark ground needs. Each was checked the way the light set
     was - as text on the card, as text on its own chip, and as text on the
     strongest row tint it can ever sit on. */
  --ok: #4cb782;
  --warn: #d99a4e;
  --danger: #f28880;
  --alt: #a892e8;

  /* Every mix goes up. The same percentage of a hue reads far weaker against a
     dark ground than against white - 12% of a pale red over #171d26 is very
     nearly #171d26 - so a dark theme built by swapping only the hues comes out
     flat and grey. These are the numbers that keep a chip looking like a chip. */
  --chip-mix: 16%;
  --hairline-mix: 34%;
  --tint-mix: 7%;
  --light-mix: 15%;
  --panel-mix: 20%;

  /* And so do the tint stops, up to the point where the ink printed *on* a
     tinted row stops clearing AA. */
  --tint-1: 6%;      --tint-1-hover: 10%;
  --tint-2: 11%;
  --tint-quiet: 7%;  --tint-quiet-hover: 11%;

  /* The chart palette is re-picked, not reused: its hues were chosen dark
     enough to read on a white card, which is exactly the wrong constraint here.
     Searched the same way and held to the same floors by the same test - dE2000
     10 apart under normal vision and the three dichromacies, 3:1 on the card -
     so a reader who switches themes gets the same guarantee and the same two
     meanings, not the same two numbers. */
  --viz-cat-1: #409bfa;
  --viz-cat-2: #65c38c;

  /* A shadow on a dark ground cannot be a darker grey - there is nothing darker
     to go to - so it is black, at alphas the light theme would drown in, and
     the card is separated by its own lighter fill as much as by the shadow. */
  --shadow-rgb: 0 0 0;
  --shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.40), 0 1px 3px rgb(var(--shadow-rgb) / 0.30);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --brand: #5c9ded;
  /* In the light theme this is a *darker* brand, for emphasis. Emphasis against
     a dark ground means brighter, so the two are mirror images rather than the
     same colour. */
  --brand-dark: #8fbdf5;
  --on-brand: #0d1620;

  --ink: #e4ebf2;
  --ink-muted: #9aabbd;
  --ink-faint: #93a4b6;

  --surface: #171d26;
  --canvas: #10151c;
  --bubble: #242b35;
  --knob: #e4ebf2;

  /* The picked/hovered ladder, reached the other way round - see the note in
     the light palette. A raised white pill is the light theme's idiom and
     cannot be this one's: `--surface` is 1.08x of `--canvas` and a drop shadow
     is invisible on a dark ground, so the selected state is a brand wash with a
     brand edge instead. The track needs no deepening because it is already the
     darkest thing here. Picked is 1.82x of the track and 1.48x of hover, and
     the ink on it reads 8.37:1. */
  --pick-track: var(--canvas);
  --pick-hover: color-mix(in srgb, var(--brand) 14%, var(--pick-track));
  --pick-bg: color-mix(in srgb, var(--brand) 30%, var(--surface));
  --pick-edge: color-mix(in srgb, var(--brand) 65%, var(--surface));
  /* Not the brand: brand on a 30% brand wash is 3.60:1 and fails AA. */
  --pick-ink: var(--ink);

  /* The four state hues, lifted rather than inverted: the same four meanings, at
     the lightness a dark ground needs. Each was checked the way the light set
     was - as text on the card, as text on its own chip, and as text on the
     strongest row tint it can ever sit on. */
  --ok: #4cb782;
  --warn: #d99a4e;
  --danger: #f28880;
  --alt: #a892e8;

  /* Every mix goes up. The same percentage of a hue reads far weaker against a
     dark ground than against white - 12% of a pale red over #171d26 is very
     nearly #171d26 - so a dark theme built by swapping only the hues comes out
     flat and grey. These are the numbers that keep a chip looking like a chip. */
  --chip-mix: 16%;
  --hairline-mix: 34%;
  --tint-mix: 7%;
  --light-mix: 15%;
  --panel-mix: 20%;

  /* And so do the tint stops, up to the point where the ink printed *on* a
     tinted row stops clearing AA. */
  --tint-1: 6%;      --tint-1-hover: 10%;
  --tint-2: 11%;
  --tint-quiet: 7%;  --tint-quiet-hover: 11%;

  /* The chart palette is re-picked, not reused: its hues were chosen dark
     enough to read on a white card, which is exactly the wrong constraint here.
     Searched the same way and held to the same floors by the same test - dE2000
     10 apart under normal vision and the three dichromacies, 3:1 on the card -
     so a reader who switches themes gets the same guarantee and the same two
     meanings, not the same two numbers. */
  --viz-cat-1: #409bfa;
  --viz-cat-2: #65c38c;

  /* A shadow on a dark ground cannot be a darker grey - there is nothing darker
     to go to - so it is black, at alphas the light theme would drown in, and
     the card is separated by its own lighter fill as much as by the shadow. */
  --shadow-rgb: 0 0 0;
  --shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.40), 0 1px 3px rgb(var(--shadow-rgb) / 0.30);
}

/* --- The staff area ----------------------------------------------------------
   Superuser-only pages, and the one place in the product where a screen is full
   of other people's names and email addresses. The styling is deliberately the
   product's own - these are lists like any other - with exactly one thing added
   that the rest of the product does not have: a banner saying whose data this
   is. A staff page that is indistinguishable from your own account's pages is a
   page somebody screen-shares without thinking about it. */
.staff-notice {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 20px; padding: 10px 14px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius);
  color: var(--warn); font-size: 0.84rem;
}
.staff-notice .icon { flex: none; }

/* The section label in the sidebar carries a glyph, which no other section does.
   It is the only group in that column that is not shown to every account, and
   the shield is what says so without a second line of text. */
.nav-section-staff { display: flex; align-items: center; gap: 7px; }
.nav-section-staff .icon { width: 12px; height: 12px; }

/* Three across, to sit beside the existing .grid-2 and .grid-4. The overview
   groups its figures in threes: this month, all time, and engagement. */
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* A short list of label/value pairs inside a card. A <dl>, because that is what
   it is, laid out as rows rather than as the browser's default indent. */
.fact-list { display: grid; gap: 10px; margin: 0; }
.fact-list > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
}
.fact-list dt { color: var(--ink-muted); font-size: 0.87rem; }
.fact-list dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
}

/* The cron jobs page. Its tiles say whether something is wrong, which the
   allowance's `.is-high` and `.is-full` are not for - only the menus tile
   takes those. Here the chip and the figure carry it, and the card stays plain. */
.stat.is-attention .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat.is-attention .stat-value { color: var(--danger); }
.stat.is-settled .stat-icon { background: var(--ok-bg); color: var(--ok); }
/* "Every job is there", which no other page has needed to say. */
.alert-success { background: var(--ok-bg); color: var(--ok); }
/* The state of the crontab leads the page, straight under the heading. */
.page-head + .alert { margin-top: 0; }

/* A crontab line. Wrapped anywhere rather than scrolled: the lines are two
   hundred characters of paths, and the one that matters is the line to paste
   into `crontab -e`, which has to be selectable whole. */
.cron-line {
  display: block; margin-top: 6px; padding: 6px 10px;
  background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink);
  white-space: pre-wrap; word-break: break-all;
}
.cron-note { margin-top: 4px; color: var(--warn-ink); }
/* A job's line sits on its own row under the job, and reads as part of it. */
table.data tr.cron-has-line > td { border-bottom: 0; padding-bottom: 4px; }
table.data tr.cron-detail > td { padding-top: 0; }
.cron-detail summary, .cron-elsewhere > summary { cursor: pointer; }

/* The honeypot on the registration and password-reset forms - see
   core/_antispam_fields.html. Off the edge of the page rather than
   `display: none`: it has to stay *rendered*, because a form-filling script
   that skips unrendered boxes is the script it is there to catch, and it has
   to stay out of the accessibility tree, which `aria-hidden` on the wrapper
   does. `!important` so no later rule on wrappers can move it back. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
