/* sitekit admin styles. Plain CSS, no build step.

   PART 1: THE VARIABLES. Every colour, font, text size, icon setting and
   corner the admin uses is a variable, set below; the rest of this file
   only uses them.

   There are three modes: light, medium (a soft dark grey) and dark. Each
   person picks one in their own menu, kept with their account: or "Auto"
   (matches the device: light, or dark when it is set to dark), or the site's
   brand when it has one. The page is marked with the choice
   (data-theme="medium") before it is drawn.

   A site gives the admin its own look in two ways, both through CSS:
     - Its brand, offered as a choice next to the modes: app.Admin.Brand
       names a stylesheet that sets these variables under
       :root[data-theme="brand"] (variables it leaves out keep the light
       values):
         :root[data-theme="brand"] { --accent: #b4532a; --font-title: Georgia, serif; }
     - For everyone, whatever they chose: its own CSS file loaded through
       the head.html slot, setting variables for each mode:
         :root { --text-md: 1rem; }
         :root[data-theme="medium"] { --accent: #367c60; }

   Its logo is added in Go, with app.Admin.Logo; --logo-h sets its size.

   A font the device doesn't have is added with @font-face in the site's
   file (the font file in its web/static/ folder), then named in --font.

   PART 2: THE PARTS. Classes admin screens (built-in, or added with
   admin.Page) can use:
     .card            a box; .card-head is a row with its h2 and a link
     .fold-card       a .card that folds away (a <details>): its summary
                      a .fold arrow, an h2 and a .note saying what is
                      inside; the rest in one element after it
     .settings        a .card in parts: each .setting has a title and
                      note on the left and its form on the right
     .split           two columns on wide screens: content, then a narrow
                      column of settings
     .stack           a form whose fields sit one under the other
     .row             a form whose fields sit side by side
     .field           a label (.label), an optional .hint, the input, and
                      a .mistake (admin.Field draws one); .field.wide for
                      long text. With a .tip after its name, the .field
                      is a <div> and its .label a span holding a <label>
                      and the .tip
     .check, .choices tick boxes and round choices; .choices puts each in
                      a box, with a .hint under its name
     .switch          an on/off switch (a checkbox; admin.Switch draws
                      one); with a .tip after its name, a div.switch
                      whose name is a <label for> and the .tip beside it
     .buttons         a row of buttons
     button, .button  the main button; add .secondary, .ghost, .danger,
                      .danger-quiet (red text), .link or .small
     .icon-button     a square button holding only an icon
     .notice          a message: .ok, .problem, .warn or .info, with an
                      icon first and a <p> (and an optional <strong>)
     .table-wrap      a box around a table; a wide table scrolls inside
                      it. table.list turns each row into a block on phones
                      (give each <td> a data-label); table.linked makes
                      a click anywhere on a row follow its a.title link
                      (rows with no other links or buttons); table.wide
                      keeps its first column in place while it scrolls; th.num and
                      td.num line up numbers on the right (a box in a
                      td.num is narrow, for a number), td.end holds a
                      row's buttons; a thead's th.sortable headings
                      (a.sort links; admin.SortHead draws one) stay
                      on phones, as one line
     .tag             a small label: .ok, .problem, .warn, .accent
     .status          a coloured dot and a word: .ok, .problem, .warn
     .facts           a <dl> of label/value pairs; .boxed in a box,
                      .across side by side (each pair in a <div>),
                      .stacked each label above its value
     .rows            a list of rows: an icon, a .main line, a .note
     ol.steps         numbered steps, each number in a circle; a step
                      starts with its .label (or a .card-head holding
                      the .label and a button)
     .toolbar         a row above a list (.end pushes an item right)
     .empty           "nothing here yet", with an optional .mark icon
     .widgets         the dashboard's grid of .card boxes (a box with a
                      table in it takes the whole row)
     .tabs            links as tabs (the current one has aria-current);
                      .tabs-bar holds them with a .field on the right
     .crumbs          the way to a folder, under its title: an <ol> of
                      links, an arrow between, the folder itself last
                      (span.here); li.middle folds into li.gap "…" on
                      a phone, li.far into li.gap.wide on a wide screen
     .library-head    the top of the file library: .library-tools
                      (.search-box with its × .clear, a .chip, the bar,
                      its .bar-said saying what is ticked)
     .search-box      a search field with a magnifier in it (and maybe
                      a × .clear); the library's, the move box's and
                      the picker's
     .just-changed    a row (or line, or part of a page) that just changed
                      or was just saved: shaded a moment
     .chip            a tick box shown as a small rounded button (or a
                      link with role="button" and aria-pressed)
     p.found          the line over a search's results (only a p: the
                      move box's folders found are li.found)
     .folder-row      a folder as a row of the files' list (.folder-rows
                      .folded hides the .more rows until "Show all";
                      .shut hides all but its .section-head, which folds
                      them); .thumb a file's small picture; tr.heads a
                      part's headings, th.sortable a heading that sorts
                      (a.sort); .privacy a folder's privacy switch
     .move-to         the box to move files in: a tree of folders to choose
     .meter           a <progress> and notes (.over past the plan)
     .address-field   in a .field: the end of an address typed in a box
                      joined to its fixed start (a span.start before
                      the <input>), such as a new link's
     .tip             a small ⓘ whose text shows on hover, tap or keyboard
                      focus, for background worth knowing now and then
                      (a long grey note's detail). Draw it with {{tip
                      "text"}} (admin.Tip), or admin.Field's or
                      admin.Switch's Tip; never
                      inside a <label> (tapping it would go to the field)
     .link-qr         a .card with a QR code (an <img>) beside a <div>
                      saying what it is, with its buttons
     .tiles / .tile   files to choose, as pictures (the picker); .tiles.strip
                      keeps them in one row that scrolls across;
                      .tile.chosen is the one chosen now
     .picker-folder   a folder that folds away (a <details>) in the picker
     .pager           under the library's list: "Showing 21–40 of 236",
                      .page-numbers (Previous, numbers, Next; the page
                      shown has aria-current) and .per-page (Per page)
     .figures         a row of big numbers, each a .card.figure: its
                      .label (and a .tip), its .value and a .sub line
     .chart           a bar chart drawn as plain HTML (analytics' screens
                      draw them): .y numbers up the side, a .plot with
                      .grid lines and .cols, one .col per bar (its
                      numbers in data-tip) holding a .bar as tall as its
                      share, or .parts (.part.p0 at the bottom, .p1,
                      .p2 striped); .now is the bar still going, drawn
                      lighter, .future an empty place; .x labels under
                      it. .chart.small for a dashboard box. .legend
                      names the parts (an <i class="p0"> before each
                      name); .chart-foot is the line under it, with
                      its "Show as a table"
     .lists           boxes of top lists side by side on wide screens (a
                      th.views/td.views column is left out on phones);
                      .share is a thin bar under a row's name, its
                      span's width the row's share; .who a name after
                      an icon
     .range           the ready ranges as .tabs, and a small form beside
                      them (the dates to show); .month-bar the same
                      layout with a .month-head (History)
     .entry-page      a form entry's page: .entry-main (its
                      .entry-answers, then each .entry-again) beside
                      the quieter .entry-about box
     .consent-history a mailing list person's changes, in a .card on an
                      .entry-page: one li each, a .change line (.tag,
                      .when, .who) and its .said on one line, with a
                      .fold arrow when it doesn't fit (admin.js)
     .note, .lead     quieter text; a line under the title
     .visually-hidden text only screen readers read
     .clip-2          text shown on two lines at most, the rest cut off
                      with "…" (screen readers still read it all; put
                      the whole text in a title for the mouse too)
   Icons: {{icon "name"}} in a template draws <svg class="icon">;
   {{tip "text"}} draws a .tip.
   Helpers in admin.js, switched on by attributes:
     data-tip="words"            on anything (a .tip has it): the words in a
                                 box on hover, tap or keyboard focus, placed
                                 so it stays whole on the screen; give the
                                 element tabindex="0" and an aria-label too
     data-copy="text"            on a <button type="button">: copies the text
     data-copy-from="id"         on a <button type="button">: copies what the
                                 field with that id holds (a long text, sent once)
     data-fill-password="a,b"    on a <button type="button"> in a form: fills
                                 fields a and b with a strong random password,
                                 shows it and copies it
     data-busy-label="..."       on a form's button: what it says while the
                                 form is sent (default "Saving…")
     data-confirm="Question?"    on a form: asks first (with
                                 data-confirm-detail and data-confirm-yes)
     data-submit-on-change       on a form: sent as soon as a box in it (or
                                 tied to it with form="...") changes
     data-add-row="id"           on a <button type="button">: adds a copy of
                                 <template id="id" data-to="tbody-id"> to
                                 that tbody, "__N__" in names made unique;
                                 tr.when-empty shows while it has no row
     data-remove-row             on a <button type="button">: removes its row
     details.list-group  a part of a list that folds away: its <summary>
                         holds a .fold arrow (a span with the
                         chevron-right icon), an h2 and a .note (such
                         as a count)
     .toggles / .toggle / .when-on   in a .toggles (such as a <tr>), .when-on
                                 shows only while its .toggle box (or round
                                 choice) is ticked, .when-off only while not
     data-check-all="name"       on a checkbox: ticks every box named
                                 "name" in its form
     data-upload                 on a form with an <input type=file> and a
                                 ul.upload-list: sends each file chosen or
                                 dropped as its own request (the file
                                 library's upload address), with progress;
                                 with a [data-folder-input] (the
                                 library's), whole folders too (M7c)
     .file-pick[data-file-field] a content Photo or File field: its
                                 Choose opens the library's picker in a
                                 box, and Remove empties it
     data-warn-unsaved           on a form: the browser asks before leaving
                                 the page with changes in it not saved
                                 (="sent" on a form shown again with a
                                 problem: its text counts as not saved)
   Every password field gets a button to show what was typed.
   The standard pieces (admin.Field, Filter, PageLinks, SortHead, Empty) use these
   too, plus .filter and .pages.

   The site's own slots sit in .slot-above-top-bar, .slot-top-bar-links,
   .slot-above-title, .slot-beside-title, .slot-below-login-form and
   .slot-footer.

   The page has three parts: .nav (the top bar), .menu (on the left; the
   button at the top left opens and closes it) and main. On a laptop the
   menu starts open and pushes the page over; closed, the page takes the
   whole width. On a phone it starts closed and slides over the page.
   Without JavaScript it is always shown. The page scrolls, never
   sideways: a wide table scrolls inside its own box. */

/* ===================== PART 1: THE VARIABLES ===================== */

:root {
  color-scheme: light;

  /* Typefaces: the device's own, so nothing is downloaded. */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-title: var(--font);  /* page titles and the site's name */
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Text sizes, smallest to largest. In rem, so a person who sets their
     browser's text larger gets a larger admin. */
  --text-xs: .75rem;     /* small labels, counts */
  --text-sm: .84rem;     /* notes under fields, second lines */
  --text-md: .9375rem;   /* normal text: 15px */
  --text-lg: 1.05rem;    /* box titles */
  --text-xl: 1.35rem;    /* the login title */
  --text-2xl: 1.6rem;    /* page titles */
  --text-3xl: 1.9rem;    /* big numbers */

  --weight-normal: 400;
  --weight-medium: 500;  /* menu entries */
  --weight-strong: 600;  /* labels, buttons */
  --weight-title: 650;   /* titles */

  --leading: 1.55;       /* space between lines of text */
  --leading-tight: 1.25; /* ... of titles */
  --title-tracking: -.015em; /* titles sit a touch tighter */

  /* Icons: drawn with lines, in the text's colour. */
  --icon-size: 1.1rem;
  --icon-stroke: 1.75;   /* line thickness, on a 24-unit square */

  /* Corners. */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Sizes of the frame and the controls. */
  --control-h: 2.375rem;     /* buttons and fields: 38px */
  --nav-h: 3.5rem;           /* the top bar */
  --logo-h: 1.75rem;         /* the site's logo in the top bar (half again above the login form) */
  --menu-width: 15.5rem;
  --field-width: 28rem;      /* most fields */
  --field-width-wide: 44rem; /* long text */

  /* Colours, light mode. */
  --bg: #f7f6f3;            /* the page behind the boxes */
  --surface: #ffffff;       /* boxes */
  --surface-2: #f3f1ed;     /* a quiet fill: table headers, hover */
  --surface-3: #e9e6e0;     /* a stronger fill */
  --raised: #ffffff;        /* drop-downs and the "are you sure?" box */
  --text: #2d2b27;
  --text-strong: #1a1916;
  --muted: #6b675f;         /* notes and labels */
  --faint: #9a958b;         /* the quietest text, icons */
  --line: #e8e5df;
  --line-strong: #d6d2ca;
  --input-bg: #ffffff;
  --input-line: #cfcac1;

  --accent: #2d2b27;        /* main buttons */
  --on-accent: #ffffff;     /* text on a main button */
  --accent-text: #1a1916;   /* links, the current tab, small marks */
  --link-underline: var(--faint);

  --nav-bg: #ffffff;
  --menu-bg: #f2f0eb;
  --menu-hover: #e8e5df;
  --menu-current: #ffffff;

  --ok: #1f7a45;       --ok-soft: #eaf5ee;
  --problem: #be3a2e;  --problem-soft: #fcefed;  --on-problem: #ffffff;
  --warn: #946000;     --warn-soft: #fcf3df;

  --shadow-sm: 0 1px 2px rgb(40 30 10 / .06);
  --shadow: 0 1px 2px rgb(40 30 10 / .05), 0 1px 3px rgb(40 30 10 / .04);
  --shadow-pop: 0 12px 32px rgb(40 30 10 / .14), 0 2px 6px rgb(40 30 10 / .06);
  --backdrop: rgb(30 25 15 / .35);
}

/* Colours, medium mode: a soft dark grey. "Auto" picks it when the
   device is set to dark. */
:root[data-theme="medium"] {
  color-scheme: dark;

  --bg: #282725;
  --surface: #31302d;
  --surface-2: #393835;
  --surface-3: #43413d;
  --raised: #3a3936;
  --text: #e4e1db;
  --text-strong: #f5f3ef;
  --muted: #aaa59c;
  --faint: #827d74;
  --line: #3f3d39;
  --line-strong: #534f49;
  --input-bg: #2b2a28;
  --input-line: #5a564f;

  --accent: #ebe8e2;
  --on-accent: #22211f;
  --accent-text: #f5f3ef;

  --nav-bg: #2e2d2a;
  --menu-bg: #2b2a28;
  --menu-hover: #36352f;
  --menu-current: #3d3b37;

  --ok: #7dd3a0;       --ok-soft: #313f35;
  --problem: #ff9f93;  --problem-soft: #4a3330;  --on-problem: #2b0d09;
  --warn: #efc56f;     --warn-soft: #463f2d;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / .2);
  --shadow: 0 1px 2px rgb(0 0 0 / .2);
  --shadow-pop: 0 14px 36px rgb(0 0 0 / .4), 0 2px 6px rgb(0 0 0 / .25);
  --backdrop: rgb(0 0 0 / .45);
}

/* Colours, dark mode: a deep grey, never pure black. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #151514;
  --surface: #1d1d1b;
  --surface-2: #252523;
  --surface-3: #2f2e2b;
  --raised: #252523;
  --text: #e6e4df;
  --text-strong: #f6f4f0;
  --muted: #9e9a91;
  --faint: #716d66;
  --line: #2c2b28;
  --line-strong: #403e3a;
  --input-bg: #191918;
  --input-line: #48453f;

  --accent: #ecebe7;
  --on-accent: #151514;
  --accent-text: #f6f4f0;

  --nav-bg: #1a1a18;
  --menu-bg: #181817;
  --menu-hover: #242422;
  --menu-current: #2a2a27;

  --ok: #66c98f;       --ok-soft: #18271e;
  --problem: #ff8d80;  --problem-soft: #351b1a;  --on-problem: #260806;
  --warn: #e9bb5e;     --warn-soft: #2f2716;

  --shadow-sm: 0 0 0 transparent;
  --shadow: 0 0 0 transparent;
  --shadow-pop: 0 14px 40px rgb(0 0 0 / .6), 0 0 0 1px rgb(255 255 255 / .04);
  --backdrop: rgb(0 0 0 / .6);
}

/* Worked out from the ones above. */
:root {
  --accent-soft: color-mix(in srgb, var(--accent-text) 11%, var(--surface));
  --accent-hover: color-mix(in srgb, var(--accent) 86%, var(--surface));
  --focus: color-mix(in srgb, var(--accent-text) 40%, transparent);
  /* The one ring round whatever the keyboard is on, everywhere. */
  --ring: 2px solid var(--focus);
}

/* ===================== PART 2: THE PARTS ===================== */

*, *::before, *::after { box-sizing: border-box; }
/* Something marked hidden stays hidden, whatever display a rule gives
   its kind (a .button link, a .notice, a flex row...). */
[hidden] { display: none !important; }

/* Pages fade into each other instead of flashing (in browsers that
   support it; others just load the page). */
@view-transition { navigation: auto; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-md);
  font-weight: var(--weight-normal);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: grid;
  grid-template:
    "above above" auto
    "nav   nav"   auto
    "menu  main"  1fr
    "foot  foot"  auto
    / var(--menu-col, var(--menu-width)) minmax(0, 1fr);
  transition: grid-template-columns .22s ease;
}
html.menu-closed { --menu-col: 0px; }

a { color: var(--accent-text); text-underline-offset: .18em; text-decoration-thickness: 1px; text-decoration-color: var(--link-underline); }
a:hover { text-decoration-thickness: 2px; text-decoration-color: currentColor; }
:focus-visible { outline: var(--ring); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
button, input, select, textarea { font-family: inherit; }

.visually-hidden, .tabs-bar .field .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Two lines at most, such as a deep folder's place ("Menus / 2026 / ...",
   up to 100 folders): without it a long one runs to dozens of lines. Only
   the look is cut: the text is all there, for screen readers. */
.clip-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }

/* --- Icons: each a few lines on a 24-unit square, in the text's colour --- */

.icon {
  display: inline-block;
  width: var(--icon-size);
  height: var(--icon-size);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.2em;
}

/* --- Slots the site fills --- */

.slot-above-top-bar { grid-area: above; }
.slot-footer { grid-area: foot; }
.slot-top-bar-links { display: flex; align-items: center; gap: 1rem; }

/* --- Top bar --- */

.nav {
  grid-area: nav;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: .5rem;
  height: var(--nav-h);
  padding: 0 .75rem;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
}
.nav .site {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  min-width: 0;
  margin-right: auto;
  padding: .25rem .4rem;
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  font-family: var(--font-title);
  font-size: var(--text-lg);
  font-weight: var(--weight-title);
  text-decoration: none;
  white-space: nowrap;
}
.nav .site span { overflow: hidden; text-overflow: ellipsis; }
.nav .site small { color: var(--faint); font-family: var(--font); font-size: var(--text-sm); font-weight: var(--weight-medium); }

/* The site's logo (app.Admin.Logo), before its name. With a version for
   dark colours, the medium and dark modes show that one instead. */
.site-logo { display: block; flex: none; align-self: center; width: auto; height: var(--logo-h); max-width: 10rem; object-fit: contain; }
.site-logo-dark,
:root[data-theme="medium"] .site-logo-light,
:root[data-theme="dark"] .site-logo-light { display: none; }
:root[data-theme="medium"] .site-logo-dark,
:root[data-theme="dark"] .site-logo-dark { display: block; }

/* A square button with only an icon in it. Give it a name for screen
   readers (a .visually-hidden span) and a title for the mouse. */
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}
.icon-button:hover { background: var(--surface-2); color: var(--text-strong); }
.icon-button .icon { --icon-size: 1.2rem; margin: 0; }
.icon-button.small { width: 2rem; height: 2rem; padding: 0; }
.icon-button.small .icon { --icon-size: 1.05rem; }
.icon-button.problem:hover { background: var(--problem-soft); color: var(--problem); }

/* The person's button at the right: their initial and name. */
.me {
  display: flex;
  align-items: center;
  gap: .55rem;
  height: var(--control-h);
  padding: 0 .55rem 0 .3rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  cursor: pointer;
}
.me:hover { background: var(--surface-2); }
.me .name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .icon { --icon-size: .95rem; margin: 0; color: var(--faint); }
.avatar {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-strong);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  flex: none;
}
/* Phones: room for the site's name; the person shows as their initial. */
@media (max-width: 40rem) {
  .nav .site small, .me .icon { display: none; }
  /* The name is still read out by screen readers, just not shown. */
  .me .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .me { padding: 0 .2rem; }
}

/* --- Menu --- */

.menu {
  grid-area: menu;
  min-width: 0;
  overflow: clip; /* "clip", not "hidden", or the list inside can't stay in place */
  background: var(--menu-bg);
  border-right: 1px solid var(--line);
}
.menu-inner {
  position: sticky;
  top: var(--nav-h);
  width: var(--menu-width);
  max-height: calc(100dvh - var(--nav-h));
  overflow-y: auto;
  padding: .9rem .75rem 2rem;
}
@media (min-width: 60.01rem) {
  html.menu-closed .menu { visibility: hidden; transition: visibility 0s .22s; }
}
/* Without JavaScript the menu is always shown, so its button is left out. */
html:not(.js) .menu-button { display: none; }

.menu ul { margin: 0; padding: 0; list-style: none; }
.menu li + li { margin-top: 1px; }
.menu li > a, .menu li > .label, .menu summary {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.25rem;
  padding: .3rem .7rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
.menu .icon { color: var(--faint); }
.menu li > a:hover, .menu summary:hover { background: var(--menu-hover); color: var(--text-strong); }
.menu li > a:hover .icon, .menu summary:hover .icon { color: var(--text-strong); }
.menu a[aria-current="page"] {
  background: var(--menu-current);
  color: var(--text-strong);
  font-weight: var(--weight-strong);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}
.menu a[aria-current="page"] .icon { color: var(--text-strong); }
/* A heading that opens to its sub-options (a section, such as SEO). */
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after {
  content: "";
  margin-left: auto;
  width: .38rem;
  height: .38rem;
  border: solid var(--faint);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
  transition: transform .15s;
  flex: none;
}
.menu details[open] > summary::after { transform: rotate(45deg) translate(-2px, -1px); }
/* A heading that is also a link: the link takes the row, the arrow opens. */
.menu summary > a { display: flex; align-items: center; gap: .65rem; flex: 1; color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
/* Sub-options sit under their heading's text, past the icon, with none
   of their own. */
.menu details ul { margin: 1px 0 .35rem 1.25rem; padding-left: .7rem; border-left: 1px solid var(--line-strong); }
.menu details ul .icon { display: none; }
/* A heading with no link and nothing under it: a quiet group label. */
.menu li > .label {
  min-height: 0;
  margin: 1.1rem 0 .2rem;
  color: var(--faint);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  letter-spacing: .07em;
  text-transform: uppercase;
}
/* Phones only: the menu's own close button. */
.menu-head { display: none; }

/* Phones and small tablets: the menu slides over the page. */
@media (max-width: 60rem) {
  body { grid-template: "above" auto "nav" auto "menu" auto "main" 1fr "foot" auto / 100%; }
  .menu-inner { position: static; width: auto; max-height: none; }

  .js .menu {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    width: min(18rem, 86vw);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-pop);
    overflow-y: auto;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .22s ease, visibility 0s .22s;
  }
  .js.menu-open .menu { transform: none; visibility: visible; transition: transform .22s ease; }
  .js .menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-h);
    padding: 0 .75rem 0 1.1rem;
    border-bottom: 1px solid var(--line);
    color: var(--text-strong);
    font-weight: var(--weight-title);
  }
  .scrim { position: fixed; inset: 0; z-index: 40; background: var(--backdrop); opacity: 0; visibility: hidden; transition: opacity .22s, visibility 0s .22s; }
  .js.menu-open .scrim { opacity: 1; visibility: visible; transition: opacity .22s; }
  .js.menu-open body { overflow: hidden; }
}
@media (min-width: 60.01rem) { .scrim { display: none; } }

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

/* --- The page --- */

main {
  grid-area: main;
  min-width: 0;
  padding: 1.75rem 2.25rem 5rem;
}
@media (max-width: 40rem) { main { padding: 1.25rem 1rem 4rem; } }

/* The top of a page: a way back (to the menu entry it is under), then the
   title. A .lead right after it sits close under the title. */
.page-head { margin: 0 0 1.5rem; }
.page-head h1 { margin: 0; }
/* A title with buttons at its right (Heading.Tools), and one with a
   button right after it, such as a pencil (Heading.Edit); on a phone the
   buttons go under the title. */
.page-head:has(> .page-tools) { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; }
.page-head > div:first-child { min-width: 0; }
.page-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
/* A form holding one button (Delete, say) sits in the row like a link
   beside it: no space under it. */
.page-tools form { margin: 0; }
.page-tools [data-filter-part] { display: contents; } /* buttons a live filter draws again (the Mailing list's Download CSV) */
.title-line { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.title-line:has(.rename:not([hidden])) > h1 { display: none; }
.title-line .rename { flex: 1 1 20rem; }
.title-line .rename .field { flex: 1 1 16rem; min-width: min(16rem, 100%); }
.page-head > div:first-child:has(.rename:not([hidden])) { flex: 1 1 24rem; }
/* An icon before the title (RenderHeading), with its tip shown on hover
   and on keyboard focus. */
.title-icon { position: relative; display: inline-grid; place-items: center; margin-right: .5rem; color: var(--muted); vertical-align: -.1em; cursor: help; border-radius: var(--radius-sm); }
.title-icon .icon { --icon-size: 1.3rem; margin: 0; }
.title-icon::after, .tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: calc(100% + .45rem);
  z-index: 20;
  width: max-content;
  max-width: 18rem;
  padding: .45rem .65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--raised);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  letter-spacing: normal;
  line-height: var(--leading);
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s;
}
.title-icon:hover::after, .title-icon:focus-visible::after { opacity: 1; visibility: visible; }
/* A small ⓘ after a line or a field, its text shown the same way (and
   when tapped on a phone: tapping gives it focus). */
.tip { position: relative; display: inline-grid; place-items: center; color: var(--muted); vertical-align: -.15em; cursor: help; border-radius: 50%; }
.tip .icon { --icon-size: 1rem; margin: 0; }
.tip:hover, .tip:focus { color: var(--text-strong); }
.tip:hover::after, .tip:focus::after { opacity: 1; visibility: visible; }
/* A hidden tip takes no room, so one near the edge never widens the page;
   on a phone it shows as a bar along the bottom of the screen instead of
   beside its ⓘ, so it never reaches past the screen's edge. */
.tip:not(:hover, :focus)::after { display: none; }
@media (max-width: 40rem) {
  .tip::after { position: fixed; left: 1rem; right: 1rem; top: auto; bottom: 1rem; width: auto; max-width: none; }
}
/* With JavaScript, admin.js shows every data-tip's words in one box
   instead (.tip-box), placed so it is always whole on the screen; the
   words drawn above are then left out. */
.js .tip::after, .js .title-icon::after { display: none; }
.tip-box {
  position: fixed;
  z-index: 50;
  width: max-content;
  max-width: min(18rem, calc(100vw - 16px));
  padding: .45rem .65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--raised);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: var(--leading);
  pointer-events: none;
}
.page-head + .lead { margin: -1.1rem 0 1.5rem; }
.back { display: inline-flex; align-items: center; gap: .35rem; margin-bottom: .5rem; color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-medium); text-decoration: none; }
.back:hover { color: var(--text-strong); }
.back .icon { --icon-size: 1rem; }

/* --- Text --- */

h1, h2, h3 { color: var(--text-strong); line-height: var(--leading-tight); overflow-wrap: anywhere; }
h1 { font-family: var(--font-title); font-size: var(--text-2xl); font-weight: var(--weight-title); letter-spacing: var(--title-tracking); margin: 0 0 1rem; }
h2 { font-size: var(--text-lg); font-weight: var(--weight-title); margin: 0 0 .75rem; }
h3 { font-size: var(--text-md); font-weight: var(--weight-title); margin: 0 0 .5rem; }
p { margin: 0 0 1rem; max-width: 68ch; }
.lead { color: var(--muted); font-size: var(--text-md); }
.note { color: var(--muted); font-size: var(--text-sm); }
strong { font-weight: var(--weight-strong); color: var(--text-strong); }
code, kbd { font-family: var(--font-mono); font-size: .85em; padding: .12em .38em; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); }
kbd { border-bottom-width: 2px; }

/* --- Boxes --- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.5rem;
  margin: 0 0 1.25rem;
}
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: 0 0 1rem; }
.card-head h2 { margin: 0; }
.card-head .note { margin: .2rem 0 0; }

/* A box that folds away (<details class="card fold-card">). Its <summary>
   is the whole top row, clickable: a .fold arrow, an h2, and a .note
   under it saying what is inside. Everything else goes in one element
   after the summary (a .stack, say), shown under a line once it opens. */
details.fold-card { padding: 0; }
details.fold-card > summary { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .1rem .5rem; padding: 1rem 1.5rem 1rem 1.1rem;
  border-radius: inherit; cursor: pointer; list-style: none; }
details.fold-card > summary::-webkit-details-marker { display: none; }
details.fold-card > summary:hover { background: var(--surface-2); }
details.fold-card > summary:focus-visible { outline-offset: -2px; }
details.fold-card > summary:hover .fold { color: var(--text-strong); }
details.fold-card > summary h2 { margin: 0; font-size: var(--text-md); }
details.fold-card > summary .note { grid-column: 2; margin: 0; }
details.fold-card[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
details.fold-card > summary ~ * { margin: 0; padding: 1.25rem 1.5rem 1.35rem; }

/* Two columns on wide screens: the content, then a narrow column of its
   settings. One under the other on smaller screens. */
.split { display: grid; gap: 1.25rem; align-items: start; }
.split > * { min-width: 0; }
@media (min-width: 72rem) { .split { grid-template-columns: minmax(0, 1fr) 20rem; } }

/* A box in parts: each part's title and note on the left, its form on the
   right; one under the other on a phone. */
.settings { padding: 0; }
.setting { display: grid; gap: .75rem 2.5rem; padding: 1.5rem; border-top: 1px solid var(--line); }
.setting:first-child { border-top: 0; }
.setting h2 { margin: 0 0 .3rem; font-size: var(--text-md); }
.setting .note { margin: 0; }
.setting form { margin: 0; }
.setting .notice { margin-bottom: 1rem; }
@media (min-width: 56rem) { .setting { grid-template-columns: 16rem minmax(0, 1fr); } }

/* Label / value pairs. */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 2rem; margin: 0 0 1.5rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; color: var(--text-strong); }
.facts.boxed { padding: 1.1rem 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
/* A pair may sit in a <div> of its own (as HTML allows): the div then
   doesn't count, so its label and value still take their columns. */
.facts:not(.across) > div { display: contents; }
.facts.across { display: flex; flex-wrap: wrap; gap: 1rem 3rem; }
/* .stacked: each label above its value, for a narrow column. */
.facts.stacked { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
.facts.stacked dd + dt, .facts.stacked > div + div > dt { margin-top: .6rem; }
.facts.across dt { font-size: var(--text-sm); margin-bottom: .15rem; }

/* --- Messages --- */

.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .15rem .75rem;
  padding: .85rem 1rem;
  margin: 0 0 1.25rem;
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
  border-radius: var(--radius);
  background: var(--tone-soft);
  color: var(--text);
}
.notice > .icon { margin-top: .15rem; color: var(--tone); grid-row: span 2; }
.notice strong { color: var(--text-strong); }
.notice p { margin: 0; max-width: none; }
.notice, .notice.info { --tone: var(--muted); --tone-soft: var(--surface-2); }
.notice.ok      { --tone: var(--ok);      --tone-soft: var(--ok-soft); }
/* A problem at the top of a page gets a × at its end (admin.js,
   topMessages). */
.notice:has(> .icon-button) { grid-template-columns: auto 1fr auto; }
.notice:not(:has(> .icon)):has(> .icon-button) { grid-template-columns: 1fr auto; } /* one without an icon (content's) */
.notice > .icon-button { grid-row: span 2; align-self: start; margin: -.3rem -.4rem 0 0; }
/* A message with its own action (a .button right in it, such as Pay now):
   the button at its right end, in line with the words; under them on a
   phone. Such a message holds one <p> (its words share one row with the
   button), and any × (admin.js) comes after the button. */
.notice:has(> .button) { grid-template-columns: auto 1fr auto; align-items: center; }
.notice:has(> .button):has(> .icon-button) { grid-template-columns: auto 1fr auto auto; }
.notice:has(> .button) > .icon { grid-row: 1; grid-column: 1; margin-top: 0; }
.notice:has(> .button) > p { grid-row: 1; grid-column: 2; }
.notice > .button { grid-row: 1; grid-column: 3; }
.notice:has(> .button) > .icon-button { grid-row: 1; grid-column: 4; align-self: center; margin-top: 0; }
@media (max-width: 40rem) {
  .notice:has(> .button) { grid-template-columns: auto 1fr; }
  .notice:has(> .button):has(> .icon-button) { grid-template-columns: auto 1fr auto; }
  .notice > .button { grid-column: 2; grid-row: 2; justify-self: start; margin-top: .5rem; }
  .notice:has(> .button) > .icon-button { grid-column: 3; }
}
/* A message going, at the top of a page or an upload's line (admin.js,
   takeAway): it fades, then closes up so the page moves up smoothly. */
main > .notice.gone, .upload-list li.gone {
  overflow: hidden;
  opacity: 0;
  height: 0 !important;
  padding-block: 0;
  margin-block: 0;
  border-width: 0;
  transition: opacity .5s, height .3s .5s, padding .3s .5s, margin .3s .5s, border-width .3s .5s;
}
/* The keyboard is put on the page's main part when that message goes
   from under it: no ring around the whole page. */
main[tabindex="-1"]:focus { outline: none; }
.notice.problem { --tone: var(--problem); --tone-soft: var(--problem-soft); }
.notice.warn    { --tone: var(--warn);    --tone-soft: var(--warn-soft); }

/* --- Buttons --- */

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  height: var(--control-h);
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgb(255 255 255 / .1);
  transition: background-color .12s, border-color .12s, box-shadow .12s, color .12s;
}
button:hover, .button:hover { background: var(--accent-hover); }
button:active, .button:active { transform: translateY(.5px); }
button .icon, .button .icon { --icon-size: 1rem; margin-left: -.15rem; }
.button .icon:last-child:not(:first-child) { margin: 0 -.15rem 0 0; }

button.secondary, .button.secondary {
  background: var(--surface);
  color: var(--text-strong);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); border-color: var(--input-line); }

button.ghost, .button.ghost { background: transparent; color: var(--text); box-shadow: none; }
button.ghost:hover, .button.ghost:hover { background: var(--surface-2); color: var(--text-strong); }

button.danger, .button.danger { background: var(--problem); color: var(--on-problem); }
button.danger:hover, .button.danger:hover { background: color-mix(in srgb, var(--problem) 86%, var(--text-strong)); }
button.danger-quiet, .button.danger-quiet { background: var(--surface); color: var(--problem); border-color: color-mix(in srgb, var(--problem) 40%, var(--line-strong)); box-shadow: var(--shadow-sm); }
button.danger-quiet:hover, .button.danger-quiet:hover { background: var(--problem-soft); }

button.link { height: auto; padding: 0; border: 0; background: none; box-shadow: none; color: var(--accent-text); font-size: inherit; font-weight: var(--weight-medium); text-decoration: underline; text-decoration-color: var(--link-underline); text-underline-offset: .18em; }

button.small, .button.small { height: 2rem; padding: 0 .75rem; font-size: var(--text-xs); border-radius: var(--radius-sm); }

button:disabled, button:disabled:hover {
  background: var(--surface-2);
  color: var(--faint);
  border-color: var(--line);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 1rem; }

/* --- Drop-downs: the browser's own pop-up (popover), so it opens, closes
   on a click outside and closes with Escape without script; admin.js
   only places it under its button --- */

[popover].pop {
  position: fixed;
  inset: auto;
  margin: 0;
  min-width: 16.5rem;
  max-width: calc(100vw - 1rem);
  padding: .35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--raised);
  color: var(--text);
  box-shadow: var(--shadow-pop);
}
/* Without JavaScript nothing places it: it opens under the top bar, at the
   right, where the person's own menu is. Browsers that can tie it to its
   button in CSS (anchor positioning) put it right under the button, even
   with a site's banner above the top bar. */
html:not(.js) [popover].pop { top: var(--nav-h); right: .5rem; }
.me { anchor-name: --account-menu; }
@supports (anchor-name: --x) {
  html:not(.js) #account-menu { position-anchor: --account-menu; top: calc(anchor(bottom) + 6px); right: anchor(right); }
}
.pop .who { padding: .55rem .65rem .7rem; margin-bottom: .3rem; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.pop .who strong { display: block; }
.pop .who span { color: var(--muted); overflow-wrap: anywhere; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: .3rem 0; }
.pop form { margin: 0; }
.pop .item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .6rem;
  width: 100%;
  height: auto;
  padding: .5rem .65rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  box-shadow: none;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.pop .item:hover { background: var(--surface-2); color: var(--text-strong); }
.pop .item .icon { --icon-size: 1rem; margin: 0; color: var(--faint); }
.pop .item.problem, .pop .item.problem .icon { color: var(--problem); }
.pop .item.problem:hover { background: var(--problem-soft); }
/* The person's choice of colours, in their own menu: a form of buttons in
   a row, the chosen one raised. */
.modes { padding: .45rem .65rem .6rem; margin: 0 0 .3rem; border-bottom: 1px solid var(--line); }
.modes > span { display: block; margin-bottom: .35rem; color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-strong); }
.modes > div { display: flex; gap: 2px; padding: 2px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.modes button { flex: 1; height: 1.9rem; padding: 0 .4rem; border: 0; border-radius: var(--radius-sm); background: transparent; box-shadow: none; color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.modes button:hover { background: var(--surface-3); color: var(--text-strong); }
.modes button[aria-pressed="true"] { background: var(--raised); color: var(--text-strong); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }

/* --- Forms --- */

form { margin: 0 0 1rem; }
.stack { display: grid; gap: 1.15rem; }
.stack > .buttons { margin: .25rem 0 0; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.row .field { flex: 1 1 14rem; }

.field { display: grid; gap: .35rem; max-width: var(--field-width); }
.field.wide { max-width: var(--field-width-wide); }
.field > .label { color: var(--text-strong); font-size: var(--text-sm); font-weight: var(--weight-strong); }
.field .optional { font-weight: var(--weight-normal); color: var(--faint); }
.field .hint { color: var(--muted); font-size: var(--text-sm); margin-top: -.1rem; }
.field .mistake { display: flex; gap: .4rem; align-items: flex-start; color: var(--problem); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.field .mistake .icon { --icon-size: 1rem; margin-top: .05rem; }

/* A box for typing the end of an address (a new link's), joined to the
   start it can't change, shown greyed before it: so it reads as the
   address being built. On a phone the start sits above the box. */
.address-field { display: flex; }
.address-field .start { display: flex; align-items: center; padding: .4rem .75rem; border: 1px solid var(--input-line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--surface-2); color: var(--muted); overflow-wrap: anywhere; }
.address-field input:not([type]) { flex: 1 1 8rem; min-width: 0; border-radius: 0 var(--radius) var(--radius) 0; }
@media (max-width: 40rem) {
  .address-field { flex-direction: column; }
  .address-field .start { border-right: 1px solid var(--input-line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; font-size: var(--text-sm); }
  .address-field input:not([type]) { flex: none; border-radius: 0 0 var(--radius) var(--radius); }
}

input:not([type=checkbox], [type=radio], [type=file], [type=hidden]), select, textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: .4rem .75rem;
  border: 1px solid var(--input-line);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text-strong);
  font-size: var(--text-md);
  box-shadow: inset 0 1px 1px rgb(0 0 0 / .03);
  transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 7.5rem; resize: vertical; line-height: var(--leading); padding-block: .55rem; }
textarea[readonly] { background: var(--surface-2); color: var(--text); font-size: var(--text-sm); } /* text to copy, not to type in */
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--focus); }
[aria-invalid="true"], [aria-invalid="true"]:hover { border-color: var(--problem) !important; }
[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--problem) 30%, transparent) !important; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); border-color: var(--line); cursor: not-allowed; box-shadow: none; }
::placeholder { color: var(--faint); opacity: 1; }

/* A password field with its eye button (admin.js adds it) inside, at the
   right. */
.password { position: relative; display: block; }
.password input { padding-right: 2.6rem; }
.password .icon-button { position: absolute; right: .2rem; top: 50%; transform: translateY(-50%); }

/* A button whose form is being sent ("Saving…"). */
button[aria-busy="true"], .button[aria-busy="true"] { opacity: .7; cursor: progress; }

/* A drop-down list with a drawn arrow, the same in every browser. */
select {
  appearance: none;
  padding-right: 2.25rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 1.05rem center, right .75rem center;
  background-size: .3rem .3rem;
  background-repeat: no-repeat;
}

/* Dates and times: the browser's own calendar and clock. */
input[type=date], input[type=time] { max-width: 12rem; }
input::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }

/* Tick boxes and round choices. */
.check { display: flex; align-items: flex-start; gap: .65rem; color: var(--text); cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; margin: .18rem 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.check .hint { display: block; color: var(--muted); font-size: var(--text-sm); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .6rem; min-width: 0; }
legend { color: var(--text-strong); font-size: var(--text-sm); font-weight: var(--weight-strong); padding: 0; margin-bottom: .5rem; }
.choices { display: grid; gap: .5rem; max-width: var(--field-width-wide); }
.choices .check { padding: .75rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.choices .check:hover { border-color: var(--faint); }
.choices .check:has(input:checked) { border-color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-text); }
.choices strong { display: block; font-weight: var(--weight-strong); }

/* An on/off switch, for a setting that applies at once. */
.switch { display: flex; align-items: flex-start; gap: .75rem; cursor: pointer; }
.switch input { appearance: none; flex: none; width: 2.2rem; height: 1.3rem; margin: .1rem 0 0; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background-color .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.3rem - 4px); height: calc(1.3rem - 4px); border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(.9rem); background: var(--on-accent); }
.switch .hint { display: block; color: var(--muted); font-size: var(--text-sm); }

/* Choosing a file (a photo). */
input[type=file] { font-size: var(--text-sm); color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button {
  margin-right: .75rem;
  height: 2.125rem;
  padding: 0 .9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-strong);
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--surface-2); }

/* --- Tabs (languages) --- */

/* The line under the tabs is a shadow inside the strip, not a border, so the
   current tab's underline can cover it without poking out below: anything
   poking out would give the strip a scroll bar. */
.tabs { display: flex; gap: .25rem; margin: 0 0 1.25rem; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .2rem; margin: 0 .6rem 0 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--text-strong); }
.tabs a[aria-current] { color: var(--text-strong); border-bottom-color: var(--accent-text); }
/* The strip scrolls sideways, so it cuts off anything outside it: the
   keyboard's ring goes inside the tab. */
.tabs a:focus-visible { outline-offset: -2px; }

/* --- Tables --- */

.table-wrap {
  position: relative; /* keeps hidden labels inside, so they can't widen the page */
  overflow-x: auto;
  margin: 0 0 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
/* Last in a box: the box's own padding is the space under it. */
:is(.card, .setting) .table-wrap:last-child { margin-bottom: 0; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-2); color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-strong); white-space: nowrap; }
thead th:first-child { border-top-left-radius: calc(var(--radius-lg) - 1px); }
thead th:last-child { border-top-right-radius: calc(var(--radius-lg) - 1px); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
td { color: var(--text); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { width: 1%; }
tbody:has(> tr:not(.when-empty)) > tr.when-empty { display: none; }
details.list-group { margin: 0 0 1rem; }
details.list-group > summary { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; cursor: pointer; list-style: none; }
details.list-group > summary::-webkit-details-marker { display: none; }
/* (Its arrow, a .fold first in the summary, is the folders' one: see
   "The arrow that folds" in the Files part.) */
details.list-group > summary .fold { margin-left: -.4rem; }
details.list-group > summary h2 { display: inline; margin: 0; font-size: var(--text-md); }
/* Each part is its own table: fixed widths keep their columns lined up. */
details.list-group table.list { table-layout: fixed; }
details.list-group table.list .num { width: 6rem; }
details.list-group table.list .end { width: 7.5rem; }
.toggles:has(.toggle:not(:checked)) .when-on { display: none; }
.toggles:has(.toggle:checked) .when-off { display: none; }
.times { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.times input[type="time"] { width: auto; }
td.num input { width: 4.5rem; text-align: right; }
td.end, th.end { text-align: right; width: 1%; white-space: nowrap; }
/* A row's own buttons, side by side at its end (on a phone, at its start). */
td.end > .buttons { margin: 0; justify-content: flex-end; flex-wrap: nowrap; }
@media (max-width: 40rem) { table.list td.end > .buttons { justify-content: flex-start; } }
td .sub { display: block; color: var(--muted); font-size: var(--text-sm); }
td a.title { color: var(--text-strong); font-weight: var(--weight-strong); text-decoration: none; }
td a.title:hover { text-decoration: underline; }
/* A whole row as its title's link: the link's ::after covers the row, so
   keyboards and screen readers still meet one plain link. */
table.linked tbody tr { position: relative; cursor: pointer; }
table.linked td a.title::after { content: ""; position: absolute; inset: 0; }
table.linked td a.title:hover { text-decoration: none; }
table.wide td { white-space: nowrap; }
table.wide th:first-child, table.wide td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 var(--line); }
table.wide th:first-child { background: var(--surface-2); }

@media (max-width: 40rem) {
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; }
  table.list tr { padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
  table.list tbody tr:last-child { border-bottom: 0; }
  table.list td { display: flex; gap: .75rem; padding: .12rem 0; border: 0; text-align: left; } /* numbers too, so each label lines up */
  table.list td[data-label]::before { content: attr(data-label); flex: 0 0 5.5rem; color: var(--muted); font-size: var(--text-sm); }
  table.list td:first-child { display: block; padding-bottom: .4rem; }
  table.list td.end { width: auto; padding-top: .4rem; }
  table.list tbody tr:hover td { background: none; }
  /* A list whose headings sort it (th.sortable, such as Form entries')
     keeps those on a phone, as one line of the orders to choose; its
     other headings are left out. */
  table.list thead:has(th.sortable) { display: block; }
  table.list thead:has(th.sortable) tr { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: .35rem 1rem; background: var(--surface-2); }
  table.list thead:has(th.sortable) th { padding: .25rem 0; border: 0; background: none; }
  table.list thead:has(th.sortable) th:not(.sortable) { display: none; }
}
/* The Files list keeps this phone layout (each row a card) up to 64rem
   (1024 px), as do its other phone rules further down. Its columns need
   about 810 px, and below 64rem its box is narrower than that (from
   60rem the menu takes room beside it), so as a table it squeezed the
   names to a letter a line and scrolled sideways (review R6-3). */
@media (min-width: 40.01rem) and (max-width: 64rem) {
  table.files thead { display: none; }
  table.files, table.files tbody, table.files tr, table.files td { display: block; }
  table.files tr { padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
  table.files tbody tr:last-child { border-bottom: 0; }
  table.files td { display: flex; gap: .75rem; padding: .12rem 0; border: 0; text-align: left; }
  table.files td[data-label]::before { content: attr(data-label); flex: 0 0 5.5rem; color: var(--muted); font-size: var(--text-sm); }
  table.files td:first-child { display: block; padding-bottom: .4rem; }
  table.files td.end { width: auto; padding-top: .4rem; }
  table.files tbody tr:hover td { background: none; }
}

/* --- Small labels --- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .05rem .45rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: .08em;
}
.tag .icon { --icon-size: .8rem; }
.tag.ok      { background: var(--ok-soft);      color: var(--ok);          border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.tag.problem { background: var(--problem-soft); color: var(--problem);     border-color: color-mix(in srgb, var(--problem) 22%, transparent); }
.tag.warn    { background: var(--warn-soft);    color: var(--warn);        border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.tag.accent  { background: var(--accent-soft);  color: var(--accent-text); border-color: color-mix(in srgb, var(--accent-text) 22%, transparent); }
.status { display: inline-flex; align-items: baseline; gap: .5rem; }
.status::before { content: ""; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--faint); transform: translateY(-.05em); }
.status.ok::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.status.problem::before { background: var(--problem); box-shadow: 0 0 0 3px var(--problem-soft); }
.status.warn::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

/* --- Lists of things --- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 0 0 1rem; }
.toolbar > p { margin: 0; }
.toolbar .end { margin-left: auto; }

.filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin: 0 0 1rem; }
.filter .field { flex: 1 1 12rem; max-width: 18rem; }
/* A date takes only its own width, so From, To and Clear sit together. */
.filter .field:has(> input[type="date"]) { flex: 0 0 auto; }
.filter input[type="date"] { width: 10.5rem; }
.filter .clear { line-height: var(--control-h); padding: 0 .25rem; font-size: var(--text-sm); }

.pages { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1.25rem; color: var(--muted); font-size: var(--text-sm); }

.empty { display: grid; justify-items: center; gap: .35rem; padding: 3rem 1.5rem; margin: 0 0 1.25rem; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.empty h2 { margin: .4rem 0 0; font-size: var(--text-md); }
.empty p { margin: 0 0 .75rem; color: var(--muted); }
.empty .mark { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.empty .mark .icon { --icon-size: 1.3rem; }

.rows { list-style: none; margin: 0 0 1rem; padding: 0; }
.rows li { display: flex; align-items: center; gap: .9rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows li > div { flex: 1 1 auto; min-width: 0; }
.rows li > .icon { color: var(--faint); --icon-size: 1.25rem; }
.rows .main { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; color: var(--text-strong); font-weight: var(--weight-strong); }
.rows .note { display: block; margin-top: .1rem; overflow-wrap: anywhere; }

/* A QR code (a link's) beside what is said about it; above it on a
   phone. The code keeps its own white border, framed by a thin line. */
.link-qr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.25rem 2rem; }
.link-qr > img { flex: none; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.link-qr > div { flex: 1 1 18rem; min-width: 0; }
.link-qr .facts { margin-bottom: 1.1rem; }
.link-qr .address { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }

/* Numbered steps (<ol class="steps">): each number in a circle, the
   step's parts one under the other beside it, at most a wide field's
   width. A step starts with its .label (a <label> for its box, or a
   span), or a .card-head holding the .label and a button; a form in a
   step lines its parts up the same way. */
ol.steps { list-style: none; margin: 0 0 1rem; padding: 0; counter-reset: step; display: grid; gap: 1.6rem; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--text-sm); font-weight: var(--weight-strong); }
ol.steps > li, ol.steps > li > form { display: grid; gap: .6rem; }
ol.steps > li > *, ol.steps > li > form > * { margin: 0; max-width: var(--field-width-wide); }
ol.steps .label { color: var(--text-strong); font-weight: var(--weight-strong); line-height: 1.85rem; }
ol.steps > li > .card-head { flex-wrap: nowrap; }

/* --- Dashboard --- */

.widgets { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); margin: 0 0 1.25rem; }
.widgets .card { margin: 0; min-width: 0; }
/* A box with a table in it (such as System) takes the whole row, so its
   columns have room. */
.widgets .card:has(table) { grid-column: 1 / -1; }
.widgets .table-wrap { margin: 0; box-shadow: none; }

/* --- Figures and charts (analytics' screens) --- */

/* A row of big numbers, each in its own box. */
.figures { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); margin: 0 0 1.25rem; }
.figures .card { margin: 0; }
.figure { display: grid; gap: .15rem; }
.figure .label { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-strong); }
.figure .value { color: var(--text-strong); font-size: var(--text-3xl); font-weight: var(--weight-title); letter-spacing: var(--title-tracking); line-height: var(--leading-tight); font-variant-numeric: tabular-nums; }
.figure .sub { color: var(--muted); font-size: var(--text-sm); }

/* The bar chart, drawn by the server as plain HTML: each bar a box as tall
   as its share of the top line, its numbers in a tip shown on hover, tap
   or keyboard focus (the ⓘ tips' look). Grid lines and labels sit at fixed
   places, so the text stays its size however wide the box. */
.chart { --chart-h: 13rem; display: grid; grid-template-columns: auto 1fr; grid-template-rows: var(--chart-h) auto; column-gap: .6rem; }
.chart .y { position: relative; min-width: 2rem; }
.chart .y span, .chart .x span { position: absolute; color: var(--muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart .y span { right: 0; transform: translateY(50%); }
.chart .plot { position: relative; border-bottom: 1px solid var(--line-strong); }
.chart .grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.chart .cols { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.chart .col { position: relative; flex: 1 1 0; display: flex; align-items: flex-end; justify-content: center; height: 100%; padding: 0 1px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; cursor: default; }
a.col { cursor: pointer; }
.chart .bar { display: block; width: min(70%, 1.75rem); min-width: 2px; min-height: 1px; border-radius: 4px 4px 0 0; background: var(--accent-text); }
.chart .now .bar { background: color-mix(in srgb, var(--accent-text) 40%, var(--surface)); }
.chart .col:hover, .chart .col:focus-visible { background: var(--surface-2); outline: none; }
.chart .col:hover .bar, .chart .col:focus-visible .bar { background: color-mix(in srgb, var(--accent-text) 75%, var(--surface)); }
/* Without JavaScript, a bar's own tip; with it, admin.js's tip box. */
.chart .col::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + .35rem); left: 50%; transform: translateX(-50%); z-index: 20;
  width: max-content; max-width: 16rem; padding: .4rem .6rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raised); box-shadow: var(--shadow-pop);
  color: var(--text); font-size: var(--text-sm); line-height: var(--leading); pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .12s;
}
.chart .col:nth-child(-n+3)::after { left: 0; transform: none; }
.chart .col:nth-last-child(-n+3)::after { left: auto; right: 0; transform: none; }
.chart .col:hover::after, .chart .col:focus-visible::after { opacity: 1; visibility: visible; }
.js .chart .col::after, .chart .future::after { display: none; }
.chart .x { position: relative; grid-column: 2; height: 1.5rem; }
.chart .x span { top: .35rem; transform: translateX(-50%); }
.chart.small { --chart-h: 6rem; margin: .75rem 0; }
.chart .future:hover { background: none; }
/* Bars in parts (the Bots page): people darkest, known bots lighter, not
   identified striped, with a thin gap of the box's colour between parts. */
.chart .parts { display: flex; flex-direction: column; justify-content: flex-end; width: min(70%, 1.75rem); min-width: 3px; height: 100%; }
.chart .part { display: block; border-top: 2px solid var(--surface); }
.chart .parts .part:first-child { border-radius: 4px 4px 0 0; }
.chart .part.p0, .legend i.p0 { background: var(--accent-text); }
.chart .part.p1, .legend i.p1 { background: color-mix(in srgb, var(--accent-text) 45%, var(--surface)); }
.chart .part.p2, .legend i.p2 { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent-text) 30%, var(--surface)) 0 3px, color-mix(in srgb, var(--accent-text) 12%, var(--surface)) 3px 6px); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 0 0 .75rem; color: var(--muted); font-size: var(--text-sm); }
.legend span { display: inline-flex; align-items: center; gap: .45rem; }
.legend i { width: .8rem; height: .8rem; border-radius: 3px; }
.chart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: .75rem; color: var(--muted); font-size: var(--text-sm); }
.chart-foot details summary { cursor: pointer; }
.chart-foot details .table-wrap { margin-top: .75rem; }

/* Top lists side by side on wide screens. On phones they keep Visits, the
   main number. */
.lists { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); align-items: start; margin: 0 0 1.25rem; }
.lists .card { margin: 0; min-width: 0; }
.lists .table-wrap { margin: 0 0 .75rem; box-shadow: none; }
.lists td:first-child { overflow-wrap: anywhere; }
.card td.num { white-space: nowrap; }
@media (max-width: 40rem) { .lists .views { display: none; } }
/* A small "FR" after a page in another language. */
td .tag { margin-left: .35rem; vertical-align: .1em; }
/* A share of the whole, as a thin bar under a row's name. */
.share { display: block; height: 3px; margin-top: .3rem; border-radius: 2px; background: var(--surface-3); }
.share > span { display: block; height: 100%; border-radius: 2px; background: var(--accent-text); }
.who { display: flex; align-items: center; gap: .5rem; }
.who .icon { color: var(--muted); }

/* The range: ready ranges as tabs, a custom one beside them. A
   .month-bar (History) is laid out the same: a .month-head (the month's
   name and a note), and the month to show beside it. */
.range, .month-bar, .tabs-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; margin: 0 0 1.25rem; box-shadow: inset 0 -1px 0 var(--line); }
.range .tabs, .tabs-bar .tabs { margin: 0; box-shadow: none; }
/* A .tabs-bar: tabs, and a choice beside them on the right (a Field,
   its label read by screen readers only). */
.tabs-bar .field { padding-bottom: .5rem; }
.tabs-bar select { width: auto; }
.range form, .month-bar form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-bottom: .5rem; }
.range form input, .month-bar form select { width: auto; }
.range form .note { margin: 0; }
.month-bar .month-head { margin: 0 0 .6rem; }
.month-bar .month-head h2 { margin: 0; }

/* The Bots page's "Who asked for pages": each row opens to its pages,
   with the usual .fold arrow before the bot's name. */
.bots td { vertical-align: top; }
.bots details summary { display: flex; align-items: center; gap: .1rem; list-style: none; cursor: pointer; }
.bots details summary::-webkit-details-marker { display: none; }
.bots details summary .fold { margin-left: -.4rem; }
.bots details summary:hover .fold { color: var(--text-strong); }
.bots tr.unknown td { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.bot-pages { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1.5rem; margin: .5rem 0 .25rem 1.45rem; font-size: var(--text-sm); color: var(--muted); }
.bot-pages span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.down { color: var(--muted); }

/* --- "Are you sure?" box (admin.js) --- */

dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: min(27rem, calc(100vw - 2rem));
  background: var(--raised);
  color: var(--text);
  box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: var(--backdrop); }
dialog h2 { font-size: var(--text-lg); margin: 0 0 .45rem; }
dialog p { margin: 0 0 1.5rem; color: var(--muted); }
dialog form { margin: 0; }
dialog menu { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; margin: 0; padding: 0; }

/* --- Files: the file library's screens, and content's photo fields --- */

/* The way to a folder, under its title: Files › Menus › 2026, each step
   a link in the accent colour with a clear arrow after it, the folder
   shown last, strong and not a link. On a phone a long way keeps its two
   ends, the steps between (li.middle) folded into li.gap "…". On a wide
   screen a very long way folds too, keeping a little more of each end:
   li.far folds into li.gap.wide. It wraps if still too long. */
.crumbs { margin: -.35rem 0 0 -.4rem; font-size: var(--text-md); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem 0; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs .here { padding: .25rem .4rem; color: var(--text-strong); font-weight: var(--weight-strong); overflow-wrap: anywhere; }
.crumbs li:not(:last-child)::after { content: ""; flex: none; width: .5rem; height: .5rem; margin: 0 .55rem 0 .3rem; border: solid var(--muted); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.crumbs a { padding: .25rem .4rem; border-radius: var(--radius-sm); color: var(--accent-text); font-weight: var(--weight-medium); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .2em; overflow-wrap: anywhere; }
.crumbs a:hover { background: var(--surface-2); text-decoration-color: currentColor; }
.crumbs a:focus-visible { outline-offset: 1px; }
.crumbs .gap { display: none; color: var(--muted); padding: 0 .25rem; }
.crumbs li.far { display: none; }
.crumbs li.gap.wide { display: inline-flex; }
@media (max-width: 40rem) {
  .crumbs li.middle { display: none; }
  .crumbs li.gap { display: inline-flex; }
  .crumbs li.gap.wide { display: none; }
}

/* The top of the library, one header: the way to the folder just under
   the title, then one row with the search, the "Used on the site" chip,
   New folder, Move, Delete and Upload; the uploads'
   progress under it. The search's form and the bar only group their
   parts: the parts sit in the row themselves, so they share it and wrap
   as one (on a phone the search takes a line of its own). */
.library-head { display: grid; gap: .85rem; margin: 0 0 1rem; }
.library-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.library-search, .library-bar { display: contents; }
.search-box { position: relative; flex: 1 1 18rem; max-width: 32rem; min-width: 0; }
.search-box > .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-box input { height: 2.6rem; padding-left: 2.5rem; padding-right: 2.6rem; border-radius: var(--radius-lg); }
/* The page's own × instead of the browser's, where it has one (the
   library's); the move box's and the picker's keep the browser's. */
.search-box:has(.clear) input::-webkit-search-cancel-button { display: none; }
.search-box:not(:has(.clear)) input { padding-right: .75rem; }
.search-box .clear { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 1.9rem; height: 1.9rem;
  border-radius: var(--radius); color: var(--muted); }
.search-box .clear:hover { background: var(--surface-2); color: var(--text-strong); }
.search-box .clear .icon { --icon-size: 1rem; }
/* On a phone: the search on a line of its own, then "Not used on the
   site", then the bar's buttons together at the right. */
@media (max-width: 40rem) {
  .search-box { flex-basis: 100%; max-width: none; }
  .library-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .6rem; flex: 1 0 auto; max-width: 100%; }
  .library-bar .bar-tools { margin-left: 0; flex-wrap: wrap; justify-content: flex-end; row-gap: .5rem; }
  /* What is ticked ("2 folders and 5 files selected") goes on a line of
     its own over the buttons, so the row never runs off the screen. */
  .library-bar .bar-said { flex-basis: 100%; margin-right: 0; text-align: right; white-space: normal; }
}
/* A choice that is on or off, as a small rounded button (a tick box
   underneath, or a link): coloured, with a tick, while on. */
.chip { position: relative; display: inline-flex; align-items: center; gap: .35rem; height: 2.1rem; padding: 0 .85rem; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: var(--text-sm); font-weight: var(--weight-medium); white-space: nowrap; cursor: pointer; user-select: none; }
.chip:hover { background: var(--surface-2); }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.chip .icon { --icon-size: .95rem; display: none; margin-left: -.2rem; }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-text); color: var(--accent-text); }
.chip:has(input:checked) .icon { display: inline-block; }
.chip:has(input:focus-visible) { outline: var(--ring); outline-offset: 2px; }
/* The same as a link that steps through choices (role="button"): on
   while aria-pressed is true. */
a.chip { text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-text); color: var(--accent-text); }
.chip[aria-pressed="true"] .icon { display: inline-block; }
a.chip:focus-visible { outline: var(--ring); outline-offset: 2px; }
.bar-tools { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.bar-said { margin-right: .35rem; color: var(--muted); font-size: var(--text-sm); white-space: nowrap; }
.bar-said:empty { display: none; }
/* As tall as the Upload button beside them, with larger icons. */
.bar-tools .icon-button { width: 2.6rem; height: 2.6rem; border: 1px solid var(--line); background: var(--surface); }
.bar-tools .icon-button:not(:disabled):hover { background: var(--surface-2); border-color: var(--line-strong); }
.bar-tools .icon-button .icon { --icon-size: 1.4rem; }
.library-bar .upload .button { height: 2.6rem; }
.bar-tools .icon-button:disabled { opacity: .35; cursor: default; background: transparent; }
/* The library's tools (New folder, Move, Delete) say their word beside
   their icon, so New folder is never taken for Upload; Upload, the main
   button, stands apart after a thin line. Where the room runs short (the
   menu beside the list, or a phone) the words go and the icons stay (each
   keeps its name for screen readers and on hover). The tools and Upload
   are one group, so they always wrap together. (They stay on one line,
   as flex keeps them, except on a phone: see above.) */
.bar-tools .tool { display: inline-flex; align-items: center; width: auto; gap: .4rem; padding: 0 .8rem 0 .6rem; color: var(--text); font-size: var(--text-sm); font-weight: var(--weight-medium); white-space: nowrap; }
.bar-tools .tool .icon { --icon-size: 1.2rem; }
.library-bar .upload { margin-left: .4rem; padding-left: .75rem; border-left: 1px solid var(--line-strong); align-self: stretch; }
@media (max-width: 75rem) {
  .bar-tools .tool { justify-content: center; width: 2.6rem; padding: 0; }
  .bar-tools .tool .icon { --icon-size: 1.4rem; }
  .bar-tools .tool-word { display: none; }
}
.upload { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: 0; }
.upload .button { cursor: pointer; }
.upload .button:focus-within { outline: var(--ring); outline-offset: 2px; }
/* Upload and its ▾ (upload a folder, M7c) are one button in two parts, the
   ▾ part narrow, after a thin line. Where the ▾ is hidden (a phone: no
   folders to pick), Upload is whole. */
.split-button { display: inline-flex; }
.split-more[hidden] { display: none; }
.split-button:has(> .split-more:not([hidden])) > .button:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-button .split-more { padding: 0 .55rem; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-color: color-mix(in srgb, var(--on-accent) 25%, transparent); }
.split-button .split-more .icon { margin: 0; }
/* Under the list: how many are shown, the pages, and Per page. On a phone
   they wrap, one under the other. */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; margin: 1rem 0 1.25rem; font-size: var(--text-sm); }
.pager > .note { margin: 0; }
.page-numbers { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.page-numbers .number { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .4rem; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.page-numbers .number:hover { background: var(--surface-2); }
.page-numbers .number.current { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.page-numbers .gap { padding: 0 .2rem; color: var(--muted); }
.per-page label { display: flex; align-items: center; gap: .5rem; color: var(--muted); }
.per-page select { width: auto; }
/* Files dragged over the library: the place to drop them. */
.library { border-radius: var(--radius-lg); outline: 2px dashed transparent; outline-offset: 4px; }
.library.dropping, .upload.dropping { outline: 2px dashed var(--line-strong); outline-offset: 4px; background: var(--surface-2); }
/* The move box: a large box (the whole screen on a phone) with a title,
   the names of what is ticked and a close button at the top, the folder
   tree in the
   middle (it scrolls on its own), then "New folder", Cancel and Move at
   the bottom. */
dialog.move-to { width: min(46rem, calc(100vw - 3rem)); height: min(44rem, calc(100vh - 3rem)); height: min(44rem, calc(100dvh - 3rem)); }
/* The picker's size (see "The picker" below): set here, before the phone
   rule the two large boxes share. */
dialog.picker-box { width: min(56rem, calc(100vw - 2rem)); height: min(46rem, calc(100vh - 2rem)); height: min(46rem, calc(100dvh - 2rem)); overflow: hidden; }
/* The two large boxes, the move box and the picker: no usual box's
   limits or padding (their parts have their own), a column once open,
   and the whole screen on a phone. (dvh: the height a phone's browser
   leaves the page, so the buttons at the bottom stay above its bar.) */
:is(dialog.move-to, dialog.picker-box) { max-width: none; max-height: none; padding: 0; }
:is(dialog.move-to, dialog.picker-box)[open] { display: flex; flex-direction: column; }
@media (max-width: 40rem) {
  :is(dialog.move-to, dialog.picker-box) { width: 100%; height: 100%; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
}
.move-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem .9rem; border-bottom: 1px solid var(--line); }
/* The titles at the top of the move, delete and picker boxes. */
:is(.move-head, .delete-head, .picker-head) h2 { margin: 0; }
.move-head .note { margin: .2rem 0 0; overflow-wrap: anywhere; }
.move-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .75rem; padding: 1rem 1.25rem; overflow-y: auto; }
.move-body .notice { margin: 0; max-width: none; }
.move-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .9rem 1.25rem; border-top: 1px solid var(--line); }
.move-foot menu { margin-left: auto; }
/* The search: the library's .search-box, across the box. */
.move-body .search-box { flex: none; max-width: none; }
/* The tree: each folder a row to click, the folders in it set in under
   it. The round choice is hidden: a row is shaded on hover, and coloured
   with a tick at its end once chosen. The folder the files are in is
   greyed out. */
.move-to .tree { flex: 1 0 12rem; overflow-y: auto; padding: .35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.move-to .tree ul { list-style: none; margin: 0; padding: 0 0 0 1.4rem; }
.move-to .tree > ul { padding: 0; }
/* Folders can go 100 deep, so the setting-in stops after 6 levels (else
   a deep folder's row is squeezed until its name shows one letter a
   line). The folders deeper than that keep one thin line down their
   left side, to show they sit further in. (The 8 "ul" are the top list
   and 7 levels in.) */
.move-to .tree ul ul ul ul ul ul ul ul { padding-left: .5rem; border-left: 1px solid var(--line); }
.move-to .tree ul ul ul ul ul ul ul ul ul { padding-left: 0; border-left: 0; }
.move-to .tree li:not(.open) > ul { display: none; }
.move-to .tree.searching li > ul { display: block; }
.move-to .tree .note { margin: .5rem .75rem; }
.node { display: flex; align-items: center; gap: .15rem; }
/* The arrow that folds a part away, the same everywhere: a folder's
   folders in the move box and the picker, the Files list's "Folders", a
   part of a content list (details.list-group), a Bots row, a long line of
   a consent history. It points right while the
   part is folded, and turns to point down once it is open. A plain arrow,
   never a raised button (it drops the shadow and press every button has). */
.fold { display: inline-grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem; padding: 0; border: 0; border-radius: var(--radius-sm);
  background: none; box-shadow: none; color: var(--muted); }
button.fold:hover { background: none; color: var(--text-strong); }
button.fold:active { transform: none; }
.fold .icon, .section-fold .icon { --icon-size: 1rem; margin: 0; transition: transform .12s; }
li.open > .node .fold .icon, .tree.searching .fold .icon, .picker-folder[open] > summary .fold .icon,
details.list-group[open] > summary .fold .icon, details.fold-card[open] > summary .fold .icon, .bots details[open] > summary .fold .icon,
.section-fold[aria-expanded="true"] .icon { transform: rotate(90deg); }
.folder-choice { position: relative; flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .55rem; min-height: 2.6rem; padding: .35rem 2.4rem .35rem .7rem;
  border-radius: var(--radius); color: var(--text-strong); cursor: pointer; user-select: none; }
.folder-choice input { position: absolute; opacity: 0; pointer-events: none; }
.folder-choice > .icon { color: var(--muted); }
.folder-choice .name { font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.folder-choice .count { color: var(--muted); font-size: var(--text-sm); }
.folder-choice > .icon:last-child { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); color: var(--accent-text); visibility: hidden; }
.folder-choice:hover { background: var(--surface-2); }
.folder-choice:has(input:focus-visible) { outline: var(--ring); outline-offset: -2px; }
.folder-choice:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-text); }
.folder-choice:has(input:checked) > .icon { color: var(--accent-text); }
.folder-choice:has(input:checked) > .icon:last-child { visibility: visible; }
.folder-choice.here, .folder-choice.inside { cursor: default; color: var(--muted); }
.folder-choice.here:hover, .folder-choice.inside:hover { background: none; }
.folder-choice.here .name, .folder-choice.inside .name { font-weight: var(--weight-normal); }
.folder-choice.inside > .icon:first-of-type { opacity: .5; }
/* Making a new folder from the box: its name and buttons in a row. */
.move-new { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.move-new .field { flex: 1 1 14rem; margin: 0; }
.move-new .notice { flex: 1 0 100%; }
/* (Space under each line as its own margin, not a gap: a line going
   closes up with its space, admin.js's takeAway, where a gap would jump.
   The last one's is taken back by the list's.) */
.upload-list { flex: 1 0 100%; display: grid; margin: 0 0 -.35rem; padding: 0; list-style: none; }
.upload-list > li { margin-bottom: .35rem; }
.upload-list:empty { display: none; }
.upload-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; font-size: var(--text-sm); }
.upload-list .name { font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.upload-list .path { color: var(--muted); font-weight: var(--weight-normal); }
/* A folder upload's line, one for the whole folder (M7c). */
.upload-list .name .icon { --icon-size: 1rem; margin-right: .35rem; vertical-align: -.15em; color: var(--faint); }
.upload-list progress { flex: 0 1 10rem; height: .5rem; }
.upload-list li.ok .said { color: var(--ok); }
.upload-list li.already .said { color: var(--muted); }
.upload-list li.problem .said { color: var(--problem); }
.upload-list li.warn .said { color: var(--warn); }
/* The line saying how the uploads went: a tick (or a problem sign), the
   words, maybe a link, and a × that clears the lines; one with nothing
   wrong fades away by itself. */
.upload-list .upload-done { gap: .5rem; padding: .35rem .5rem .35rem .65rem; border-radius: var(--radius); font-weight: var(--weight-medium); color: var(--text-strong); }
.upload-list .upload-done.ok { background: var(--ok-soft); }
.upload-list .upload-done.ok > .icon { color: var(--ok); }
.upload-list .upload-done.problem { background: var(--problem-soft); }
.upload-list .upload-done.problem > .icon { color: var(--problem); }
.upload-list .upload-done > button { margin-left: auto; }
/* A folder's line that is also the finished line (one folder uploaded
   alone): grey while it goes, then green or red; its words in the
   finished line's colour. */
.upload-list .upload-done:not(.ok, .problem) { background: var(--surface-2); }
.upload-list .upload-done:not(.ok, .problem) > .icon { color: var(--muted); }
.upload-list li.upload-done .said { color: inherit; }
/* A row that just changed (renamed, made private, just uploaded), or a
   part of a page just saved (a part of Business info, an item's box):
   shaded, fading back in two seconds. */
@keyframes just-changed { from { background: var(--accent-soft); } }
tr.just-changed > td, .just-changed:not(tr) { animation: just-changed 2s ease-out; }
@media (prefers-reduced-motion: reduce) { tr.just-changed > td, .just-changed:not(tr) { animation-duration: .01s; } }
.upload-list form { margin: 0; }

/* A search's line over its results: what was found, where, and the link
   that looks elsewhere. */
p.found { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .75rem; max-width: none; margin: 0 0 .75rem; color: var(--muted); font-size: var(--text-sm); }
p.found a { font-weight: var(--weight-medium); }

/* The list: one table in two parts, the folders then the files, each
   with its own row of headings (tr.heads, its first row's corners
   rounded with the box's). A heading that sorts is a link, with an arrow
   while the list is in its order. */
table.files tbody:first-child > tr:first-child > th:first-child { border-top-left-radius: calc(var(--radius-lg) - 1px); }
table.files tbody:first-child > tr:first-child > th:last-child { border-top-right-radius: calc(var(--radius-lg) - 1px); }
th a.sort { display: inline-flex; align-items: center; gap: .2rem; color: inherit; text-decoration: none; }
th a.sort:hover { color: var(--text-strong); text-decoration: underline; }
th[aria-sort] a.sort { color: var(--text-strong); }
th a.sort .icon { --icon-size: .9rem; }
th.num a.sort { flex-direction: row-reverse; }
.file-rows > tr.heads > th { border-top: 1px solid var(--line); }
table.files tbody:first-child > tr.heads:first-child > th { border-top: 0; }

/* Folders, as the list's first rows: a heading that folds them away
   (with how many), their own headings, then a folder picture, its name,
   how many folders and files are directly in it, when it was made, its
   privacy switch, its download (a .zip) and an arrow; the rest of the
   row opens it. With many, the rows past the first few wait behind "Show
   all" (only while JavaScript runs: without it, every row shows). What
   the folder holds shows under its name on a phone only (the columns say
   it on a wider screen). */
.section-head th { padding: 0; background: var(--surface); color: var(--text-strong); }
.section-fold { display: flex; align-items: center; justify-content: flex-start; gap: .4rem; width: 100%; height: auto; padding: .6rem 1rem; border: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--text-strong); font-size: var(--text-sm); font-weight: var(--weight-strong); text-align: left; }
.section-fold:hover { background: var(--surface-2); }
.section-fold:active { transform: none; }
/* (Its focus ring sits inside it: the table round it cuts off anything
   that sticks out.) */
.section-fold:focus-visible { outline-offset: -2px; }
.section-fold .icon { color: var(--muted); }
.section-fold .count { color: var(--muted); font-weight: var(--weight-normal); }
html:not(.js) .section-fold { pointer-events: none; }
html:not(.js) .section-fold .icon { display: none; }
.folder-rows.shut > tr:not(.section-head) { display: none; }
/* A folder's row ticks like a file's; its icon and name open it, with
   room around them to hit easily (padding the margin takes back, so the
   row looks the same). */
.folder-row .file-name { min-width: 0; padding: .6rem 1.25rem .6rem .25rem; margin: -.6rem -1.25rem -.6rem -.25rem; border-radius: var(--radius-sm); }
.folder-row .file-name:hover .title { text-decoration: underline; text-underline-offset: .2em; }
.thumb.folder { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.folder-text { display: grid; min-width: 0; }
.folder-text .title { color: var(--text-strong); font-weight: var(--weight-strong); overflow-wrap: anywhere; }
.folder-text .sub { display: none; font-weight: var(--weight-normal); }
.folder-row .tag { margin-left: .5rem; }
.folder-row .go { color: var(--faint); }
.folder-row:hover .go { color: var(--text-strong); }
/* A folder's privacy switch: a lock, faint while public, coloured while
   private; greyed out while a folder around it decides. */
.privacy { color: var(--faint); }
.privacy.on { color: var(--accent-text); }
.privacy[aria-disabled="true"] { opacity: .45; cursor: default; }
.privacy[aria-disabled="true"]:hover { background: none; }
.folder-rows:not(:last-child) > tr:last-child > td { border-bottom: 1px solid var(--line-strong); }
.js .folder-rows.folded > tr.more { display: none; }
html:not(.js) .show-all { display: none; }
.show-all td { padding-block: .55rem; }
.show-all button { gap: .35rem; text-decoration: none; }
.show-all button .icon { margin: 0; }
/* On a phone: each part's headings are one line of the orders to choose
   (and the tick-all box, at the right, over the rows' boxes). A folder is
   one line: its name (with what it holds under it), its buttons, its box;
   on a narrow phone (most are), its buttons go on a line under it, so
   its name has room. A name breaks between words, not inside one; a
   single word too long for its cell is broken where it must be
   (min-width: 0 lets the name be narrower than that word, so it stays
   in its cell). A private folder's "Private" tag goes on a line of its
   own when it doesn't fit beside the name, rather than squeezing it.
   (Up to 64rem, not only on a phone: see the Files list's cards.) */
@media (max-width: 64rem) {
  .folder-text .title { overflow-wrap: break-word; min-width: 0; }
  table.list tr.heads { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; padding: .35rem .5rem .35rem 1rem; background: var(--surface-2); }
  table.list tr.heads > th { padding: .25rem 0; border: 0; background: none; }
  table.list tr.heads > th:not(.pick, .sortable) { display: none; }
  table.list tr.heads > th.pick { order: 1; margin-left: auto; width: 3rem; }
  table.list tr.heads > th.num a.sort { flex-direction: row; }
  table.list tr.section-head { padding: 0; }
  table.list tr.section-head > th { display: block; border-bottom: 1px solid var(--line); }
  .folder-text .sub { display: block; }
  table.list tr.folder-row { display: flex; align-items: center; gap: .25rem; padding-right: .5rem; }
  table.list tr.folder-row > td { align-items: center; padding: 0; }
  .folder-rows:not(:last-child) > tr:last-child > td { border-bottom: 0; }
  table.list .folder-rows:not(:last-child) > tr:last-child { border-bottom: 1px solid var(--line-strong); }
  table.list tr.folder-row > td:not(.end, .pick):first-of-type, table.list tr.folder-row > td.pick + td { flex: 1; min-width: 0; flex-wrap: wrap; }
  table.list tr.folder-row > td.num, table.list tr.folder-row > td[data-label], table.list tr.folder-row > td:empty { display: none; }
  table.list tr.folder-row > td.pick { order: 1; flex: none; width: 3rem; }
  table.list tr.show-all > td.pick, table.list tr.show-all > td.end { display: none; }
}
@media (max-width: 27.5rem) {
  table.list tr.folder-row { flex-wrap: wrap; }
  table.list tr.folder-row > td.end { order: 2; flex-basis: 100%; }
}

/* The delete box (admin.js's askDelete): its title, then lists that
   scroll inside it (what goes, then, set apart in the warning colour,
   what is kept and why), then, not scrolling, "This can't be undone" and
   its buttons, so the warning is always in sight beside the button. The
   whole screen's width on a phone. */
dialog.delete-box { width: min(32rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); padding: 0; }
dialog.delete-box[open] form { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); }
.delete-head { padding: 1.25rem 1.5rem .5rem; }
.delete-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: .9rem; padding: .25rem 1.5rem 1rem; }
.delete-body section { display: grid; gap: .35rem; }
.delete-body h3 { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.delete-body ul { display: grid; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.delete-body li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; }
.delete-body li .name { color: var(--text-strong); font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.delete-body li.more { color: var(--muted); font-size: var(--text-sm); }
.delete-body .kept { padding: .75rem .9rem; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }
.delete-body .kept h3 { color: var(--warn); }
.delete-box .undo { flex: none; display: flex; align-items: center; gap: .45rem; margin: 0; padding: 0 1.5rem 1rem; color: var(--text-strong); font-weight: var(--weight-medium); }
.delete-box .undo .icon { color: var(--problem); }
dialog.delete-box menu { padding: .9rem 1.5rem 1.25rem; border-top: 1px solid var(--line); }

/* A file's page: its picture and descriptions, then what to know and its
   facts at the right on a wide screen; one column on a phone (and for a
   document, which has neither picture nor descriptions). */
.file-page { display: grid; gap: 1.25rem; align-items: start; }
.file-page > * { min-width: 0; }
.file-page:not(.two) { max-width: 44rem; }
@media (min-width: 60rem) { .file-page.two { grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem); } }
.file-page .facts { margin: 0; gap: .5rem 1.25rem; font-size: var(--text-sm); }
.file-page .notice { margin: 0; max-width: none; }
.descriptions .field { max-width: none; }

/* A file's small picture in a list. */
.thumb { display: inline-grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; object-fit: cover;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--faint); }
.file-name { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; }
.file-cell { display: inline-flex; align-items: center; gap: .25rem; }
/* A row's place for a button the file doesn't have (Open, Copy its link):
   as wide as a small icon button, so every row's buttons line up. */
.icon-slot { display: inline-block; width: 2rem; height: 2rem; vertical-align: middle; }
/* A file with something to know (open it to read): a warning icon. */
.flag { display: inline-grid; place-items: center; width: 2rem; height: 2rem; color: var(--warn); border-radius: var(--radius); }
.flag:hover { background: var(--warn-soft); }
.rename { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.rename .field { flex: 1 1 12rem; margin: 0; }
/* Settings that only matter while the one above is on: set in under it. */
.sub-settings { display: grid; gap: .75rem; margin-left: 1.5rem; padding-left: 1rem; border-left: 2px solid var(--line); }
/* Ticking files: the whole cell is the place to click (.pick-box), and the
   box is drawn by admin.css, rounded, filled with a tick once ticked, a
   dash for "some" (the tick-all box). A ticked row is lightly shaded. */
table.files th.pick, table.files td.pick { width: 3rem; padding: 0; }
.pick-box { display: grid; place-items: center; width: 100%; min-height: 3rem; cursor: pointer; }
.pick-box input {
  appearance: none;
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  border: 1.5px solid var(--input-line);
  border-radius: 5px;
  background: var(--input-bg);
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.pick-box:hover input { border-color: var(--muted); box-shadow: 0 0 0 4px var(--surface-3); }
.pick-box input:focus-visible { outline: var(--ring); outline-offset: 2px; }
.pick-box input::before {
  content: "";
  width: .32rem;
  height: .6rem;
  margin-top: -.12rem;
  border: solid var(--on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .12s;
}
.pick-box input:checked, .pick-box input:indeterminate { background: var(--accent); border-color: var(--accent); }
.pick-box input:checked::before { transform: rotate(45deg) scale(1); }
.pick-box input:indeterminate::before { width: .55rem; height: 0; margin: 0; border-width: 0 0 2px; transform: none; }
table.files tbody tr:has(.pick input:checked) > td { background: var(--surface-2); }
/* On a phone each file is a block: its tick box sits at its top right
   rather than on a line of its own. A ticked row is shaded as one (its
   cells are no longer a table's, so shading them leaves gaps). (Up to
   64rem, as the Files list's cards.) */
@media (max-width: 64rem) {
  table.files tbody tr { position: relative; }
  table.files tbody tr:has(.pick input:checked) { background: var(--surface-2); }
  table.files tbody tr:has(.pick input:checked) > td { background: none; }
  table.files tbody tr:not(.folder-row, .show-all) > td.pick { position: absolute; top: .5rem; right: .5rem; }
  table.files tbody tr:not(.folder-row, .show-all):has(> td.pick) > td.pick + td { padding-right: 3rem; }
}
table.files td.num { white-space: nowrap; }
/* A folder's Size shares its column with the files' "Used on the site",
   so it isn't a narrow td.num, which would squeeze that column; it lines
   up on the right like one. */
table.files td.folder-size { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* The storage meter. */
.meter p { margin: 0 0 .35rem; }
.meter progress { width: 100%; max-width: var(--field-width); height: .65rem; accent-color: var(--accent); }
.meter.over progress { accent-color: var(--warn); }

/* A file's page: its picture. */
.preview { margin: 0; padding: .75rem; text-align: center; }
.preview img { max-width: 100%; max-height: 28rem; border-radius: var(--radius-sm); }

/* A Photo or File field in content's forms: the photo chosen (a small
   picture), the file's name and folder, then Choose and Remove (links
   without JavaScript, buttons with it: admin.js). */
.file-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.file-preview:empty { display: none; }
.file-preview img { display: block; width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.file-chosen { flex: 1 1 12rem; min-width: 0; display: grid; gap: .4rem; }
/* (Three lines at most, the rest cut off with "…": a file deep in folders
   has a long place in brackets. Screen readers read it all; admin.js puts
   the whole line in a title, for the mouse.) */
.file-chosen p { margin: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.file-chosen .buttons { margin: 0; }

/* The picker: the library in a box over a content form (or, without
   JavaScript, a page of its own, its files links). The box keeps one
   size whatever is open in it (the whole screen on a phone): its title
   and close button, then the search and Upload, stay at the top; only
   the list under them (.picker-list) scrolls. In the list: Recent, the
   newest files in one row that scrolls across on its own, then the
   folders, each a row that opens (<details>) onto the folders inside it,
   set in, and its files. */
/* (Its size, and the whole screen on a phone, are set with the move
   box's, above.) */
.picker-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem .85rem 1.25rem; border-bottom: 1px solid var(--line); }
.picker-head h2 { min-width: 0; overflow-wrap: anywhere; }
.picker-head .icon-button { flex: none; }
.picker-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.picker-body > .note { margin: 0; padding: 1rem 1.25rem; }
.picker-box .picker { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.picker .toolbar { gap: .6rem; }
/* The search: the library's .search-box, sharing its line with Upload
   (or Search) even on a phone. */
.picker .toolbar .search-box { flex: 1 1 9rem; }
/* The picker's Upload stays at the end of the search line, and what it
   says ("Uploaded.", a problem) goes on its own line under both. (Its form
   takes no box of its own, so the button and the list sit in the toolbar's
   row directly: else the form grew as wide as a long message, and wrapped
   under the search with the button part-way across.) */
.picker .toolbar .upload { display: contents; }
.picker .toolbar .upload > .button { margin-left: auto; }
/* (So, as a file is dragged over it, the dashed "drop here" line goes
   round the Upload button: the form has no box to draw it on.) */
.picker .toolbar .upload.dropping > .button { outline: 2px dashed var(--line-strong); outline-offset: 4px; }
.picker-box .picker > .toolbar { flex: none; margin: 0; padding: .75rem 1.25rem; border-bottom: 1px solid var(--line); }
/* (A long list of uploads scrolls on its own, so the list under it keeps
   its room.) */
.picker-box .upload-list { max-height: 7.5rem; overflow-y: auto; }
.picker-box .picker-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .25rem 1.25rem 1.25rem;
  scroll-padding-block: .5rem; /* (so a tile the keys bring into view keeps its focus ring in view too) */ }
.picker h3 { margin: 1rem 0 .5rem; font-size: var(--text-sm); color: var(--muted); }
.picker-said { margin: .75rem 0; }
.picker-all { margin: .75rem 0 0; }
.picker-all a { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--text-sm); }
.picker-more { margin: .6rem 0 0; }
.picker-load { margin: .35rem 0 .5rem .5rem; font-size: var(--text-sm); }
/* A folder: a row to click (its arrow turns once open), its name, and how
   many files the field can take in it. */
.picker-folder > summary { display: flex; align-items: center; gap: .45rem; min-height: 2.6rem; padding: .3rem .5rem .3rem .2rem; border-radius: var(--radius);
  color: var(--text-strong); cursor: pointer; list-style: none; user-select: none; }
.picker-folder > summary::-webkit-details-marker { display: none; }
.picker-folder > summary:hover { background: var(--surface-2); }
.picker-folder > summary:focus-visible { outline-offset: -2px; }
.picker-folder > summary > .icon { color: var(--muted); }
.picker-folder > summary .name { min-width: 0; font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.picker-folder > summary .count { margin-left: auto; padding-left: .5rem; color: var(--muted); font-size: var(--text-sm); text-align: right; }
.picker-folder-body { margin: 0 0 .5rem 1.05rem; padding: .15rem 0 .25rem .75rem; border-left: 1px solid var(--line); }
/* (Folders can go 100 deep, so the setting-in stops after 6 levels, as
   in the move box: the folders deeper than that line up under the 6th
   level's thin line, so a deep folder's name keeps its room.) */
.picker-folder-body .picker-folder-body .picker-folder-body .picker-folder-body .picker-folder-body .picker-folder-body .picker-folder-body {
  margin-left: 0; padding-left: 0; border-left: 0; }
.picker-folder-body > .tiles { margin-top: .35rem; }
.tiles { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(8rem, 100%), 1fr)); margin: 0; padding: 0; list-style: none; }
/* Recent: one row, scrolling across inside itself (never the page). The
   bit of room round it keeps a chosen file's outline in view. */
.tiles.strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 8.5rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 3px 3px .6rem; margin: 0 -3px;
  scroll-padding-inline: 3px; /* (the tiles line up 3px in, keeping that room for the ring) */ }
.tiles.strip > li { scroll-snap-align: start; }
/* The picker on a phone: less room at the sides, folders set in less,
   smaller tiles. */
@media (max-width: 40rem) {
  .picker-head { padding-left: 1rem; }
  .picker-box .picker > .toolbar, .picker-box .picker-list { padding-left: 1rem; padding-right: 1rem; }
  .picker-folder-body { margin-left: .9rem; padding-left: .5rem; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(min(7rem, 100%), 1fr)); gap: .5rem; }
  .tiles.strip { grid-auto-columns: 7.25rem; }
  /* (The page under the box doesn't scroll meanwhile, nor keep a scroll
     bar beside it.) */
  html:has(dialog.picker-box[open]) { overflow: hidden; }
}
/* (A tile's one column never grows past it, and its name may wrap, which
   buttons don't by default: a long name wraps inside the tile rather than
   widening the picture over the next tile.) */
.tiles > li { display: grid; min-width: 0; }
.tile { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: .3rem; width: 100%; min-width: 0; height: auto; white-space: normal; padding: .4rem;
  text-align: left; line-height: var(--leading-tight); font-weight: var(--weight-normal); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.tile:hover { background: var(--surface-2); }
.tile:focus-visible { outline-offset: 1px; }
a.tile { text-decoration: none; }
.tile img { display: block; }
.tile img, .tile .thumb { width: 100%; max-width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); }
/* A document's tile: its kind's icon and its ending ("PDF") in place of a
   picture. */
.tile .thumb { display: grid; place-content: center; justify-items: center; gap: .2rem; border: 0; }
.tile .thumb .icon { --icon-size: 1.6rem; margin: 0; }
.tile .ext { font-size: var(--text-xs); font-weight: var(--weight-strong); letter-spacing: .04em; color: var(--muted); }
.tile-name { font-size: var(--text-sm); color: var(--text-strong); overflow-wrap: anywhere; }
.tile-about { display: flex; align-items: center; gap: .25rem; min-width: 0; font-size: var(--text-xs); color: var(--muted); overflow-wrap: anywhere; }
.tile-about .icon { --icon-size: .85rem; margin: 0; }
/* The file the field holds now: coloured, with a tick in its corner. */
.tile.chosen { background: var(--accent-soft); border-color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-text); }
.tile-chosen { position: absolute; top: .65rem; right: .65rem; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.tile-chosen .icon { --icon-size: .95rem; margin: 0; }

/* --- The Form entry page --- */

/* The answers on the left, and the entry's details (Received, Form, ...)
   in a smaller box at the right; one under the other on a phone. Not too
   wide, so a long message stays easy to read. */
.entry-page { display: grid; gap: 1.25rem; align-items: start; max-width: 68rem; }
.entry-page > * { min-width: 0; }
@media (min-width: 60rem) { .entry-page { grid-template-columns: minmax(0, 1fr) minmax(15rem, 19rem); } }
.entry-main > :last-child, .entry-main > :last-child > :last-child { margin-bottom: 0; }
.entry-about { margin: 0; gap: .5rem 1.25rem; font-size: var(--text-sm); }
/* What the same address sent again: under the first, quieter (a smaller,
   grey title and a plain box). */
.entry-again { margin-top: 2rem; }
.entry-again h2 { font-size: var(--text-md); color: var(--muted); }
.entry-again .facts.boxed { background: transparent; }
/* On a phone each answer's name sits above it, so a long message has
   the whole width. */
@media (max-width: 40rem) {
  .entry-answers { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .entry-answers dd + dt { margin-top: .75rem; }
}

/* --- A mailing list person's page --- */

/* It is laid out as an entry's page, its two boxes .card ones (the
   grid's gap spaces them, not their own margin). */
.entry-page > .card { margin: 0; }
/* The consent history: one row per change, a line between. Each row is
   its Yes or No, when and who, and under it what was said, grey, on one
   line: with the script, one too long is cut off with "…" and its arrow
   (shown by admin.js only then) opens it whole. Without the script, and
   printed, it shows whole. */
.consent-history { list-style: none; margin: 0; padding: 0; }
.consent-history > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .25rem .5rem; padding: .75rem 0; }
.consent-history > li + li { border-top: 1px solid var(--line); }
.consent-history > li:first-child { padding-top: .25rem; }
.consent-history > li:last-child { padding-bottom: 0; }
.consent-history .change { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; }
.consent-history .when { color: var(--text-strong); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.consent-history .who { color: var(--muted); }
.consent-history .said { color: var(--muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.consent-history .said:has(+ .fold[hidden]) { grid-column: 1 / -1; } /* no arrow: the text takes the whole width */
html.js .consent-history .said:not(.open) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.consent-history .said.open { color: var(--text); }
.consent-history .fold { width: 1.25rem; height: 1.25rem; align-self: start; }
.consent-history .fold[aria-expanded="true"] .icon { transform: rotate(90deg); }
@media print {
  html.js .consent-history .said:not(.open) { overflow: visible; white-space: normal; }
  .consent-history .fold { display: none; }
}

/* --- The login screen: no menu, a narrow column in the middle --- */

body.bare { grid-template: "above" auto "main" 1fr "foot" auto / 100%; }
main.login { display: grid; align-content: center; justify-items: center; padding: 3rem 1rem 6rem; }
.login .site { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.5rem; color: var(--text-strong); font-family: var(--font-title); font-size: var(--text-lg); font-weight: var(--weight-title); }
.login .site-logo { height: calc(var(--logo-h) * 1.5); max-width: 15rem; }
.login .card { width: 100%; max-width: 24rem; padding: 2rem; }
.login h1 { font-size: var(--text-xl); margin: 0 0 .3rem; }
.login .card > .note:first-of-type { margin: 0 0 1.5rem; }
.login .card > .note:last-child { margin: 1.25rem 0 0; }
.login .field { max-width: none; }
.login .stack > button { width: 100%; height: 2.6rem; }
.login .slot-below-login-form { width: 100%; max-width: 24rem; margin: 1.25rem 0 0; text-align: center; color: var(--muted); font-size: var(--text-sm); }
.login .slot-below-login-form > :last-child { margin-bottom: 0; }
