/* =============================================================================
 * Daena Foundation — the organizers' desk
 * THEME: Shab (Night), borrowed whole from the public site
 *
 * This stylesheet adds the furniture a desk needs and the public pages have
 * none of: a bar that says whose desk it is, a long editing form in sections,
 * a season that can be reordered, a door list that has to survive a phone and
 * a printer, and a save bar that follows the organizer down the page.
 *
 * Everything else comes from template-a-html/assets/css/daena.css, which the
 * page loads first: the ground, the gold, Cinzel on the nameplate, Cormorant
 * on the headings, Spectral in the paragraphs, Vazirmatn for Persian, and the
 * components — .btn, .link, .field, .chip, .note, .help, .error-summary,
 * .label, .rule-hair, .masthead, .wrap, .foot. None of those are said twice
 * here. Where a value is needed it is taken from daena.css's own custom
 * properties, never typed out again.
 *
 * Logical properties throughout, as the public stylesheet does it, so the
 * Persian right-to-left desk needs no second stylesheet.
 *
 * No framework, no build step, no imports, no dependencies.
 * ========================================================================== */

/* ------------------------------------------------- 1 · the fallback tokens ---
 * index.html promises that the desk stays plain rather than unreadable if
 * daena.css cannot be found — a server that serves admin/ui from somewhere
 * else needs one href changed, and that href is the single point of failure
 * for the whole look. So the night theme's own values are repeated here.
 *
 * They are wrapped in :where(), which carries no specificity at all, so the
 * identical :root block in daena.css (and the .theme-night class that feeds
 * it) outranks every line below whenever the public stylesheet is present —
 * even though this file is loaded second. These values therefore only ever
 * apply when there is nothing else to apply. Change a colour in
 * shared/brand/tokens.json, not here.
 * -------------------------------------------------------------------------- */

:where(:root) {
  --ink: #06060A;
  --paper: #F2EDE1;
  --body: #D9D0BF;
  --muted: #A89F8F;
  --gold: #E4C06A;
  --gold-lit: #F0D79A;
  --line: color-mix(in srgb, var(--gold) 30%, transparent);
  --line-faint: color-mix(in srgb, var(--gold) 14%, transparent);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --font-text: 'Spectral', 'Vazirmatn', Georgia, serif;
  --font-display: 'Cormorant Garamond', 'Vazirmatn', Georgia, serif;
  --font-label: 'Spectral', 'Vazirmatn', Georgia, serif;
  --font-nav: 'Cinzel', 'Vazirmatn', Georgia, serif;
  --font-fa-body: 'Vazirmatn', 'IRLotus', Tahoma, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --bar-h: 4.25rem;
  --color-surface: #111016;
  --color-rule: #2A2620;
  --color-focus: #F2B705;
  --color-success: #A8D5B5;
  --color-warning: #F2B705;
  --color-danger: #E06B83;
}

/* The one reset the desk cannot do without. Several rules below give a block
   display:grid or display:flex, and a component rule like that overrides the
   browser's own [hidden] rule — which would un-hide every screen at once and
   show the organizer six pages stacked on top of each other. daena.css carries
   this line for the same reason; it is repeated so the desk is still usable
   when daena.css is the thing that went missing. */
[hidden] { display: none !important; }

/* And the language switch, for the same reason: every line on this desk is
   written twice, once in each language, and without this rule a missing
   daena.css leaves "Every gatheringهمه‌ی گردهمایی‌ها" in every heading. The
   same two lines daena.css carries, so nothing changes when it is there. */
[data-lang="en"] [lang="fa"].alt,
[data-lang="fa"] [lang="en"].alt { display: none; }

/* --------------------------------------------- 2 · the desk's own values ---
 * Two measurements daena.css has no use for, because no public page has a
 * save bar or a row of small tools.
 * -------------------------------------------------------------------------- */

:root {
  /* The strip of nothing left after the last field so the save bar, which
     follows the organizer down the page, has somewhere to hover that is not
     over a field they are typing in. It is the bar's own height — one row of
     buttons and its padding — and it grows on a phone, where those buttons
     take two rows. */
  --admin-savebar-h: 5.5rem;
  /* A tool beside a repeated row (move up, move down, remove). Smaller than
     the site's 44px button, because three of them stand in a column beside a
     single row, and still over the 24px a target must be. */
  --admin-tool: 2.25rem;
}

@media (max-width: 560px) {
  :root { --admin-savebar-h: 8.5rem; }
}

/* ------------------------------------------------------ 3 · the page ------
 * The desk is one long document with a bar at the top and a foot at the
 * bottom. The foot belongs at the bottom of the window even on the sign-in
 * screen, which is three fields tall.
 * -------------------------------------------------------------------------- */

.admin {
  display: flex;
  flex-direction: column;
  min-block-size: 100dvh;
  /* Said here, in the desk's own voice, so that a missing daena.css leaves a
     dark page with light type rather than gold on white. The values are the
     tokens above, not colours typed out again. */
  background: var(--ink);
  color: var(--body);
  font-family: var(--font-text);
}

.admin-main {
  flex: 1 0 auto;
  padding-block: clamp(1.5rem, 4vw, 2.75rem) clamp(2.5rem, 6vw, 4rem);
}

/* .screen needs nothing: a section of the document, shown or hidden by
   admin.js. Only the centred one has a layout of its own. */
.screen--centre {
  display: grid;
  align-content: center;
  justify-items: center;
  min-block-size: min(62vh, 34rem);
}

/* The desk's bar is not fixed over the page on a phone (see § 4), so a jump
   to a field needs no room kept above it there. */
@media (max-width: 700px) {
  html:has(.admin-bar) { scroll-padding-block-start: 1rem; }
}

/* ----------------------------------------------------- 4 · the bar -------
 * The public masthead, with the desk's name beside the Foundation's and the
 * three sections of the desk where the public menu would be.
 * -------------------------------------------------------------------------- */

/* A gold edge along the very top. The desk and the site are the same
   institution and look it, which is the point — so the private pages are
   marked off by something a glance catches before anything is read. */
.admin-bar { border-block-start: 2px solid var(--gold); }

/* The public bar becomes a three-column grid above 1280px (wordmark · menu ·
   tools) and refuses to wrap above 700px. Neither suits a bar with a fourth
   thing in it: the desk's name would be dropped into the menu's column, and
   at 768px the two names, three sections, the language switch and sign out
   would be clipped off the end. The desk's bar is flex at every width and
   wraps when it must. */
.admin-bar .masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  inline-size: min(100% - 2.5rem, 1320px);
  margin-inline: auto;
  column-gap: clamp(.75rem, 2vw, 1.75rem);
}
.admin-bar .wordmark { margin-inline-end: 0; }

/* Whose desk this is. A hairline between it and the Foundation's name, drawn
   on the starting edge so it changes sides with the reading direction. */
.admin-bar__desk {
  margin: 0;
  margin-inline-end: auto;
  padding-inline-start: clamp(.75rem, 2vw, 1.25rem);
  border-inline-start: 1px solid var(--line);
  font: 500 .76rem/1.4 var(--font-label);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-bar__desk:lang(fa) { font: 400 .9rem/1.8 var(--font-text); text-transform: none; }

/* The sections of the desk, as the public menu. daena.css already gives a
   menu item its 44px target, its Cinzel capitals, and the rule that grows
   under the one you are on — so the current section is marked by more than a
   change of colour without anything being added here. */
.admin-nav { margin-inline-start: auto; }

/* Quieter than the public site's.
   There the nav is the page's main movement and is set at .92rem in a wide,
   otherwise empty masthead. Here it shares one bar with the Foundation's name,
   the words "Admin Panel", the language switch and sign out — five things
   competing at the same weight, and the three sections shouted loudest of
   all. A step down puts them back in their place without making them small. */
.admin-nav a:lang(en) { font-size: .78rem; letter-spacing: .1em; }
.admin-nav a:lang(fa) { font-size: .86rem; }

/* On a phone the bar wraps: the two names, then the language switch and sign
   out, then the three sections on a rule of their own, where they read as the
   tabs they are.
   Three rows is a third of a phone's screen, so down here the bar scrolls
   away with the page instead of sitting on top of it — which is what the
   public season rail does at this width, and for the same reason. The
   sections are a scroll away at the head of the page. */
@media (max-width: 700px) {
  .admin-bar { position: static; }
  .admin-bar .masthead__inner { row-gap: 0; }
  .admin-bar__desk { margin-inline-end: 0; }
  .admin-bar .masthead__tools { order: 1; margin-inline-start: auto; }
  .admin-nav {
    order: 2;
    flex-basis: 100%;
    margin-inline-start: 0;
    justify-content: space-between;
    column-gap: .75rem;
    border-block-start: 1px solid var(--line-faint);
  }
}

/* How the website stands, beside Sign out: a dot and a few words, quiet when
   all is well. The dot is not the only signal — the words say it too. */
.admin-live {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-block-size: 2.75rem;
  margin-inline-end: 1rem;
  color: var(--muted);
  font: 500 .76rem/1.4 var(--font-label);
  letter-spacing: .06em;
  text-decoration: none;
}
.admin-live:lang(fa) { font: 400 .86rem/1.8 var(--font-text); }
.admin-live:hover, .admin-live:focus-visible { color: var(--gold); }
.admin-live__dot {
  inline-size: .55rem;
  block-size: .55rem;
  border-radius: 50%;
  background: var(--color-success);
  flex: none;
}
.admin-live[data-state="busy"] .admin-live__dot { background: var(--gold); }
.admin-live[data-state="stuck"] { color: var(--color-danger); }
.admin-live[data-state="stuck"] .admin-live__dot { background: var(--color-danger); }
@media (prefers-reduced-motion: no-preference) {
  .admin-live[data-state="busy"] .admin-live__dot { animation: admin-live-pulse 1.2s ease-in-out infinite; }
}
@keyframes admin-live-pulse { 50% { opacity: .35; } }

/* The banner for a change that could not be put up, above every screen. */
.admin-live-alert { margin-block: 1.5rem 0; }

/* Sign out, and "I need to change the web address": real buttons that must
   not look like the ones that change the season. No frame, no ground, the
   words underlined so they are not mistaken for a label. */
.admin-quiet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 2.75rem;
  min-inline-size: 1.5rem;
  padding: .25rem 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font: 500 .8rem/1.4 var(--font-label);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: .3em;
  transition: color .3s var(--ease), text-decoration-color .3s var(--ease);
}
.admin-quiet-btn:lang(fa) { font: 400 .95rem/1.8 var(--font-text); text-transform: none; }
.admin-quiet-btn:hover,
.admin-quiet-btn:focus-visible { color: var(--gold-lit); text-decoration-color: var(--gold); }

/* Delete. Outlined in the danger colour and nowhere near as filled as Save,
   so the two can never be hit for one another; the word itself says what it
   does, the colour only agrees with it. */
.admin-danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 2.75rem;
  padding: .7rem 1.3rem;
  border: 1px solid color-mix(in srgb, var(--color-danger) 55%, transparent);
  background: none;
  color: var(--color-danger);
  cursor: pointer;
  font: 600 .78rem/1.2 var(--font-label);
  letter-spacing: .11em;
  text-transform: uppercase;
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.admin-danger-btn:lang(fa) { font: 500 .92rem/1.4 var(--font-text); text-transform: none; }
.admin-danger-btn:hover,
.admin-danger-btn:focus-visible {
  border-color: var(--color-danger);
  background: color-mix(in srgb, var(--color-danger) 14%, transparent);
}

/* The demonstration banner is the public site's own; it only needs standing
   off the bar. */

/* -------------------------------------------- 5 · headings and the prose ---
 * Every screen opens the same way: what this is, a gold hairline, the
 * heading, a line explaining it, and what you can do here.
 * -------------------------------------------------------------------------- */

.admin-head { margin-block-end: clamp(1.5rem, 4vw, 2.25rem); }
.admin-head h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.admin-head h1:lang(fa) { font-size: clamp(1.7rem, 4.2vw, 2.5rem); }

.admin-subhead {
  margin-block: clamp(2.25rem, 5vw, 3.25rem) 1rem;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

/* The sentence under a heading that says what the screen is for. Not the
   site's italic lede: an organizer is reading an instruction, not a poster. */
.admin-lede {
  max-inline-size: 58ch;
  margin-block: .9rem 0;
  font-size: 1.05rem;
  color: var(--body);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.6rem;
  margin-block: 1.4rem 0;
}

.admin-back { margin-block: 0 .5rem; }

/* The count of registrations, which admin.js rewrites as the search narrows.
   It keeps its line whether or not it has anything to say, so the table does
   not jump up the page when the number arrives. */
.admin-count {
  min-block-size: 1.5em;
  margin-block: .75rem .25rem;
  font: 500 .78rem/1.5 var(--font-label);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: lining-nums tabular-nums;
}
.admin-count:lang(fa) { font: 400 .92rem/1.8 var(--font-text); text-transform: none; }

/* Waiting on the server. A gold mark that breathes, so a slow line looks like
   work rather than a dead page; it holds still under reduced motion, where
   the words alone carry it. */
.admin-waiting {
  position: relative;
  margin-block: 1.25rem;
  padding-inline-start: 1.5rem;
  color: var(--muted);
}
.admin-waiting::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: .62em;
  inline-size: .55rem;
  block-size: .55rem;
  background: var(--gold);
  animation: admin-breathe 1.6s var(--ease) infinite alternate;
}
@keyframes admin-breathe { from { opacity: .25; } to { opacity: 1; } }

/* Nothing here yet. A dashed frame, because an outline that is not quite
   drawn says "empty" to anyone, including a reader who cannot tell gold from
   parchment. */
.admin-empty {
  margin-block: 1.5rem;
  padding: clamp(1.75rem, 5vw, 3rem) clamp(1.25rem, 4vw, 2rem);
  border: 1px dashed color-mix(in srgb, var(--gold) 26%, transparent);
  text-align: center;
}
.admin-empty h2 { margin-block-end: .6rem; font-size: 1.5rem; }
.admin-empty p { max-inline-size: 48ch; margin-inline: auto; color: var(--muted); }
.admin-empty p:last-child { margin-block-end: 0; }

/* ------------------------------------------------------- 6 · signing in ---
 * One card, centred, on the empty desk.
 * -------------------------------------------------------------------------- */

.admin-signin {
  position: relative;
  inline-size: min(100%, 25rem);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 6%, transparent), transparent 60%);
}
/* The ticket's doubled hairline, which is how this institution frames the one
   thing on a page that matters. */
.admin-signin::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--line-faint);
  pointer-events: none;
}
.admin-signin h1 { font-size: clamp(1.9rem, 5vw, 2.4rem); }
.admin-signin .admin-lede { max-inline-size: none; font-size: 1rem; }
.admin-signin > .help { margin-block-start: 1.5rem; }

/* ------------------------------------------------------- 7 · the season ---
 * Every gathering in the order the site shows them. The rows are the same
 * .admin-row as the form's repeated rows (admin.js builds them from that
 * class), so they need only what a gathering needs and a ticket option does
 * not: its position, which is the whole point of the screen, since the order
 * here is the order on the site.
 *
 * The numeral is drawn from a counter rather than from the list marker, which
 * the row loses the moment it is given a layout, and admin.js does not number
 * these itself.
 * -------------------------------------------------------------------------- */

.admin-season {
  display: grid;
  gap: .75rem;
  /* A row holds a name, a date and a chip. Given the whole of a 1440px desk
     it would put a hand's width of nothing between the name and the button
     that edits it. */
  max-inline-size: 64rem;
  margin-block: 1.5rem 0;
  padding-inline-start: 0;
  list-style: none;
  counter-reset: gathering;
}
.admin-season > li {
  position: relative;
  counter-increment: gathering;
  /* room for the numeral, inside the row's own padding */
  padding-inline-start: calc(clamp(.9rem, 2.5vw, 1.25rem) + 2.4rem);
}
.admin-season > li::before {
  content: counter(gathering);
  position: absolute;
  inset-inline-start: clamp(.9rem, 2.5vw, 1.25rem);
  inset-block-start: clamp(.9rem, 2.5vw, 1.25rem);
  inline-size: 1.8rem;
  font: 500 1.3rem/1.2 var(--font-display);
  color: var(--gold);
  text-align: end;
  font-variant-numeric: lining-nums tabular-nums;
}
/* Persian counts in Persian figures. */
.admin-season:lang(fa) > li::before,
[lang="fa"] .admin-season > li::before { content: counter(gathering, persian); }

/* The gathering's name. admin.js gives it .admin-row__id — the class the
   form's rows use for a database reference, which is set tiny and in the mono
   face — so here, where that element is the name of the evening and the first
   thing to read, it is given the name's own setting instead. */
.admin-season .admin-row__id {
  font: 500 1.35rem/1.3 var(--font-display);
  color: var(--paper);
  overflow-wrap: normal;
}
.admin-season .admin-row__id [lang="fa"] { font-size: 1.15rem; }

/* Edit, and who is coming. Unlike the tools beside a ticket option these are
   words rather than arrows, and they keep the site's full-sized target. */
/* A name, a date and a chip read as one short paragraph, closer together than
   the fields of a form. */
.admin-season .admin-row__body { gap: .45rem; }

.admin-season .admin-row__tools { gap: .6rem; align-items: stretch; }
@media (max-width: 560px) {
  .admin-season .admin-row__tools { align-items: start; }
}

/* ---------------------------------------------------------- 8 · the form ---
 * The long one. A gathering is forty-odd fields, so it is read in sections
 * with a ruled band between them, each section headed and introduced, and the
 * two languages of a field standing side by side where there is room.
 * -------------------------------------------------------------------------- */

/* The short forms — signing in — are a stack of fields. */
.admin-form:not(.admin-form--wide) {
  display: grid;
  gap: 1.25rem;
  max-inline-size: 34rem;
  margin-block-start: 1.5rem;
}
/* The long one stays in normal flow on purpose: the save bar at its foot is
   sticky, and a sticky grid item can only move inside its own row, which is
   its own height — it would never stick to anything. */
.admin-form--wide { max-inline-size: 74rem; }

/* The public form's own fieldset and legend rules are scoped to .form, which
   the desk's form is not, so the desk says these two for itself. The legend
   is the site's label: small, tracked, gold. */
.admin-form fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.admin-form legend {
  padding: 0;
  margin-block-end: .7rem;
  font: 600 .76rem/1.5 var(--font-label);
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--gold);
}
.admin-form legend:lang(fa) { font: 500 .92rem/1.8 var(--font-text); text-transform: none; }

/* A section of the form. Each is separated by a rule and a good deal of air:
   an organizer should be able to tell at a glance that they have finished
   with "when it happens" and arrived at "where it is". */
.admin-form--wide > .admin-group + .admin-group {
  margin-block-start: clamp(2.5rem, 5vw, 3.5rem);
  padding-block-start: clamp(1.75rem, 4vw, 2.5rem);
  border-block-start: 1px solid var(--line-faint);
}
.admin-group > h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
.admin-group > * + * { margin-block-start: 1.5rem; }
/* A help line explains the field or the pair above it, so it sits close
   enough to belong to it rather than floating between two of them. */
.admin-group > * + .help { margin-block-start: .5rem; }
/* The hairline under the heading takes its spacing from the section, so the
   gap above it is not the site's margin plus the section's. */
.admin-group > .rule-hair { margin-block: .85rem 0; }
.admin-group > .rule-hair + * { margin-block-start: 1.1rem; }

/*
 * A list or a fieldset that sets its own margin to nothing wins, and the
 * section's rhythm is lost.
 *
 * ".admin-group > * + *" counts one class: the two universal selectors are
 * worth nothing. So it ties with ".admin-rows { margin: 0 }" and loses to it
 * on order alone — which is why every repeating list sat flush against the
 * line of help that explains it, with no air at all between the sentence and
 * the first box. Naming them raises the weight just enough, without making
 * every other rule in this file heavier to match.
 */
.admin-group > * + :is(.admin-rows, .admin-actions, .tiles, fieldset) {
  margin-block-start: 1.5rem;
}

/* The same fault, one screen along: the reports table sits in a scrolling
   frame whose own margin is nothing, directly under the line explaining how
   to sort it, so the heading row met the sentence above it. */
.admin-subhead + .admin-sift,
:is(.help, p, .admin-subhead) + :is(.admin-scroll, .admin-charts, .admin-figures-set) {
  margin-block-start: 1.5rem;
}
.admin-sift + .help { margin-block-start: 1.25rem; }

/* The last section ends in a strip of nothing: the save bar hovers over this
   rather than over the field the organizer is filling in. */
.admin-form--wide > .admin-group:last-of-type { padding-block-end: var(--admin-savebar-h); }

/* Two fields that are one field in two languages. They are read as a pair, so
   they stand as a pair wherever there is room for both. */
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.75rem;
  align-items: start;
}
@media (max-width: 760px) {
  .pair { grid-template-columns: 1fr; }
}

/* Three short fields on a line — a day and two times, a capacity and a count.
   They stay short at 1440px, where a full-width date box invites a date
   nobody writes. */
.row-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 1.25rem 1.5rem;
  align-items: start;
  max-inline-size: 72rem;
}
.row-3 > .help { grid-column: 1 / -1; margin-block-start: 0; }
/*
 * The boxes on one line, whatever their labels. "Seats taken by telephone or
 * at the door" runs to three lines where "How many people fit" takes one,
 * and each box sat under its own label, so the four boxes of the room stood
 * at three different heights. Each field shares its row's tracks (subgrid):
 * the labels in one, all starting on its first line, the boxes in the next,
 * and what is said under a box in the two after.
 */
@supports (grid-template-rows: subgrid) {
  .admin-form .row-3 > .field:not(.field--check) {
    display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; margin: 0;
  }
  /* The labels start on one line too: set on their boxes, a short label sat
     lower than a long one beside it and the row read as uneven. */
  .admin-form .row-3 > .field:not(.field--check) > :is(label, .label) { align-self: start; }
}
/* Inside a repeated row the three fields are the row, and one of them is
   usually a sentence, so they take the width the row has. */
.admin-row .row-3 { max-inline-size: none; }

/* A field whose answer is short however wide the desk is: a web address, a
   number of seats, a choice from a list. */
.field--short { max-inline-size: 26rem; }

/* A Persian box takes Persian whether or not the desk is in Persian. An
   organizer types the Persian name of a gathering while reading English
   labels, so the box is right-to-left and set in the Persian face at all
   times — never only when the interface language happens to match. */
.admin-form :is(input, textarea)[lang="fa"] {
  direction: rtl;
  text-align: start;
  font-family: var(--font-fa-body);
  /* Vazirmatn sits smaller on the same em than Spectral, and these boxes hold
     whole sentences. */
  font-size: 1.1rem;
  line-height: 1.9;
}

/* A long address under the slug field would otherwise push the page sideways
   on a phone. */
.admin-form .help bdi { overflow-wrap: anywhere; }

/* What the gathering's rules say beside a box. A hint is advice — "ends the
   next day, at 02:00" — and is said in the help's colour, not the error's;
   it marks nothing and stops nothing. The count under a box of prose turns
   to the error's colour once it is past what the box may hold. A list's own
   line sits under the list, not under one of its rows. */
.admin-form .field__error[data-kind="hint"] { color: var(--muted); }
.admin-form .field__count {
  margin: .2rem 0 0;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.admin-form .field__count[data-over="true"] { color: var(--color-danger); }
.admin-group > [data-list-error] { margin-block-start: .5rem; }

/* What kind of day it is, and the shapes the poster may use: a dozen
   checkboxes, which read as a list of choices rather than a column of
   fields. The legend and the explanation run the width of the grid — a
   fieldset's legend is laid out outside the grid in some browsers and as an
   item in others, and spanning it is right either way. */
.admin-flags {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: .25rem 1.75rem;
}
.admin-flags > legend,
.admin-flags > .help { grid-column: 1 / -1; }
.admin-flags > .help { margin-block-end: .5rem; }

/* A public page asks a guest to tick one box, and leans on the 44px label
   beside it to be the target. The desk shows a dozen at once and they are
   ticked quickly, with a trackpad, so the box itself is brought up to the
   24px a target needs. The margin keeps it on the label's first line. */
.admin-form .field--check input[type="checkbox"] {
  inline-size: 24px;
  block-size: 24px;
  margin-block-start: 10px;
}

/* A colour, as a well and the six characters that spell it. The two are one
   control, so they sit together; the picker keeps its own square size against
   the site's full-width field rule, and the characters are set in the mono
   face because that is what they are. */
.colour-pair {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
}
.colour-pair input[type="color"] {
  flex: none;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  min-block-size: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: none;
  cursor: pointer;
}
.colour-pair input[type="color"]:hover { border-color: var(--gold); }
.colour-pair input[type="text"] {
  flex: none;
  /* Seven characters and no more, so the well, the characters and the row's
     three tools still stand on one line at 360px. */
  inline-size: 7rem;
  min-block-size: 2.75rem;
  padding: .35rem .1rem;
  border: 0;
  /* The swatch template puts this box outside any .field, so the site's own
     ruled-input styling never reaches it. The rule is drawn here instead, in
     the site's tokens, so a swatch's box matches every other box on the desk.
     (A .field wrapper in the template would make these four lines
     unnecessary.) */
  border-block-end: 1px solid var(--line);
  background: none;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: .95rem;
  letter-spacing: .04em;
  transition: border-color .3s var(--ease);
}
.colour-pair input[type="text"]:hover { border-block-end-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.colour-pair input[type="text"]:focus { border-block-end-color: var(--gold); }

/* ------------------------------------------------- 9 · the repeated rows ---
 * A ticket option, a moment in the evening, a note at the foot of the page.
 * Each is a small form of its own with its tools beside it.
 * -------------------------------------------------------------------------- */

.admin-rows {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding-inline-start: 0;
  list-style: none;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: clamp(.9rem, 2.5vw, 1.25rem);
  border: 1px solid var(--line-faint);
  /* The heavier starting edge is how the site marks a block that is set apart
     from the text around it, and it follows the reading direction on its
     own. */
  border-inline-start: 3px solid var(--line);
  background: color-mix(in srgb, var(--paper) 2%, transparent);
}

.admin-row__body {
  display: grid;
  gap: 1.1rem;
  min-inline-size: 0;
  justify-items: stretch;
}
.admin-row__body > .help { margin-block-start: -.5rem; }
/* A grid stretches its items, and a status chip stretched across the row
   stops reading as a chip and starts reading as a banner. Anything that is a
   mark rather than a field keeps its own width and sits at the start. */
.admin-row__body > :is(.chip, .btn, .link, .admin-quiet-btn) { justify-self: start; }

/* The row's own id, for the one conversation a year that begins "which one?".
   Small, quiet, and allowed to break anywhere so it cannot widen the page. */
.admin-row__id {
  margin: 0;
  font-family: var(--font-mono);
  font-size: .7rem;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Move up, move down, remove. A short line of them at the end of the row,
   level with its first field; a column would make every one-line row as tall
   as three buttons. */
.admin-row__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: flex-end;
  gap: .4rem;
}
.admin-row__tools > * { flex: none; }
/* Beside a ticket option or a moment in the evening, these are arrows and a
   cross: a tool, not a page's worth of button. Square, small, and still over
   the 24px a target needs. The season's rows are left alone — their tools are
   words. */
.admin-rows .admin-row__tools :is(button, .btn, .admin-quiet-btn, .admin-danger-btn) {
  min-block-size: var(--admin-tool);
  min-inline-size: var(--admin-tool);
  padding: .3rem .55rem;
  letter-spacing: .06em;
}

/*
 * The cross that takes a row away.
 *
 * Quiet until it is wanted: a row of eight red crosses down the side of a
 * form reads as a page of warnings. It takes the danger colour on hover and
 * on focus, which is the moment it matters, and it is square at the size a
 * finger needs rather than the size a sentence needs.
 */
.admin-remove-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: var(--admin-tool);
  block-size: var(--admin-tool);
  padding: 0;
  border: 1px solid var(--line-faint);
  border-radius: .2rem;
  background: none;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease), background-color .25s var(--ease);
}
.admin-remove-btn:hover,
.admin-remove-btn:focus-visible {
  border-color: var(--color-danger);
  background: color-mix(in srgb, var(--color-danger) 12%, transparent);
  color: var(--color-danger);
}
@media (max-width: 560px) {
  .admin-row { grid-template-columns: 1fr; }
  /* Under the row rather than beside it, so they line up with what they act
     on rather than hanging off the far edge. */
  .admin-row__tools { justify-content: flex-start; }
}

/* ------------------------------------------------------ 10 · the save bar ---
 * It follows the organizer down the form, because the form is longer than any
 * window and a save button that scrolled off the top would be found by
 * nobody. It never covers the last field: the last section ends in a strip
 * reserved for it, and the bar keeps its place in the page, so when the foot
 * of the form is reached the bar settles into that strip.
 *
 * z-index 61 clears the film grain and the vignette (59 and 60), which would
 * otherwise darken the bar's own edges.
 * -------------------------------------------------------------------------- */

.admin-savebar {
  position: sticky;
  inset-block-end: 0;
  z-index: 61;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.25rem;
  margin-block-start: clamp(1.5rem, 4vw, 2.25rem);
  padding: .8rem clamp(.9rem, 3vw, 1.4rem);
  padding-block-end: calc(.8rem + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(10px);
}

/* Saved, or not saved yet. A live region, so it keeps its line even when it
   has nothing in it. */
/* Unsaved work is said in gold, so "Not saved yet" carries the weight it
   means. touch() has written data-dirty since it was written and nothing
   here read it, so the line sat in the same muted grey as "Saved". */
.admin-savebar__state[data-dirty="true"] { color: var(--gold); font-weight: 600; }

/* Which gathering is being saved, with its year. */
.admin-savebar__name {
  flex: 0 1 auto;
  min-inline-size: 0;
  margin: 0;
  font-size: .92rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.admin-savebar__name:empty { display: none; }

.admin-savebar__state {
  flex: 1 1 10rem;
  min-inline-size: 0;
  min-block-size: 1.4em;
  margin: 0;
  font-size: .92rem;
  color: var(--muted);
}

.admin-savebar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1rem;
  margin-inline-start: auto;
}
/* Delete stands apart from Cancel and Save rather than against them, so a
   hurried hand does not find it where Save was. It keeps its place in the
   reading and tabbing order; only the air around it changes. */
.admin-savebar__actions .admin-danger-btn { margin-inline-end: clamp(1rem, 4vw, 2.5rem); }

@media (max-width: 560px) {
  .admin-savebar__actions { inline-size: 100%; }
  /* Save is the button the thumb is reaching for, so it takes the room left
     over once the other two have what they need. */
  .admin-savebar__actions .btn--solid { flex: 1 1 8rem; }
}

/* ------------------------------------- 11 · registrations and the reports ---
 * A door list and a season at a glance. Both are wide tables, and a wide
 * table is given something to scroll in rather than being allowed to push the
 * page sideways.
 * -------------------------------------------------------------------------- */

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem 1.75rem;
  margin-block: clamp(1.25rem, 3vw, 1.75rem) 0;
}
.admin-toolbar .field { flex: 1 1 18rem; max-inline-size: 28rem; }
.admin-toolbar__right { margin: 0; margin-inline-start: auto; }
/* The archived gatherings' switch takes the width of its words, not a box's. */
.admin-toolbar .admin-toolbar__check { flex: 0 1 auto; margin: 0; }

/* The scroll container. It is focusable and labelled in the markup, so it can
   be reached and scrolled from the keyboard; the scrollbar is left visible
   and drawn in gold, because the bar itself is the only honest sign that
   there is more of the table off the edge. */
.admin-scroll {
  max-inline-size: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-block-end: .25rem;
  border: 1px solid var(--line-faint);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--gold) 45%, transparent) transparent;
}
/*
 * A table that can be scrolled sideways takes focus, so that it can be
 * scrolled from the keyboard. The site's default ring is 2px of gold set four
 * pixels out, which around something the width of the desk draws a hard
 * rectangle down the whole screen — the table stops reading as part of the
 * page and starts reading as a selected object.
 *
 * It takes the same answer the public site's fields take (see daena.css, "a
 * soft glow"): the hairline it already has lifts to the lit gold and glows.
 * The edge doubles in weight without moving anything — the second pixel is a
 * shadow ring, not a thicker border — which is the change of at least 2px
 * that WCAG 2.4.11 asks for, in the language the rest of the site speaks.
 */
.admin-scroll:focus-visible {
  outline: none;
  border-color: var(--gold-lit);
  box-shadow: 0 0 0 1px var(--gold-lit),
              0 0 16px -2px color-mix(in srgb, var(--gold) 55%, transparent);
}

.admin-table {
  inline-size: 100%;
  /* Nine columns of names, addresses and references. Below this the cells
     start breaking words, so the table keeps its width and the container
     scrolls instead. */
  min-inline-size: 58rem;
  border-collapse: collapse;
  font-size: .95rem;
}
.admin-table :is(th, td) {
  padding: .7rem .9rem;
  text-align: start;
  vertical-align: top;
  border-block-end: 1px solid var(--line-faint);
}
.admin-table thead th {
  border-block-end: 1px solid var(--line);
  font: 600 .72rem/1.4 var(--font-label);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}
.admin-table thead th [lang="fa"] { font-size: .85rem; font-weight: 500; text-transform: none; }
.admin-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--paper) 3%, transparent); }
/* A report row leads to who is coming: its name is the link, the row follows. */
.admin-table tbody tr[data-href] { cursor: pointer; }
.admin-table tbody tr[data-href]:hover { background: color-mix(in srgb, var(--gold) 7%, transparent); }
.admin-report__open {
  display: inline-block;
  min-block-size: 1.5rem;
  line-height: 1.5rem;
  color: inherit;
  text-decoration: none;
}
.admin-report__open:hover,
.admin-report__open:focus-visible,
.admin-table tbody tr[data-href]:hover .admin-report__open { color: var(--gold); text-decoration: underline; text-underline-offset: .2em; }

/* Archived: off the website, set back here and said in words. */
/* The words set back, never the controls: the eye that puts it back stays bright. */
.admin-row--hidden :is(.admin-row__name, .admin-row__when, .admin-meter),
.admin-season > .admin-row--hidden::before { opacity: .55; }
/*
 * "Archived", small and quiet beside the name.
 *
 * It was a chip like the state's, a dashed pill reading HIDDEN FROM THE
 * WEBSITE in capitals — the longest and loudest thing on a row whose point
 * is that it no longer matters to the website. The row is already set back;
 * the tag only has to say why, so it is one word in the text's own face and
 * case, in a soft well, and the full meaning is its tooltip and is read out
 * after the word (admin.js, renderSeason).
 */
.admin-tag {
  display: inline-block;
  padding: .05rem .45rem;
  border-radius: 3px;
  font: 500 .74rem/1.45 var(--font-text);
  letter-spacing: .01em;
  text-transform: none;
  color: var(--muted);
  background: color-mix(in srgb, var(--paper) 9%, transparent);
  white-space: nowrap;
  cursor: help;
}
.admin-tag:lang(fa), [lang="fa"] .admin-tag { font-size: .8rem; }
/* A report row that includes archived gatherings marks them the same way. */
.admin-report__open + .admin-tag { margin-inline-start: .5rem; vertical-align: .1em; }

/* A gathering just saved, on the way back to the season. */
.admin-row--gathering[data-fresh="true"] {
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  box-shadow: inset 3px 0 0 var(--gold);
  transition: background .6s var(--ease), box-shadow .6s var(--ease);
}
/* A registration that arrived while the list was open, for a minute. */
.admin-table tbody tr[data-fresh="true"] {
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  box-shadow: inset 3px 0 0 var(--gold);
}
.admin-new {
  display: inline-block;
  padding: .05rem .4rem;
  border: 1px solid var(--gold);
  border-radius: .2rem;
  color: var(--gold);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  vertical-align: .1em;
}
@media (prefers-reduced-motion: no-preference) {
  .admin-table tbody tr[data-fresh="true"] { animation: admin-arrive 1.2s ease-out; }
  @keyframes admin-arrive { from { background: color-mix(in srgb, var(--gold) 38%, transparent); } }
}
.admin-table tbody tr:last-child :is(th, td) { border-block-end: 0; }
.admin-table td { color: var(--body); font-variant-numeric: lining-nums tabular-nums; }
.admin-table tbody th { color: var(--paper); font-weight: 400; }

/* The door list's own columns, in the order the markup sets them: a count is
   read against the counts above it, and an email address is allowed to break
   wherever it must rather than widening the table. */
[data-table="bookings"] :is(th, td):nth-child(4) { text-align: end; }
/* An email breaks before its @ (the <wbr> the door list puts there), and
   only a very long one anywhere else. */
[data-table="bookings"] td:nth-child(2) { overflow-wrap: normal; word-break: normal; }
[data-table="bookings"] td:nth-child(2) bdi { overflow-wrap: break-word; }
/* A telephone number broken across two lines is a telephone number nobody can
   read back down a line.

   It is also the one cell with no letters in it — a plus, some digits and
   some spaces — so in the Persian table the browser has nothing to tell it
   which way the number runs and lays it out right to left: +1 917 555 0142
   came out as "0142 555 917 1+". The same goes for the date beside it. Both
   columns are therefore given their own direction. A <bdi> round each in
   admin.js would do this at the source and is the better fix. */
[data-table="bookings"] td:is(:nth-child(3), :nth-child(8)) {
  direction: ltr;
  white-space: nowrap;
}
[dir="rtl"] [data-table="bookings"] td:is(:nth-child(3), :nth-child(8)) { text-align: end; }
/* The season's counts: holds, taken, left. */
[data-screen="reports"] [data-sortable="reports"] :is(th, td):nth-child(n+3):nth-child(-n+5) { text-align: end; }

/* The counted season. Each tile is built by admin.js, so the grid is told the
   smallest a tile may be and left to decide how many fit. */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 1px;
  margin-block: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--line-faint);
}
/* A frame drawn around nothing reads as something that failed to load, so a
   list or a grid with no contents takes no room at all. */
.tiles:empty,
.admin-rows:empty,
.admin-reasons:empty,
.admin-season:empty { display: none; }

/*
 * The hairlines between the figures are drawn by each figure, not by the grid
 * behind them.
 *
 * A ground behind the grid shows through wherever the last row is short of
 * figures, and a lit rectangle beside the last figure reads as a panel that
 * failed to load rather than as the end of the row. An outline costs no
 * layout and stops at the last figure, which is where the counting stops.
 */
.tiles > * {
  padding: 1.1rem 1.2rem;
  background: var(--ink);
  outline: 1px solid var(--line-faint);
}
.tiles p { margin: 0; }
/* Whatever carries the number is the thing the eye should land on. */
.tiles :is(strong, b, dd) {
  display: block;
  margin: 0;
  font: 500 clamp(1.7rem, 4vw, 2.4rem)/1.1 var(--font-display);
  color: var(--paper);
  font-variant-numeric: lining-nums tabular-nums;
}
.tiles :is(dt, small) {
  display: block;
  font: 600 .72rem/1.4 var(--font-label);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}
.tiles :is(dt, small):lang(fa) { font: 500 .88rem/1.7 var(--font-text); text-transform: none; }

/* ------------------------------------------------------- 12 · publishing ---
 * The one page that changes what guests see, so it explains itself before it
 * offers the button, and says plainly afterwards what did or did not happen.
 * -------------------------------------------------------------------------- */

.admin-explain {
  max-inline-size: 62ch;
  margin-block: clamp(1.5rem, 4vw, 2.25rem);
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--line-faint);
  background: color-mix(in srgb, var(--gold) 4%, transparent);
}
.admin-explain h2 { font-size: 1.4rem; margin-block-end: 1rem; }

.admin-steps {
  margin: 0;
  padding-inline-start: 1.6rem;
}
.admin-steps li { margin-block-start: .5rem; }
.admin-steps li { padding-inline-start: .2rem; }
/*
 * The step numbers are read as numbers, so they are set on the line and at
 * the size of the words beside them. Cormorant's figures are old-style — 1 is
 * x-height, 3 and 4 hang below the line — which in a list of four steps reads
 * as an afterthought rather than as the order to do them in.
 */
.admin-steps li::marker {
  color: var(--gold);
  font: 500 .95rem var(--font-text);
  font-variant-numeric: lining-nums tabular-nums;
}
[lang="fa"] .admin-steps li::marker { font: 500 .95rem var(--font-fa-body); }
/* Persian counts in Persian figures. */
.admin-steps:lang(fa),
[lang="fa"] .admin-steps { list-style-type: persian; }

/* The three answers. They differ by frame, by ground and by the mark in the
   margin as well as by colour, so a reader who cannot separate gold from
   pomegranate can still tell "published" from "nothing was changed": the
   refusal is heavily framed over a hatched ground and marked with an
   exclamation, the publish is plainly framed and ticked, and the check that
   changed nothing is drawn in a dashed line over no ground at all. */
.admin-outcome {
  position: relative;
  max-inline-size: 68ch;
  margin-block: clamp(1.5rem, 4vw, 2rem);
  padding: clamp(1.1rem, 3vw, 1.5rem);
  padding-inline-start: calc(clamp(1.1rem, 3vw, 1.5rem) + 3rem);
  border: 1px solid var(--line-faint);
}
.admin-outcome::before {
  content: "✓" / "";
  position: absolute;
  inset-block-start: clamp(1.1rem, 3vw, 1.5rem);
  inset-inline-start: clamp(1.1rem, 3vw, 1.5rem);
  display: grid;
  place-items: center;
  inline-size: 1.9rem;
  block-size: 1.9rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: 600 .95rem/1 var(--font-label);
  letter-spacing: 0;
}
.admin-outcome h2 { font-size: 1.5rem; margin-block-end: .6rem; }
.admin-outcome > :last-child { margin-block-end: 0; }

.admin-outcome--refused {
  border-color: color-mix(in srgb, var(--color-danger) 45%, transparent);
  border-inline-start: 5px solid var(--color-danger);
  background-image: repeating-linear-gradient(135deg,
    color-mix(in srgb, var(--color-danger) 10%, transparent) 0 6px,
    transparent 6px 15px);
}
.admin-outcome--refused::before { content: "!" / ""; color: var(--color-danger); border-width: 2px; }
.admin-outcome--refused h2 { color: var(--color-danger); }

/* Which step of a rebuild it stopped at. */
.admin-outcome__step {
  margin-block: 1rem .5rem;
  padding-inline-start: .75rem;
  border-inline-start: 2px solid var(--color-warning);
  font: 600 .76rem/1.6 var(--font-label);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-warning);
}
.admin-outcome__step:lang(fa) { font: 500 .92rem/1.8 var(--font-text); text-transform: none; }

/* What did not pass. A list of plain sentences, sometimes with a path in
   them, so it is allowed to break anywhere. */
.admin-reasons {
  margin: 0;
  padding-inline-start: 1.1rem;
  color: var(--body);
}
.admin-reasons li { margin-block-start: .45rem; overflow-wrap: anywhere; }
.admin-reasons li::marker { color: color-mix(in srgb, var(--color-danger) 70%, transparent); }
/* One gathering's problems: its name, what is wrong, and the way to it. */
.admin-reasons__name { display: block; font-weight: 600; color: var(--paper); }
.admin-reasons__what { margin: .2rem 0 .35rem; padding-inline-start: 1rem; }
.admin-reasons__what li { margin-block-start: .2rem; }
.admin-reasons__open { display: inline-block; padding-block: .35rem; }

/* What the organizer cannot put right, and the lines for whoever can. */
.admin-live-alert__setup { margin-block: .75rem 0; }
.admin-live-alert__details { margin-block-start: 1rem; }
.admin-live-alert__details > summary {
  cursor: pointer;
  padding-block: .4rem;
  font: 600 .76rem/1.6 var(--font-label);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-live-alert__details > summary:lang(fa) { font: 500 .92rem/1.8 var(--font-text); text-transform: none; }
.admin-live-alert__raw {
  margin: .5rem 0 .75rem;
  padding: .75rem;
  max-block-size: 16rem;
  overflow: auto;
  border: 1px solid var(--line-faint);
  font: .8rem/1.55 var(--font-mono);
  color: var(--body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------- 13 · the foot ----
 * The public foot, cut down: a desk needs the motto and who is signed in, not
 * four columns of links.
 * -------------------------------------------------------------------------- */

.admin-foot { padding-block: 2.25rem 2.5rem; }
.admin-foot .foot__motto { margin-block-end: 1.25rem; font-size: 1.15rem; }
.admin-foot .foot__legal { max-inline-size: 70ch; margin-block-start: .5rem; }
.admin-foot .foot__legal:first-of-type { margin-block-start: 0; }

/* -------------------------------------------------- 14 · asking, telling ---
 * The one box that confirms anything, and the line that says what happened.
 * -------------------------------------------------------------------------- */

.ask {
  max-inline-size: min(34rem, calc(100% - 2rem));
  margin: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--gold);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--body);
  box-shadow: 0 24px 60px rgb(0 0 0 / .55);
}
.ask::backdrop { background: rgb(0 0 0 / .72); }
/* The question fades and settles in, rather than appearing at once. */
.ask[open] { animation: ask-in .2s var(--ease); }
.ask[open]::backdrop { animation: ask-fade .2s var(--ease); }
@keyframes ask-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ask-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ask[open], .ask[open]::backdrop { animation: none; } }
.ask h2 { font-size: 1.5rem; margin-block-end: .75rem; }
.ask--refund form { display: grid; gap: 1rem; margin-block-start: 1.25rem; }
.ask--refund .field { margin: 0; }
.ask--refund input, .ask--refund textarea { inline-size: 100%; }
.ask--refund .field__help { margin-block-start: .35rem; color: var(--muted); font-size: .9rem; }
.ask--refund .field__error:empty { display: none; }
.ask p { margin-block-end: 0; }
.ask__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .6rem 1rem;
  margin-block-start: 1.5rem;
}
@media (max-width: 420px) {
  .ask__actions > * { flex: 1 1 8rem; }
}

/* Saved, deleted, copied: a small note in the bottom corner of the window
   (the trailing corner, so it mirrors on the Persian panel), fading and
   rising in. It lifts clear of the save bar while a gathering is open so it
   never covers the button the organizer has just pressed. z-index 80 clears
   the grain, the vignette and the save bar. */
.toast {
  position: fixed;
  z-index: 80;
  inset-block-end: calc(1.25rem + env(safe-area-inset-bottom));
  inset-inline-end: 1.25rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .7rem;
  inline-size: min(23rem, calc(100vw - 2.5rem));
  padding: .8rem .55rem .8rem .9rem;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--color-success);
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-surface) 95%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px -10px rgb(0 0 0 / .7);
  color: var(--paper);
  font-size: .95rem;
  line-height: 1.45;
  text-align: start;
  opacity: 0;
  translate: 0 .75rem;
  transition: opacity .25s var(--ease), translate .25s var(--ease);
}
.toast[hidden] { display: none; }
.toast[data-shown] { opacity: 1; translate: 0 0; }
.toast[data-kind="bad"] { border-inline-start-color: var(--color-danger); }
.toast[data-kind="warn"] { border-inline-start-color: var(--color-warning); }
.toast__icon {
  display: grid; place-items: center; inline-size: 1.35rem; block-size: 1.35rem; margin-block-start: .05rem;
  border-radius: 50%; font: 700 .78rem/1 var(--font-text);
  color: var(--ink); background: var(--color-success);
}
.toast__icon::before { content: "✓"; }
.toast[data-kind="bad"] .toast__icon { background: var(--color-danger); }
.toast[data-kind="bad"] .toast__icon::before { content: "!"; }
.toast[data-kind="warn"] .toast__icon { background: var(--color-warning); }
.toast[data-kind="warn"] .toast__icon::before { content: "!"; }
/* Working: a ring turning in place of the mark, until the note changes. */
.toast[data-kind="busy"] { border-inline-start-color: var(--gold); }
.toast[data-kind="busy"] .toast__icon {
  background: transparent; border: 2px solid color-mix(in srgb, var(--gold) 30%, transparent);
  border-block-start-color: var(--gold); animation: toast-turn .8s linear infinite;
}
.toast[data-kind="busy"] .toast__icon::before { content: ""; }
@keyframes toast-turn { to { rotate: 1turn; } }
@media (prefers-reduced-motion: reduce) { .toast[data-kind="busy"] .toast__icon { animation: none; } }
/* A button at work says so, and is not pressed twice. */
.btn[aria-busy="true"] { opacity: .65; cursor: progress; }
.toast__text { margin: 0; }
.toast__close {
  display: grid; place-items: center; inline-size: 28px; block-size: 28px; margin: -.2rem 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted);
  font-size: 1.15rem; line-height: 1; cursor: pointer;
}
.toast__close:hover { color: var(--paper); background: color-mix(in srgb, var(--paper) 7%, transparent); }
.toast__close:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
@media (max-width: 520px) {
  /* On a phone, across the foot of the screen, as a phone's own notes are. */
  .toast { inset-inline: .75rem; inline-size: auto; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; translate: none; } }
body:has(form[data-form="gathering"]:not([hidden])) .toast {
  inset-block-end: calc(var(--admin-savebar-h) + 1.25rem + env(safe-area-inset-bottom));
}

/* ----------------------------------------------------------- 15 · motion ---
 * tokens.css already cuts every transition in the system to nothing under
 * reduced motion. The desk's own handful are named here as well, so they are
 * off rather than merely instant, and the waiting mark holds still.
 * -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .admin-waiting::before { animation: none; opacity: 1; }
  .admin-quiet-btn,
  .admin-danger-btn,
  .colour-pair input[type="color"],
  .colour-pair input[type="text"] { transition: none; }
}

/* ------------------------------------------------------------ 16 · print ---
 * The door list. An organizer will print the registrations and stand at the
 * door with them, so paper gets the table and nothing else: no bar, no menu,
 * no search box, no buttons, and no film grain over the names.
 *
 * The ink is turned round by rebinding the tokens rather than by overriding
 * each rule — every colour on the desk is drawn from them, so inverting them
 * once inverts the whole desk. Browsers do not print backgrounds by default,
 * which is why the type is what has to change.
 * -------------------------------------------------------------------------- */

@media print {
  :root {
    /* The night theme asks the browser for a dark canvas, and a dark canvas
       is what a print preview then shows under type that has just been turned
       dark. Paper is light. */
    color-scheme: light;
    --ink: #FFFFFF;
    --paper: #000000;
    --body: #1A1A1A;
    --muted: #4A4A4A;
    --gold: #4A3C0E;
    --gold-lit: #4A3C0E;
    --line: #666666;
    --line-faint: #AAAAAA;
    --color-danger: #7A1026;
    --color-success: #1B4D33;
    --color-warning: #6A3008;
  }

  @page { margin: 14mm; }

  .admin { display: block; min-block-size: 0; background: var(--ink); }
  /* Nothing on paper can be focused, and the ring the desk draws round the
     heading it has just moved to would print as a box round the title. */
  :focus, :focus-visible { outline: none !important; }
  /* The grain and the vignette are fixed layers over the whole page; on paper
     they are a grey wash over every name. */
  .admin::before,
  .admin::after { display: none !important; }

  .admin-bar,
  .admin-nav,
  .admin-foot,
  .admin-toolbar,
  .admin-savebar,
  .admin-back,
  .admin-actions,
  .skip-link,
  .toast,
  .ask { display: none !important; }

  .admin-main { padding-block: 0; }

  /* Which gathering, and how many came — the two lines that make the list
     usable at a door. */
  .admin-head { margin-block-end: .5rem; }
  .admin-head h1 { font-size: 18pt; }
  .admin-count { color: #000; }

  /* Nothing scrolls on paper. */
  .admin-scroll {
    overflow: visible !important;
    border: 0;
    padding: 0;
  }
  .admin-table {
    min-inline-size: 0;
    inline-size: 100%;
    font-size: 9.5pt;
  }
  .admin-table :is(th, td) {
    padding: 4pt 5pt;
    border: 0.5pt solid #999;
  }
  /* The column headings are repeated at the top of every sheet, and no row is
     split across two of them. */
  .admin-table thead { display: table-header-group; }
  .admin-table tbody tr { break-inside: avoid; }
  .admin-table tbody tr:nth-child(even) { background: none; }
  /* A tick box down the end of each row, for marking people in. */
  .admin-table tbody tr:last-child :is(th, td) { border-block-end: 0.5pt solid #999; }
}

/* ------------------------------------------------- 17 · the moved focus ---
 * Changing screen moves focus to the new screen's heading, so that somebody
 * using a screen reader is told where they now are instead of being left
 * where the last screen was. That is the right thing to do and it should not
 * also draw a ring: a heading is not something to operate, and a gold box
 * around the title reads as a selected field. The ring stays everywhere it
 * means something — every button, link and box on the desk.
 */
.screen :is(h1, h2)[tabindex="-1"]:focus { outline: none; }

/* ------------------------------------------------- 18 · the season's figures ---
 * "At a glance" has to fit in a glance.
 *
 * Eight figures at display size, stacked in three full-width bands, took three
 * screens to read — by which point it is not a glance but a document. The
 * three groups now sit side by side, each a small card of two columns, so the
 * whole season is one screenful on a laptop and one scroll on a phone. The
 * numbers stay the largest thing in the card, because they are what is being
 * read; they are simply no longer the largest thing on the page.
 */
.admin-figures {
  margin-block: clamp(1rem, 2.5vw, 1.5rem);
}
.admin-figures .admin-subhead {
  margin-block-end: .5rem;
  font: 600 .72rem/1.2 var(--font-label);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}
.admin-figures:lang(fa) .admin-subhead,
[lang="fa"] .admin-figures .admin-subhead {
  font: 500 .95rem/1.4 var(--font-fa-body);
  letter-spacing: 0;
  text-transform: none;
}
.admin-figures .tiles {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  margin-block: 0;
}
.admin-figures .tiles > * { padding: .7rem .85rem; }
.admin-figures .tiles :is(strong, b, dd) {
  font: 500 clamp(1.25rem, 2.2vw, 1.6rem)/1.15 var(--font-display);
}
.admin-figures .tiles :is(span, dt, small) { font-size: .78rem; line-height: 1.35; }

/* Three cards abreast once there is room for them, so the people, the halls
   and the money are read together rather than one after another. */
@media (min-width: 62rem) {
  .admin-figures-set {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1rem, 2vw, 1.75rem);
    align-items: start;
  }
  .admin-figures-set .admin-figures { margin-block: 0; }
  .admin-figures-set .tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ----------------------------------------------------- 19 · the pictures ---
 * Three charts, drawn with boxes and one path, no library.
 *
 * A chart library would be the first dependency this project has ever had in
 * a page, for shapes that are a div with a width and an SVG path. Drawing
 * them here means they take the site's own gold, respect the reader's font
 * size, reflow on a phone, print, and carry text a screen reader can read —
 * none of which a canvas chart does without work.
 */
.admin-charts {
  margin-block: clamp(1.5rem, 3vw, 2.25rem);
}
.admin-chart {
  margin: 0 0 clamp(1.25rem, 2.5vw, 1.75rem);
  padding: clamp(.9rem, 2vw, 1.25rem);
  border: 1px solid var(--line-faint);
  background: color-mix(in srgb, var(--paper) 2%, transparent);
}
.admin-chart > figcaption {
  margin-block-end: .9rem;
  font: 600 .72rem/1.2 var(--font-label);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}
[lang="fa"] .admin-chart > figcaption {
  font: 500 .95rem/1.4 var(--font-fa-body);
  letter-spacing: 0;
  text-transform: none;
}
.admin-chart .help { margin-block-start: .75rem; }

/* --- bars: a label, a track, a figure --------------------------------- */

.admin-bars {
  display: grid;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.admin-bars > li {
  display: grid;
  grid-template-columns: minmax(7rem, 14rem) minmax(4rem, 1fr) auto;
  align-items: center;
  gap: .5rem .9rem;
}
.admin-bars__label {
  font-size: .85rem;
  color: var(--body);
  overflow-wrap: anywhere;
}
/*
 * The empty part of a bar is a trough, not a bar of its own.
 *
 * At 7% of the paper colour the track read as a filled grey bar, so twelve
 * gatherings at nought per cent looked like twelve gatherings that were
 * doing something. It is now a hairline-tinted groove with an edge, which
 * reads as the space a bar could fill.
 */
.admin-bars__track {
  position: relative;
  block-size: .55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 3%, transparent);
  box-shadow: inset 0 0 0 1px var(--line-faint);
  overflow: hidden;
}
/* The fill grows from the start of the line, so it runs left to right in
   English and right to left in Persian without a second rule. */
/* A gathering with one spot taken must not look like a gathering with none,
   so anything above nought keeps a visible head. Nought gets nothing. */
.admin-bars__fill {
  display: block;
  block-size: 100%;
  min-inline-size: .4rem;
  border-radius: 999px;
  /*
   * A flat gold, not a gradient.
   *
   * This was linear-gradient(to inline-end, ...), and a gradient takes no
   * logical direction keyword — there is no such value — so the whole
   * declaration was dropped and every bar below 100% was drawn with no fill
   * at all. Gahanbar at 92% looked exactly as empty as Nowruz at nought,
   * which is the one thing this chart exists to tell apart. The season's own
   * meter was flat gold all along and never had the fault.
   */
  background: var(--gold);
  transition: inline-size .35s var(--ease);
}
.admin-bars__fill[data-share="0"] { min-inline-size: 0; }
.admin-bars__fill[data-full="true"] { background: var(--gold-lit); }
.admin-bars__value {
  font-size: .8rem;
  color: var(--muted);
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

/* --- the line: sixteen weeks ------------------------------------------ */

.admin-line {
  display: block;
  inline-size: 100%;
  block-size: clamp(4.5rem, 9vw, 6.5rem);
  overflow: visible;
}
.admin-line__area { fill: color-mix(in srgb, var(--gold) 14%, transparent); }
.admin-line__stroke {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.admin-line__ends {
  display: flex;
  justify-content: space-between;
  margin-block: .4rem 0;
  font-size: .72rem;
  color: var(--muted);
}

/* Two charts abreast once there is room; the weeks keep the full width,
   because a line squeezed into half a column is a line nobody can read. */
/*
 * Each chart takes the width of the page.
 *
 * Two side by side halved every bar, so a gathering at six per cent and one
 * at sixty looked much the same — which is the one thing a bar is for. The
 * bars inside the chart run in two columns instead, so the height stays
 * reasonable and the length stays readable.
 */
.admin-bars > li {
  grid-template-columns: minmax(7rem, 15rem) minmax(8rem, 1fr) auto;
}

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

/* ------------------------------------------------------ 20 · the numerals ---
 * A figure is read, not admired.
 *
 * Cormorant is the Foundation's display face and its figures are old-style:
 * 1 is the height of an x, 3 7 9 hang below the line. That is right in a
 * heading on the public site and wrong on a desk, where 2790 and 371 sit side
 * by side and have to be compared at a glance. Asking for lining figures does
 * not help — the shipped subset has no lnum table — so the figures are set in
 * Spectral, which draws them on the line and at one width by default, and the
 * labels stay in the display face.
 */
.admin-figures .tiles :is(strong, b, dd) {
  font: 400 clamp(1.3rem, 2.3vw, 1.7rem)/1.15 var(--font-text);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -.01em;
}
/* Persian figures have their own face, which already draws them on the line. */
[lang="fa"] .admin-figures .tiles :is(strong, b, dd) {
  font-family: var(--font-fa-body);
}
.admin-table :is(td, th) { font-variant-numeric: lining-nums tabular-nums; }

/* ------------------------------------------------------- 21 · sorting ---
 * A heading that sorts is still a heading.
 *
 * A <button> inside a <th> arrives as a grey system button in a gold table,
 * which is both ugly and a lie about what it is: pressing it does not submit
 * anything, it changes the order of what is underneath. So it keeps the
 * heading's own type and colour, and earns an arrow only while it is the
 * column doing the sorting — a row of arrows is a row of questions.
 */
.admin-sort {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  /*
   * A heading that can be pressed is something to hit, so it is at least the
   * 24px WCAG 2.5.8 asks for. The heading's own type is 11px, which made the
   * button 16px tall in every browser — comfortably readable and not
   * comfortably tappable, which is the distinction the rule is about. The
   * padding is taken out of the cell's so nothing moves.
   */
  min-block-size: 1.5rem;
  padding: .25rem 0;
  margin-block: -.25rem;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  text-align: inherit;
}
.admin-sort:hover { color: var(--gold-lit); }
.admin-sort__arrow::before {
  content: "";
  display: inline-block;
  inline-size: 0;
  block-size: 0;
  border-inline: .3rem solid transparent;
  /* No arrow until this column is the one sorting. */
  border-block-end: 0 solid transparent;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.admin-sort[data-direction]:not([data-direction=""]) { color: var(--gold-lit); }
.admin-sort[data-direction="ascending"] .admin-sort__arrow::before {
  border-block-end: .34rem solid currentColor;
  opacity: 1;
}
.admin-sort[data-direction="descending"] .admin-sort__arrow::before {
  border-block-start: .34rem solid currentColor;
  border-block-end: 0;
  opacity: 1;
}
/* Where it is the sorting column, the heading keeps a hairline under it so
   the eye finds the sorted column without reading the arrow. */
.admin-table th[aria-sort]:not([aria-sort="none"]) {
  box-shadow: inset 0 -2px 0 var(--gold);
}
@media (prefers-reduced-motion: reduce) {
  .admin-sort__arrow::before { transition: none; }
}

/* --------------------------------------------- 22 · a gathering's row ---
 * Twelve gatherings should be readable without scrolling three screens.
 *
 * The row was a tall card with the name, the date, the state and the counts
 * each on a line of their own; at Persian line heights that came to a third
 * of a laptop screen for one gathering. It is now one band: the ordinal and
 * the name on the first line with the state beside it, the date under it, and
 * the fill bar carrying the count — the one thing an organizer scans for —
 * instead of a sentence to be read and compared.
 */
.admin-row--gathering {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .35rem 1rem;
  padding: .75rem .9rem;
  align-items: center;
}
.admin-row--gathering .admin-row__body { display: grid; gap: .3rem; min-inline-size: 0; }
.admin-row__head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.admin-row__name {
  margin: 0;
  font: 500 1.05rem/1.25 var(--font-display);
  color: var(--paper);
}
[lang="fa"] .admin-row__name { font: 500 1.05rem/1.7 var(--font-fa-body); }
.admin-row__when { margin: 0; font-size: .8rem; color: var(--muted); }

/* The fill bar, and what it says, on one line. */
.admin-meter { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .6rem; margin: .1rem 0 0; }
.admin-meter__track {
  flex: 1 1 8rem;
  max-inline-size: 22rem;
  block-size: .4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 7%, transparent);
  overflow: hidden;
}
.admin-meter__fill {
  display: block;
  block-size: 100%;
  border-radius: 999px;
  background: var(--gold);
  transition: inline-size .35s var(--ease);
}
.admin-meter__fill[data-status="sold-out"] { background: var(--color-danger); }
.admin-meter__fill[data-status="past"] { background: color-mix(in srgb, var(--muted) 70%, transparent); }
.admin-meter__said {
  /* May wrap on a phone rather than run out of its line. */
  flex: 0 1 auto;
  min-inline-size: 0;
  font-size: .75rem;
  color: var(--muted);
  font-variant-numeric: lining-nums tabular-nums;
}
.admin-row--gathering .admin-row__tools { display: flex; align-items: center; gap: .5rem; }

/* The grip: the one control for the order. */
/* ------------------------------------------------- the marks on a row ---
 * A pencil, two figures, two sheets. Square, bordered like the grip beside
 * them, gold when the pointer or the keyboard is on them. The words have not
 * gone: they are the accessible name and the tooltip, so nothing is lost to
 * anybody reading the page with their ears.
 * ------------------------------------------------------------------------ */

.admin-iconbtn {
  flex: none;
  inline-size: var(--admin-tool, 2.25rem);
  block-size: var(--admin-tool, 2.25rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-faint);
  border-radius: .2rem;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.admin-iconbtn:hover,
.admin-iconbtn:focus-visible { color: var(--gold); border-color: var(--gold); }
/* The one that cannot be undone goes red under the pointer, and only then:
   a row of red bins down the side of the season reads as an alarm. */
.admin-iconbtn--danger:hover,
.admin-iconbtn--danger:focus-visible { color: var(--color-danger); border-color: var(--color-danger); }
.admin-iconbtn .admin-icon,
.admin-grip .admin-icon {
  inline-size: 1.05rem;
  block-size: 1.05rem;
  display: block;
}
/* The grip's six dots are dots: round caps on a zero-length path need the
   round join as well, or some engines draw nothing at all. */
.admin-grip .admin-icon { inline-size: 1rem; block-size: 1rem; }

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

.admin-grip {
  flex: none;
  inline-size: var(--admin-tool, 2.25rem);
  block-size: var(--admin-tool, 2.25rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-faint);
  border-radius: .2rem;
  background: none;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: grab;
}
/*
 * A finger on the grip drags the gathering; it does not scroll the page.
 *
 * Without this the browser claims the gesture for scrolling before the first
 * pointermove arrives, and on a touch screen the grip does nothing at all —
 * which is the whole reason this is built on pointer events rather than
 * HTML5 dragging. It is scoped to the grip, so the rest of the list scrolls
 * with a finger exactly as it should.
 */
.admin-grip { touch-action: none; }
.admin-grip:hover { color: var(--gold); border-color: var(--gold); }
.admin-grip:active { cursor: grabbing; }
/*
 * The row being carried is lifted, not faded.
 *
 * It was drawn at 55% with a dashed outline, which reads as a row being
 * removed rather than one being held. This is the shape every list that can
 * be rearranged uses: the row comes up off the page, keeps its own colour so
 * it can still be read while it is moved, and casts a shadow so it is plainly
 * above the others rather than among them.
 */
.admin-row.is-dragging {
  position: relative;
  z-index: 3;
  outline: 1px solid var(--gold);
  background: var(--admin-panel, var(--ink-raised, #15141C));
  box-shadow: 0 .9rem 2rem rgb(0 0 0 / .45);
  cursor: grabbing;
  /* It follows the pointer; nothing else may animate it. */
  transition: none;
}
/* While a row is in the air the pointer belongs to the drag, so nothing
   underneath should light up or be clicked on the way past. */
.admin-season.is-reordering .admin-row { transition: none; }
.admin-season.is-reordering { cursor: grabbing; user-select: none; }
.admin-season.is-reordering .admin-row__tools { pointer-events: none; }
/* A mouse is told the whole row can be picked up; a finger uses the grip. */
@media (hover: hover) and (pointer: fine) {
  .admin-season [data-ordered="true"] .admin-row--gathering { cursor: grab; }
  .admin-season [data-ordered="true"] .admin-row--gathering :is(a, button, input, select, textarea) { cursor: pointer; }
}

@media (max-width: 36rem) {
  .admin-row--gathering { grid-template-columns: minmax(0, 1fr); }
  .admin-row--gathering .admin-row__tools { justify-content: flex-start; }
  .admin-meter__said { font-size: .72rem; }
}

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

/* ------------------------------------------------- 23 · a note under a set ---
 * A note that explains the figures above it belongs to them: close under the
 * last row, with the gap after it, not floating between the two.
 */
.admin-figures .help { margin-block: .5rem 0; }
.admin-figures-set .admin-figures > .help { margin-block-end: 0; }

/* ------------------------------------------------- 24 · lists that scroll ---
 * A long list belongs in a box, not down the page.
 *
 * Twelve gatherings today and thirty next year: printed in full, the season
 * pushes everything else off the screen and an organizer scrolls past the
 * list to reach the things that act on it. The list keeps its own height and
 * scrolls inside it, so the page stays one page.
 *
 * The height is in vh so it answers the screen rather than a guess at one,
 * and it is a maximum: a season of three gatherings takes three rows' worth
 * and no empty box underneath.
 */
.admin-season {
  max-block-size: min(62vh, 44rem);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding-inline-end: .25rem;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--gold) 45%, transparent) transparent;
}

/* A table scrolled inside its box loses its headings at the first turn of the
   wheel unless they are told to stay. */
.admin-scroll { max-block-size: min(62vh, 44rem); overflow-y: auto; }
.admin-table thead th {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: var(--ink);
  box-shadow: inset 0 -1px 0 var(--line-faint);
}
.admin-table th[aria-sort]:not([aria-sort="none"]) {
  box-shadow: inset 0 -2px 0 var(--gold);
}

/* Nothing is clipped or stuck on paper. */
@media print {
  .admin-season, .admin-scroll { max-block-size: none; overflow: visible; }
  .admin-table thead th { position: static; }
}

/* --------------------------------------------- 25 · a row's own actions ---
 * The public site's button is a call to action: wide, lettered, meant to be
 * seen across a hero. In a list of twelve rows it is the loudest thing on the
 * screen, repeated twelve times, saying "Edit" each time — so on the desk it
 * keeps the same shape at the size of a row's own type. The gathering's name
 * is what the eye should land on, not the button beside it.
 */
.admin-row--gathering .btn {
  padding: .4rem .85rem;
  font-size: .68rem;
  letter-spacing: .1em;
  min-block-size: 2rem;
}
.admin-row--gathering .link { font-size: .85rem; }
.admin-row--gathering :is(.admin-grip, .admin-iconbtn) { --admin-tool: 2rem; font-size: .9rem; }
[lang="fa"] .admin-row--gathering .btn { font-size: .8rem; letter-spacing: 0; }

/* --------------------------------------- 26 · the ordinal and its gathering ---
 * The number belongs to the name, so it sits on the name's line.
 *
 * The row's padding changed when the row became a band, and the numeral —
 * which is placed from the top of the row — was left floating halfway down
 * beside the date. It is now set to the row's own top padding and given the
 * name's line height, so "1" and "Tirgan" share a baseline however many lines
 * the rest of the row runs to.
 */
.admin-row--gathering { padding-inline-start: calc(.9rem + 2.2rem); }
.admin-season > .admin-row--gathering::before {
  inset-inline-start: .9rem;
  inset-block-start: .75rem;
  inline-size: 1.7rem;
  font: 500 1.05rem/1.25 var(--font-display);
  font-variant-numeric: lining-nums tabular-nums;
}
[lang="fa"] .admin-season > .admin-row--gathering::before { line-height: 1.7; }

/* ---------------------------------------- the left reads, the right acts ---
 * The grip, the number, then the gathering: its name (a link that opens it),
 * its state with the eye that switches it, the date, and the count that leads
 * to who is coming. On the right only copy, edit and delete. The numeral is a
 * cell of the row's grid here rather than placed over its padding, so the
 * grip can stand before it where a hand expects one.
 */
.admin-season > .admin-row--gathering {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "grip num body tools";
  column-gap: .75rem;
  padding-inline-start: .9rem;
}
.admin-season > .admin-row--gathering:has(> .admin-grip[hidden]) {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "num body tools";
}
.admin-season > .admin-row--gathering::before {
  position: static;
  grid-area: num;
  align-self: start;
  inline-size: auto;
  min-inline-size: 1.2rem;
  /* The name's face, size and line height, so the two share a baseline
     exactly rather than by a nudge (see the name's line, below). */
  line-height: 1.9rem;
}
[lang="fa"] .admin-season > .admin-row--gathering::before { line-height: 1.9rem; }
.admin-row--gathering > .admin-grip { grid-area: grip; align-self: start; --admin-tool: 1.9rem; }
.admin-row--gathering > .admin-row__body { grid-area: body; }
.admin-row--gathering > .admin-row__tools { grid-area: tools; }

/* The name is the way into the gathering: its own colour until the pointer or
   the keyboard is on it, then the gold and the rule every link here has. */
/* A box of its own, so the whole line's height is the target (WCAG 2.5.8):
   as plain inline text it was the letters' 20px, not the line's 30. */
.admin-row__open { display: inline-block; color: inherit; text-decoration: none; }
.admin-row__open:hover,
.admin-row__open:focus-visible { color: var(--gold); text-decoration: underline; text-underline-offset: .2em; }

/* The eye, beside the state it switches: the same mark, a size down, so it
   sits on the name's line without pushing it apart. */
.admin-iconbtn--small { --admin-tool: 1.9rem; align-self: center; }
/*
 * The name's line is one height whether or not the eye is on it — a gathering
 * already held has no eye — so the grip and the numeral, both set to the top
 * of the row, meet the name on every row rather than drifting below it.
 */
.admin-row--gathering .admin-row__head { align-items: baseline; min-block-size: 1.9rem; }
/*
 * One baseline for the numeral, the name and the state. The name's line is the
 * height of the row's marks, so the grip and the numeral — both set to the top
 * of the row — meet it; the state's words sit on the name's baseline rather
 * than being centred in a box of their own, which in a different face left
 * them a pixel or two off; and only the eye, a mark rather than words, is
 * centred on the line.
 */
.admin-row--gathering .admin-row__name,
[lang="fa"] .admin-row--gathering .admin-row__name { line-height: 1.9rem; }
.admin-row--gathering .admin-row__head > .admin-iconbtn--small { align-self: center; }

/* The count, which leads to the door list. */
.admin-meter__who {
  display: inline-flex;
  min-inline-size: 0;
  align-items: center;
  gap: .35rem;
  min-block-size: 1.9rem;
  color: var(--muted);
  text-decoration: none;
}
.admin-meter__who .admin-icon { inline-size: .95rem; block-size: .95rem; flex: none; }
.admin-meter__who:hover,
.admin-meter__who:focus-visible { color: var(--gold); }
.admin-meter__who:hover .admin-meter__said,
.admin-meter__who:focus-visible .admin-meter__said { color: var(--gold); text-decoration: underline; text-underline-offset: .2em; }

@media (max-width: 560px) {
  .admin-season > .admin-row--gathering {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas: "grip num body" ". . tools";
  }
  .admin-season > .admin-row--gathering:has(> .admin-grip[hidden]) {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "num body" ". tools";
  }
}

/* ----------------------------------------- 27 · a chart that fits the page ---
 * Twelve gatherings in one column of bars leaves half the screen empty and
 * puts the last of them below the fold. They run in two columns once there is
 * room for two labels and two bars side by side, which is about 54rem; the
 * order still reads down the first column and then down the second, as a list
 * does, because these are the season in its own order and not a ranking.
 */
@media (min-width: 54rem) {
  /* Both charts of bars, not only the first: "which spots people take" has a
     row for every kind of ticket in the season — nine of them already — and
     was running down one column with the whole right of the figure empty,
     which is the fault this rule was written for. */
  .admin-chart[data-chart="fullness"] .admin-bars,
  .admin-chart[data-chart="tiers"] .admin-bars {
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(1.25rem, 3vw, 2.5rem);
    grid-auto-flow: column;
    grid-template-rows: repeat(var(--admin-bar-rows, 6), auto);
  }
}

/* --------------------------------------------- 28 · the publishing screen ---
 * The one screen that changes what guests see, laid out like the others.
 *
 * It was a single 62ch column down the left of a 1440px desk: a readable
 * measure, which is right for the prose, but it left two thirds of the page
 * empty and set its heading larger than the headings on every other screen.
 * The explanation keeps its measure and now sits beside the buttons that act
 * on it, and its heading is the same size as "The people" and "In pictures".
 */
.admin-publish {
  display: grid;
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
  margin-block: clamp(1.25rem, 3vw, 1.75rem);
}
@media (min-width: 58rem) {
  .admin-publish { grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 1fr); }
}
.admin-publish .admin-explain { margin-block: 0; max-inline-size: none; }
.admin-explain h2 {
  margin-block: 0 .75rem;
  font: 600 .72rem/1.2 var(--font-label);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}
[lang="fa"] .admin-explain h2 {
  font: 500 .95rem/1.4 var(--font-fa-body);
  letter-spacing: 0;
  text-transform: none;
}
.admin-explain .admin-steps li { font-size: .92rem; }
/* The buttons are the point of the screen, so they are given their own card
   rather than being the last line of a paragraph. */
.admin-publish__act {
  padding: clamp(1rem, 2.5vw, 1.4rem);
  border: 1px solid var(--line-faint);
  background: color-mix(in srgb, var(--gold) 4%, transparent);
}
/*
 * The card that acts, laid out as a card.
 *
 * Two buttons floating in an otherwise empty box read as something that
 * failed to finish loading. It now says what it is, how much is about to go
 * live, and then offers the two ways to go about it — the real one first and
 * the rehearsal under it, both the width of the card they sit in, which is
 * narrow enough that a full-width button is a button rather than a banner.
 */
.admin-publish__ready {
  margin: 0 0 .35rem;
  font: 600 .72rem/1.2 var(--font-label);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}
[lang="fa"] .admin-publish__ready {
  font: 500 .95rem/1.4 var(--font-fa-body);
  letter-spacing: 0;
  text-transform: none;
}
.admin-publish__count {
  margin: 0 0 .9rem;
  font-size: .85rem;
  color: var(--muted);
  font-variant-numeric: lining-nums tabular-nums;
}
.admin-publish__act .admin-actions { display: grid; gap: .55rem; margin: 0; }
.admin-publish__act .btn {
  inline-size: 100%;
  padding-block: .6rem;
  font-size: .72rem;
}
[lang="fa"] .admin-publish__act .btn { font-size: .85rem; letter-spacing: 0; }

/* ------------------------------------------------- 29 · the desk's own bar ---
 * The public site's bar is held to one row at every width, because on those
 * pages it is fixed over a photograph and a second row would sit on the page.
 * The desk's bar is not fixed below 700px — it scrolls away with everything
 * else — and it carries more: three sections, the language, and the way out.
 * Held to one row it ran 239px off the side of a phone. Here it wraps.
 */
@media (max-width: 44rem) {
  .masthead:has(.admin-nav) :is(.masthead__inner, .nav) { flex-wrap: wrap; }
  .masthead:has(.admin-nav) .masthead__inner { block-size: auto; padding-block: .5rem; }
  .admin-nav { gap: .25rem 1rem; }
}

/* --------------------------------------------------- 30 · the last spaces ---
 * Two gaps that were doing nothing: the room above a section heading that
 * already has a rule of space above it, and a publish button stretched the
 * width of its card. A button says how long it is by what is written on it.
 */
.admin-subhead { margin-block: clamp(1.25rem, 2.5vw, 1.75rem) .6rem; }
.admin-charts + .admin-subhead { margin-block-start: clamp(1rem, 2vw, 1.4rem); }
.admin-publish__act .btn { inline-size: auto; justify-self: start; }
.admin-publish__act .admin-actions { justify-items: start; }

/* ------------------------------------- 31 · a heading that stays put, cleanly ---
 * With collapsed borders the row borders belong to the table rather than to
 * the cells, and a row scrolling under a sticky heading leaves a few pixels
 * of itself showing in the join. Separated borders give each cell its own
 * edge, which the heading's own background then covers completely.
 */
.admin-table { border-collapse: separate; border-spacing: 0; }
.admin-table :is(th, td) { border-block-end: 1px solid var(--line-faint); }
.admin-table tbody tr:last-child :is(th, td) { border-block-end: 0; }

/* --------------------------------------------- 32 · the length of a bar ---
 * A bar is read against the others beside it, not against the page.
 *
 * Stretched to the full width of a desk, one ticket type came out as a gold
 * rule a metre long saying "two spots", and twelve gatherings at nought per
 * cent came out as twelve long empty troughs. The track takes a sensible
 * length and stops; the row no longer stretches to fill what is left.
 */
.admin-bars > li {
  grid-template-columns: minmax(6rem, 14rem) minmax(5rem, 26rem) auto;
  justify-content: start;
}
/* On a phone the label sits above its own bar: three columns in 390px gives
   the bar an inch and pushes the figure off the side. */
@media (max-width: 34rem) {
  .admin-bars > li {
    grid-template-columns: 1fr auto;
    gap: .15rem .6rem;
  }
  .admin-bars__label { grid-column: 1 / -1; }
  .admin-bars__value { font-size: .72rem; }
}

/* The weeks are a shape, not a wall: half the height reads the same and
   leaves room for what is under it. */
.admin-line { block-size: clamp(3.5rem, 7vw, 5.5rem); }
.admin-chart[data-chart="arrivals"] svg { max-inline-size: 72rem; }
/* The two dates sit under the two ends of the line, which stops at 72rem. */
.admin-chart[data-chart="arrivals"] .admin-line__ends { max-inline-size: 72rem; margin-inline-start: 2rem; }

/* ------------------------------------------- 33 · finding one gathering ---
 * Four small controls on one line, and the count of what they left.
 *
 * They are deliberately quiet: the season itself is what the organizer came
 * to look at, and a bank of boxes above it would be the loudest thing on the
 * screen. They wrap rather than shrink, so at any width each keeps a label
 * and a usable box rather than four unreadable slivers.
 */
.admin-sift {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .75rem clamp(.75rem, 2vw, 1.5rem);
  margin-block: clamp(1rem, 2.5vw, 1.5rem) .5rem;
  padding-block-end: clamp(.75rem, 2vw, 1rem);
  border-block-end: 1px solid var(--line-faint);
}
.admin-sift .field { margin: 0; flex: 1 1 10rem; max-inline-size: 15rem; }
.admin-sift .field > label { font-size: .64rem; }
[lang="fa"] .admin-sift .field > label { font-size: .82rem; }
.admin-sift__count {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 .75rem;
  margin: 0;
  padding-block-end: .5rem;
  font-size: .78rem;
  color: var(--muted);
  font-variant-numeric: lining-nums tabular-nums;
}
/* Which gatherings: on the website, archived, all. Tabs on one line with
   their counts, the pressed one underlined in gold, so the archived ones are
   always in sight and never mixed in unasked. */
.admin-place {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(1rem, 3vw, 2rem);
  margin-block: clamp(1rem, 2.5vw, 1.5rem) 0;
  border-block-end: 1px solid var(--line-faint);
}
.admin-place__tab {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-block-size: 2.75rem;
  margin-block-end: -1px;
  padding: .25rem .125rem;
  border: 0;
  border-block-end: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-family: var(--font-nav);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
[lang="fa"] .admin-place__tab { font-family: var(--font-fa-body); font-size: .95rem; letter-spacing: 0; }
.admin-place__tab:hover { color: var(--paper); }
.admin-place__tab[aria-pressed="true"] { color: var(--gold); border-block-end-color: var(--gold); }
.admin-place__tab:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.admin-place__n {
  min-inline-size: 1.6rem;
  padding: .05rem .45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-text);
  font-size: .75rem;
  letter-spacing: 0;
  text-align: center;
  font-variant-numeric: lining-nums tabular-nums;
}
.admin-place__tab[aria-pressed="true"] .admin-place__n { border-color: var(--gold); }
.admin-place + .admin-sift { margin-block-start: .75rem; }
/* A note about the view, not an error: it sits under the controls it is
   about, and says nothing at all while the season is in its own order. */
[data-season-note] { margin-block: 0 .75rem; }

@media (max-width: 34rem) {
  .admin-sift .field { flex: 1 1 100%; max-inline-size: none; }
}

/* ------------------------------------------------- a figure, not a field ---
 * Two of the boxes in "the room" are counted rather than typed: the spots
 * still free and how it is going. An input would offer to change a number
 * that nothing can usefully change — the room less what is taken — so they
 * are set as figures, in the same place a field's value would sit and
 * without the line under it that invites a cursor.
 * -------------------------------------------------------------------------- */
.field--read .field__figure {
  display: block;
  padding-block: .55rem .6rem;
  /* The same rule a box has under it, so a counted figure lines up with the
     fields either side of it instead of floating a few pixels high with
     nothing beneath it. It is drawn in the fainter of the two greys: still a
     field, still plainly not one to type in. */
  border-block-end: 1px solid var(--line-faint);
  color: var(--paper);
  font-size: 1.05rem;
  font-variant-numeric: lining-nums tabular-nums;
}
.field--read .field__figure:lang(fa) { font-size: 1rem; }

/* ----------------------------------------------------------- the poster ---
 * The poster as it is now, and one way to replace it. It used to be four
 * questions about colour; it is the picture itself, which is the thing the
 * organizer actually has.
 *
 * Held to the width of its own contents rather than run across the form: a
 * thumbnail with a button beside it and two thirds of a wide screen left
 * empty reads as something that failed to load.
 * -------------------------------------------------------------------------- */
.poster {
  display: grid;
  grid-template-columns: 13rem minmax(0, 22rem);
  gap: clamp(1rem, 3vw, 1.75rem);
  align-items: start;
  inline-size: fit-content;
  max-inline-size: 100%;
  margin: 0;
  padding: clamp(.9rem, 2.5vw, 1.15rem);
  border: 1px solid var(--line-faint);
  border-inline-start: 3px solid var(--line);
  background: color-mix(in srgb, var(--paper) 2%, transparent);
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
/* A file being dragged over it: the whole box answers, because the whole box
   is the target. */
.poster[data-over="true"] {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
}
.poster[data-busy="true"] { opacity: .55; pointer-events: none; }

.poster__img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border: 1px solid var(--line-faint);
  background: var(--ink);
}

.poster__side { display: grid; gap: .9rem; justify-items: start; align-content: start; }
.poster__side .help { margin: 0; }

/* Which poster this is. A sentence, not a heading: the old label type set it
   in gold small-caps across three lines, which shouted a caption. */
.poster__what:empty { display: none; }
.poster__what { margin: 0; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.poster__what:lang(en) { font-size: .92rem; }

.poster__buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }

/*
 * The chooser itself: present for a keyboard, out of the way for everyone.
 *
 * display:none would take it out of the tab order and out of reach of a
 * screen reader, leaving the label as a button nothing can operate without a
 * mouse. This keeps it focusable, and its own label lights up when it is.
 */
.poster__input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[data-poster-choose]:has(+ .poster__input:focus-visible),
[data-picture-choose]:has(+ .poster__input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.poster__state:empty { display: none; }
.poster__state { margin: 0; color: var(--muted); font-size: .88rem; }

/* The big picture is landscape, so its thumbnail is given the width a
   landscape picture needs to be seen at all. */
.poster--wide { grid-template-columns: 20rem minmax(0, 22rem); }
.poster--wide .poster__img { aspect-ratio: 16 / 9; object-fit: cover; }

@media (max-width: 760px) {
  .poster { grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); inline-size: auto; }
  .poster--wide { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .poster { grid-template-columns: 1fr; }
  .poster__img { max-inline-size: 11rem; }
  .poster--wide .poster__img { max-inline-size: 100%; }
}

/* More set aside than the room holds. The sentence says it; the colour is so
   that somebody scrolling past does not have to read it to notice. */
[data-tier-sum][data-over="true"] { color: var(--color-danger); }

/* ------------------------------------------------------- which language ---
 * Half the boxes in the form are one field written twice, and each carried
 * "· in English" or "· in Persian" after its name — eleven characters of
 * small capitals repeated forty times down a form, saying the same thing as
 * the box underneath, which is already in that language. A mark does it.
 * -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 1.9em;
  margin-inline-start: .5em;
  padding: .1em .4em;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  border-radius: .15rem;
  color: color-mix(in srgb, var(--gold) 85%, var(--paper));
  font: 600 .72em/1.3 var(--font-label);
  letter-spacing: .08em;
  /* The label around it is uppercase; the mark already is. */
  text-transform: none;
  vertical-align: baseline;
}

/* The first ticket option's share is worked out, not typed: the room, less
   every option under it. The box is read-only rather than disabled — the
   figure is real and has to be saved — so it is marked by eye instead, in the
   quiet colour the other counted figures use. */
.admin-row [data-field="quota"][readonly] {
  border-block-end-color: var(--line-faint);
  color: var(--muted);
  cursor: default;
}
.admin-row[data-main-tier="true"] { border-inline-start-color: var(--gold); }

/* The row's own number. numberRows() has set these since the form was
   written and no template carried one, so a form of eight moments in an
   evening had nothing to count by — "the third one down" was the only way to
   name a row out loud. Quiet, and out of the way of the fields. */
.admin-row__n {
  margin: 0;
  color: var(--muted);
  font: 600 .75rem/1.6 var(--font-label);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: .08em;
}
.admin-row:has(.admin-row__n) { grid-template-columns: auto minmax(0, 1fr) auto; }
@media (max-width: 560px) {
  .admin-row:has(.admin-row__n) { grid-template-columns: 1fr; }
}

/* ------------------------------------------------- changing one booking ---
 * The door list could be read and not kept: somebody writes to say they
 * cannot come, and there was nothing on the screen to act on it with. These
 * are the words for that, at the end of each row — small, because a row of
 * loud buttons down a table of sixty registrations is a wall rather than a
 * set of choices.
 * -------------------------------------------------------------------------- */
.admin-moves {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .7rem;
  min-inline-size: 11rem;
}
.admin-table .admin-quiet-btn { min-block-size: 24px; font-size: .68rem; letter-spacing: .08em; }
.admin-table .admin-quiet-btn:lang(fa) { font-size: .85rem; letter-spacing: 0; }
/* The three that give a spot back are marked apart from the two that take
   one, because the difference matters to the hall and not to the sentence. */
.admin-quiet-btn--undo { color: var(--muted); }
.admin-quiet-btn--undo:hover,
.admin-quiet-btn--undo:focus-visible { color: var(--color-danger); text-decoration-color: var(--color-danger); }

/* ------------------------------------------------ two boxes, one height ---
 * The story in English and the story in Persian sit side by side, and both
 * are seven rows — but a row of Vazirmatn at 1.1rem/1.9 is a third taller
 * than a row of Spectral, so the Persian box came out 57px longer than the
 * English one and the pair ended at two different heights.
 *
 * Rows are the wrong unit for a box that has to match another box in a
 * different face. A height in rem is the same for both. A box of words is a
 * fixed size that scrolls, not one dragged taller by a corner: dragged, the
 * two of a pair stood at different heights and the form shifted under it.
 * -------------------------------------------------------------------------- */
.admin-form .pair :is(input, textarea) {
  /* 44px, which is the target size a finger needs and what the English box
     already came to. The Persian face is taller on the same em, so left to
     its own line-height it drew its underline a couple of pixels lower than
     the box beside it — small, and exactly the kind of small that makes a
     pair look like two unrelated things. */
  block-size: 2.75rem;
}
.admin-form .pair textarea {
  block-size: 11rem;
  resize: none;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--gold) 45%, transparent) transparent;
}
.admin-form .pair textarea::-webkit-scrollbar { inline-size: 6px; }
.admin-form .pair textarea::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 3px; }
/* The notes for the page are a sentence or two, not the story. */
.admin-form .pair textarea[rows="3"] { block-size: 6.5rem; }

/* The registrations chart's span: one quiet segmented bar, the chosen span
   lit in it — a tint and the gold of the type, not a slab of gold that
   outweighed the chart it chose for. */
.admin-range {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin-block: .25rem 1rem;
  border: 1px solid var(--line-faint); border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 2%, transparent);
}
.admin-range button {
  min-inline-size: 44px; min-block-size: 32px; padding: .3rem .8rem;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--muted); font: 600 .7rem/1 var(--font-label); letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; transition: color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.admin-range button:lang(fa), .admin-range button :lang(fa) { letter-spacing: 0; text-transform: none; font: 500 .8rem/1 var(--font-text); }
@media (hover: hover) { .admin-range button:hover { color: var(--paper); background: color-mix(in srgb, var(--paper) 5%, transparent); } }
.admin-range button[aria-pressed="true"] {
  color: var(--gold-lit);
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent);
}
.admin-range button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.admin-line:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }

/* The points of the line, each a dot to move between; the one being read
   grows, glows and carries its label. Set over the stretched line by
   percentages, with two quiet guide lines behind them. */
.admin-line__plot {
  position: relative; max-inline-size: 72rem; margin-inline-start: 2rem;
  outline: none; cursor: crosshair; touch-action: pan-y;
}
.admin-line__plot:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 6px; border-radius: 4px; }
/* The line draws itself in when the span changes, and the dots follow it.
   On the line alone, never on the plot: a clip on the plot cut off the label
   over a dot near its edge, and the figures of the guide lines beside it. */
.admin-line__plot > svg { animation: admin-line-in .55s var(--ease) both; }
.admin-line__dot { animation: admin-dot-in .3s .35s var(--ease) both; }
@keyframes admin-line-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes admin-dot-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .admin-line__plot > svg, .admin-line__dot { animation: none; } }
.admin-line__guide {
  position: absolute; inset-inline: 0; block-size: 0;
  border-block-start: 1px solid color-mix(in srgb, var(--paper) 7%, transparent);
  pointer-events: none;
}
.admin-line__guide-figure {
  position: absolute; inset-inline-end: calc(100% + .5rem); transform: translateY(-50%);
  color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.admin-line__dot {
  position: absolute; inline-size: 8px; block-size: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 2px var(--color-surface, #111016);
  pointer-events: none; transition: transform .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}
.admin-line__dot[data-none] { background: color-mix(in srgb, var(--gold) 35%, transparent); }
.admin-line__dot[data-active] {
  transform: scale(1.75); background: var(--gold-lit);
  box-shadow: 0 0 0 1.5px var(--color-surface, #111016), 0 0 12px 3px color-mix(in srgb, var(--gold) 55%, transparent);
}
.admin-line__tip {
  position: absolute; z-index: 2; translate: -50% calc(-100% - 14px);
  display: grid; gap: .1rem; padding: .45rem .65rem; min-inline-size: max-content;
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 92%, var(--gold) 8%);
  box-shadow: 0 6px 18px -6px rgb(0 0 0 / .6);
  pointer-events: none; text-align: start;
}
.admin-line__tip[hidden] { display: none; }
.admin-line__tip[data-side="start"] { translate: -12px calc(-100% - 14px); }
.admin-line__tip[data-side="end"] { translate: calc(-100% + 12px) calc(-100% - 14px); }
.admin-line__tip[data-below="true"] { translate: -50% 16px; }
.admin-line__tip[data-below="true"][data-side="start"] { translate: -12px 16px; }
.admin-line__tip[data-below="true"][data-side="end"] { translate: calc(-100% + 12px) 16px; }
.admin-line__tip strong { color: var(--paper); font: 600 1rem/1.2 var(--font-text); font-variant-numeric: tabular-nums; }
.admin-line__tip span { color: var(--muted); font-size: .78rem; line-height: 1.35; }
/* What the label says, for a screen reader: the label itself is drawn. */
.admin-line__readout {
  position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* The door list's search takes the room it needs for a name or a number. */
[data-screen="registrations"] .admin-sift .field:first-child { flex: 2 1 16rem; max-inline-size: 22rem; }

/* The archived gatherings' heading in the season list, in place of a badge
   on every row: once, quietly, with how one comes back. */
.admin-season > .admin-season__archived { counter-increment: none; padding: .5rem 0 0; border: 0; background: none; }
.admin-season > .admin-season__archived::before { content: none; }
.admin-season > .admin-season__archived[data-after] { margin-block-start: 1rem; padding-block-start: 1.5rem; border-block-start: 1px solid var(--line-faint); }
.admin-season__archived-title { margin: 0; font: 600 .74rem/1.4 var(--font-label); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.admin-season__archived-title:lang(fa), [lang="fa"] .admin-season__archived-title { font: 500 .95rem/1.6 var(--font-text); letter-spacing: 0; text-transform: none; }
.admin-season__archived-means { margin: .2rem 0 0; color: var(--muted); font-size: .88rem; }
/* An archived gathering counted in the reports only because it was asked for. */
.admin-report--archived > td { opacity: .6; }
.admin-report__archived { color: var(--muted); font-size: .8rem; font-style: italic; }

/* A box with suggestions looks like every other box: Chrome's arrow is not
   drawn, and the suggestions still open as the box is clicked or typed in. */
input[list]::-webkit-calendar-picker-indicator { display: none !important; }
input[list]::-webkit-list-button { display: none !important; }

/* No poster or picture yet (a gathering not saved): the words and the button
   take the box's width, rather than sitting in a column beside an empty one. */
.poster:has(> .poster__img[hidden]),
.poster--wide:has(> .poster__img[hidden]) { grid-template-columns: minmax(0, 40rem); inline-size: fit-content; }
.poster__buttons .btn { white-space: nowrap; }

/* A quiet switch beside the toolbar's buttons, not a heading: ordinary text
   and a smaller box. */
.admin-toolbar .admin-toolbar__check { display: flex; gap: .6rem; align-items: center; }
.admin-toolbar__check label { margin: 0; padding: 0; line-height: 1.2; }
.admin-toolbar .admin-toolbar__check input[type="checkbox"] { inline-size: 1.1rem; block-size: 1.1rem; margin: 0; }
.admin-toolbar__check label {
  font-family: var(--font-text);
  font-size: .95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--body);
}
[lang="fa"] .admin-toolbar__check label { font-family: var(--font-fa-body); font-size: .95rem; }
/* The words sit in the middle of the switch's height, beside its box. */
.admin-toolbar .admin-toolbar__check label { display: flex; align-items: center; }

/* A section's explanation and the box under it (the poster, the big picture,
   a list of rows): room between them, not the explanation's line touching
   the box's edge. */
.admin-group > .help + :is(.poster, figure, .admin-rows, fieldset, .admin-table, .row-3, .pair) { margin-block-start: 1rem; }

/* A dish's picture, in its row: the small square, the button, the note. */
.dish-course { margin-block-start: .75rem; max-inline-size: 16rem; }
.dish-pic { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-block-start: .75rem; }
.dish-pic__img { inline-size: 64px; block-size: 64px; object-fit: cover; border: 1px solid var(--line-faint); }
.dish-pic__file { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; overflow: hidden; }
.dish-pic__choose { position: relative; }
.dish-pic__note { flex-basis: 100%; margin: 0; }
[data-row][data-busy="true"] .dish-pic { opacity: .55; pointer-events: none; }

/* The Reports screen's Donations: the gifts given on the website, under the
   season's own figures, with a little more room above them as a section of
   their own. The table keeps a message to a readable measure. */
.admin-donations { display: grid; gap: 1rem; margin-block-start: clamp(2.5rem, 5vw, 4rem); }
.admin-donations > .admin-toolbar { margin: 0; }
.admin-donations .admin-table td:nth-child(6) { min-inline-size: 14rem; max-inline-size: 28rem; white-space: normal; }
/* The day, the address, the sum and the reference on one line each (the table scrolls sideways on a phone); the sum is read
   against the sums above and below it. */
[data-table="donations"] td:is(:nth-child(1), :nth-child(3), :nth-child(4), :nth-child(7)) { white-space: nowrap; }
[data-table="donations"] :is(th, td):nth-child(4) { text-align: end; }

/* ------------------------------------------------------------ the door ---
   The check-in box on the door list and the one-guest screen it opens
   (admin.js, loadCheck). Read standing up, on a telephone, in a dim hall:
   the state is a wide band of colour with a sentence in it, the name is
   large, and the controls are big enough for a thumb. */
/* One column that may be narrower than what is in it: a text box keeps a
   width of its own (twenty characters, in Firefox), which pushed the row past
   the edge of a 360px telephone. */
.admin-checkin { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; margin-block: 0 2rem; max-inline-size: 32rem; }
.admin-checkin > label { font: 600 0.76rem/1.5 var(--font-label); letter-spacing: .11em; text-transform: uppercase; color: var(--gold); }
.admin-checkin > label:lang(fa), .admin-checkin > label :lang(fa) { font: 500 .92rem/1.8 var(--font-fa-body); letter-spacing: 0; text-transform: none; }
.admin-checkin__row { display: flex; align-items: stretch; gap: .6rem; min-inline-size: 0; }
/* One box, its own border lit on focus: no second ring drawn around it. */
.admin-checkin__row input {
  /* As wide as a reference and a little more; a scanned link scrolls in it. */
  flex: 0 1 17rem; min-inline-size: 0; block-size: 48px; padding: 0 1rem;
  border: 1px solid var(--color-rule); border-radius: 0; background: var(--color-surface); color: var(--paper);
  font: 500 1rem/1 var(--font-mono); letter-spacing: .05em;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.admin-checkin__row input::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); }
.admin-checkin__row input:hover { border-color: color-mix(in srgb, var(--gold) 45%, var(--color-rule)); }
.admin-checkin__row input:focus,
.admin-checkin__row input:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 16px -6px color-mix(in srgb, var(--gold) 80%, transparent); }
.admin-checkin__row .btn { flex: none; block-size: 48px; min-block-size: 48px; padding-block: 0; padding-inline: 1.4rem; }
.admin-checkin .help { margin: 0; }

.check { display: grid; gap: .9rem; max-inline-size: 34rem; margin-block-end: 2rem; }
.check__state { margin: 0; padding: 1rem 1.15rem; border: 1px solid; font: 600 1.05rem/1.4 var(--font-label); }
.check__state:lang(fa), .check__state :lang(fa) { font: 600 1.05rem/1.8 var(--font-fa-body); }
.check__state[data-tone="go"] { color: var(--color-success); border-color: color-mix(in srgb, var(--color-success) 60%, transparent); background: color-mix(in srgb, var(--color-success) 12%, transparent); }
.check__state[data-tone="wait"] { color: var(--color-warning); border-color: color-mix(in srgb, var(--color-warning) 60%, transparent); background: color-mix(in srgb, var(--color-warning) 10%, transparent); }
.check__state[data-tone="stop"] { color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 60%, transparent); background: color-mix(in srgb, var(--color-danger) 12%, transparent); }
.check__name { margin: .2rem 0 0; font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.15; }
.check__event, .check__ref { margin: 0; color: var(--muted); }
.check__day { margin: 0; color: var(--color-warning); }
.check__lines { margin: 0; padding: 0; list-style: none; display: grid; gap: .25rem; font-size: 1.1rem; }
.check__ref bdi { font-family: var(--font-mono); color: var(--paper); letter-spacing: .04em; }

/* Marking them in: how many (a party of more than one), then the one button. */
.check__mark { display: grid; gap: 1.1rem; margin-block-start: .35rem; padding-block-start: 1.35rem; border-block-start: 1px solid var(--color-rule); }
.check__party { display: grid; gap: .55rem; }
.check__party > label { font: 600 0.76rem/1.5 var(--font-label); letter-spacing: .11em; text-transform: uppercase; color: var(--gold); }
.check__party > label:lang(fa), .check__party > label :lang(fa) { font: 500 .92rem/1.8 var(--font-fa-body); letter-spacing: 0; text-transform: none; }
.check__count { display: flex; align-items: center; gap: .9rem; }
/* The minus, the count and the plus as one control, joined, 48px high. */
.check__stepper { display: inline-flex; border: 1px solid var(--color-rule); background: var(--color-surface); transition: border-color .2s ease, box-shadow .2s ease; }
.check__stepper:focus-within { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.check__step { inline-size: 48px; block-size: 48px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--gold); font-size: 1.4rem; line-height: 1; cursor: pointer; transition: background-color .2s ease; }
.check__step:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.check__step:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.check__stepper input {
  inline-size: 3.75rem; block-size: 48px; margin: 0; padding: 0; border: 0; border-inline: 1px solid var(--color-rule);
  background: transparent; color: var(--paper); text-align: center; font: 600 1.3rem/1 var(--font-label);
  appearance: textfield; -moz-appearance: textfield;
}
.check__stepper input::-webkit-outer-spin-button,
.check__stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.check__stepper input:focus { outline: none; }
.check__of { color: var(--muted); font-size: 1.05rem; }
.check__save { justify-self: start; block-size: 48px; min-block-size: 48px; padding-block: 0; padding-inline: 1.75rem; }
.check__said { margin: 0; color: var(--color-success); }
.check__said:empty { display: none; }
[data-screen="check"] .admin-back { margin-block-end: 1.25rem; }
/* The next guest's box, set apart from this guest's. */
[data-screen="check"] .admin-checkin { margin-block-start: .25rem; padding-block-start: 1.5rem; border-block-start: 1px solid var(--color-rule); }

@media (max-width: 480px) { .admin-checkin__row input { flex: 1 1 auto; } }

/* Remove: the one move that cannot be undone, in the colour that says so. */
.admin-quiet-btn--danger { color: var(--color-danger); }
.admin-quiet-btn--danger:hover, .admin-quiet-btn--danger:focus-visible { color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 60%, transparent); }

/* A registration entered by hand: a card above the list, the tickets as rows
   with the door's own joined stepper. */
.admin-toolbar__left { margin: 0; }
.admin-byhand { display: grid; gap: 1rem; max-inline-size: 46rem; margin-block: 1.5rem 2.25rem; padding: 1.5rem 1.75rem 1.75rem; border: 1px solid var(--color-rule); background: var(--color-surface); }
.admin-byhand > .help { margin: 0; }
.admin-byhand__form { display: grid; gap: 1.1rem; }
.admin-byhand__tickets { display: grid; gap: .6rem; margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.admin-byhand__tiers { display: grid; margin: 0; padding: 0; list-style: none; }
.admin-byhand__tickets > legend { margin-block-end: .35rem; padding: 0; font: 600 0.76rem/1.5 var(--font-label); letter-spacing: .11em; text-transform: uppercase; color: var(--gold); }
.admin-byhand__tickets > legend:lang(fa), .admin-byhand__tickets > legend :lang(fa) { font: 500 .92rem/1.8 var(--font-fa-body); letter-spacing: 0; text-transform: none; }
.admin-byhand__tier { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem 1rem; padding: .6rem .9rem; border-block-start: 1px solid var(--color-rule); border-inline-start: 2px solid transparent; transition: background-color .35s var(--ease), border-color .35s var(--ease); }
/* An option with seats on it, lit as the website lights one (daena.css, .tier-line[data-taken]). */
.admin-byhand__tier[data-taken] { border-inline-start-color: var(--gold); background: linear-gradient(to right, color-mix(in srgb, var(--gold) 9%, transparent), transparent 80%); }
[dir="rtl"] .admin-byhand__tier[data-taken] { background: linear-gradient(to left, color-mix(in srgb, var(--gold) 9%, transparent), transparent 80%); }
.admin-byhand__tier[data-taken] .admin-byhand__name { color: var(--gold); }
.admin-byhand__tier[data-taken] .check__stepper { border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.admin-byhand__about { display: grid; gap: .1rem; min-inline-size: 0; }
.admin-byhand__tier:last-child { border-block-end: 1px solid var(--color-rule); }
.admin-byhand__name { color: var(--paper); transition: color .35s var(--ease); }
.admin-byhand__price { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums lining-nums; }
.admin-byhand__tier .check__stepper input, .admin-byhand__tier .check__step { block-size: 44px; }
.admin-byhand__tier .check__step { inline-size: 44px; }
.admin-byhand__tier .check__stepper input { inline-size: 3.25rem; font-size: 1.1rem; }
.admin-byhand__total { margin: 0; color: var(--gold-lit, var(--gold)); font-weight: 600; }
.admin-byhand__send { display: flex; align-items: center; gap: .65rem; min-block-size: 44px; color: var(--paper); cursor: pointer; }
.admin-byhand__send input { inline-size: 20px; block-size: 20px; accent-color: var(--gold); }
.admin-byhand__send:has(input:disabled) { color: var(--muted); cursor: default; }
.admin-byhand__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
@media (max-width: 400px) { .admin-byhand { padding: 1.1rem; } }

/* The door list: a reference whole on one line; an email broken only before its @. */
.admin-cell--reference { white-space: nowrap; }
.admin-cell__note { display: block; font-size: .85em; color: var(--muted); white-space: nowrap; }

.admin-cell__line { display: block; }
.admin-cell__sep { display: none; }
