/* The back office, built on the same tokens as the member site.

   Deliberately plainer: this is a tool used all day by two people who know what everything
   does, not a page that has to persuade anyone. Dense tables, obvious affordances, no
   animation. It shares tokens.css so a brand change lands in both places at once. */

*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none !important}

body{
  margin:0; background:var(--bg); color:var(--fg);
  font:400 15px/1.55 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;
}

a{color:var(--accent)}
:focus-visible{outline:3px solid var(--accent); outline-offset:2px; border-radius:6px}

/* ------------------------------------------------------------- the shell ----
   Two columns at a desk; one column under a top bar on a phone. Most of the traffic is
   somebody standing in the gym with a phone in one hand and a member on the other end of
   it, so the phone layout is the one that has to be quick, not the one that merely fits.

   minmax(0,1fr) rather than 1fr: a grid item's automatic minimum size is its content, so a
   wide table would widen the column and push the whole page sideways instead of scrolling
   inside .table-wrap. */

.shell{display:grid; grid-template-columns:220px minmax(0,1fr); min-height:100vh}

/* Pinned to the viewport at a desk, so the name and Sign out at its foot stay on screen however
   far the page scrolls. align-self:start, because a grid item stretched to the row's height has
   nowhere to stick. In a window too short for the menu, the menu scrolls inside the column and
   .who sticks to its foot over it — which is why the column's bottom padding is .who's. */
.side{
  background:var(--surface); border-right:1px solid var(--border);
  padding:var(--space-lg) var(--space-md) 0; display:flex; flex-direction:column; gap:var(--space-xs);
  position:sticky; top:0; align-self:start; height:100vh; height:100dvh; overflow-y:auto;
}
.side .brand{
  display:flex; align-items:center; gap:8px; font-weight:700; letter-spacing:-.01em;
  margin-bottom:var(--space-lg); color:var(--fg); text-decoration:none; flex:0 0 auto;
}
.side .brand span{
  display:grid; place-items:center; width:26px; height:26px; border-radius:8px;
  background:var(--accent); color:var(--on-accent); flex:0 0 auto;
}
.side__panel{display:flex; flex-direction:column; gap:var(--space-xs); flex:1 1 auto; min-height:0}
.side a.nav{
  display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:8px;
  color:var(--fg-muted); text-decoration:none; font-weight:500;
}
.side a.nav .nav__label{flex:1 1 auto; min-width:0}

/* The count beside Today: how many bookings the page it opens will list as needing
   somebody. Amber rather than red — it is work, not an outage — and absent at zero, because
   a badge that is always there stops being read. */
.nav__count{
  flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center;
  min-width:20px; height:20px; padding:0 6px; border-radius:999px;
  background:rgba(251,191,36,.16); color:var(--warning); border:1px solid rgba(251,191,36,.40);
  font-size:12px; font-weight:700; font-variant-numeric:tabular-nums;
}

/* Finding a person, not a page. Above the sections because on a phone the thing being
   looked for is almost always a member, a booking or a code somebody has read out. 16px
   because iOS Safari zooms the whole page when a smaller field takes focus. */
.side__find{margin:0 0 var(--space-md)}
.side__find input{
  min-height:44px; padding:0 12px; font-size:16px;
  background:var(--surface-2); border:1px solid var(--border-2); border-radius:8px;
  color:var(--fg);
}
.side a.nav:hover{background:var(--surface-2); color:var(--fg)}

/* Any aria-current, not only "page": the row is the *section* you are in and the page itself
   is a tab inside it, so the sidebar marks itself `true` and the strip marks the tab `page`.
   Matching only "page" left the section you were in looking exactly like the four you were
   not — which the markup was right about and the stylesheet was not. */
.side a.nav[aria-current]{background:var(--surface-3); color:var(--fg)}
.side .group{
  margin:var(--space-md) 0 4px; font-size:11px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--fg-subtle);
}
.side .who{
  margin-top:auto; padding:var(--space-md) 0 var(--space-lg); border-top:1px solid var(--border);
  font-size:13px; color:var(--fg-subtle);
  position:sticky; bottom:0; background:var(--surface);
}

/* The menu button, and the name in the top bar beside it: both belong to the phone layout
   and are turned on in the media query below. */
.side__toggle, .side__who{display:none}

.main{padding:var(--space-xl); max-width:1100px; min-width:0}
.main h1{font-size:26px; letter-spacing:-.02em; margin:0 0 4px}
.main .sub{color:var(--fg-muted); margin:0 0 var(--space-xl)}

/* ------------------------------------------------------- the phone layout ----
   The old rule collapsed the grid to one column and left it there, which put nine links and
   a sign-out between the top of the screen and the first line of the page. Now the nav is a
   bar: the mark, who is signed in, and a menu that opens the rest over the page.

   It is a <details>, so opening it, closing it and reaching it from the keyboard are the
   browser's job and work with scripting off. The element holds no content — the panel is its
   sibling, revealed by [open] ~ .side__panel — because a <details> whose content must also be
   visible when it is closed (which is what the sidebar is at width) cannot be forced open
   from CSS in every engine. wwwroot/js/nav.js adds only Escape and a tap outside. */

@media(max-width:860px){
  .shell{display:block}

  .side{
    position:sticky; top:0; z-index:40;
    /* The top bar is as tall as its row, and must not clip the panel that hangs below it. */
    height:auto; overflow:visible;
    flex-direction:row; align-items:center; gap:var(--space-sm);
    padding:var(--space-sm) var(--space-md);
    border-right:0; border-bottom:1px solid var(--border);
  }
  .side .brand{margin-bottom:0}

  .side__who{
    display:block; flex:1 1 auto; min-width:0; margin:0;
    font-size:13px; color:var(--fg-subtle);
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }

  .side__toggle{display:block; flex:0 0 auto}
  .side__toggle > summary{
    display:flex; align-items:center; gap:8px; min-height:44px; padding:0 14px;
    border:1px solid var(--border-2); border-radius:8px; cursor:pointer;
    font-weight:600; font-size:14px; color:var(--fg); list-style:none;
  }
  .side__toggle > summary::-webkit-details-marker{display:none}
  .side__toggle > summary::after{content:"\2261"; font-size:18px; line-height:1}
  .side__toggle[open] > summary{background:var(--surface-3)}
  .side__toggle[open] > summary::after{content:"\00D7"; font-size:20px}

  .side__panel{
    display:none; position:absolute; left:0; right:0; top:100%;
    background:var(--surface); border-bottom:1px solid var(--border); box-shadow:var(--shadow-3);
    padding:var(--space-sm) var(--space-md) var(--space-md);
    max-height:calc(100dvh - 100%); overflow-y:auto;
  }
  .side__toggle[open] ~ .side__panel{display:block}

  /* Full-width rows at a thumb's height, rather than the tight list a mouse can hit. */
  .side a.nav{padding:11px 12px; min-height:44px; font-size:15px}
  .side .group:first-child{margin-top:var(--space-xs)}
  .side .who{margin-top:var(--space-md); padding-bottom:0; position:static}
  .side .who__name{display:none}

  .main{padding:var(--space-lg) var(--space-md); max-width:none}
  .main h1{font-size:22px}
  .main .sub{margin-bottom:var(--space-lg)}

  /* 16px of main and 16px of card is 64px of the 360px screen gone before a word of it is
     read. The card keeps a gutter; it does not keep a desk's gutter. */
  .card{padding:var(--space-md); margin-bottom:var(--space-md)}
  .empty{padding:var(--space-xl) 0}
}

@media(max-width:860px) and (prefers-reduced-motion:no-preference){
  .side__toggle[open] ~ .side__panel{animation:nav-in .18s var(--ease)}
}
@keyframes nav-in{from{opacity:0; transform:translateY(-6px)} to{opacity:1; transform:none}}

.card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md);
  padding:var(--space-lg); margin-bottom:var(--space-lg);
}
.card h2{font-size:17px; margin:0 0 var(--space-sm)}
.card p.hint{color:var(--fg-muted); font-size:13.5px; margin:0 0 var(--space-md)}
/* The same muted aside inside a table cell, where a <p> would add a paragraph's margins. */
.card span.hint{color:var(--fg-muted); font-size:13px}

table{width:100%; border-collapse:collapse; font-size:14px}
th{
  text-align:left; font-size:11px; letter-spacing:.12em; text-transform:uppercase;
  color:var(--fg-subtle); padding:0 10px 8px; border-bottom:1px solid var(--border);
}
td{padding:10px; border-bottom:1px solid var(--border); vertical-align:middle}
tr:last-child td{border-bottom:0}
td.num, th.num{text-align:right; font-variant-numeric:tabular-nums}

/* A table wide enough to need it scrolls inside its own box. Without this the grid column,
   and with it the page, widens to fit the widest row and the whole layout drifts sideways. */
.table-wrap{overflow-x:auto}

/* ------------------------------------------------------ tables on a phone ----
   Eight columns do not fit on a 360px screen, and a table that scrolls sideways inside a
   card hides the column that matters behind the edge. Below 720px each row becomes a small
   stack: the column heading, from data-label, above the value it belongs to.

   The heading has to travel with the cell because <thead> is gone. A column added later
   without a data-label loses its label silently, so a test walks the markup and insists on
   one for every cell — see AdminResponsiveTests. */

@media(max-width:720px){
  .table--stack,
  .table--stack thead,
  .table--stack tbody,
  .table--stack tr,
  .table--stack th,
  .table--stack td{display:block}

  /* Hidden from the screen, kept for anything reading the table aloud. */
  .table--stack thead{
    position:absolute; width:1px; height:1px; margin:-1px; padding:0;
    overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0;
  }

  .table--stack tr{
    background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm);
    padding:var(--space-sm) 12px; margin-bottom:var(--space-sm);
  }
  .table--stack tr:last-child{margin-bottom:0}

  /* The label sits above its value, not beside it. Beside it was tried: at 360px the value
     column is left about 180px, which is not a sentence, and it wants the cell to be one
     flex line — <br> is an element, so in a flex container each side of it becomes a
     separate item and every cell built as "name<br>email" comes apart. */
  .table--stack td{
    padding:6px 0; border-bottom:1px solid var(--border); text-align:left; line-height:1.45;
  }
  .table--stack tr td:last-child{border-bottom:0}
  .table--stack td.num{text-align:left}
  .table--stack td::before{
    content:attr(data-label); display:block; line-height:1.3;
    font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--fg-subtle);
  }
  /* An action column has no heading worth repeating on every card. */
  .table--stack td[data-label=""]::before{display:none}
  .table--stack td[data-label=""]{padding-top:var(--space-sm)}
  .table--stack td[data-label=""] .btn{width:100%; justify-content:center}

  /* A table whose every value is a date, a count or a price already fits: seven days of
     bookings as seven cards would be three times the height and no easier to read. Those
     stay a table and are simply tightened. */
  .table--tight{font-size:13px}
  .table--tight th{padding:0 0 8px; font-size:10px; letter-spacing:.08em}
  .table--tight th + th, .table--tight td + td{padding-left:var(--space-sm)}
  .table--tight td{padding:9px 0}
  /* Shrink-to-fit, and no wrapping: a cron expression broken across two lines stops being
     one, and a date is not a phrase either. */
  .table--tight td:first-child, .table--tight th:first-child{width:1%; white-space:nowrap}
}

input,select,textarea{
  font:inherit; color:var(--fg); background:var(--surface-2);
  border:1px solid var(--border-2); border-radius:8px; padding:8px 10px; width:100%;
}
input:focus,select:focus,textarea:focus{outline:none; border-color:var(--accent)}
label{display:block; font-size:13px; color:var(--fg-muted); margin-bottom:4px}
.field{margin-bottom:var(--space-md)}
.row{display:flex; gap:var(--space-md); flex-wrap:wrap}
.row > *{flex:1 1 160px}

.btn{
  display:inline-flex; align-items:center; gap:8px; min-height:38px; padding:0 16px;
  border-radius:8px; font-weight:600; font-size:14px; border:1px solid transparent;
  cursor:pointer; text-decoration:none;
}
.btn--primary{background:var(--accent); color:var(--on-accent)}
.btn--secondary{background:transparent; color:var(--fg); border-color:var(--border-2)}
.btn--danger{background:transparent; color:var(--destructive); border-color:var(--destructive)}

/* ---------------------------------------------------- controls on a phone ----
   Two hard numbers, not preferences. 44px is the smallest thing a thumb hits reliably, and
   Safari on iOS zooms the whole page when a field it is focusing is under 16px — which
   leaves the operator pinching back out after every filter. */

@media(max-width:860px){
  input,select,textarea{font-size:16px; min-height:44px}
  textarea{min-height:88px}
  .btn{min-height:44px; padding:0 18px}
  .pill--action{min-height:44px; padding:0 14px}
  .linklike{min-height:44px; display:inline-flex; align-items:center}
  .toast__close{min-width:44px; min-height:44px; justify-content:center; display:inline-flex; align-items:center}
  /* A filter row wraps to as many lines as it needs; nothing here is worth a sideways
     scroll, and a button pushed off the right edge cannot be pressed at all. */
  .row{gap:var(--space-sm)}
  .row > *{flex:1 1 220px; min-width:0}
}

.pill{
  display:inline-block; padding:2px 9px; border-radius:999px; font-size:12px; font-weight:600;
  background:var(--surface-3); color:var(--fg-muted);
}
.pill.on{background:var(--accent-soft); color:var(--accent)}
.pill.off{background:var(--surface-3); color:var(--fg-subtle)}
.pill.warn{background:rgba(251,191,36,.16); color:var(--warning)}

.note{
  border-left:3px solid var(--accent-line); padding:10px 14px; background:var(--accent-soft);
  border-radius:0 8px 8px 0; font-size:13.5px; margin-bottom:var(--space-lg);
}
/* Still in use where a message belongs *in* the page rather than in a toast: the standing
   explanations, and the sign-in errors, which have to stay beside the form they are about. */
.note.warn{border-left-color:var(--warning); background:rgba(251,191,36,.10)}

/* ------------------------------------------------------------------ toasts ----
   What a save says, and where it says it. The old banner sat at the top of the page,
   so every save scrolled away from whatever was being edited. These sit in the corner
   and leave the scroll position alone. Rendered by the server, dismissed by
   wwwroot/js/toast.js. */

.toasts{
  position:fixed; right:var(--space-lg); bottom:var(--space-lg); z-index:50;
  display:flex; flex-direction:column; gap:var(--space-sm);
  width:min(380px, calc(100vw - var(--space-lg) * 2));
  /* Nothing here should swallow a click meant for the page behind an empty corner. */
  pointer-events:none;
}
.toast{
  pointer-events:auto;
  display:flex; align-items:flex-start; gap:var(--space-sm);
  padding:12px 14px; font-size:13.5px; color:var(--fg);
  background:var(--surface-2); border:1px solid var(--border);
  border-left:3px solid var(--success);
  border-radius:var(--radius-md); box-shadow:var(--shadow-3);
  transition:opacity .28s var(--ease), transform .28s var(--ease);
}
.toast--error{border-left-color:var(--destructive)}
.toast.is-leaving{opacity:0; transform:translateY(6px)}
.toast__message{margin:0; flex:1 1 auto}
.toast__close{
  flex:0 0 auto; background:none; border:0; padding:0 2px; cursor:pointer;
  font:inherit; font-size:18px; line-height:1; color:var(--fg-subtle);
}
.toast__close:hover{color:var(--fg)}

/* Full width at the bottom where a corner would crowd the content. The nav bar is at the
   top and one z-index below, so a message can never end up behind it. */
@media(max-width:860px){
  .toasts{left:var(--space-md); right:var(--space-md); bottom:var(--space-md); width:auto}
}
@media(prefers-reduced-motion:reduce){ .toast{transition:none} }

.empty{padding:var(--space-2xl) 0; text-align:center; color:var(--fg-muted)}

/* ---------------------------------------------------------------- the gate ----
   Sign in, the second factor, enrolment, access denied. One centred card, no nav:
   every link the nav would offer is one the visitor cannot follow yet. */

.bare{display:grid; place-items:center; min-height:100vh; padding:var(--space-lg)}
.gate{width:100%; max-width:420px}
.gate .card{margin:0}
.gate h1{font-size:22px; letter-spacing:-.02em; margin:0 0 4px}
.gate .sub{color:var(--fg-muted); margin:0 0 var(--space-lg)}
.gate .btn{width:100%; justify-content:center}
.gate .btn + .btn{margin-top:var(--space-sm)}

/* The authenticator key, in groups of four so it can be typed without losing your place. */
.setup-key{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:16px; letter-spacing:.18em;
  background:var(--surface-2); border:1px solid var(--border-2); border-radius:8px;
  padding:10px 12px; margin:0 0 var(--space-md); word-break:break-all;
}
/* Always black on white with its own quiet zone, in either theme: an inverted code is one many
   scanners will not read. The SVG sizes to its box. */
.setup-qr{
  width:min(240px,100%); margin:0 0 var(--space-md); padding:0;
  background:#fff; border:1px solid var(--border-2); border-radius:8px; overflow:hidden;
}
.setup-qr svg{display:block; width:100%; height:auto}
.codes{
  display:grid; grid-template-columns:repeat(2,1fr); gap:6px 16px;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:15px;
  background:var(--surface-2); border:1px solid var(--border-2); border-radius:8px;
  padding:12px; margin:0 0 var(--space-md);
}

/* Sign out is a POST — a GET would let any page on the internet end a staff session with an
   image tag — so it is a button that has to read as the link it behaves like. */
.linklike{
  background:none; border:0; padding:0; margin-top:6px; cursor:pointer;
  font:inherit; font-size:13px; color:var(--accent); text-decoration:underline;
}

/* A pill that removes the thing it names. Revoking a role is a POST, so it has to be a
   button; it should still read as the label it replaces. */
.pill--action{
  border:1px solid var(--border-2); cursor:pointer; font-family:inherit; margin:0 4px 4px 0;
}
.pill--action:hover{background:var(--surface-3); color:var(--fg)}


/* ---- payments and booking detail ---------------------------------------------------
   A door code is read out over the telephone by somebody who cannot see the screen well and
   is standing in a car park. It gets to be big, spaced and monospaced. */
.code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:16px;
  letter-spacing:.18em; font-weight:600}

.codebig{margin:0 0 var(--space-sm);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:clamp(30px,7vw,42px); font-weight:700; letter-spacing:.22em;
  color:var(--accent)}

/* Hidden from the screen, kept for anything reading the page aloud. The stacked-table rule
   below does the same job, but only under 720px — a label that has to be there at every width
   needs its own class. */
.vh{
  position:absolute; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0;
}

/* Editing a price rule where it is read. Each field is sized to what it holds rather than
   stretched to the column, so a row of inputs still scans as a row of prices. */
.reprice{display:flex; gap:6px; align-items:center; justify-content:flex-end}

.reprice input{
  width:7ch; min-width:0; text-align:right;
  font-variant-numeric:tabular-nums;
}

.reprice .btn{padding-inline:10px}

/* The day, window, label and effective date, in the cells that used to print them. Everything
   but the size comes from the base field rule, so these look like every other field in the
   back office; a table row is tighter than a form, and only that is restated. */
.rule-field{min-width:0; padding:5px 8px; font-size:13px}

/* A day name is the first thing read on the row, and the table algorithm will happily
   squeeze the select until "Wednesday" renders as "Wednesd" — which is unreadable next to
   "Wednesday" on the row below. The column is given the width its longest day needs. */
.rule-field--day{min-width:8.2em}

/* A window is one value read as a range, so its two ends stay on one line. Allowed to wrap,
   the table sizes the column to a single field and the range reads as two unrelated times
   with a stray dash after the first. They share the column and shrink instead. */
.rule-window{display:flex; gap:4px; align-items:center; flex-wrap:nowrap; min-width:15rem}

.rule-window .rule-field{width:auto; flex:1 1 0; min-width:0}

@media (max-width:860px){
  /* 16px, like every other field: under it, Safari on iOS zooms the page the moment one
     takes focus and leaves the operator pinching back out. */
  .reprice input,
  .rule-field{font-size:16px}
  .reprice{justify-content:flex-start}
}

.stats{display:flex; flex-wrap:wrap; gap:var(--space-xl)}

.stats > div{display:flex; flex-direction:column; gap:2px}

.stats .k{font-size:11px; letter-spacing:.12em; text-transform:uppercase;
  color:var(--fg-subtle); font-weight:500}

.stats .v{font-size:clamp(21px,4vw,27px); font-weight:700}

/* A second line inside a cell — a phone number under a name, a length under a time. */
td .sub{display:block; margin:2px 0 0; font-size:12.5px; color:var(--fg-muted)}

code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12.5px;
  padding:2px 6px; border-radius:5px; background:var(--surface-3); color:var(--fg-muted);
  overflow-wrap:anywhere}
/* ------------------------------------------------------- the tiny editor ----
   Bold, italic, two headings, two lists, a link. The toolbar and the editable region are
   both [hidden] in the markup and revealed by wwwroot/js/editor.js: with scripting off the
   textarea underneath is the field, and it still saves, because the server sanitises either
   way. A toolbar that fails closed would leave the page uneditable. */

.editor{margin-bottom:var(--space-md)}
.editor > label{margin-bottom:2px}
.editor .hint{color:var(--fg-muted); font-size:13px; margin:0 0 6px}

.editor__toolbar{
  display:flex; flex-wrap:wrap; gap:4px; padding:6px;
  background:var(--surface-2); border:1px solid var(--border-2); border-bottom:0;
  border-radius:8px 8px 0 0;
}
.editor__btn{
  min-height:32px; min-width:36px; padding:0 10px; cursor:pointer;
  font:inherit; font-size:13px; font-weight:600; color:var(--fg-muted);
  background:transparent; border:1px solid transparent; border-radius:6px;
}
.editor__btn:hover{background:var(--surface-3); color:var(--fg)}
/* The pressed state is read off the document by the script, so it is the caret's state and
   not a memory of what was clicked. */
.editor__btn[aria-pressed="true"]{background:var(--accent-soft); color:var(--accent); border-color:var(--accent-line)}

.editor__surface{
  min-height:180px; padding:10px 12px; overflow-wrap:break-word;
  background:var(--surface-2); border:1px solid var(--border-2); border-radius:0 0 8px 8px;
}
.editor__surface:focus{outline:none; border-color:var(--accent)}
.editor__surface > :first-child{margin-top:0}
.editor__surface > :last-child{margin-bottom:0}
.editor__surface h2{font-size:19px; margin:var(--space-md) 0 6px}
.editor__surface h3{font-size:16px; margin:var(--space-md) 0 6px}
.editor__surface p{margin:0 0 10px}
.editor__surface ul, .editor__surface ol{margin:0 0 10px; padding-left:22px}
/* Without the textarea's own rounding the two boxes would not line up when the script has
   not run. */
.editor textarea{border-radius:8px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:13px}

@media(max-width:860px){
  .editor__btn{min-height:44px; min-width:44px}
}

/* ----------------------------------------------------------- the gallery ----
   One card per photograph, wide enough to judge the shot by. Alternative text is shown, not
   hidden behind an edit: it is the half of the upload that nobody checks. */

.gallery{list-style:none; margin:0 0 var(--space-lg); padding:0; display:grid; gap:var(--space-md);
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr))}
.gallery__item{
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:var(--space-sm); display:flex; flex-direction:column; gap:8px;
}
/* Whole, never cropped: the gym's page shows every photograph whole (decisions-made.md §100),
   so the list does too, letterboxed in a frame of one shape so the cards stay in line. */
.gallery__shot{
  display:block; width:100%; aspect-ratio:3/2; max-width:100%; object-fit:contain;
  border-radius:var(--radius-sm); background:var(--surface-3);
}
.gallery__alt{margin:0; font-size:13px; color:var(--fg-muted); flex:1 1 auto}
.gallery__actions{display:flex; flex-wrap:wrap; gap:6px}
.gallery__actions .btn{min-height:32px; padding:0 10px; font-size:13px}
.gallery__actions form{flex:0 0 auto}

@media(max-width:860px){
  .gallery{grid-template-columns:1fr}
  .gallery__actions .btn{min-height:44px; padding:0 14px}
  .gallery__actions form{flex:1 1 auto}
  .gallery__actions .btn{width:100%; justify-content:center}
}

/* ------------------------------------------------------ framing the cover ----
   The whole photograph beside the card's own 16:10 frame. Over the whole one, the part the
   card shows is lit and the rest dimmed — drawn by cover-frame.js, which knows the
   photograph's shape once it has loaded; with no script the preview alone says it. */

.cover-frame{margin:0 0 var(--space-lg); padding:var(--space-md); border:1px solid var(--border);
  border-radius:var(--radius-sm); background:var(--surface-2)}
.cover-frame h3{margin-top:0}
.cover-frame__body{display:grid; gap:var(--space-md); grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
  align-items:start; margin-bottom:var(--space-md)}
.cover-frame figure{margin:0}
.cover-frame figcaption{margin-top:6px; font-size:13px; color:var(--fg-muted)}
.cover-frame__stage{position:relative; display:inline-block; max-width:100%; overflow:hidden;
  border-radius:var(--radius-sm); vertical-align:top; touch-action:none}
.cover-frame__stage img{display:block; max-width:100%; max-height:360px; width:auto; height:auto}
[data-cover-frame].is-live .cover-frame__stage{cursor:crosshair}
.cover-frame__window{position:absolute; pointer-events:none; border:2px solid #fff;
  border-radius:4px; box-shadow:0 0 0 9999px rgba(8,8,9,.55)}
.cover-frame__card{aspect-ratio:16/10; overflow:hidden; border-radius:var(--radius-sm);
  border:1px solid var(--border); background:var(--surface-3)}
.cover-frame__card img{display:block; width:100%; height:100%; object-fit:cover}
.cover-frame input[type=range]{padding:0; border:0; background:none; min-height:44px;
  accent-color:var(--accent)}

@media(max-width:720px){
  .cover-frame__body{grid-template-columns:1fr}
}

/* Photographs picked with gallery-upload.js: one row each, its thumbnail beside the line
   that describes it and the button that takes it back out. */
.picked__choose{margin-bottom:var(--space-md)}
.picked{list-style:none; margin:0 0 var(--space-md); padding:0; display:grid; gap:var(--space-sm)}
.picked__item{display:grid; grid-template-columns:72px minmax(0, 1fr) auto; gap:var(--space-sm);
  align-items:end; padding:var(--space-sm); border:1px solid var(--border);
  border-radius:var(--radius-sm); background:var(--surface-2)}
.picked__thumb{width:72px; height:72px; object-fit:contain; border-radius:6px; background:var(--surface-3);
  align-self:center}
.picked__item .field{margin:0}
.picked__item .btn{min-height:44px}
.picked__busy{font-size:13px; color:var(--fg-muted)}

@media(max-width:560px){
  .picked__item{grid-template-columns:56px minmax(0, 1fr)}
  .picked__thumb{width:56px; height:56px}
  .picked__item .btn{grid-column:1 / -1; width:100%; justify-content:center}
}

/* --------------------------------------------------- the home page's photographs ----
   One card per slot: the photograph at the shape the page crops it to, beside what it is and
   the form that replaces it. Side by side at a desk, one above the other on a phone. */

.photo-slot__body{display:grid; gap:var(--space-md); grid-template-columns:minmax(0, 240px) minmax(0, 1fr); align-items:start}
.photo-slot__shot{display:block; width:100%; height:auto; object-fit:cover;
  border-radius:var(--radius-sm); background:var(--surface-3)}
.photo-slot__about > p{margin:0 0 8px}
.photo-slot .gallery__alt{margin-bottom:var(--space-md)}

@media(max-width:720px){
  .photo-slot__body{grid-template-columns:1fr}
  .photo-slot__shot{max-width:320px}
}

/* Where a placement lands: a sketch of the home page with it lit, beside the sentence that
   says the same thing. The sketch stays beside the words even on a phone — it is 96px. */
.photo-place__where{display:grid; grid-template-columns:auto minmax(0, 1fr); gap:var(--space-md);
  align-items:start; margin-bottom:var(--space-md)}
.photo-place__where p{margin:0 0 8px}
.schematic{display:block; flex:none}
.schematic__page{fill:var(--surface-2); stroke:var(--border-2)}
.schematic__ink{fill:var(--fg-subtle)}
.schematic__line{fill:var(--border-2)}
.schematic__tile{fill:var(--surface-3); stroke:var(--border-2); stroke-width:.5}
.schematic__photo{fill:var(--surface-3); stroke:var(--border-2); stroke-width:.5}
.schematic__on{fill:var(--accent)}

/* The gallery, as the list it is: one row per photograph in the home page's order, its
   number first, because the number is where it lands. */
.photo-list{list-style:none; margin:0 0 var(--space-lg); padding:0; display:flex; flex-direction:column; gap:var(--space-sm)}
.photo-list__item{display:grid; grid-template-columns:160px minmax(0, 1fr); gap:var(--space-sm) var(--space-md);
  align-items:start; padding:var(--space-sm); background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--radius-sm)}
.photo-list__shot{display:block; width:100%; height:auto; aspect-ratio:4/3; object-fit:cover;
  border-radius:var(--radius-sm); background:var(--surface-3)}
.photo-list__about > p{margin:0 0 6px}
.photo-list__number{display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px}
.photo-list__number strong{font-size:18px}
.photo-list__controls{grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:6px}
.photo-list__controls > *{flex:0 0 auto}
.photo-list__controls .btn{min-height:32px; padding:0 12px; font-size:13px}
.photo-list__more > summary{list-style:none}
.photo-list__more > summary::-webkit-details-marker{display:none}
.photo-list__more[open]{flex-basis:100%}
.photo-list__more form{padding:var(--space-sm) 0 0}

@media(max-width:860px){
  .photo-list__item{grid-template-columns:96px minmax(0, 1fr)}
  .photo-list__controls > *{flex:1 1 calc(50% - 6px)}
  .photo-list__controls .btn{min-height:44px; width:100%; justify-content:center}
}

/* A file input and the words that go with it are one thing, so they stay on one line at a
   desk and stack on a phone like every other .row. */
.uploads__row{align-items:end}
.uploads input[type="file"]{padding:7px 10px; background:var(--surface-3)}
/* A card for the one act that cannot be undone. The border is the whole signal: the
   delete button below it is already .btn--danger, and a red panel would shout over the
   rest of the page every time a member is opened. */
.card--danger{border-color:var(--destructive)}
.card--danger > h2{color:var(--destructive)}

/* A heading over one session length's prices. Twenty-two rules as one flat list is a wall;
   the same rules under a heading each are a price list. Smaller than the card's own h2, so
   the card still reads as the thing containing them. */
.card h3{
  font-size:14px; font-weight:600; letter-spacing:.01em;
  margin:var(--space-lg) 0 var(--space-sm); display:flex; align-items:center; gap:8px;
}
.card h3:first-of-type{margin-top:var(--space-sm)}

/* Two verbs in one action cell — deactivate and delete, end and delete. They sit on one
   line at a desk; the stacked-table rule below 720px already makes each button full width,
   so wrapping is all this has to get right. */
.actions{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}

/* ── Choosing what a promotion gives ──────────────────────────────────────────────────────
   Three options, each with its own number beside it, rather than a kind picker and a
   "value" field that means something different in each case. The operator reads a sentence
   and fills in the one blank it contains.

   `min-inline-size:0` is load-bearing, not tidying: a fieldset's default is `min-content`,
   which takes its width from the longest unbreakable run inside it and pushed a phone
   layout to 935px the last time it was left off. */
.choices{border:1px solid var(--border-2); border-radius:10px; min-inline-size:0;
  padding:var(--space-md); margin:0 0 var(--space-lg)}

.choices legend{padding:0 6px; font-size:13px; color:var(--fg-muted)}

.choicerow{display:flex; align-items:center; gap:10px; margin:0; padding:8px 4px;
  min-height:44px; font-size:14px; color:var(--fg); cursor:pointer}

.choicerow + .choicerow{border-top:1px solid var(--border)}

.choicerow > input[type=radio]{width:18px; height:18px; flex:0 0 auto; accent-color:var(--accent)}

/* The sentence the option is. It wraps on a phone rather than pushing the card sideways. */
.choicerow__text{display:flex; align-items:center; gap:6px; flex-wrap:wrap; min-width:0}

/* Global `input{width:100%}` would make each of these fill the row on its own. */
.choicerow__text input{width:5.5rem; flex:0 0 auto; text-align:right;
  font-variant-numeric:tabular-nums}

/* "— optional" beside a label: present, and clearly not part of the field's name. */
.opt{color:var(--fg-subtle); font-weight:400}

/* ──────────────────────────────────────────────────────────────── section tabs ────
   The pages of one section, across the top of whichever of them you are on. The sidebar
   names the section; this names the page, which is why the current tab is marked here and
   the section row is marked there.

   Only tabs the person can open are rendered, and a section down to one visible tab renders
   no strip at all (AdminNavigationView.ShowTabs) — a lone tab is the page's own heading
   said twice.

   It scrolls sideways on a phone rather than wrapping to three lines above the content:
   five tabs wrapped is half a screen gone before the first row of the table. */
.tabs{
  display:flex; gap:4px; margin:0 0 var(--space-lg);
  border-bottom:1px solid var(--border);
  overflow-x:auto; scrollbar-width:none;
}
.tabs::-webkit-scrollbar{display:none}

.tabs__tab{
  flex:0 0 auto; display:inline-flex; align-items:center; min-height:44px; padding:0 14px;
  color:var(--fg-muted); text-decoration:none; font-weight:500; font-size:14px;
  border-bottom:2px solid transparent; white-space:nowrap;
}
.tabs__tab:hover{color:var(--fg)}
.tabs__tab[aria-current="page"]{color:var(--fg); font-weight:600; border-bottom-color:var(--accent)}

@media(max-width:860px){
  /* The strip is the page's own navigation, so it keeps the gutter the content has and the
     tap targets the menu has. */
  .tabs{margin-bottom:var(--space-md)}
  .tabs__tab{font-size:15px; padding:0 12px}
}


/* A checkbox and its words on one line, with a target big enough for a thumb. The global
   label rule is display:block, which puts the words under the box. */
label.inline{display:flex; align-items:center; gap:10px; margin:0; min-height:44px; font-size:15px}

/* Stacked cards give every field the full width, which turns a checkbox into a square the
   size of the card. It is a checkbox: 22px, and the label beside it carries the tap target. */
label.inline input[type=checkbox]{flex:0 0 auto; width:22px; height:22px; margin:0}

/* ───────────────────────────────────────────────────────── the FAQ, as a list ────
   The home page's questions in the shape the home page shows them: one collapsed line
   each, opening onto the answer. It used to be one card per question with the question in
   a text box and the answer in a rich-text editor, which made six questions a very long
   page and twenty of them unusable — most of all on the phone this is read on. The editing
   went to a page of its own; what is left here is the list and the order.

   The order is the content: the first question showing is the one already open on the home
   page, so it gets read whether anybody clicks or not. */

.qlist{list-style:none; margin:0 0 var(--space-lg); padding:0; display:flex;
  flex-direction:column; gap:var(--space-sm)}

.q{
  display:flex; align-items:flex-start; gap:var(--space-sm);
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:var(--space-sm);
}

/* The handle, and only the handle, starts a drag. Anywhere else on the row belongs to
   scrolling the page and to opening the question, which on a touch screen are the two
   gestures a draggable row would steal.

   `touch-action:none` is what makes the drag work with a finger at all: without it the
   browser claims the gesture as a scroll before the first pointermove arrives. It is scoped
   to this 44px square for exactly that reason. */
.q__grip{
  flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center;
  width:32px; min-height:44px; margin:0; color:var(--fg-subtle);
  font-size:15px; line-height:1; letter-spacing:-2px;
  cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none;
}
.q__grip:hover{color:var(--fg)}

.q__panel{flex:1 1 auto; min-width:0}

.q__summary{
  display:flex; align-items:center; gap:var(--space-sm); flex-wrap:wrap;
  min-height:44px; padding:0 4px; cursor:pointer; list-style:none;
  font-size:15px; font-weight:500; color:var(--fg);
}
.q__summary::-webkit-details-marker{display:none}

/* The disclosure triangle, drawn rather than left to the engine: Safari and Firefox draw
   different shapes in different places, and this one has to line up with a number. */
.q__summary::before{
  content:""; flex:0 0 auto; width:0; height:0; margin-right:2px;
  border-left:5px solid currentColor; border-top:4px solid transparent;
  border-bottom:4px solid transparent; color:var(--fg-subtle);
  transition:transform .12s ease;
}
.q__panel[open] > .q__summary::before{transform:rotate(90deg)}

.q__summary:hover{color:var(--accent)}
.q__summary:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:6px}

/* The position on the home page. A number rather than a bullet, because it is the thing
   being changed by dragging and an operator needs to see it land. */
.q__index{
  flex:0 0 auto; min-width:22px; text-align:right;
  font-size:12px; font-variant-numeric:tabular-nums; color:var(--fg-subtle);
}

/* `flex-basis:0` rather than `auto`, and it is the difference between a readable row and a
   silly one on a phone: with the basis taken from the question's own width, a question longer
   than the row wraps to a line of its own and leaves the number stranded above it. At zero it
   takes what is left of the line and wraps inside itself, under the number. */
.q__text{flex:1 1 0; min-width:0}

.q__detail{padding:var(--space-sm) 4px 4px}

/* The answer as the site renders it, at the size the site renders it. This is the only
   place in the back office where marked-up copy is shown as copy rather than as a field. */
.q__answer{color:var(--fg-muted); font-size:14px; line-height:1.6}
.q__answer > :first-child{margin-top:0}
.q__answer > :last-child{margin-bottom:0}
.q__answer p{margin:0 0 10px}
.q__answer h2{font-size:16px; color:var(--fg); margin:var(--space-md) 0 6px}
.q__answer h3{font-size:14px; color:var(--fg); margin:var(--space-md) 0 6px}
.q__answer ul, .q__answer ol{margin:0 0 10px; padding-left:22px}

.q__edit{flex:0 0 auto; min-height:36px; padding:0 12px; font-size:13px}

/* When it was last changed, under the answer. Muted and small on purpose: it is provenance,
   not copy, and at the answer's own weight it reads as another sentence of the answer. */
.q__detail .hint{color:var(--fg-muted); font-size:13px; margin:var(--space-sm) 0}

/* The verbs, once a question is open. Its own class rather than the gallery's, which it used
   to borrow: the two happen to want the same shape today and nothing should make a change to
   a photograph's buttons quietly reach the FAQ. */
.q__actions{display:flex; flex-wrap:wrap; gap:6px}
.q__actions .btn{min-height:32px; padding:0 10px; font-size:13px}
.q__actions form{flex:0 0 auto}

/* Picked up. Kept deliberately quiet: the item is moving through the list under the
   pointer, so the list itself is the feedback and a shadow the size of the row would be
   the loudest thing on the screen. */
.q.is-dragging{
  border-color:var(--accent-line); background:var(--surface-3);
  opacity:.92; cursor:grabbing;
}
.q.is-dragging .q__grip{cursor:grabbing}

/* Mid-drag, nothing else on the page is selectable. Dragging a row over a paragraph
   otherwise selects the paragraph, and the operator ends a reorder with half the page
   highlighted. */
body.is-reordering{user-select:none; -webkit-user-select:none}

/* "Ask another one" is the start of something, not the end of a row of verbs, so it sits
   where reading stops rather than pushed to the right margin like a Save. */
.actions--start{justify-content:flex-start}

@media(max-width:860px){
  /* A thumb-sized handle, and the edit button on the same line as the question it edits —
     at this width the row is grip, question, Edit and nothing else until it is opened. */
  .q__grip{width:44px}
  .q__edit{min-height:44px; padding:0 14px}
  .q__summary{font-size:15px}

  /* Thumb-sized, and each verb on a line of its own rather than four narrow targets in a
     row — Delete is among them. */
  .q__actions .btn{min-height:44px; padding:0 14px; width:100%; justify-content:center}
  .q__actions form{flex:1 1 auto}
}

/* --------------------------------------------------------------- are you sure? ----
   The guard in front of "Cancel & refund". Two shapes of the same markup: a disclosure
   panel when there is no script, and a modal dialog when confirm.js has upgraded it.
   Shared/_CancelSession.cshtml explains which is the mechanism and which is the polish. */

.confirm{margin:0}

/* The summary is the button. A <summary> defaults to display:list-item, and .btn's
   inline-flex is what removes the marker in most engines — but not all of them, so the
   marker is turned off explicitly rather than left to that side effect. */
.confirm__disclosure > summary{list-style:none; cursor:pointer}
.confirm__disclosure > summary::-webkit-details-marker{display:none}
.confirm__disclosure > summary::marker{content:""}

/* Open under the row, with no script. Deliberately not the width of the table: it is a
   question about one session, and it should not read as the page changing shape. */
.confirm__body{
  margin-top:var(--space-sm); padding:var(--space-md); text-align:left;
  border:1px solid var(--destructive); border-radius:var(--radius-sm);
  background:var(--surface-2); width:min(420px, 100%);
}
.confirm__title{font-size:16px; margin:0 0 6px; color:var(--destructive)}
.confirm__what{font-size:13.5px; color:var(--fg-muted); margin:0 0 var(--space-md)}
.confirm__body .field{margin-bottom:var(--space-md)}
.confirm__actions{display:flex; gap:8px; flex-wrap:wrap}
.confirm__actions .btn{flex:1 1 auto; justify-content:center}

/* The upgraded shape. A closed <dialog> is display:none by the user agent, so nothing here
   needs to hide it; the top layer puts it over the page and ::backdrop dims the rest. */
dialog.confirm__dialog{
  padding:0; border:0; background:transparent; color:var(--fg);
  width:min(420px, calc(100vw - var(--space-lg) * 2));
  max-height:calc(100dvh - var(--space-lg) * 2);
}
dialog.confirm__dialog::backdrop{background:rgba(0,0,0,.62)}
dialog.confirm__dialog .confirm__body{
  margin:0; width:100%; box-shadow:var(--shadow-4); background:var(--surface);
  padding:var(--space-lg); overflow:auto;
}

@media(max-width:860px){
  /* A cell in a stacked table is as wide as the card, and so is the question in it. */
  .confirm__body{width:100%}
  .confirm__actions .btn{width:100%; flex:1 1 100%}
}

/* ─────────────────────────────────────────────────────────────── member reports ────
   What members report from the gym (decisions-made.md §84). */

/* A tab carries the number its page lists — Today's bookings needing attention, Reports' open
   reports — so the strip says which half of the sidebar's total is which. */
.tabs__tab .nav__count{margin-left:8px}

/* What a member or a member of staff typed, as they typed it: plain text, encoded, with the
   line breaks kept by the stylesheet rather than turned into markup. */
.said{margin:0 0 var(--space-sm); white-space:pre-line; overflow-wrap:anywhere; line-height:1.6}

/* A report's photographs, square and tappable for the full size. */
.shots{list-style:none; margin:var(--space-md) 0 var(--space-sm); padding:0; display:grid;
  gap:var(--space-sm); grid-template-columns:repeat(auto-fill, minmax(140px, 1fr))}
.shots a{display:block; border-radius:var(--radius-sm)}
.shots__img{display:block; width:100%; aspect-ratio:1; object-fit:cover; border-radius:var(--radius-sm);
  background:var(--surface-3); border:1px solid var(--border)}

/* The replies, oldest first, each marked as the gym's side of the conversation. */
.thread{list-style:none; margin:0 0 var(--space-lg); padding:0; display:flex; flex-direction:column;
  gap:var(--space-sm)}
.thread__item{border-left:3px solid var(--accent-line); background:var(--surface-2);
  border-radius:0 8px 8px 0; padding:10px 14px}
.thread__who{margin:0 0 4px; font-size:13px; color:var(--fg-muted)}
.thread__item .said{margin:0}

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

/* ──────────────────────────────────────────────────────────────────── the banner ────
   /banner: the message card at the top of the member site's pages (decisions-made.md §98).
   The card itself is the member site's own stylesheet (css/banner.css, a copy held identical
   by a test); these rules are only the frame around it. */

/* The whole form sits in one fieldset so a reader gets it disabled in one place. A fieldset's
   default min-inline-size is min-content, which a long URL would turn into a sideways scroll. */
.banner-form__fields{border:0; margin:0; padding:0; min-inline-size:0}

.banner-status h2{display:flex; align-items:center; gap:10px}
.banner-status .hint{margin-bottom:0}

/* Dark and light side by side at a desk, one above the other on a phone. Each sets its own
   data-theme, so the tokens inside it are that theme's whatever the back office's is. */
.banner-previews{display:grid; gap:var(--space-md)}
.banner-preview{padding:var(--space-md); border-radius:12px; background:var(--bg); color:var(--fg);
  border:1px solid var(--border); min-width:0}

/* Drawn, not working: the preview's close and link are pictures of the site's. */
.banner-preview .site-banner__close, .banner-preview .site-banner__link{cursor:default}

/* The preview wraps the button's words in a span of their own for the script to fill, which
   the site's markup does not — and a flex item that is a span wraps where the site's text does not. */
.banner-preview .site-banner__link > span{white-space:nowrap}

.tone-swatch{flex:none; display:block}
.tone-swatch .site-banner__card{width:44px; height:30px; padding:0; gap:0; justify-content:center;
  border-radius:8px; box-shadow:none; font-size:13px; font-weight:600; line-height:1}

.choices label.inline + label.inline{border-top:1px solid var(--border)}

.banner-picture{display:flex; align-items:center; gap:var(--space-md); margin-bottom:var(--space-md)}
.banner-picture img{width:80px; height:80px; flex:none; object-fit:cover; border-radius:10px}

.banner-switch{margin-top:var(--space-sm)}

/* An empty field's example, in the preview: there, and plainly not what was typed. */
.banner-preview .is-placeholder{opacity:.45; font-style:italic}

/* The global field padding squeezes a colour picker's swatch to a hairline. */
.banner-form input[type=color]{height:44px; padding:4px; cursor:pointer}

.banner-form input[type=checkbox], .banner-form input[type=radio]{accent-color:var(--accent)}

/* ---------------------------------------------------------------- door log ----
   One gym's own pages under the section's strip. Pulled up to sit as a second row of the
   same navigation rather than a second heading. */
.tabs + .tabs--sub{margin-top:calc(-1 * var(--space-md))}

.door-log__head{display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:var(--space-sm) var(--space-md); margin-bottom:var(--space-md)}
.door-log__head h2{margin:0}
.door-log__pager{display:flex; gap:var(--space-sm)}
.door-log__schedule{margin-top:var(--space-lg)}

/* Twenty-four hours across the card. Everything on it is placed by DoorTimeline as a
   percentage; this only says what each thing looks like. */
.door-timeline__track{position:relative; height:56px; border-radius:10px; overflow:hidden;
  background:var(--surface-2); border:1px solid var(--border)}
.door-timeline__hour{position:absolute; top:0; bottom:0; width:1px; background:var(--border)}
.door-timeline__hour--major{background:var(--border-2)}
.door-timeline__session{position:absolute; top:0; bottom:0; background:var(--accent-soft);
  box-shadow:inset 1px 0 var(--accent-line), inset -1px 0 var(--accent-line)}
.door-timeline__open{position:absolute; bottom:0; height:6px; background:var(--warning)}
.door-timeline__mark{position:absolute; top:10px; bottom:10px; width:3px; margin-left:-1.5px; border-radius:2px}
.door-timeline__mark--unlocked{background:var(--fg)}
/* Shorter, so a member arriving and leaving read as two different things at a glance. */
.door-timeline__mark--exited{background:var(--fg-subtle); top:26px}
.door-timeline__mark--refused{background:var(--warning)}
.door-timeline__mark--alarm{background:var(--destructive); width:4px; margin-left:-2px; top:4px; bottom:4px}

.door-timeline__axis{position:relative; height:18px; margin-top:6px; font-size:12px;
  color:var(--fg-muted); font-variant-numeric:tabular-nums}
.door-timeline__label{position:absolute; transform:translateX(-50%); white-space:nowrap}
.door-timeline__label--major{color:var(--fg)}
.door-timeline__summary{margin:var(--space-md) 0 var(--space-sm)}

/* A phone keeps every sixth hour: eight labels in 330px collide. */
@media(max-width:600px){
  .door-timeline__label:not(.door-timeline__label--major){display:none}
}

.door-legend{list-style:none; display:flex; flex-wrap:wrap; gap:var(--space-xs) var(--space-md);
  padding:0; margin:0; font-size:13px; color:var(--fg-muted)}
.door-legend li{display:inline-flex; align-items:center; gap:6px}
.door-legend__key{width:12px; height:12px; border-radius:3px; flex:none}
.door-legend__key--unlocked{background:var(--fg)}
.door-legend__key--exited{background:var(--fg-subtle)}
.door-legend__key--refused{background:var(--warning)}
.door-legend__key--alarm{background:var(--destructive)}
.door-legend__key--session{background:var(--accent-soft); box-shadow:inset 0 0 0 1px var(--accent-line)}
.door-legend__key--open{background:var(--warning); height:6px}

/* Every record, newest first: when, what, who. Two columns on a phone, who under what. */
.door-records{list-style:none; margin:0; padding:0}
.door-records__row{display:grid; grid-template-columns:7.5rem minmax(0,1.3fr) minmax(0,1fr);
  gap:2px var(--space-md); align-items:baseline; padding:10px 0; border-bottom:1px solid var(--border)}
.door-records__row:last-child{border-bottom:0}
.door-records__when{color:var(--fg-muted); font-variant-numeric:tabular-nums; white-space:nowrap}
.door-records__row--locked .door-records__what, .door-records__row--other .door-records__what{color:var(--fg-muted)}
.door-records .hint{color:var(--fg-muted); font-size:13px}
@media(max-width:600px){
  .door-records__row{grid-template-columns:6.25rem minmax(0,1fr)}
  .door-records__who{grid-column:2}
  .door-records__who:empty{display:none}
}

.door-log__schedule .btn{margin-bottom:var(--space-lg)}

.door-uses{list-style:none; padding:0; margin:0 0 var(--space-md)}
.door-uses li{padding:6px 0; border-bottom:1px solid var(--border)}
.door-uses li:last-child{border-bottom:0}
.door-uses time{display:inline-block; min-width:9ch; font-variant-numeric:tabular-nums; color:var(--fg-muted)}

/* ───────────────────────────────────────────────────────────────── newsletters ────
   The editor's extra pieces, the preview, and the audience picker (decisions-made.md §102). */

/* A picture is as wide as the editor at most, as it is in the email at most the card. */
.editor__surface img{display:block; max-width:100%; height:auto; margin:0 0 10px; border-radius:6px}

/* The Button block, roughly as the email draws it, so the operator can tell it from a link. */
.editor__surface a.button{display:inline-block; padding:10px 18px; border-radius:10px;
  background:var(--fg); color:var(--bg); font-weight:700; text-decoration:none}

.editor__surface--tall{min-height:320px}

.email-preview{width:100%; height:720px; border:1px solid var(--border); border-radius:var(--radius-md);
  background:#FAFAF8}

@media(max-width:720px){
  .email-preview{height:560px}
}

/* The link and picture pickers borrow the confirmation dialog's frame, without its red: they
   ask nothing dangerous. */
dialog.picker .confirm__body{border-color:var(--border-2)}
dialog.picker .confirm__title{color:var(--fg)}

/* Three groups, and consent is what tells them apart, so they look different: the two that
   asked are edged in the accent, the one that did not in the warning colour. `min-inline-size`
   for the .choices reason above. */
.audience{min-inline-size:0; border-left:4px solid var(--accent)}
.audience--not-asked{border-left-color:var(--warning)}
.audience legend{float:left; width:100%; padding:0; margin:0 0 6px; font-size:17px; font-weight:700}
.audience legend + *{clear:both}
.audience__all{font-weight:600}
.audience__list{list-style:none; margin:var(--space-sm) 0 0; padding:0; overflow-wrap:anywhere}
.audience__list li{padding:6px 0; border-bottom:1px solid var(--border)}
.audience__list li:last-child{border-bottom:0}
.audience__list--pick li{padding:0}
.audience__list--pick label.inline{padding:4px 0}
.audience__who{flex:1 1 auto; min-width:0; overflow-wrap:anywhere}
.audience__counts{margin:0 0 var(--space-md)}
.audience__counts strong{font-size:18px; margin-right:4px}
.audience .note{margin-top:var(--space-md)}

/* ------------------------------------------------------- the site by section ----
   /home lists the site a section at a time (decisions-made.md §111). Each row is one link,
   the whole of it the tap target: the number is the section's place on the page, the second
   line what it currently reads, the third what it holds. */
.sections{list-style:none; margin:0; padding:0}
.sections li + li{border-top:1px solid var(--border)}
.sections__row{
  display:flex; align-items:center; gap:var(--space-md); min-height:44px;
  padding:12px 4px; color:var(--fg); text-decoration:none;
}
.sections__row:hover .sections__name{color:var(--accent)}
.sections__row:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:8px}
.sections__n{
  flex:0 0 28px; height:28px; display:grid; place-items:center; border-radius:999px;
  background:var(--surface-3); color:var(--fg-muted); font-size:13px; font-weight:600;
  font-variant-numeric:tabular-nums;
}
.sections__body{flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:2px}
.sections__name{font-weight:600}
.sections__reads{color:var(--fg-muted); font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.sections__meta{color:var(--fg-subtle); font-size:13px}
.sections__go{flex:0 0 auto; color:var(--fg-subtle); font-size:22px; line-height:1}

/* A section's field: what is wrong with it, or what somebody else saved, under it. */
.field__hint, .field__error, .field__theirs{margin:4px 0 0; font-size:13px; color:var(--fg-subtle)}
.field__error{color:var(--destructive)}
.field--refused input, .field--refused textarea{border-color:var(--destructive)}
.field__theirs{color:var(--warning)}
.field__theirs q{color:var(--fg)}

/* Long enough for a sentence, short enough to read one: a heading across a desk's whole width
   is a line nobody can take in. */
.section-words{max-width:720px}

/* A part of a section after its wording — the boxes, the questions, the photographs. */
.section-part{font-size:17px; margin:var(--space-xl) 0 var(--space-xs)}
.section-part + .hint{margin:0 0 var(--space-md); color:var(--fg-muted); font-size:13.5px}

.section-nav{display:flex; gap:var(--space-sm); margin-top:var(--space-lg)}
.section-nav a{min-width:0}
.section-nav a[rel=next]{margin-left:auto}

/* -------------------------------------------------------------- statistics ----
   Read-only figures, drawn on the server (§129). The charts are inline SVG coloured from the
   tokens, never a library, and each has its numbers in a table beneath it. The period control
   is plain links and one GET form, every one of them a 44px target at every width. */

.period{display:flex; flex-direction:column; gap:var(--space-sm)}
.period__now{margin:0; font-size:17px}
.period__bar{display:flex; flex-wrap:wrap; gap:var(--space-sm) var(--space-md); align-items:center}
.period__kinds, .period__step, .period__gyms{display:flex; flex-wrap:wrap; gap:var(--space-sm)}
.period__btn{min-height:44px; padding:0 16px; justify-content:center}
.period__btn[aria-current="page"]{background:var(--accent-soft); border-color:var(--accent-line); color:var(--accent)}
.period__custom > summary{
  cursor:pointer; min-height:44px; display:inline-flex; align-items:center;
  color:var(--fg-muted); font-size:14px;
}
.period__custom .row{align-items:end; margin-top:var(--space-xs)}
.period__custom .field{margin:0}
.period__custom .period__go{flex:0 0 auto}
.period__custom .hint{margin:var(--space-sm) 0 0; font-size:13px; color:var(--fg-subtle)}
/* Never under 16px, at a desk as well: iOS zooms on a smaller field, and a tablet is a desk. */
.period__custom input{font-size:16px; min-height:44px}

.stats .was{font-size:12.5px; color:var(--fg-muted)}
.stats--compare{gap:var(--space-lg) var(--space-xl)}
.stats-frame{font-size:19px; margin:var(--space-2xl) 0 var(--space-xs)}
.stats-frame + .sub{margin-bottom:var(--space-lg)}
.stats-foot p{margin:0 0 var(--space-sm)}
.stats-foot p:last-child{margin:0}

/* Two cards a row where there is room, one where there is not — min() keeps a 300px column
   from being wider than a phone. */
.stats-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap:0 var(--space-lg)}

.chart{margin:var(--space-md) 0 0}
.chart__top{font-size:12.5px; color:var(--fg-subtle); margin:0 0 var(--space-xs)}
.chart__svg{
  display:block; width:100%; height:160px; overflow:visible;
  border-bottom:1px solid var(--border-2);
}
.chart__bar{fill:var(--accent)}
.chart__none{fill:var(--surface-3)}
.chart__ends{display:flex; justify-content:space-between; gap:var(--space-sm); margin-top:4px; font-size:12px; color:var(--fg-subtle)}
.chart__labels{
  display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:2px;
  list-style:none; margin:4px 0 0; padding:0;
  font-size:11.5px; line-height:1.3; color:var(--fg-muted); text-align:center; overflow-wrap:anywhere;
}
.chart__labels strong{display:block; color:var(--fg); font-size:13px; font-variant-numeric:tabular-nums}
.chart__numbers{margin-top:var(--space-sm)}
.chart__numbers > summary{
  cursor:pointer; min-height:44px; display:inline-flex; align-items:center;
  font-size:13.5px; color:var(--fg-muted);
}

/* The weekday-by-hour grid: shaded by how busy the hour was, with its number in it, so the
   shade is never the only way to read a cell. The darkest two shades take dark text. */
.hours th, .hours td{text-align:center; padding:6px 4px}
.hours th[scope="row"]{
  text-align:left; color:var(--fg-muted); font-weight:500; white-space:nowrap;
  text-transform:none; letter-spacing:0; font-size:12.5px; border-bottom-color:var(--border);
}
.heat{font-variant-numeric:tabular-nums; border-bottom-color:var(--bg)}
/* On a phone the eight columns have about 280px between them: every pixel of padding is
   spent on the numbers, and the day names drop their letter-spacing. */
@media(max-width:720px){
  .table--tight.hours th, .table--tight.hours td{padding:6px 1px; letter-spacing:0}
  .table--tight.hours th[scope="row"]{padding-right:4px}
  .table--tight.hours{table-layout:fixed}
  .table--tight.hours th:first-child{width:44px}
}
.heat--0{color:var(--fg-subtle)}
.heat--1{background:color-mix(in srgb, var(--accent) 14%, transparent)}
.heat--2{background:color-mix(in srgb, var(--accent) 30%, transparent)}
.heat--3{background:color-mix(in srgb, var(--accent) 60%, transparent); color:var(--on-accent)}
.heat--4{background:var(--accent); color:var(--on-accent); font-weight:600}

/* A breakdown's first column is a page, a source or a campaign — a stranger's text, up to 100
   characters — so it wraps, where a tight table's first column normally does not. */
.breakdown td:first-child{overflow-wrap:anywhere}
.breakdown__rest td{color:var(--fg-muted)}
@media(max-width:720px){
  .table--tight.breakdown td:first-child, .table--tight.breakdown th:first-child{white-space:normal; width:auto}
}

.campaigns td:first-child{min-width:160px; overflow-wrap:anywhere}
/* Eleven columns at a desk: narrower padding and type, so the last of them is not behind the edge. */
@media(min-width:721px){
  .campaigns{font-size:13px}
  .campaigns th, .campaigns td{padding-left:5px; padding-right:5px}
  .campaigns th{letter-spacing:.04em; font-size:10.5px}
}
.campaigns .sub{margin:2px 0 0}
.campaigns__variant td{font-size:13px; color:var(--fg-muted)}
.campaigns__nested::before{content:"↳ "; color:var(--fg-subtle)}
.campaigns__total td{border-top:1px solid var(--border-2); font-weight:600}
.campaigns__why{margin:var(--space-md) 0 0}
@media(max-width:720px){
  /* Eleven figures one above another is a card taller than the phone; two a row halves it. */
  .campaigns tr{display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); column-gap:var(--space-md)}
  .campaigns td:first-child{min-width:0; grid-column:1 / -1}
  .campaigns tr td:nth-last-child(2){border-bottom:0}
  .campaigns__variant{margin-left:var(--space-md)}
}

/* ---------------------------------------------------------------- receipts ----
   Every document issued (§131): the period's links and one GET form, the totals, the list. The
   fields wrap two to a line on a phone and sit on one row at a desk; every one is 16px and 44px. */

.receipts-filter{align-items:end; margin-top:var(--space-xs)}
.receipts-filter .field{margin:0; flex:1 1 150px; min-width:0}
.receipts-filter .receipts-filter__find{flex:2 1 260px}
.receipts-filter__go{flex:0 0 auto}
.receipts-filter input, .receipts-filter select{font-size:16px; min-height:44px}
.receipts-totals{margin-top:var(--space-md)}
.receipts .nowrap{white-space:nowrap}
.receipts td .hint{display:block; margin:2px 0 0}
.receipts td a.hint{display:inline-block; color:var(--fg-muted)}
.receipts-pdf{white-space:nowrap}
/* A long address breaks rather than pushing Download PDF off the edge of the card. */
.receipts__who{overflow-wrap:anywhere; min-width:150px}
@media(max-width:720px){
  /* On a card every cell is a line of its own, so nothing needs holding together. */
  .receipts .nowrap{white-space:normal}
  .receipts td a.hint{display:inline-flex; align-items:center; min-height:44px}
}
