/* Icons (Lucide, inlined in app.js — there is no CDN; the app runs with no
   internet). Sized in `em` so an icon always matches the text beside it, and
   stroked with currentColor so it picks up the tier colour for free. */
.ic {
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.125em;
  display: inline-block;
}
.ic-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

:root {
  --bg: #000000;
  --surface: #161617;
  --surface-elevated: #1d1d1f;
  --surface-row: #252528;
  --separator: rgba(255, 255, 255, 0.09);
  --separator-strong: rgba(255, 255, 255, 0.16);
  
  /* Raised for contrast on the near-black surfaces. #636366 (the old tertiary)
     measured ~3.5:1 against --surface, which fails the 4.5:1 minimum for the
     12px captions that use it — unreadable on a phone in daylight.
       secondary  #A1A1A6  ~7.0:1 on --surface, ~8.2:1 on --bg
       tertiary   #8E8E93  ~5.5:1 on --surface, ~6.4:1 on --bg */
  --text-primary: #FFFFFF;
  --text-secondary: #A1A1A6;
  --text-tertiary: #8E8E93;
  
  /* Access Tiers — tied to physical wristband colours (fuchsia, green, blue, orange),
     refined away from raw Tailwind neon to sit cleanly on neutral-dark surfaces. */
  --fuchsia: #DF73DF;
  --fuchsia-deep: #9B1C97;
  --fuchsia-border: rgba(223, 115, 223, 0.32);
  
  --green: #32C766;
  /* Darkened so white text clears the 4.5:1 floor on filled tier buttons. */
  --green-deep: #0E7A3A;
  --green-bg: rgba(50, 199, 102, 0.12);
  --green-border: rgba(50, 199, 102, 0.32);
  
  --blue: #4DA1FF;
  --blue-deep: #0066CC;
  --blue-bg: rgba(77, 161, 255, 0.12);
  --blue-border: rgba(77, 161, 255, 0.32);

  /* Single primary accent & link-on-dark aligned with 005-design-tokens.css (--ds-accent / --ds-link-on-dark). */
  --accent-blue: #0071e3;
  --accent-blue-text: #2997ff;

  /* Orange = not a restriction on where you may go, but an obligation to hand in
     your phone (stand-ins / body doubles). Deliberately the warmest, highest-energy
     colour in the palette so it reads as an ACTION, not as a lower clearance. */
  --orange: #F58E3C;
  --orange-deep: #B84209;
  --orange-bg: rgba(245, 142, 60, 0.14);
  --orange-border: rgba(245, 142, 60, 0.36);

  --coral: #FF5A5F;
  --amber: #F5A623;
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* =========================================================================
     Harmonic Typographic System (phi^0.5 ~ 1.272 modular scale)
     Base: 15-16px. Responsive scaling with clamp() preserves clear visual
     hierarchy on mobile phones and desktop displays without abrupt jumps.
     ========================================================================= */
  --text-xl:  clamp(26px, 1.7rem + 0.9vw, 32px); /* Hero crew name (.person-display-name) */
  --text-lg:  clamp(22px, 1.4rem + 0.6vw, 26px); /* Page headers (.admin-h1, .tier-headline) */
  --text-md:  clamp(18px, 1.15rem + 0.4vw, 20px);/* Section, panel & modal titles */
  --text-base: clamp(15px, 0.95rem + 0.15vw, 16px);/* Standard body, search, primary buttons */
  --text-sm:  13px;                              /* Secondary labels, subtitles, table data */
  --text-xs:  11px;                              /* Badges, uppercase section captions, chips */

  /* Proportional Line Heights (Leading) */
  --leading-tight: 1.16;                         /* Headings & display hero */
  --leading-snug:  1.32;                         /* Subheadings & card titles */
  --leading-normal: 1.48;                        /* Body text & data rows */

  /* Optical Letter Spacing (Tracking) */
  --tracking-tight: -0.022em;                    /* Headings & hero titles */
  --tracking-wide: 0.065em;                      /* Uppercase badges & caps headers */
}

/* Block-proof zoom & universal mobile styling */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

/* ON THE ROOT ONLY, and that is not a style choice — it is what allows
   `position: sticky` to work anywhere in this app.

   This declaration used to sit on `html, body`. On `body` it did much more than
   clip a stray wide element: CSS coerces the axis left `visible` to `auto` the
   moment the other one is not, so `body` silently became a scroll container. And
   since the viewport takes its scrolling from the root element, that container
   never scrolls — so every `position: sticky` descendant resolved against a
   scrollport frozen at zero and simply scrolled away with the page. The console
   header, the door board's header and the directory's newly pinned bar were all
   inert, and none of them looked broken enough to notice.

   On `html` alone the clipping is unchanged: the root element's overflow is the
   one the viewport uses, so anything too wide is still cut off at the screen
   edge. What changes is that `body` stays `visible`, which is what lets a sticky
   child stick. */
html { overflow-x: hidden; }

/* Crucial: Inputs at 17px prevent iOS Safari from automatically zooming into the field */
input, select, textarea {
  user-select: text;
  -webkit-user-select: text;
  font-size: 17px !important;
  font-family: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

/* Keyboard focus was completely invisible (every control sets outline:none for
   touch). Put it back for keyboard users only — no ring on tap. */
:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 2px;
}
input:focus-visible,
select:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 1px;
}

[hidden] {
  display: none !important;
}

/* =========================================================================
   REDUCED MOTION — AN ALTERNATIVE, NOT A KILL SWITCH.

   Almost every animation in this app is an ENTRANCE: a sheet rising into place, a
   box popping open, a toast rising and fading. None of it carries information — the
   element is on screen whether or not it travelled there, and the toast is announced
   by `#toasts`' own live region — so the alternative is "appear, don't travel", and
   every state change survives with only the travel dropped.

   `transition: none` WITHOUT `!important` is the mechanism rather than a shortcut,
   and it is what keeps this from being the blanket kill that destroys feedback. The
   one piece of motion here that IS information is the slide-to-confirm drag, and
   `80-person.js` sets its transitions as INLINE styles (during the drag, and again
   on release) — so an inline style outranks this rule and the gesture keeps its
   feedback, while every transition declared in a stylesheet is dropped. `!important`
   here would take the gesture's feedback with it, which is the failure mode this
   block exists to avoid.

   The console's Hub tiles have their own block in `215-admin-hub.css` and are not
   restated here; this file is the base both trees load, so the rule reaches the door
   board, the scanner and the console's un-migrated pages alike. */
@media (prefers-reduced-motion: reduce) {
  .modal-card,
  .confirm-box,
  .onsite-box,
  .login-box,
  .toast-pill {
    animation: none;
  }
  * {
    transition: none;
  }
}

/* =========================================================================
   THE SIDE SAFE AREAS, WHICH DID NOT EXIST.

   `--safe-top`/`--safe-bottom` have been here since the app was built and eleven
   rules read them; the left and right pair were never defined, while
   `templates/index.html` declares `viewport-fit=cover`. The gap is invisible in
   portrait and wrong in landscape, which is how a door board gets handed over: a
   notched iPhone insets ~59px per side, and every horizontal gutter in the app is a
   flat 16px, so the search field, the first result row and the document title sit
   under the notch.

   Defined here in the same shape as the other two — `env()` with a 0px fallback, so
   a browser or a device without insets resolves them to nothing and not one existing
   measurement moves. */
:root {
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ============================================================================
   THE DESIGN-SYSTEM LAYER — DESIGN.md, named and namespaced
   ============================================================================

   THIS FILE DEFINES NAMES. IT STYLES NOTHING. No rule here is a selector for an
   element, so adding it to the stylesheet cannot change how any page renders —
   which is what makes it safe to land on its own, ahead of the pages that will
   consume it.

   WHY A SECOND TOKEN BLOCK. `000-base.css` already opens with a `:root` holding
   this app's palette, and every shipped surface reads from it: the door board,
   the meal scanner and the signing page are live at real shoots and are not part
   of this redesign. Rewriting that block in place would re-theme all of them at
   once, on the day, with nothing to roll back to. So DESIGN.md's values arrive
   BESIDE the old ones rather than over them, under a `--ds-` prefix that cannot
   collide with anything (`--bg` and `--ds-bg` are two different names, and only
   the second one is new).

   THE RULE THAT KEEPS THE TWO APART: **a component moves to `--ds-*` whole.** No
   rule reads a `--ds-` name and a legacy name for the same decision. A surface
   that takes half its ground from `--surface` and half from `--ds-surface`
   renders correctly today and diverges the first time either block is edited, and
   the symptom is a seam rather than an error.

   COMPONENTS, NOT PAGES, because that is what actually happened. The console's
   chrome — the 48px bar, the five menu items with their flyouts, the account and
   phone sheets — moved first and moved whole, and the seven pages underneath it
   are still on the legacy palette. That is not a half-migrated page; it is a
   migrated component standing in front of un-migrated ones, which is the only
   order available when the chrome is shared and the pages are not. A page counts
   as moved when every rule that paints it, chrome excepted, names `--ds-*`. The
   legacy block is deleted when the last one has — not before, and not gradually.

   WHERE THE VALUES COME FROM. DESIGN.md §15 is the starter sheet; §2.1/§2.5
   (surfaces on dark), §2.7/§2.11 (one accent), §4.2–§4.5 (type and tracking),
   §5.5 (elevation), §6.1–§6.3 (motion and the nav) are the rules behind it.

   TWO KINDS OF TOKEN LIVE HERE, and the difference is deliberate:

     * LITERAL — taken from DESIGN.md as written: the accent and its states, the
       focus ring, every radius, every duration, the nav height, and the whole
       type scale. These are the design system proper.
     * ALIASED — pointed at the value this app already uses, where the two agree
       closely enough that changing it would be a regression dressed as
       compliance. The surfaces and the text ramp are the ones: see the note on
       each group below. An alias is not a compromise; it is what stops the new
       layer from opening a visible seam down the middle of the console while the
       migration is half done.
   ============================================================================ */

:root {

  /* --------------------------------------------------------------------------
     GROUND AND SURFACES — aliased, and the reason matters.

     DESIGN.md §2.1 puts dark pages on `#000` with panels at `#1d1d1f`. This app
     is already on `#000` — the two systems agree on the page ground exactly, so
     `--ds-bg` is genuinely the same black and nothing moves. The panels are
     where they differ: `#1d1d1f` against this app's `#16171B`.

     They are aliased rather than adopted because the Hub does not stand alone —
     it sits in a console in which every other page is still on the legacy
     palette (`ADMIN_PATHS` in `web/assets.py` is the set, and it is the count
     rather than this sentence that decides) — and a Hub whose tiles were one
     grey step off every panel in every other page's chrome reads as a rendering
     fault, not as a newer design. When the last console page moves, these three
     lines are the ones to re-point at `#1d1d1f`; the consumers will not need an
     edit.

     `--ds-surface-media` is new and has no legacy counterpart: it is the well a
     product photograph sits in, one step darker than the card that frames it, so
     an image with a dark edge still reads as a framed picture rather than as a
     hole. It is from the prototype, backed by §12.1's "media sits on its own
     ground".
     -------------------------------------------------------------------------- */
  --ds-bg:               var(--bg);
  --ds-surface:          var(--surface);
  --ds-surface-elevated: var(--surface-elevated);
  --ds-surface-media:    #121214;

  /* --------------------------------------------------------------------------
     TEXT — aliased, and this one is not a judgement call.

     `000-base.css` carries a comment above `--text-secondary` recording the
     contrast measurements these three values were chosen by: `#636366` measured
     ~3.5:1 on `--surface`, which fails 4.5:1 for the 12px captions that use it,
     so the ramp was raised until every step cleared it. DESIGN.md's dark ramp
     (`#f5f5f7` / `#86868b` / `#6e6e73`) is Apple's, measured against Apple's
     surfaces — and `#86868b` is *darker* than anything here.

     Adopting it would undo accessibility work that was done deliberately, to
     match a document that was not measuring this app's panel. So the ramp is
     aliased, and `--ds-text-on-dark-secondary` below is the value a future
     surface that really is on `#1d1d1f` would want.
     -------------------------------------------------------------------------- */
  --ds-text-primary:     var(--text-primary);
  --ds-text-secondary:   var(--text-secondary);
  --ds-text-tertiary:    var(--text-tertiary);

  /* DESIGN.md's own dark ramp, kept for the light-on-dark half of the system
     (§2.5). Unused by the console; the door board and the signing page are the
     surfaces these belong to. */
  --ds-text-on-dark:            #f5f5f7;
  --ds-text-on-dark-secondary:  #86868b;
  --ds-text-on-dark-tertiary:   #6e6e73;

  /* --------------------------------------------------------------------------
     THE ONE ACCENT — literal, and the whole point of the exercise.

     §2.7 and §2.11: one accent colour for the platform, and it is blue. The
     console currently ships six (`--fuchsia`, `--green`, `--blue`, `--orange`,
     `--coral`, `--amber`) and paints the Hub's three card groups with three of
     them. Under this layer a group is told apart by its HEADER and by the
     segmented control's filter, not by its hue — colour stops carrying
     information, so it stops being able to contradict the label beside it.

     `--ds-link-on-dark` is `#2997ff` and is a *different* blue from the accent
     on purpose: §2.11 makes the accent a fill and the link a text colour, and
     `#0071e3` does not clear contrast as small text on black.
     -------------------------------------------------------------------------- */
  --ds-accent:           #0071e3;
  --ds-accent-hover:     #0076DF;
  --ds-accent-active:    #006EDB;
  --ds-link-on-dark:     #2997ff;
  --ds-focus-ring:       0 0 0 4px rgba(0, 125, 250, 0.6);

  /* WHAT SITS ON THE ACCENT. It exists as a token rather than a literal so that
     "no rule outside this file names a colour" can be an absolute rule with no
     allowlist — see the check in `test_console.py` that sweeps the Hub's own
     stylesheet for a bare hex. An allowlist would be the hole in that gate: the
     first person to add a second exception moves the boundary, and the boundary
     is the whole point. It is `#ffffff` rather than §2.1's `#f5f5f7` because on a
     saturated fill the off-white reads as a faintly dirty white. */
  --ds-text-on-accent:   #ffffff;

  /* --------------------------------------------------------------------------
     LINES
     `--ds-separator` is aliased to this app's hairline; `--ds-divider` is
     DESIGN.md §2.1's slightly stronger line for a real border. `--ds-disabled`
     is an opacity, not a colour — §2.1 applies it to the whole element so a
     disabled control's icon, label and border fade together.
     -------------------------------------------------------------------------- */
  --ds-separator:        var(--separator);
  --ds-separator-strong: var(--separator-strong);
  --ds-divider:          #333336;
  --ds-disabled:         0.42;

  /* --------------------------------------------------------------------------
     TYPE — literal, from §3.1 and the §4.5 scale.

     The stack is the one `body` in `000-base.css` already resolves to, written
     out as two names because §4.2's optical rule needs both: DISPLAY for 19px
     and up, TEXT below it. They are the same family on this machine — the
     difference is which optical size macOS picks — so getting it wrong is not a
     broken page, it is type that is subtly too tight or too loose at exactly one
     size. `-apple-system` must stay first for that to work at all.
     -------------------------------------------------------------------------- */
  --ds-font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ds-font-text:    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* §4.5's table, as size / leading / tracking / weight. Apple switches these at
     its own breakpoints rather than flowing them, and the three media queries at
     the foot of this file carry the ≤1068px and ≤734px steps. Writing them as
     tokens rather than as `clamp()` is what lets a consumer name a role once and
     get all three steps — and it is why there are no magic numbers in the Hub's
     stylesheet.

     The tracking values are the V-curve §4.3 describes, and the sign is not a
     mistake: negative below 17px and at display sizes, POSITIVE from 19px to
     32px. Type set at 28px with -0.022em reads cramped in a way that is obvious
     on a device and invisible in a diff.

     DELIBERATELY ABSENT: `display-xxl` (80px), `display-xl` (64px) and
     `headline-elevated` (56px). They are marketing hero sizes — a full-bleed
     homepage tile — and a console that opened on an 80px headline would be
     shouting at an operator who is holding a phone at a door. `headline` at
     48px is this platform's ceiling. `sosumi` is absent because it is `caption`
     under another name (§4.5), and two names for one row is how a scale drifts.
     -------------------------------------------------------------------------- */
  --ds-type-headline-size:     48px;
  --ds-type-headline-leading:  1.08349;
  --ds-type-headline-tracking: -0.003em;
  --ds-type-headline-weight:   600;

  --ds-type-eyebrow-size:      32px;
  --ds-type-eyebrow-leading:   1.125;
  --ds-type-eyebrow-tracking:  0.004em;
  --ds-type-eyebrow-weight:    600;

  --ds-type-feature-size:      28px;
  --ds-type-feature-leading:   1.14286;
  --ds-type-feature-tracking:  0.007em;
  --ds-type-feature-weight:    600;

  --ds-type-subhead-size:      28px;
  --ds-type-subhead-leading:   1.14286;
  --ds-type-subhead-tracking:  0.007em;
  --ds-type-subhead-weight:    400;

  --ds-type-label-size:        24px;
  --ds-type-label-leading:     1.16667;
  --ds-type-label-tracking:    0.009em;
  --ds-type-label-weight:      600;

  --ds-type-intro-size:        21px;
  --ds-type-intro-leading:     1.381;
  --ds-type-intro-tracking:    0.011em;
  --ds-type-intro-weight:      400;

  /* Fixed at every breakpoint — the three rows §4.5 does not vary. */
  --ds-type-body-size:         17px;
  --ds-type-body-leading:      1.47059;
  --ds-type-body-tracking:     -0.022em;
  --ds-type-body-weight:       400;

  --ds-type-body-reduced-size:    14px;
  --ds-type-body-reduced-leading: 1.42859;
  --ds-type-body-reduced-tracking: -0.016em;
  --ds-type-body-reduced-weight:  400;

  --ds-type-caption-size:      12px;
  --ds-type-caption-leading:   1.33337;
  --ds-type-caption-tracking:  -0.01em;
  --ds-type-caption-weight:    400;

  /* --------------------------------------------------------------------------
     GEOMETRY — literal, from §15 and §13.

     THE ONE THAT NEEDS A WORD IS THE CARD RADIUS. §15's starter sheet says 8px,
     which is the marketing tile; §13.1 (store cards) and §13.4 (support tiles)
     both say 18px, and those are the two card-LED registers. The Hub is a card
     index, so it takes 18px and this token is named for what it is used on
     rather than after the sheet's default. A surface that is a panel rather than
     a tile wants `--ds-radius-inner`.

     `--ds-control-h` is 44px, dropping to 36px at ≤734px. §12.2 lists that as a
     real change to the control rather than a repaint — the mobile CTA is a
     smaller button, not a 44px button drawn short — and §12.1 is what makes the
     step safe to take here: 734px is a CONTENT breakpoint, and it is not the
     833px NAVIGATION breakpoint, so a control and the bar above it can move at
     different widths without either being wrong. Do not collapse the two.
     -------------------------------------------------------------------------- */
  --ds-radius-pill:      980px;
  --ds-radius-card:      18px;
  --ds-radius-inner:     12px;
  --ds-control-h:        44px;
  --ds-gutter:           22px;
  --ds-content-max:      980px;
  --ds-nav-max:          1024px;
  --ds-nav-h:            48px;
  /* §6.3 gives the nav link's colour as a literal — "12px/12px, weight 400,
     `rgba(255,255,255,0.8)`" — and it is a token here for the same reason
     `--ds-text-on-accent` is. White at 80% is not `--ds-text-secondary`
     (`#A1A1A6`): one is white let through, the other is a grey, and on the
     frosted bar they read differently. Aliasing the two would be a decision
     nobody made. */
  --ds-nav-link:         rgba(255, 255, 255, 0.8);
  --ds-section-y:        56px;

  /* --------------------------------------------------------------------------
     MOTION — literal, from §6.1/§6.2.

     §2.9 restricts animation to `transform` and `opacity`. That is not a
     preference: those two are the only properties the compositor can animate
     without laying the page out again, so anything else animates at the speed of
     the slowest frame. A transition on `box-shadow` or `height` is a promise the
     browser cannot keep on a phone.

     `--ds-dur-ui` is the default for a control responding to a tap; `-fast` is
     for a colour change that should feel instant; `-content` is for a surface
     arriving. `--ds-ease` is Apple's standard curve — it starts and ends gently,
     which is what makes a 240ms move read as deliberate rather than as lag.
     -------------------------------------------------------------------------- */
  --ds-ease:         cubic-bezier(0.4, 0, 0.6, 1);
  --ds-dur-fast:     100ms;
  --ds-dur-ui:       240ms;
  --ds-dur-content:  400ms;

  /* --------------------------------------------------------------------------
     ELEVATION — one shadow, and tiles do not get it.

     §5.5 makes surface COLOUR the thing that communicates height, and §2.11
     forbids a glow or a drop shadow used to imply depth. So a card here is
     raised by being `--ds-surface` on `--ds-bg`, not by casting anything, and
     hover moves it with `transform` alone.

     `--ds-shadow-overlay` is the single exception and it is §15's "the only
     shadow": a modal, a sheet, a popover — something that genuinely floats over
     the page rather than sitting on it. It is NOT a card token, and reaching for
     it because a tile looks flat is the mistake this comment exists to prevent.
     -------------------------------------------------------------------------- */
  --ds-shadow-overlay: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;

  /* --------------------------------------------------------------------------
     THE NAV'S OWN SURFACES — the flyout, the drawer, and the two states a row
     in them can be in.

     §5.5 puts a surface above the page by COLOUR, and these are the three steps
     it takes: the bar is `--ds-nav-bg`, a panel hanging off it is one step
     lighter (`#161617` over `rgba(29,29,31,0.8)`), and a row inside that panel
     is lighter again when the pointer is on it (`#252528`) or lighter still when
     it is pressed (`#2d2d31`). No borders between them and no shadows under
     them: the hierarchy IS the ramp, which is why there are exactly three
     values here and not a fourth for the panel's own header.

     `--ds-surface-flyout` IS OPAQUE WHERE `--ds-nav-bg` IS NOT, and that is the
     whole reason it is a separate token rather than a second use of the first.
     A flyout is a panel of TEXT over a page of text; the frosted bar can afford
     to let the page through because it carries twelve links in fixed positions
     and nothing behind it is legible at speed, but a flyout carrying link
     descriptions would be showing the document underneath through its own
     paragraphs. §10's flyouts are solid; only the bar is glass.
     -------------------------------------------------------------------------- */
  --ds-surface-flyout:  #161617;
  --ds-surface-hover:   #252528;
  --ds-surface-pressed: #2d2d31;

  /* --------------------------------------------------------------------------
     THE CONSOLE NAV — glass where a dropped filter cannot happen, opaque where
     it can.

     §6.3's signature is `saturate(1.8) blur(20px)` over `rgba(29,29,31,0.8)`.
     The two values are one design: the blur is what the translucency is FOR, and
     a translucent bar without it is not a lighter version of the same thing — it
     is a bar with the page scrolling through it. That is not hypothetical here.
     `010-layout.css` removed the blur from the console header deliberately,
     because rows travelling up behind a *sharp* translucent bar read as a
     rendering fault.

     THE FALLBACK IS NOT A SECOND DESIGN. `rgba(29,29,31,0.8)` over `#000`
     resolves to `#181819`, so the two branches are the same colour to the eye
     and the only difference is whether the page shows through.

     Consumers write `background: var(--ds-nav-bg); backdrop-filter:
     var(--ds-nav-filter);` and get the guard for free — the conditional is
     evaluated once, here, instead of being repeated into every rule that wants a
     frosted surface.
     -------------------------------------------------------------------------- */
  --ds-nav-bg:     #181819;
  --ds-nav-filter: none;

}

/* GLASS IS SCOPED TO THE WIDTHS WHERE IT CANNOT BE DROPPED, and that is the
   result of a measurement rather than a precaution.

   The first version of this block keyed on `@supports (backdrop-filter: ...)`
   alone, on the argument that "a browser which cannot render the filter gets the
   opaque token". It was checked the way this repo checks things — the header band
   captured over a scrolled Directory list, once with the filter live and once
   with it force-disabled — and the argument did not survive:

       filter force-disabled:  background still rgba(29,29,31,0.8)
                               band differs by up to 51/255 (20%) as rows
                               scroll under it, a person's name legible
                               through the bar

   Low Power Mode is not a browser that CANNOT render the filter. It is one that
   SUPPORTS it and does not paint it, so `@supports` is true, the translucent
   token wins, and the opaque base never applies. No media query, feature query or
   `@supports` form can see Low Power Mode; the only honest levers are the width
   and the alpha, and the alpha is a dead end — dragging a 20% leak below the ~3%
   where it stops being legible needs 0.97, where the bar is visually solid and
   the blur buys nothing.

   So the glass is scoped to widths where nothing takes the filter away. From
   §12.1's navigation breakpoint up it is §6.3 exactly; at and below it the bar is
   `#181819` with no filter to lose. That is where the phone is, and a phone on a
   shoot all day is the device most likely to be in Low Power Mode. The console
   gives up nothing it had: the narrow branch is very nearly the solid header
   `010-layout.css` used to force on every device. */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  @media (min-width: 834px) {
    :root {
      --ds-nav-bg:     rgba(29, 29, 31, 0.8);
      --ds-nav-filter: saturate(1.8) blur(20px);
    }
  }
}

/* ============================================================================
   THE RESPONSIVE STEPS

   §4.5 switches its scale at Apple's breakpoints rather than flowing it, so the
   steps live here and the consumer names a role once. Overriding a custom
   property on `:root` inside a media query is what makes that work: every rule
   reading the token re-resolves it, with no second declaration anywhere.

   ≤1068px is the tablet step and ≤734px the phone step, matching the app's own
   `@media (max-width: 820px)` for the console nav closely enough that one page
   never shows type from one breakpoint and chrome from another.
   ============================================================================ */
@media (max-width: 1068px) {
  :root {
    --ds-type-headline-size:     40px;
    --ds-type-headline-leading:  1.1;
    --ds-type-headline-tracking: 0em;

    --ds-type-eyebrow-size:      28px;
    --ds-type-eyebrow-leading:   1.14286;

    --ds-type-feature-size:      24px;
    --ds-type-feature-leading:   1.16667;

    --ds-type-subhead-size:      24px;
    --ds-type-subhead-leading:   1.16667;

    --ds-type-label-size:        21px;
    --ds-type-label-leading:     1.19048;
  }
}

@media (max-width: 734px) {
  :root {
    --ds-type-headline-size:     32px;
    --ds-type-headline-leading:  1.125;
    --ds-type-headline-tracking: 0.002em;

    --ds-type-eyebrow-size:      24px;
    --ds-type-eyebrow-leading:   1.16667;

    --ds-type-feature-size:      21px;
    --ds-type-feature-leading:   1.19048;

    --ds-type-subhead-size:      19px;
    --ds-type-subhead-leading:   1.21053;
    --ds-type-subhead-tracking:  0.012em;

    --ds-type-intro-size:        19px;
    --ds-type-intro-leading:     1.4211;

    --ds-control-h:              36px;
  }
}
/* Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

/* Top Navigation Bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #000000;
  border-bottom: 0.5px solid var(--separator);
  padding: calc(var(--safe-top) + 8px) calc(16px + var(--safe-right)) 10px calc(16px + var(--safe-left));
}

/* THE CONSOLE GOES BACK TO GLASS, and this rule used to be the opposite of
   itself. It read:

       body.admin-body .app-header {
         background: var(--bg);
         backdrop-filter: none;
       }

   and the reason was a real bug, seen on a real Mac: on the console the frosted
   treatment smeared the directory. The top of a row travelling up behind the
   header was legible through it and then HARD-CUT at the bar's bottom edge by the
   pinned row below, which reads as a fault rather than as depth. `blur(24px)`
   only hides that where it is supported AND affordable — iOS renders it, drops it
   in Low Power Mode, and then the text is sharp again. `rgba(0,0,0,0.82)` was
   never opaque enough to dissolve a glyph on its own.

   The redesign takes the blur back, on two grounds, and the second is the one
   that matters:

     * THE STACKING THAT CAUSED IT IS GONE. The bug needed a PAIR of bars — this
       header, and a pinned row directly below it to do the hard-cutting. The
       console header is one bar now, with the tabs and the Hub button inside it,
       so there is no second edge for content to be cut against. That is a claim
       about a cause, so it is checked rather than asserted: the Directory and
       Projects pages are scrolled at ~940px and read TWICE, once with the filter
       live and once with it force-disabled — because a working `backdrop-filter`
       DISSOLVES exactly this class of render bug, and a pass with the blur on
       proves nothing about the case that was reported.

     * THE NARROW BRANCH IS OPAQUE, SO A DROPPED FILTER HAS NOTHING TO SMEAR.
       §6.3's frosted bar is `saturate(1.8) blur(20px)` over
       `rgba(29,29,31,0.8)`. At and below §12.1's navigation breakpoint the bar
       is `#181819` instead — the same colour to the eye, with nothing showing
       through — so the bar a phone gets cannot smear whatever the filter does.
       That is not a second design and not a regression: it is very nearly the
       solid header this rule used to force on every device.

       THE OBVIOUS VERSION OF THIS WAS WRONG, and the check above is what caught
       it. Keying the fallback on `@supports (backdrop-filter: ...)` alone reads
       as "a browser that cannot render the filter gets the opaque token", but
       Low Power Mode is not that browser: it SUPPORTS the filter and does not
       paint it, so `@supports` is true, the translucent token wins, and the
       opaque base never applies. Measured with the filter force-disabled, the
       header over a scrolled Directory list still resolved to
       `rgba(29,29,31,0.8)` and the band moved by up to 51/255 as rows passed
       under it — a person's name readable through the bar. No feature query can
       see Low Power Mode, and raising the alpha until the leak stops being
       legible needs 0.97, where the blur buys nothing. So the width is the lever
       instead: glass above the breakpoint, opaque at and below it, where the
       phone is. `005-design-tokens.css` carries the rule and the numbers.

   Both branches live in `005-design-tokens.css` as `--ds-nav-bg` /
   `--ds-nav-filter`, so the `@supports` test is written ONCE for the platform
   instead of once per bar — and so the fallback cannot be updated in one place
   and forgotten in the other. */
body.admin-body .app-header {
  background: var(--ds-nav-bg);
  backdrop-filter: var(--ds-nav-filter);
  -webkit-backdrop-filter: var(--ds-nav-filter);
  border-bottom: 1px solid var(--ds-separator);
  /* THE BAR IS 48px, and the 8px below the row is what makes it so: every child
     on the row is 40px, so `40 + 8 + safe-area` is §6.3's `--ds-nav-h` at the
     top of the page. That used to be stated as an arithmetic about the nav tabs
     and the Hub button; neither exists on this bar any more — the chrome is
     `015-globalnav.css`'s now, bar, brand, five items and three actions — and the
     number is the same because its children are, not because the old parts are
     still here. Below the navigation breakpoint the menu list is `display: none`
     and the drawer trigger takes its place at the same height, so the bar does
     not change height when the navigation does. */
  padding: var(--safe-top) 16px 8px 16px;
}

/* Row 1 = brand + actions, row 2 = the day switcher, at every width. A single row
   cannot hold brand + the day tabs + four actions on a 320–375px phone: the "New"
   button was pushed off the right edge and clipped. `flex-wrap` here only lets a
   second row happen — `.day-switcher`'s own `order: 3; flex: 1 0 100%` below is what
   FORCES it, and it also lets the tabs grow into proper 44px targets. */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.header-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-title {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.net-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
}
.net-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.net-ok .net-dot { background: var(--green); }
.net-ok .net-label { color: var(--text-secondary); }
.net-bad .net-dot { background: var(--coral); }
.net-bad .net-label { color: var(--coral); }

/* Day Segmented Switcher — full width on its own row (see .header-row) */
.day-switcher {
  order: 3;
  flex: 1 0 100%;
  display: flex;
  align-items: stretch;
  background: var(--surface);
  padding: 3px;
  border-radius: var(--ds-radius-inner);
  border: 0.5px solid var(--separator);
  /* A LONG SHOOT SCROLLS THE STRIP RATHER THAN LOSING IT. `.day-tab` will not shrink
     below its 44px target, so past roughly five days the row ran past the right edge
     and `html { overflow-x: hidden }` CUT "Find a day", the one control here that
     leaves the shoot, 94px off-screen. Scrollbar hidden for the reason `.stats-bar`
     hides its own: this is a segmented control, and a trough under it reads as a list. */
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
}

.day-switcher::-webkit-scrollbar { display: none; }

.day-tab {
  flex: 1 1 0;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 9px;
  padding: 5px 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: var(--leading-snug);
  transition: background 0.15s ease, color 0.15s ease;
}

.day-tab span:last-child {
  font-size: var(--text-xs);
  font-weight: 400;
  opacity: 0.8;
}

.day-tab[aria-pressed="true"] {
  background: var(--surface-row);
  color: var(--text-primary);
}

/* The one control in the strip that leaves the current shoot.

   `flex: 0 0 auto`, never `1 1 0` like the tabs: it is not a day, and stretching
   it to share the row equally would make it read as one — an extra tab with a
   label instead of a date. It sits apart at the right edge, at the same 44 px
   minimum so it is no harder to hit than the tabs beside it while being
   obviously a different kind of thing. */
.day-tab-find {
  flex: 0 0 auto;
  flex-direction: row;
  gap: 5px;
  padding: 5px 10px;
  color: var(--text-secondary);
  border-left: 0.5px solid var(--separator);
  margin-left: 2px;
  border-radius: 9px;
}

.day-tab-find:active {
  background: var(--surface-row);
  color: var(--text-primary);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

/* THE BUTTON ROW STAYS ON THE RIGHT EDGE, WRAPPED OR NOT.
   `space-between` on `.header-row` holds this cluster against the right edge only
   while it shares a row with the brand. A phone is narrower than the brand, the
   Hub button and these five controls — the day switcher alone is most of a row —
   so the cluster wraps onto a row of its own, and `space-between` parks a lone
   item at the START. That is the whole bug: the row of buttons jumping from the
   right edge to the left edge on a narrow screen, and back again at a wider one,
   with no relationship to anything the operator did.
   An auto margin absorbs the free space in BOTH cases, so the cluster lands on
   the same edge either way and there is no width at which it moves.

   The CONSOLE deliberately does not carry this class. Its header has four parts
   on one row — brand, Hub, nav, actions — and `space-between` floats the nav in
   the middle of them; the same auto margin would take all that free space for the
   actions and pin the nav against the Hub button instead. */
.header-actions-end {
  margin-left: auto;
}

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 0.5px solid var(--separator);
  color: var(--text-primary);
  /* An `<a>` wears this now — the board's Export control became a link to
     `/admin/wraps` on 2026-10-07 — and an anchor arrives underlined where a
     `<button>` does not. There is no text in here for a line to sit under, so
     this is hygiene rather than a fix; the rest of the class already applies to
     both, which is why the link renders identical to the button it replaced. */
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background 0.15s;
}

.btn-icon:active {
  transform: scale(0.92);
  background: var(--surface-row);
}

.btn-icon .ic {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ── The Hub button ─────────────────────────────────────────────────

   ONE BUTTON, ON THE TWO STAFF-FACING PAGES THAT ARE NOT THE CONSOLE, REPLACING
   TWO HAMBURGER MENUS. There used to be a hamburger in the console header and
   another on the door board, carrying the same element ids in two files, and no
   navigation at all on the scanner or the guest form. Each of those pages now
   carries this instead: the same 4-square glyph — the phone menu's glyph for the
   hub, kept so the app has one visual word for it rather than two — and the same
   bare word.

   THE CONSOLE STOPPED USING IT, and the console-scoped rules that restyled it
   are gone with the rest of that header. The console has a real navbar now and
   the brand in it is the way home, which is the same answer this button gives —
   a wordmark you can click. Two of them on one bar would be two names for one
   destination. So `body.admin-body .hub-link` no longer matches anything, and
   the base rule below is the door board's and the scanner's alone. */
.hub-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  margin-left: -12px;
  color: var(--ds-nav-link);
  font-family: var(--ds-font-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--ds-dur-fast) linear;
}

/* THE CHIP IS GONE AND THE GLYPH IS NOT, which is the whole of this change.

   It was a bordered pill: `#1C1D24`, a 0.5px edge, radius 11, white-on-hover.
   That is the console's OLD vocabulary for a control, and it is the one thing in
   these three headers that is still speaking it. On the door board it sat
   between the brand and the day switcher and read as a fourth button beside
   Undo, Export and New — a navigation that looks like an action, competing for
   the same glance, on the bar where the glance is scarcest.

   What it is now is what the console's navbar made its own links: bare words at
   `--ds-nav-link`, brightening to white on hover and press, no edge and no fill.
   §2.11 has no case for a chip here — a surface is a colour and there is no
   elevation to express — and §6.3's own nav treats a destination as text.

   THE 4-SQUARE GLYPH STAYS, deliberately. It is the app's one visual word for the
   hub on the three pages that do not carry the console's bar, and the three
   copies of this control are held to the same drawing on purpose (see the note on
   `REGISTER_HUB_BUTTON` in web/assets.py). What left is the box around it.

   `min-height: 44px` with a matching negative `margin-left` keeps this a real
   touch target without the word starting 12px inboard of the brand above it. */


/* UNDO AND REDO ARE 40px ON THE CONSOLE BAR, NOT 44, AND THAT IS A MEASURED
   HEIGHT FIX — the rule itself is `body.admin-body .globalnav-actions
   .globalnav-icon` in 015-globalnav.css, next to the bar that needs it.

   `.btn-icon` is a 44×44 circle, sized on the door board where the header is
   ~64px and 44 is the whole point. On the console's 48px bar it was the tallest
   thing on the row, so the row measured **53px** with the pair showing and
   **49px** without it — and the pair is `hidden` until `renderUndoButtons()`
   lifts it. The result was a 4px jump in the height of a sticky bar, and of
   everything below it, the moment an operator made an edit. 40 is `--ds-nav-h`
   minus the 8px the bar keeps below the row, which is the same arithmetic every
   other child on that bar uses. */

/* The glyph is 1em, so a page that forgets this draws a glyph of exactly
   nothing — which is why `test_console.py` checks this rule exists, and why the
   scanner and the guest form each repeat it in their own inline `<style>`: one
   loads this stylesheet and one deliberately does not. */
.hub-link .ic {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.hub-link:hover,
.hub-link:active {
  color: var(--ds-text-on-dark);
}

.btn-add-person {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  min-width: 44px;
  padding: 0 14px;
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
  border-radius: var(--ds-radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.1s, opacity 0.15s;
}

/* 320px (iPhone SE / small Android): shrink the wordmark and the button padding
   so brand + actions still fit on the first row without clipping. */
@media (max-width: 360px) {
  .brand-title { font-size: 14px; }
  .header-actions { gap: 4px; }
  .btn-add-person { padding: 0 10px; }
  .app-header { padding-left: calc(12px + var(--safe-left)); padding-right: calc(12px + var(--safe-right)); }
}

.btn-add-person:active {
  transform: scale(0.94);
  opacity: 0.85;
}

.btn-add-person .ic {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

/* ============================================================================
   THE GLOBAL NAV — the console's navbar, ported from the design lab.

   WHERE THIS COMES FROM. `future_development/hub_design_lab.html` is the
   prototype the hub redesign was approved against, and its §10 global nav is
   what the operator asked for by name after seeing the console keep eight flat
   tabs: "where is my navbar? We redid the whole navbar into that design lab."
   The structure, the 48px frosted bar, the flyout band, the curtain and the
   ≤833px drawer are all the lab's. What is NOT the lab's is the contents — see
   the note in `templates/partials/admin_header.html` about the badges, which
   were prototype data and are gone.

   WHAT CHANGED FROM THE LAB, and why each thing is not merely a copy:

     * THE BRAND IS THE HUB LINK. The lab's brand is a `tapToast` stub and the
       console had a separate `.hub-link` button beside the wordmark. Two names
       for one destination, and the wordmark always loses. `data-nav="hub"` sits
       on the brand now and there is no Hub button anywhere in the console.
     * THE TRIGGERS ARE REAL ANCHORS, not `<button onclick>`. Each one points at
       the first page of its group, so the bar works with no script at all — the
       flyouts are opened by `:hover` / `:focus-within`, which is CSS, and the
       only thing JavaScript does is the curtain.
     * THE FLYOUT IS A BAND, not a box under its item. The lab does the same and
       it is worth stating why: a flyout positioned under a 100px trigger has to
       be clamped against the viewport's right edge at every width, and the clamp
       is a magic number that goes stale the moment a label is renamed. A
       full-width band under the bar cannot overflow anything.

   SCOPED TO `body.admin-body`. `.app-header` is shared with the door board,
   which has its own header and its own `.hub-link`, and none of this may reach
   it. Every rule below is written against the `--ds-*` layer; the console's
   legacy palette is not read here at all.
   ============================================================================ */

body.admin-body .globalnav-content {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: var(--ds-nav-max);
  margin: 0 auto;
  min-width: 0;
}

/* ---------------------------------------------------------------------------
   THE BRAND — and it is the way home, which is the whole of that feature.
   --------------------------------------------------------------------------- */
/* `flex: 0 1 auto` AND `min-width: 0`, NOT `0 0 auto`, and the change is the
   bar's only guarantee that it cannot overflow.

   Every other child on this row is a fixed 40px control with `flex: 0 0 auto`,
   so the brand is the one thing that can give. Left at `0 0 auto` its own
   `min-width: auto` refuses to shrink past its contents and the row simply
   exceeds `.globalnav-content` — which is a horizontal scrollbar on the page,
   not a squashed wordmark, because nothing in the chain clips.

   WHAT MADE THIS VISIBLE: the undo/redo pair, which is `hidden` until
   `renderUndoButtons()` lifts it. With it hidden the row needs 254.66px and fits
   a 320px phone. With it showing it needs **350.66px**, and the 32px of gutter
   means it stops fitting below **383px** — so an operator on an iPhone SE who
   made an edit got `document.scrollWidth = 367` against `clientWidth = 320`, 47px
   of sideways scroll, with the drawer trigger sitting past the right edge.
   Measured, not reasoned: the four numbers are re-derived in
   `test_design_audit.py`, which is where they will go stale if a padding moves.

   This rule is the FLOOR, not the design. A brand squeezed to nothing is worse
   than no wordmark at all, so below 400px the wordmark goes deliberately — see
   the block after §12.1's, which is the part an operator actually sees. */
body.admin-body .globalnav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  /* Not `min-width: 0`. The floor is the MARK, not nothing: 22px of logo plus the
     8px gap, so the shrink stops where the wordmark ends and never crushes the
     mark into its neighbour. At an unsupported width — anything under ~300px —
     the bar overflows and scrolls, which is visible and is a width nothing
     targets; a crushed logo would instead OVERLAP the undo button, which is a
     rendering fault that looks like the app breaking. */
  min-width: 30px;
  min-height: 40px;
  padding: 0 6px 0 0;
  text-decoration: none;
  color: var(--ds-text-on-dark);
}

body.admin-body .globalnav-logo {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  /* `flex: 0 0 auto` so the brand's shrink stops at the TEXT and never reaches
     the mark. Without it the logo is just another flexible child and a narrow
     enough bar squeezes it to 8.5px, clipping the P — measured at 280px, which
     is below any phone this app targets but is exactly what a floor mechanism is
     supposed to survive. The wordmark is the give; the mark is the brand. */
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
  font-family: var(--ds-font-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

body.admin-body .globalnav-title {
  font-family: var(--ds-font-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  /* The other half of the brand's `min-width: 0` above. A flex item that may
     shrink does not do anything useful with the room unless the TEXT inside it
     is allowed to give as well — without these two the wordmark keeps its full
     width and overflows its own shrinking box instead, which is the same bug one
     level down and looks like a word hanging out of the header. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-body .globalnav-brand:hover .globalnav-title,
body.admin-body .globalnav-brand[aria-current="page"] .globalnav-title {
  color: var(--ds-text-on-dark);
}

/* ---------------------------------------------------------------------------
   THE MENU — six items, four of them flyout triggers.

   THE ITEM'S BOX IS 40px AND THE BAR IS 48px, and the 8px between them is the
   one thing here that has to be got right. `.app-header` keeps 8px of padding
   under the row so the bar measures `--ds-nav-h` while every child in it is 40 —
   and a flyout hangs from the bottom of the BAR. So without something claiming
   that 8px, a pointer travelling down from a trigger crosses a band that belongs
   to no item, `:hover` goes false, and the menu closes on the way to the thing
   it just opened.
   The band is claimed by `.globalnav-flyout::before` below, and NOT here.

   A NEGATIVE MARGIN ON THIS LIST WAS THE FIRST ATTEMPT AND IT DOES NOT WORK.
   `margin: 0 0 -8px 0` alongside `align-self: stretch` reads as "stretch, then
   keep 8px of it out of the layout", and that is what the comment here used to
   claim. Chrome resolves the stretched size against the line's cross size and
   discards the bottom margin in the process: the list measures **40px** with the
   declaration present, byte-identical to its height without it. It was removed
   rather than left in place, because a no-op that is documented as load-bearing
   is worse than no rule at all — the next person trusts it and the bug comes
   back with the comment still standing guard over nothing.
   It was caught by driving the real pointer through the band in small steps: the
   flyout closed at y=40, the trigger's last row of pixels. A `hover` that jumps
   straight to an element never samples the band and reports a clean pass.
   --------------------------------------------------------------------------- */
body.admin-body .globalnav-menu-list {
  display: flex;
  align-items: stretch;
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.admin-body .globalnav-item {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
}

/* §6.3, verbatim where the numbers are concerned: `12px/12px`, weight 400,
   `rgba(255,255,255,0.8)`. No background on any state — the item is a word on a
   bar, and filling it on hover would put the old segmented control back one item
   at a time. */
body.admin-body .globalnav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 11px;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--ds-font-text);
  font-size: 12px;
  line-height: 12px;
  font-weight: 400;
  color: var(--ds-nav-link);
  transition: color var(--ds-dur-fast) linear;
}

body.admin-body .globalnav-link:hover,
body.admin-body .globalnav-item:hover > .globalnav-link {
  color: var(--ds-text-on-dark);
}

/* WHERE YOU ARE, SAID IN WHITE AND NOTHING ELSE — §2.11: a surface is a colour
   rather than a shadow, and there is no elevation here to express. Colour alone
   is enough because `aria-current="page"` carries it for anyone not reading
   colour. `mountChrome()` sets that attribute on every `[data-nav]` in the bar,
   which is why the selector below is on the attribute and not on a class. */
body.admin-body .globalnav-link[aria-current="page"] {
  color: var(--ds-text-on-dark);
}

body.admin-body .globalnav-chevron {
  width: 10px;
  height: 6px;
  flex: 0 0 auto;
  transition: transform var(--ds-dur-fast) var(--ds-ease);
}

body.admin-body .globalnav-item:hover > .globalnav-link .globalnav-chevron,
body.admin-body .globalnav-item:focus-within > .globalnav-link .globalnav-chevron {
  transform: rotate(180deg);
}

/* ---------------------------------------------------------------------------
   THE FLYOUT BAND.

   `top: 100%` IS THE BAR'S BOTTOM EDGE, and the containing block is
   `.app-header` — which is `position: sticky`, so it is positioned, and no
   `.globalnav-item` above is. That is deliberate: making an item `relative` is
   the obvious way to write this and it is the one that breaks the band, because
   the flyout would then be as wide as its trigger.
   --------------------------------------------------------------------------- */
body.admin-body .globalnav-flyout {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  background: var(--ds-surface-flyout);
  border-top: 1px solid var(--ds-divider);
}

body.admin-body .globalnav-item:hover > .globalnav-flyout,
body.admin-body .globalnav-item:focus-within > .globalnav-flyout {
  display: block;
  animation: flyoutSlide var(--ds-dur-ui) var(--ds-ease);
}

/* THE BAND BETWEEN THE ROW AND THE FLYOUT, CLAIMED WITH AN INVISIBLE STRIP.

   It is 9px and `top: -9px` because the flyout's own border-top is 1px: absolute
   offsets are measured from the PADDING box, so a child at `top: -8px` would
   start at y=41 and leave the trigger's last pixel at y=40 belonging to nothing
   again — an 8px gap turned into a 1px one, which is the same bug with a smaller
   number. 9px reaches the trigger's bottom edge exactly.

   WHAT MAKES IT WORK IS WHERE IT LIVES, not what it covers. A `::before` on the
   flyout is a DESCENDANT of `.globalnav-item`, so while the pointer is inside it
   `:hover` on the item is true and the flyout that the strip belongs to stays
   open. A strip anywhere else in the header — a spacer, a taller bar, a wrapper
   — would be a sibling of the item and would close the menu it is meant to be
   holding open.

   IT PAINTS NOTHING AND INTERCEPTS NOTHING. It is transparent and it sits below
   the row rather than over it, so no pixel of the trigger or of the flyout's own
   top edge changes. `display: none` on the closed flyout takes it with it, so it
   does not exist over the page until there is a menu for it to bridge to.

   THE ALTERNATIVE, FOR THE NEXT PERSON CONSIDERING IT: `top: calc(100% - 8px)`
   with `padding-top: 8px` on the flyout closes the same gap with no pseudo
   element at all, and moves the band's `--ds-divider` line up to y=40 and fills
   the header's bottom 8px with the flyout's opaque surface instead of the bar's
   translucent one. Two visible changes to buy one invisible element. */
body.admin-body .globalnav-flyout::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -9px;
  height: 9px;
}

@keyframes flyoutSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

body.admin-body .globalnav-flyout-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0 48px;
  max-width: var(--ds-nav-max);
  margin: 0 auto;
  padding: 20px 16px 24px 16px;
}

body.admin-body .flyout-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
}

/* A LABEL, NOT A HEADING, and it is not clickable: §10's column headers name a
   grouping and nothing else. */
body.admin-body .flyout-header {
  padding: 0 8px 6px 8px;
  font-family: var(--ds-font-text);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--ds-text-on-dark-tertiary);
}

/* 14px for every row, which is the lab's own correction: it used to set the
   featured rows larger than the rest, and size is not what makes a tool
   primary — position in the column is. */
body.admin-body .flyout-link {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 8px;
  border-radius: 8px;
  text-decoration: none;
  font-family: var(--ds-font-text);
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
  color: var(--ds-text-on-dark);
  transition: background-color var(--ds-dur-fast) linear;
}

body.admin-body .flyout-link:hover,
body.admin-body .flyout-link:focus-visible {
  background: var(--ds-surface-hover);
}

body.admin-body .flyout-link:active {
  background: var(--ds-surface-pressed);
}

body.admin-body .flyout-link small {
  font-size: 12px;
  line-height: 16px;
  color: var(--ds-text-on-dark-secondary);
}

/* ---------------------------------------------------------------------------
   THE CURTAIN — the page says it is not what you are pointing at.

   `z-index: 49` IS THE HEADER'S OWN NUMBER MINUS ONE, and that is the whole
   trick: `.app-header` is `z-index: 50`, so 49 puts the curtain under the bar
   AND under the flyout hanging off it, and over every other thing on the page.
   The bar being translucent means the curtain darkens it a little as well,
   which reads as the bar going back a step rather than as a fault.
   --------------------------------------------------------------------------- */
/* THE DIM BEHIND AN OPEN FLYOUT, AND IT IS NOT A CLICK TARGET.

   The lab closes the menu when this is clicked, and it cannot be: the flyout
   opens on `:hover`, so this element only exists while the pointer is inside a
   nav item, and the moment the pointer leaves that item for the curtain the item
   is no longer hovered and the curtain is already gone. A control that can never
   be reached is worse than no control, so the click handler is not here and
   Escape does the closing instead — see `mountNavCurtain()`.

   `pointer-events: none` FOLLOWS FROM THAT and is not decoration. The one case
   where the dim outlives the pointer is a KEYBOARD-opened menu: `focusin` shows
   it and the pointer is anywhere on the page. With hit testing left on, the
   curtain would then swallow the next click on the page below — a full-viewport
   dead zone with no handler behind it, which reads as the console having frozen.
   Turning it off costs nothing, because there is no click that was ever meant to
   land here. */
body.admin-body .globalnav-curtain {
  position: fixed;
  inset: 0;
  z-index: 49;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.48);
}

body.admin-body .globalnav-curtain[hidden] {
  display: none;
}

/* ---------------------------------------------------------------------------
   THE ACTIONS CLUSTER.
   --------------------------------------------------------------------------- */
body.admin-body .globalnav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

/* The undo/redo pair, scaled to 40 like everything else on the bar. Left at
   `.btn-icon`'s 44 they would make the bar 4px taller whenever the stack had
   something, which is a sticky bar jittering every time somebody makes an edit. */
body.admin-body .globalnav-actions .globalnav-icon {
  width: 40px;
  height: 40px;
}

/* A CONTROL, NOT A BANNER. The phone addresses and the account were two panels
   on the hub page; both are now things you open, and both are drawn as the same
   quiet 40px row so neither reads as more important than the other or than the
   navigation beside them. */
body.admin-body .globalnav-phone,
body.admin-body .globalnav-account,
body.admin-body .globalnav-menutrigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-nav-link);
  cursor: pointer;
  font-family: var(--ds-font-text);
  font-size: 12px;
  line-height: 12px;
  font-weight: 400;
  padding: 0;
  transition: color var(--ds-dur-fast) linear, background-color var(--ds-dur-fast) linear;
}

body.admin-body .globalnav-phone {
  padding: 0 12px;
}

body.admin-body .globalnav-account,
body.admin-body .globalnav-menutrigger {
  width: 40px;
}

body.admin-body .globalnav-phone:hover,
body.admin-body .globalnav-account:hover,
body.admin-body .globalnav-menutrigger:hover {
  color: var(--ds-text-on-dark);
  background: var(--ds-surface-hover);
}

body.admin-body .globalnav-phone .ic,
body.admin-body .globalnav-account .ic,
body.admin-body .globalnav-menutrigger .ic {
  width: 16px;
  height: 16px;
}

/* The drawer trigger is the phone's navigation and nothing else's — above 834px
   the six items are on the bar. */
body.admin-body .globalnav-menutrigger {
  display: none;
}

/* THE BAR SHEDS AS IT NARROWS, AND THE BREAKPOINTS ARE LISTED IN THE ORDER
   THEY ARE CROSSED — 1005, then 834, then 401 — each derived from the one
   above it rather than chosen. They do not overlap: a rule in the 1004 block is
   live inside the 834 block too, and a rule in 834 is not live above it. */

/* ---------------------------------------------------------------------------
   THE PHONE BUTTON'S LABEL, WHICH GOES LONG BEFORE THE BAR IS A PHONE'S.

   1005px, and it is arithmetic rather than taste.

   The bar's widest state is brand
   (110.66) + menu + actions — and the actions are brand + undo + redo +
   phone + account at 40 each, so the phone's 92.63px of label is the difference
   between 184 and 276.63. With the pair showing, the row measures **972.39px**
   plus the bar's 32px of gutter = 1004.39, so it fits from **1005px** and the
   label goes below it.

   IT WAS 933px UNTIL 2026-10-07, and it moved because the MENU moved rather than
   because anyone re-tasted it. A sixth top-level item — the "Wraps" flyout, added
   with `/admin/payroll` — took the row from 900.33px to 972.39px, and the old rule
   then hid the label in a band where the row no longer fitted at all.

   THE TRIGGER WAS SHORTENED RATHER THAN THE BREAKPOINT MOVED, and that was the
   cheaper of the two by a wide margin. At the group's full name "Wraps and
   Reports" the trigger measures 143.95px against 72.06, taking the row to
   **1044.28px** — 53px wider than a 834px tablet has, measured, with the undo pair
   showing and the label already gone. Making THAT fit means moving 834, which is
   §12.1's tablet split and not a number this bar owns; shortening one label costs
   nothing else at all. `templates/partials/admin_header.html` carries the same
   argument where the label actually is.

   WHATEVER MOVES NEXT, `tests/test_design_audit.py`'s `EXPECT` dict carries the
   same four numbers — its `(True, False)` and `(True, True)` entries ARE the
   876.39 and 972.39 above — and they are re-measured in the same pass as this
   rule or neither is, because a number adjusted to agree with the other is a
   number that has stopped checking anything.

   WHAT THAT LOOKED LIKE, because the numbers are not the interesting part. In the
   834-1004 band between the menu's floor and the label's ceiling the browser does
   not wrap — nothing on this bar wraps — so it
   squeezed the brand down to its 22px mark and then started clipping the MENU's
   labels, which have no ellipsis of their own; at the very bottom edge it gave up
   and put 2px of horizontal scroll on every console page. A bar that clips the
   word "Directory" to "Directo" rather than admitting it is out of room.

   THE LABEL IS THE RIGHT THING TO GIVE and there is only one other label here to
   weigh it against. `Prod Engine` is on the bar too, and it is the way home; this
   one is a caption on a button that already has a phone glyph and an `aria-label`.
   It is also the SAME DECISION §12.1's block below already makes one breakpoint
   down — "the label is the first thing to go — the glyph is the whole control on a
   phone" — applied at the width where it is actually true rather than at the
   width where the menu disappears. Those two widths are not the same width, and
   tying them together was the mistake.

   THE RULE LIVES HERE, NOT IN THE 833 BLOCK, so there is one home for it. It used
   to be in there, where 833 was doing two unrelated jobs at once.

   ONE THING THIS DOES NOT FIX, WRITTEN DOWN SO IT IS NOT HUNTED FOR LATER. At
   834-840px WITH the undo/redo pair showing, the row is still 5.7px short, and
   the brand's shrink covers it by ellipsising the wordmark to "Prod Engin…". That
   is the floor mechanism below working exactly as designed — it is not a fourth
   breakpoint to add. The window is six pixels wide, needs the menu AND the
   transient pair at once, and the alternative was a rule that hides the wordmark
   on a 768px tablet where it fits comfortably. Measured: `test_design_audit.py`
   asserts the brand never falls below its own mark and never overflows the page,
   and both hold here.
   --------------------------------------------------------------------------- */
@media (max-width: 1004px) {
  body.admin-body .globalnav-phone {
    width: 40px;
    padding: 0;
  }

  body.admin-body .globalnav-phone-text {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   WHAT THE BAR DOES BELOW §12.1's NAVIGATION BREAKPOINT.

   834 rather than the console's old 820: §12.1 splits the two systems, and this
   is the navigation one. The bar keeps its brand and gains the drawer trigger;
   the menu list goes, because six items plus a brand plus three actions is not
   a phone's width and pretending otherwise is how a tab ends up parked off the
   end of a scroll.
   --------------------------------------------------------------------------- */
@media (max-width: 833px) {
  body.admin-body .globalnav-menu {
    display: none;
  }

  body.admin-body .globalnav-menutrigger {
    display: flex;
  }
}

/* ---------------------------------------------------------------------------
   THE SMALLEST PHONES, WHERE THE WORDMARK IS WHAT GOES.

   400px, and the number is derived rather than picked: the row's widest state is
   brand + undo + redo + phone + account + drawer, which measures 350.66px, and
   with the bar's 32px of gutter that stops fitting below 383px. 400 is that with
   room to spare on both sides of the edge, so no font-metric wobble moves the
   breakpoint's behaviour without moving the breakpoint.

   THE WORDMARK IS THE RIGHT THING TO DROP and the alternatives are worth saying
   out loud, because this is a judgement and not an arithmetic. The other three
   candidates on the row are the menu trigger, the phone sheet and the account —
   all of them functions, all of them 40px minimum, none of them removable. The
   undo/redo pair is the widest single thing here at 88px and it is TEMPORARY:
   it appears the moment somebody edits something and goes away again, so hiding
   it would quietly take away the control an operator reaches for immediately
   after a mistake, on the screen where they are most likely to have made one.

   What goes instead is `Prod Engine`, thirteen pixels of type. The logo mark
   STAYS and it is inside the same `<a href="/admin/hub">`, so the brand is still
   the way home and still a real tap target — what is lost is the second half of a
   wordmark that the P already stands for, on a screen where every pixel of the
   bar is a control.
   --------------------------------------------------------------------------- */
@media (max-width: 400px) {
  body.admin-body .globalnav-title {
    display: none;
  }

  /* AND THE MARK ALONE IS TOO SMALL TO BE THE LINK. 22px of logo plus the 6px
     the brand keeps on its right is a 28px box — under this repo's own 32px
     floor for a phone target, and under Apple's 44 by a wide margin. It is also
     worse than it sounds, because the thing that shrank is the way HOME.

     The padding and the margin are equal and opposite on purpose: the box grows
     to 42px so the target is real, and the negative margin pulls the extra back
     out of the layout so the GLYPH does not move. A `padding: 0 10px` on its own
     would have shifted the mark 10px inboard of the page's gutter, where it would
     no longer line up with the page title under it or with the flyout's own
     gutter — a 10px misalignment on every console page, in exchange for a target
     nobody would have noticed was missing. */
  body.admin-body .globalnav-brand {
    padding: 0 10px;
    margin: 0 -10px;
  }
}

/* ---------------------------------------------------------------------------
   THE DRAWER — the lab's `#mobileNavPanel`, which is `100dvh` because a panel
   that stops short of the bottom of a phone reads as one that failed to load.
   --------------------------------------------------------------------------- */
body.admin-body .globalnav-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.6);
}

body.admin-body .globalnav-drawer[hidden] {
  display: none;
}

body.admin-body .globalnav-drawer-panel {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--ds-surface-flyout);
  animation: drawerIn var(--ds-dur-ui) var(--ds-ease);
}

@keyframes drawerIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

body.admin-body .globalnav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--ds-nav-h) + var(--safe-top));
  flex: 0 0 auto;
  padding: var(--safe-top) 8px 8px 16px;
  border-bottom: 1px solid var(--ds-divider);
}

body.admin-body .globalnav-drawer-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-nav-link);
  cursor: pointer;
}

body.admin-body .globalnav-drawer-close:hover {
  color: var(--ds-text-on-dark);
}

body.admin-body .globalnav-drawer-close .ic {
  width: 18px;
  height: 18px;
}

body.admin-body .globalnav-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 16px calc(24px + var(--safe-bottom, 0px)) 16px;
}

body.admin-body .globalnav-drawer-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.admin-body .globalnav-drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--ds-divider);
  background: transparent;
  color: var(--ds-text-on-dark);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  font-family: var(--ds-font-text);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.022em;
}

body.admin-body .globalnav-drawer-row:active {
  background: var(--ds-surface-pressed);
}

body.admin-body .globalnav-drawer-item .globalnav-chevron {
  width: 12px;
  height: 8px;
  color: var(--ds-text-on-dark-tertiary);
  transition: transform var(--ds-dur-fast) var(--ds-ease);
}

body.admin-body .globalnav-drawer-item.open .globalnav-chevron {
  transform: rotate(180deg);
}

body.admin-body .globalnav-drawer-sublinks {
  display: none;
  flex-direction: column;
  padding: 0 0 8px 0;
}

body.admin-body .globalnav-drawer-item.open .globalnav-drawer-sublinks {
  display: flex;
}

body.admin-body .globalnav-drawer-sublinks a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px 0 16px;
  text-decoration: none;
  font-family: var(--ds-font-text);
  font-size: 15px;
  color: var(--ds-link-on-dark);
}

body.admin-body .globalnav-drawer-actions {
  padding-top: 24px;
}

body.admin-body .globalnav-drawer-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--ds-divider);
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-text-on-dark);
  cursor: pointer;
  font-family: var(--ds-font-text);
  font-size: 15px;
}

body.admin-body .globalnav-drawer-phone .ic {
  width: 16px;
  height: 16px;
}

/* ---------------------------------------------------------------------------
   THE TWO SHEETS — the account, and the phone addresses.

   Both are `.modal-scrim`, which is what makes them cheap: `wireScrims()`
   closes any scrim on a backdrop click and on Escape, and `syncSheetLock()`
   pins the page behind one. Nothing below dismisses anything; it only draws.

   `--ds-shadow-overlay` IS USED HERE AND NOWHERE ELSE IN THIS FILE. It is §15's
   one shadow — for something that genuinely floats over the page rather than
   sitting on it — and a sheet is the case it exists for. A flyout is NOT: it is
   a surface in the bar's own stacking, and giving it a shadow would be depth
   drawn with a shadow, which §2.11 forbids.
   --------------------------------------------------------------------------- */
body.admin-body .globalnav-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  max-width: 380px;
  padding: 24px;
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface-flyout);
  box-shadow: var(--ds-shadow-overlay);
}

body.admin-body .globalnav-sheet-title {
  margin: 0 0 6px 0;
  font-family: var(--ds-font-display);
  font-size: 21px;
  line-height: 1.19;
  font-weight: 600;
  color: var(--ds-text-on-dark);
}

body.admin-body .globalnav-sheet-note {
  margin: 0 0 16px 0;
  font-family: var(--ds-font-text);
  font-size: 14px;
  line-height: 1.43;
  color: var(--ds-text-on-dark-secondary);
}

body.admin-body .globalnav-sheet-note strong {
  color: var(--ds-text-on-dark);
  font-weight: 600;
}

body.admin-body .globalnav-sheet-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

body.admin-body .globalnav-sheet-addresses {
  margin: 0 0 20px 0;
  padding: 0;
  list-style: none;
}

body.admin-body .globalnav-sheet-addresses:empty {
  display: none;
}

body.admin-body .globalnav-sheet-address {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ds-divider);
}

body.admin-body .globalnav-sheet-address-where {
  font-family: var(--ds-font-text);
  font-size: 12px;
  line-height: 16px;
  color: var(--ds-text-on-dark-tertiary);
}

body.admin-body .globalnav-sheet-address a {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 18px;
  color: var(--ds-link-on-dark);
  text-decoration: none;
  /* An address is one unbreakable token and the LAN one can be long. `anywhere`
     rather than `break-word` because only `anywhere` lowers the intrinsic
     minimum width, which is what stops a long address widening the sheet. */
  overflow-wrap: anywhere;
}

body.admin-body .globalnav-sheet-address a:hover {
  text-decoration: underline;
}

body.admin-body .globalnav-sheet-account {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.admin-body .globalnav-account-line {
  margin: 0;
  font-family: var(--ds-font-text);
  font-size: 15px;
  line-height: 20px;
  color: var(--ds-text-on-dark);
}

body.admin-body .globalnav-account-name {
  font-weight: 600;
}

/* The role is a CAPTION ON THE NAME — parentheses drawn by the stylesheet, so
   the markup carries two clean values and the punctuation appears only when the
   server actually named a role. */
body.admin-body .globalnav-account-role {
  color: var(--ds-text-on-dark-secondary);
}

body.admin-body .globalnav-account-role:not(:empty)::before {
  content: ' (';
}

body.admin-body .globalnav-account-role:not(:empty)::after {
  content: ')';
}

/* SIGN OUT IS THE CONSOLE'S ONE DESTRUCTIVE CONTROL, and it is drawn like one:
   full width, and the accent line colour rather than the ordinary one. It is
   behind a labelled control of its own, which is the other half of the same
   argument — see the partial. */
body.admin-body .globalnav-sheet-signout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--ds-divider);
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-text-on-dark);
  cursor: pointer;
  font-family: var(--ds-font-text);
  font-size: 15px;
}

body.admin-body .globalnav-sheet-signout:hover {
  background: var(--ds-surface-hover);
}

body.admin-body .globalnav-sheet-signout .ic {
  width: 16px;
  height: 16px;
}

body.admin-body .globalnav-sheet-close {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
  cursor: pointer;
  font-family: var(--ds-font-text);
  font-size: 15px;
  font-weight: 400;
}

body.admin-body .globalnav-sheet-close:hover {
  background: var(--ds-accent-hover);
}
/* Landing / Search Stage */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px calc(16px + var(--safe-right)) calc(var(--safe-bottom) + 24px)
           calc(16px + var(--safe-left));
}

.search-stage { margin: 8px 0 12px; }

.search-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--separator-strong);
  border-radius: var(--ds-radius-inner);
  padding: 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-field-wrapper:focus-within {
  border-color: var(--ds-accent);
  box-shadow: var(--ds-focus-ring);
}

.search-glyph {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  margin-right: 10px;
}

/* `min-width: 0`, or an `<input>`'s intrinsic min-width is what overflows at 200%
   text — measured 535px wide inside a 361px wrapper. `.form-input` has this guard. */
#searchInput {
  flex: 1;
  min-width: 0;
  height: 52px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 18px !important;
  font-weight: 500;
  outline: none;
}

#searchInput::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.search-clear-btn {
  position: relative;
  flex: 0 0 auto;
  background: var(--surface-row);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 8px;
  color: var(--text-primary);
}

/* Keeps the 22px visual dot but gives it a 44x44 touch area. */
.search-clear-btn::after {
  content: '';
  position: absolute;
  inset: -11px;
}

.search-clear-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

/* Stats Pill */
.stats-bar {
  display: flex;
  align-items: center;
  margin-top: 10px;
  padding: 2px 4px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.stats-bar::-webkit-scrollbar {
  display: none;
}

.stats-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  flex-wrap: nowrap;
  min-width: 100%;
}

.pill-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  padding: 6px 12px;
  min-height: 44px;              /* the on-site pill is a button — tap it at the door */
  border-radius: var(--ds-radius-pill);
  border: 0.5px solid var(--separator);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.pill-stat strong {
  color: var(--text-primary);
  font-weight: 700;
  font-size: var(--text-base);
}

.pill-stat:active {
  transform: scale(0.97);
}

/* People who have NOT checked out yet are outstanding work, so the count is amber
   — never the success green it used to use, which read as "all good" at wrap. */
.pill-stat.on-site.is-outstanding {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.5);
  color: var(--amber);
}
.pill-stat.on-site.is-outstanding strong {
  color: var(--amber);
  font-size: var(--text-base);
}

/* Green is only correct once the number reaches zero. */
.pill-stat.on-site.is-clear {
  color: var(--text-secondary);
}
.pill-stat.on-site.is-clear strong {
  color: var(--green);
}

/* The pill whose list is currently on screen.
   This is a separate class from `.is-outstanding` on purpose. `is-outstanding`
   belongs to the on-site pill and means "people still inside"; it is set for the
   whole time anyone is on site, which is every minute of a shoot day. When the
   filter borrowed it, the pill you had just tapped was styled identically to the
   two you had not, so the screen gave no sign which list it was showing or which
   pill to tap to get back. */
.pill-stat.is-filtering {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
  color: #FFFFFF;
}

.pill-stat.is-filtering strong {
  color: #FFFFFF;
}

/* A leading dot, so "this one is on" reads without relying on colour alone —
   the same reason the Orange tier dot is a diamond rather than a colour change. */
.pill-stat.is-filtering::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFFFFF;
  flex: none;
}

/* On phones, bleed the scrollable track to the screen edges so pills slide smoothly
   without clipped boundaries while the first pill stays flush with the search input. */
@media (max-width: 600px) {
  .stats-bar {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    scroll-padding: 0 16px;
    overscroll-behavior-x: contain;
  }
}

/* Results Dropdown / Table View */
.results-viewport {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.results-list {
  background: var(--surface);
  border-radius: var(--ds-radius-card);
  border: 0.5px solid var(--separator);
  overflow: hidden;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 0.5px solid var(--separator);
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.1s;
}

.result-row:last-child {
  border-bottom: none;
}

.result-row:active {
  background: var(--surface-row);
}

.result-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

/* The tier is carried by a SILHOUETTE as well as a colour. Relying on hue alone
   fails for colourblind operators (and in direct sunlight), and a screen reader
   gets nothing at all from a coloured dot. 16px so the triangle/diamond vertices
   survive antialiasing. Orange is the diamond — maximally distinct from the rest. */
.tier-dot-indicator {
  width: 16px;
  height: 16px;
  border-radius: 0;
  flex-shrink: 0;
}
.tier-dot-indicator.t-Fuchsia { background: var(--fuchsia); clip-path: circle(50%); }
.tier-dot-indicator.t-Green   { background: var(--green);   clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tier-dot-indicator.t-Blue    { background: var(--blue);    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.tier-dot-indicator.t-Orange  { background: var(--orange);  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.tier-dot-indicator.t-None    {
  background: #475569;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  border-radius: 4px;
}

/* Same silhouettes at hero size, watermarked on the person card, so the tier is
   identifiable from across a doorway without reading any text. */
.tier-shape-mark {
  position: absolute;
  right: 14px;
  bottom: 10px;
  width: 64px;
  height: 64px;
  opacity: 0.16;
  pointer-events: none;
}
.tier-shape-mark.m-Fuchsia { background: #fff; clip-path: circle(50%); }
.tier-shape-mark.m-Green   { background: #fff; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tier-shape-mark.m-Blue    { background: #fff; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.tier-shape-mark.m-Orange  { background: #fff; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); opacity: 0.22; }
.tier-shape-mark.m-None    { display: none; }

.result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* Flex row rather than a single ellipsised string: the phone chip must survive
   however long the name is. Only .rn-text is allowed to truncate. */
.result-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: #FFFFFF;
}

.result-name .rn-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-sub {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 8px;
}

.status-tag {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  /* 23px was under 1.5.8's 24×24 floor, and this tag is a long-press target on the
     person card — holding it opens the time editor. `inline-flex` is what lets
     `min-height` bite on what was an inline span (vertical padding on an inline box
     paints but does not make a target), and centring keeps the label where it was. */
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.status-tag.tag-onsite {
  background: var(--green-bg);
  color: var(--green);
  border: 0.5px solid var(--green-border);
}

.status-tag.tag-out {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.status-tag.tag-expected {
  background: rgba(0, 113, 227, 0.14);
  color: var(--ds-link-on-dark);
}

.chevron-arrow {
  width: 14px;
  height: 14px;
  stroke: var(--text-tertiary);
  stroke-width: 2.2;
  fill: none;
}

/* Add Unfound Row (When no matching person found) */
.add-unfound-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: rgba(0, 113, 227, 0.14);
  border: 1px dashed rgba(41, 151, 255, 0.4);
  border-radius: var(--ds-radius-card);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}

.add-unfound-row:active {
  transform: scale(0.99);
  background: rgba(0, 113, 227, 0.22);
}

.add-unfound-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.add-unfound-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.add-unfound-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
}

.add-unfound-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.add-unfound-sub {
  font-size: 13px;
  color: var(--ds-link-on-dark);
  margin-top: 1px;
}

.add-unfound-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--ds-link-on-dark);
  /* icon + "Add" sit side by side; the arrow needs the same gap the other
     icon-bearing chips get from their own rules. */
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Empty Landing Info */
.landing-empty-box {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-secondary);
}

.landing-empty-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.landing-empty-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* What the door board offers when nothing is running today.

   Stacked and full-width rather than side by side: at 390 px two buttons on one
   row are ~160 px each, which is below the comfortable thumb target for the two
   actions that are the only way off this screen. The primary action comes first
   because it is the recoverable one — "set up a shoot" is the console's job and
   most staff phones that tap it will be refused there. */
.no-shoot-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.no-shoot-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--ds-radius-pill);
  font-size: 15px;
  font-weight: 600;
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 0.5px solid var(--separator);
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}

.no-shoot-btn:active {
  transform: scale(0.98);
}

.no-shoot-btn.is-primary {
  background: var(--amber);
  color: var(--bg);
  border-color: transparent;
}

.section-caption {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
  text-transform: uppercase;
  margin: 18px 4px 8px 4px;
}

/* The on-site list header doubles as the way into the wrap reconciliation view,
   so it is a real button with a real touch target. */
button.section-caption {
  display: block;
  width: auto;
  background: transparent;
  text-align: left;
  min-height: 44px;
}

.caption-onsite {
  color: var(--amber);
}

/* ==================== PERSON VIEW ==================== */
.person-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.person-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--separator);
}

.back-link {
  display: flex;
  align-items: center;
  gap: 2px;
  background: transparent;
  color: var(--ds-link-on-dark);
  font-size: var(--text-base);
  font-weight: 500;
  min-height: 44px;
  min-width: 44px;
  padding: 6px 4px;
  margin-left: -4px;
}

.back-link .ic {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

.person-nav-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-nav-ghost {
  width: 48px;
}

.person-scrollable {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(var(--safe-bottom) + 32px) 16px;
}

/* Person Header */
.person-header {
  margin-bottom: 16px;
}

/* The name and its Edit button, on one line. A long crew name is the common case
   at phone width, so the row wraps the button UNDER the name rather than letting
   it squeeze the name into an ellipsis or push the row out of the panel. Inside
   the row the gap owns the spacing and the name's own bottom margin is dropped —
   the flex row is centred, so a margin there reads as the button sitting low. */
.person-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.person-display-name {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin: 0 0 4px 0;
  min-width: 0;
}

.person-name-row .person-display-name {
  margin-bottom: 0;
}

.person-display-sub {
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  color: var(--text-secondary);
  font-weight: 400;
}

/* Huge Access Level & Tier Hero Card */
.tier-hero-card {
  border-radius: var(--ds-radius-card);
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.tier-hero-card.tc-Fuchsia {
  background: rgba(223, 115, 223, 0.14);
  border: 1px solid var(--fuchsia-border);
}

.tier-hero-card.tc-Green {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
}

.tier-hero-card.tc-Blue {
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
}

.tier-hero-card.tc-Orange {
  background: var(--orange-bg);
  border: 1.5px solid var(--orange);
}

.tier-hero-card.tc-None {
  background: var(--surface);
  border: 1px solid var(--separator-strong);
}

.tier-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: 4px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.tc-Fuchsia .tier-badge-top { background: rgba(223, 115, 223, 0.18); color: var(--fuchsia); }
.tc-Green   .tier-badge-top { background: var(--green-bg); color: var(--green); }
.tc-Blue    .tier-badge-top { background: var(--blue-bg); color: var(--blue); }
.tc-Orange  .tier-badge-top { background: var(--orange); color: #431407; }
.tc-None    .tier-badge-top { background: var(--surface-row); color: var(--text-secondary); }

/* ---- Phone-surrender reminder -------------------------------------------
   Orange is an obligation, not a clearance level, so it gets a banner that no
   operator can mistake for "just another colour". High contrast, large type, and
   it never relies on colour alone (the phone glyph + wording carry the meaning). */
.phone-surrender-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--ds-radius-inner);
  background: var(--orange);
  color: #431407;
  font-weight: 800;
  font-size: var(--text-base);
  line-height: var(--leading-snug);
}

.phone-surrender-banner .ps-icon {
  font-size: var(--text-xl);
  line-height: 1;
  flex: 0 0 auto;
}

.phone-surrender-banner .ps-title {
  font-size: var(--text-md);
  font-weight: 900;
  letter-spacing: var(--tracking-tight);
  text-transform: uppercase;
}

.phone-surrender-banner .ps-sub {
  font-size: var(--text-sm);
  font-weight: 600;
  opacity: 0.85;
  margin-top: 2px;
}

/* ---- Missing documents ---------------------------------------------------
   Same shape as the phone banner above and for the same reason: an obligation
   gets a banner no operator can mistake for "just another colour" — high
   contrast, large type, and the meaning carried by the wording and the glyph
   rather than by the hue alone.

   Its own hue rather than the phone banner's, because these are two different
   obligations and only one of them is about the access tier. A phone is a
   condition of the tier; a document this shoot requires and nobody has signed
   is a reason the desk cannot let the person in at all. Orange already means
   "hand in your phone" on this card, so borrowing it would collapse the two
   into one signal.

   Aligned to the top rather than centred, unlike the phone banner: this one
   names the documents, so its sub line wraps to two or three lines on a phone
   while the glyph and the title stay put. */
.missing-docs-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--ds-radius-inner);
  background: var(--coral);
  color: #450A0A;
  font-weight: 800;
  font-size: var(--text-base);
  line-height: var(--leading-snug);
}

.missing-docs-banner .md-icon {
  font-size: var(--text-xl);
  line-height: 1;
  flex: 0 0 auto;
}

.missing-docs-banner .md-title {
  font-size: var(--text-md);
  font-weight: 900;
  letter-spacing: var(--tracking-tight);
  text-transform: uppercase;
}

.missing-docs-banner .md-sub {
  font-size: var(--text-sm);
  font-weight: 600;
  opacity: 0.9;
  margin-top: 2px;
}

/* Compact form used in lists, where a full banner would crowd the row */
.phone-surrender-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--orange);
  color: #431407;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
  flex: 0 0 auto;   /* never let a long name squeeze the reminder away */
}

/* NO BTS Armband requirement for signers who rejected BTS coverage */
.bts-armband-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--ds-radius-inner);
  background: var(--coral);
  color: #450A0A;
  font-weight: 800;
  font-size: var(--text-base);
  line-height: var(--leading-snug);
}

.bts-armband-banner .ba-icon {
  font-size: var(--text-xl);
  line-height: 1;
  flex: 0 0 auto;
}

.bts-armband-banner .ba-title {
  font-size: var(--text-md);
  font-weight: 900;
  letter-spacing: var(--tracking-tight);
  text-transform: uppercase;
}

.bts-armband-banner .ba-sub {
  font-size: var(--text-sm);
  font-weight: 600;
  opacity: 0.9;
  margin-top: 2px;
}

.bts-armband-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--coral);
  color: #450A0A;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
  flex: 0 0 auto;
}

/* How many taps have not reached the Mac. Deliberately the SAME orange pill as the
   reminder above rather than the network pill beside it: the dot already says whether
   the connection is up, and this says what is sitting on it. A quantity of door work
   that exists nowhere else yet is not a status, it is a thing to act on. */
.pending-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--orange);
  color: #431407;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
  flex: 0 0 auto;
}

.tier-headline {
  font-size: var(--text-lg);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-bottom: 6px;
}

.tier-detail-rule {
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 8px;
}

.tier-client-ref {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.55);
}

/* Quick Tier Buttons — the access colour, changeable on anybody.

   Drawn only for a person with NO tier until 2026-10-13, so on a shoot where
   everybody has one the row never appeared and nobody could be recoloured — while
   "this person is wearing the WRONG colour" is the case a door actually meets. */
.tier-quick-assign {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.quick-tier-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-radius: var(--ds-radius-pill);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, box-shadow 0.1s;
}

.quick-tier-btn:active {
  transform: scale(0.96);
}

.quick-tier-btn.btn-fuchsia { background: var(--fuchsia-deep); color: #FFFFFF; }
.quick-tier-btn.btn-green   { background: var(--green-deep);   color: #FFFFFF; }
.quick-tier-btn.btn-blue    { background: var(--blue-deep);    color: #FFFFFF; }
.quick-tier-btn.btn-orange  { background: var(--orange-deep);  color: #FFFFFF; }

/* The colour they are already on. Two cues rather than one, because colour alone
   is not a signal for everybody: a white inset ring and a check glyph on the
   label. The ring is INSET — a border would grow the button 6px and shove the row
   out of its grid track, which `test_design_audit.py` catches as an overflow.
   `aria-pressed` carries the same fact to a screen reader (80-person.js). */
.quick-tier-btn.is-current {
  box-shadow: inset 0 0 0 3px #FFFFFF, 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.quick-tier-btn.is-current::after {
  content: " ✓";
  font-size: 13px;
}

/* ==================== APPLE SLIDE TO CONFIRM ==================== */
/* The knob's size is stated once, here, and read by `.slider-thumb` below — so nothing
   can be laid out for a knob of a different size than the one that is drawn. This is
   the door board's slider only; the crew's dashboard (`templates/dashboard/`) is
   self-contained and carries its own copy, whose label rule is deliberately NOT this
   one. See `.slider-label`. */
.action-box {
  margin-bottom: 24px;
  --slider-knob: 54px;
}

.slider-container {
  width: 100%;
}

.slider-track {
  position: relative;
  width: 100%;
  height: 64px;
  border-radius: 32px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
}

.slider-track.slider-in {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
}

.slider-track.slider-out {
  background: rgba(255, 90, 95, 0.18);
  border: 1px solid rgba(255, 90, 95, 0.35);
}

.slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  pointer-events: none;
  transition: width 0.05s ease-out;
}

.slider-in .slider-fill {
  background: rgba(50, 199, 102, 0.25);
}

.slider-out .slider-fill {
  background: rgba(255, 90, 95, 0.25);
}

/* THE LABEL IS CENTRED ON THE TRACK. `left` and `right` are both 0, so the box IS the
   track and "centred in the box" and "centred on the track" are the same sentence.

   It was `width: 100%` plus a `padding-left: 28px`, which centres the text inside a box
   shifted 28px to the right — so every label rendered 14px right of the track's centre.

   THE FIRST FIX FOR THAT MADE THIS SURFACE WORSE, and the mistake is worth keeping. It
   borrowed `left: 66px; right: 14px` from the /me/ copy, where the label really does
   have to be pushed clear of the knob. But an unequal gutter shifts the BOX by
   (66 - 14) / 2 = 26px, so the door board went from 14px off-centre to 26px — nearly
   twice as far out, in a commit that said it was fixed. Sharing one rule with the /me/
   page was the entire appeal of it, and sharing one rule is exactly what forced the
   narrow surface's answer onto the wide one.

   Centring is safe HERE because this is the wide end of the range, and that is a
   measurement rather than a hunch. On the built page "Slide to Check Out" is 181.2px
   against a 54px knob resting 5px in, so the knob's right edge is at 60px; centred, the
   text starts at trackCentre - 90.6 and therefore collides only once the track falls
   below 90.6 + 60 ≈ 301px. Swept from 1600px down with the real stylesheet: offset is
   0px at every width, and the first overlap is a 288px track — a 320px viewport, where
   the gap is -6.6px. The door board is drawn at 648px, `test_design_audit.py` renders
   it at 393px (gap +29.9px), and the narrowest phone that can run any of this is 375px
   (gap +20.9px), since iOS 16.4 is the web-push floor. The overlap is unreachable on
   every surface this board is drawn on.

   The dashboard's copy, in `templates/dashboard/030-style-slider.html`, KEEPS its
   unequal gutter, and that divergence is the point rather than a drift: it is the narrow
   end of the range, its box is `min(86vw, 340px)`, and there the label is longer than the
   room a centred one would have. Its own comment carries that number and names this file
   back, which is the pair — change one and read the other.

   The track's `overflow: hidden` means a label that ever does outgrow its box is
   silently CUT rather than wrapped — hence `nowrap`, so the failure is a shrink and
   never a second line inside a 64px pill. */
.slider-label {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity 0.1s ease-out;
}

.slider-in .slider-label {
  color: var(--green);
}

.slider-out .slider-label {
  color: var(--coral);
}

.slider-thumb {
  position: absolute;
  top: 5px;
  left: 5px;
  width: var(--slider-knob, 54px);
  height: var(--slider-knob, 54px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  z-index: 10;
  transition: transform 0.05s ease-out;
}

.slider-thumb:active {
  cursor: grabbing;
}

.slider-in .slider-thumb {
  background: var(--green);
  color: #022C15;
}

.slider-out .slider-thumb {
  background: var(--coral);
  color: #3B0707;
}

.slider-thumb svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2.8;
  fill: none;
}

.action-time-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
}

/* Inset Grouped Info (Apple Settings Style) */
.grouped-table {
  background: var(--surface);
  border-radius: var(--ds-radius-card);
  border: 0.5px solid var(--separator);
  overflow: hidden;
  margin-bottom: 20px;
}

.grouped-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 0.5px solid var(--separator);
}

.grouped-row:last-child {
  border-bottom: none;
}

.grouped-label {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

.grouped-value {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  text-align: right;
}

.nda-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.nda-badge.signed { background: var(--green-bg); color: var(--green); border: 0.5px solid var(--green-border); }
.nda-badge.pending { background: rgba(251, 191, 36, 0.15); color: var(--amber); border: 0.5px solid rgba(251, 191, 36, 0.35); }

/* Agency and client people, covered by their own agreement with adidas. Grey,
   deliberately not the amber of Pending: this is not a signature we are waiting
   on, and it must not read as something outstanding at the door. */
.nda-badge.not-required {
  background: rgba(161, 161, 166, 0.15);
  color: var(--text-secondary);
  border: 0.5px solid rgba(161, 161, 166, 0.3);
}

/* One rule for every small "add / change this field" button rather than a copy of
   the same eleven declarations per field. A selector list does not change either
   selector's specificity, so the phone button keeps exactly the styling it had.
   `.btn-edit-person` covers the department and the name, which sit on rows built
   the same way — a value and a button, side by side, inside `.grouped-value`. */
.btn-add-phone,
.btn-add-email,
.btn-edit-person {
  background: var(--surface-row);
  color: var(--text-primary);
  padding: 4px 10px;
  height: 32px;
  border-radius: var(--ds-radius-pill);
  font-size: 12px;
  font-weight: 600;
  border: 0.5px solid var(--separator-strong);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-edit-person.is-primary {
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
  border-color: transparent;
}

.door-kind-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--bg);
  padding: 3px;
  border-radius: var(--ds-radius-inner);
}

.door-kind-pill {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  min-height: 30px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.door-kind-pill.active {
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

.door-inline-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.door-inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.door-inline-input {
  flex: 1 1 160px;
  min-width: 0;
  height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--separator-strong);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 13px;
}

.door-dept-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.door-dept-chip {
  border: 0.5px solid var(--separator-strong);
  background: var(--surface-row);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--ds-radius-pill);
  cursor: pointer;
}

.door-dept-chip.active {
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
  border-color: transparent;
}

/* Same reasoning as the add buttons above — both are a plain accent link. */
.phone-link,
.email-link {
  color: var(--ds-link-on-dark);
  text-decoration: none;
}

/* Days Matrix */
.days-chips-row {
  display: flex;
  gap: 6px;
}

.day-chip-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface-row);
  color: var(--text-secondary);
}

.day-chip-tag.active {
  background: rgba(0, 113, 227, 0.14);
  color: var(--ds-link-on-dark);
  border: 0.5px solid rgba(41, 151, 255, 0.4);
}

/* History Events Log */
.timeline-box {
  background: var(--surface);
  border-radius: var(--ds-radius-card);
  border: 0.5px solid var(--separator);
  padding: 12px 16px;
  margin-bottom: 24px;
}

.timeline-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--separator);
  font-size: 14px;
}

.timeline-entry:last-child {
  border-bottom: none;
}

.timeline-action {
  font-weight: 600;
}

.timeline-action.in { color: var(--green); }
.timeline-action.out { color: var(--coral); }

.timeline-time {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ==================== LONG PRESS ====================
   Holding a recorded time opens the editor for it. The cue is a held-tint and
   nothing else: these are records, not controls, and a border or a raised card
   would read as "tap me" on a screen where a tap does nothing. There is no
   `touch-action` here on purpose — pinch-zoom is how this screen gets read in
   direct sunlight, and it is not worth trading for a press gesture. */
.long-pressable {
  border-radius: 8px;
  transition: background-color 0.15s ease, filter 0.15s ease;
}

.long-pressable:active {
  filter: brightness(1.25);
}

/* The log row has no background of its own to tint, so it takes one. The status
   tag does have one, and that background is the colour saying on site or checked
   out — brightening it keeps the colour, a white tint would wash it out. */
.timeline-entry.long-pressable:active {
  background-color: rgba(255, 255, 255, 0.06);
}

/* ---- Edit time sheet ---- */
.time-edit-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 0.5px solid var(--separator);
  border-radius: var(--ds-radius-inner);
  padding: 10px 12px;
  margin-bottom: 16px;
}

.time-edit-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  flex: 0 0 auto;
}

/* 17px is not a size choice: iOS Safari zooms the page into any field smaller
   than that and the zoom leaves the Save button off the screen. The global input
   rule already forces it — restated here so the deliberate size is visible next
   to the field it applies to. min-width:0 is what lets it shrink inside the row
   instead of pushing itself out past the modal edge. */
.time-edit-input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
}

/* Outlined rather than filled coral: it must read as the destructive action
   without competing with Save for the thumb. */
.time-edit-delete {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border-radius: var(--ds-radius-pill);
  background: transparent;
  border: 0.5px solid var(--coral);
  color: var(--coral);
  font-weight: 700;
  font-size: 16px;
}

.time-edit-delete:active {
  background: rgba(255, 90, 95, 0.14);
}

/* ==================== MODALS & SHEETS ==================== */
.modal-scrim {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 0;
}

#confirmModal {
  z-index: 1500;
}

@media (min-width: 600px) {
  .modal-scrim {
    align-items: center;
    padding: 20px;
  }
}

.modal-card {
  width: 100%;
  max-width: 540px;
  background: var(--surface-elevated);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border: 0.5px solid var(--separator-strong);
  box-shadow: var(--ds-shadow-overlay);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 600px) {
  .modal-card {
    border-radius: 24px;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 0.5px solid var(--separator);
}

.modal-card-title {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin: 0;
}

.btn-text-ghost {
  background: transparent;
  color: var(--ds-link-on-dark);
  font-size: var(--text-base);
  padding: 4px 10px;
  min-height: 44px;
}

.btn-text-primary {
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
  font-size: var(--text-base);
  font-weight: 700;
  padding: 6px 18px;
  min-height: 44px;
  border-radius: var(--ds-radius-pill);
}

.modal-card-body {
  padding: 16px 18px calc(var(--safe-bottom) + 20px) 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.form-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 20px 4px 8px 4px;
}

.form-group {
  background: var(--surface);
  border-radius: var(--ds-radius-card);
  border: 0.5px solid var(--separator);
  overflow: hidden;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--separator);
  gap: 10px;
  min-width: 0;
}

.form-row:last-child {
  border-bottom: none;
}

.form-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 0 1 110px;
  min-width: 0;
}

/* A read-only stand-in for a form field, where the value is not a choice. Used by
   the add-person sheet's NDA state, which is derived from whether a document
   exists and so cannot be set at creation time. Sized and aligned like the inputs
   it sits beside, in the secondary colour, so it reads as information rather than
   as a control the operator has failed to fill in. */
.form-static {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  text-align: right;
  color: var(--text-secondary);
}

/* min-width:0 is what stops these overflowing the sheet: a text input's automatic
   minimum size comes from its 20-character default width, so without it the field
   refuses to shrink and pushes itself out past the modal's right edge. */
.form-input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 17px !important;
  text-align: right;
  outline: none;
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-select {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--surface-row);
  border: 0.5px solid var(--separator);
  color: var(--text-primary);
  font-size: 17px !important;
  padding: 6px 8px;
  border-radius: var(--ds-radius-inner);
  outline: none;
}

/* Below ~460px the sheet is only as wide as the phone, and a label + control on
   one line cannot hold the four-pill tier selector. Stack them instead of
   letting the pills run off the edge. */
@media (max-width: 460px) {
  .form-row { flex-wrap: wrap; }
  .form-row .form-label {
    flex: 1 0 100%;
    max-width: none;
  }
  .form-row .form-input,
  .form-row .form-select,
  .form-row .tier-segmented-control,
  .form-row .days-selector-group {
    flex: 1 0 100%;
  }
  .form-input { text-align: left; }
}

/* Tier Segmented inside Form */
.tier-segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  background: var(--bg);
  padding: 3px;
  border-radius: var(--ds-radius-inner);
}

.tier-pill-opt,
.kind-pill-opt {
  flex: 1 1 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: transparent;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.kind-pill-opt.active {
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

/* In the stacked (narrow) form the four pills get the full sheet width, which is
   just enough for all four on one line at 320px once the type is a step down. */
@media (max-width: 460px) {
  .form-row .tier-pill-opt {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 6px;
    font-size: 11px;
  }
}

.tier-pill-opt.tp-fuchsia.active { background: var(--fuchsia-deep); color: #FFFFFF; }
.tier-pill-opt.tp-green.active   { background: var(--green-deep);   color: #FFFFFF; }
.tier-pill-opt.tp-blue.active    { background: var(--blue-deep);    color: #FFFFFF; }
.tier-pill-opt.tp-orange.active  { background: var(--orange-deep);  color: #FFFFFF; }

.days-selector-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.day-select-pill {
  flex: 1 1 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: var(--ds-radius-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-row);
  color: var(--text-secondary);
}

.day-select-pill.active {
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

/* Confirmation Dialog */
.confirm-box {
  width: 90%;
  max-width: 360px;
  background: var(--surface-elevated);
  border-radius: var(--ds-radius-card);
  border: 0.5px solid var(--separator-strong);
  padding: 20px;
  box-shadow: var(--ds-shadow-overlay);
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  text-align: center;
}

.confirm-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 18px 0;
  text-align: center;
  line-height: 1.4;
}

/* Exactly what is about to be written down: who, what, which day, what time. */
.confirm-detail {
  background: var(--bg);
  border: 0.5px solid var(--separator);
  border-radius: var(--ds-radius-inner);
  padding: 4px 12px;
  margin-bottom: 16px;
}

.confirm-detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 0.5px solid var(--separator);
}

.confirm-detail-row:last-child {
  border-bottom: none;
}

.confirm-detail-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  flex: 0 0 auto;
}

.confirm-detail-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  min-width: 0;
}

.confirm-actions {
  display: flex;
  gap: 8px;
}

.confirm-btn-cancel {
  flex: 1;
  min-height: 56px;
  border-radius: var(--ds-radius-pill);
  background: var(--surface-row);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 16px;
}

.confirm-btn-action {
  flex: 1;
  min-height: 56px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
  font-weight: 700;
  font-size: 16px;
}

.confirm-btn-action.danger {
  background: var(--coral);
  color: #3B0707;
}

/* Check-in / check-out confirm buttons match the slider they came from, so the
   last thing tapped before the write is the same green/red as the gesture. */
.confirm-btn-action.ok-in {
  background: var(--green);
  color: #022C15;
}

.confirm-btn-action.ok-out {
  background: var(--coral);
  color: #3B0707;
}

/* ---------------------------------------------------------- context menu */
.ctx-menu {
  position: fixed;
  z-index: 1200;
  min-width: 236px;
  max-width: 310px;
  padding: 6px;
  border-radius: 10px;
  background: var(--surface-elevated, #1d1d1f);
  border: 1px solid var(--separator-strong, rgba(255, 255, 255, 0.16));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48), 0 2px 8px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-primary, #ffffff);
  outline: none;
  user-select: none;
}

.ctx-menu-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px 7px;
}

.ctx-menu-header-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctx-menu-header-sub {
  font-size: 11px;
  color: var(--text-secondary, #a1a1a6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctx-menu-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--separator, rgba(255, 255, 255, 0.09));
}

.ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary, #ffffff);
  font: inherit;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 110ms ease, color 110ms ease;
}

.ctx-menu-item:hover:not(.is-disabled),
.ctx-menu-item:focus-visible:not(.is-disabled) {
  background: var(--surface-row, #252528);
  outline: none;
}

.ctx-menu-item.is-disabled {
  color: var(--text-tertiary, #8e8e93);
  opacity: 0.55;
  cursor: default;
}

.ctx-menu-item.is-danger:not(.is-disabled) {
  color: #ff5c5c;
}

.ctx-menu-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--text-secondary, #a1a1a6);
}

.ctx-menu-item:hover:not(.is-disabled) .ctx-menu-ic,
.ctx-menu-item:focus-visible:not(.is-disabled) .ctx-menu-ic {
  color: var(--text-primary, #ffffff);
}

.ctx-menu-ic .ic {
  width: 15px;
  height: 15px;
}

.ctx-menu-label {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctx-menu-hint {
  flex: 0 0 auto;
  margin-left: 8px;
  font-size: 11px;
  color: var(--text-tertiary, #8e8e93);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-context-person="1"] {
  cursor: context-menu;
}
/* ==================== EXPORT DIALOG ====================
   The export sheet is a `.modal-card` rather than a `.confirm-box`: it holds a
   text field, a row of token chips and a scrollable picker, and the confirm box
   is sized for one sentence and two buttons. It reuses the add-person sheet's
   header and scrolling body so the two sheets feel like the same furniture. */
.export-card {
  max-width: 560px;
}

/* Balances the header so the title stays centred next to the Close button. */
.export-head-ghost {
  flex: 0 0 60px;
}

.export-loading {
  padding: 28px 4px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.export-help {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-tertiary);
  margin: 8px 4px 0 4px;
}

/* Amber, not red: nothing is broken, the server is just older than this page.
   The wording in the sheet says which controls are off and what still works. */
.export-warn {
  font-size: 13px;
  line-height: 1.45;
  color: var(--amber);
  background: rgba(251, 191, 36, 0.12);
  border: 0.5px solid rgba(251, 191, 36, 0.4);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px 0;
}

.export-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 0.5px solid var(--separator);
  border-radius: var(--ds-radius-inner);
  color: var(--text-primary);
  font-size: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 12px 14px;
  min-height: 44px;
  outline: none;
}

.export-input:focus {
  border-color: var(--ds-accent);
}

/* The chips are the whole vocabulary of the field above them, so they sit
   directly under it — a token the operator cannot spell is a token they will
   never use. */
.export-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.export-token {
  background: var(--surface-row);
  border: 0.5px solid var(--separator);
  border-radius: var(--ds-radius-pill);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 7px 11px;
  min-height: 36px;
}

.export-token:active {
  background: var(--ds-surface-pressed);
}

.export-token:disabled {
  opacity: 0.4;
}

.export-preview {
  background: var(--bg);
  border: 0.5px solid var(--separator);
  border-radius: var(--ds-radius-inner);
  padding: 10px 12px;
  margin-top: 10px;
}

.export-preview-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* break-all, because a template with several tokens produces a long name and
   this is the one line the operator has to read character by character. */
.export-preview-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-all;
  margin-top: 4px;
}

.export-preview-name.is-bad {
  color: var(--coral);
}

.export-preview-for {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.export-seg {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.export-seg-btn {
  flex: 1;
  min-height: 44px;
  border-radius: var(--ds-radius-pill);
  background: var(--surface-row);
  border: 0.5px solid var(--separator);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.export-seg-btn.active {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

.export-seg-btn:disabled {
  opacity: 0.4;
}

.export-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.export-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.export-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-row);
  border: 0.5px solid var(--separator);
  border-radius: var(--ds-radius-pill);
  padding: 8px 12px;
  min-height: 44px;
  font-size: 13px;
  color: var(--text-secondary);
}

.export-value.on {
  background: rgba(0, 113, 227, 0.14);
  border-color: var(--ds-accent);
  color: var(--text-primary);
}

.export-value input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
}

.export-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 0.5px solid var(--separator);
  border-radius: var(--ds-radius-inner);
  padding: 0 12px;
  min-height: 42px;
  margin-bottom: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.export-search-wrapper:focus-within {
  border-color: var(--ds-accent);
}

.export-search-glyph {
  width: 16px;
  height: 16px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  margin-right: 8px;
}

.export-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.export-search-input::placeholder {
  color: var(--text-tertiary);
}

.export-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface-row);
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  margin-left: 6px;
  flex-shrink: 0;
}

.export-search-clear:hover {
  background: var(--ds-surface-pressed);
}

.export-pick-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.export-pick-count {
  margin-left: auto;
  align-self: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

.export-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Capped and scrolled: the roster is a few hundred rows and the sheet still has
   two export buttons below it that must stay reachable. */
.export-people {
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 0.5px solid var(--separator);
  border-radius: 12px;
}

/* Sticky, so you can still see which folder you are ticking people into once
   you are three departments down the list. */
.export-group-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-elevated);
  padding: 8px 12px;
  border-bottom: 0.5px solid var(--separator);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.export-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 44px;
  border-bottom: 0.5px solid var(--separator);
  font-size: 14px;
  color: var(--text-primary);
}

.export-person input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
}

.export-person-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-person-sub {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: right;
}

.export-summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 18px 4px 8px 4px;
}

/* Stacked, not side by side: "Spreadsheet" and "Everything" produce files of
   very different sizes and the operator should read them before tapping. */
.export-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-actions > button {
  width: 100%;
}

/* The one tap that finds a bundle already made. Left-aligned and quiet on purpose:
   it is not a fourth way to export, it is the way to reach what the other three
   produced — the filtered bundles that are never downloaded and would otherwise
   live only as a filename in a toast. */
.export-reveal {
  display: block;
  text-align: left;
  margin: 14px 0 0 0;
  padding: 4px 0;
  font-size: 13px;
}

/* ==================== WRAP / ON-SITE RECONCILIATION ====================
   Who has not checked out yet, longest on site first. Amber-headed so it never
   reads as a success screen — this is the list to work through at wrap. */
.onsite-box {
  width: 92%;
  max-width: 460px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-elevated);
  border-radius: var(--ds-radius-card);
  border: 0.5px solid var(--separator-strong);
  box-shadow: var(--ds-shadow-overlay);
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.onsite-head {
  padding: 18px 18px 12px 18px;
  border-bottom: 0.5px solid var(--separator);
  flex: 0 0 auto;
}

.onsite-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--amber);
  margin: 0;
}

.onsite-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 5px 0 0 0;
  line-height: 1.4;
}

.onsite-list {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.onsite-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 18px;
  text-align: left;
  background: transparent;
  color: var(--text-primary);
  border-bottom: 0.5px solid var(--separator);
}

.onsite-row:last-child {
  border-bottom: none;
}

.onsite-row:active {
  background: var(--surface-row);
}

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

.onsite-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.onsite-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.onsite-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.onsite-dur {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

/* The day-lookup sheet's shoot headings.

   Sticky, because the list is every day on the machine and on a busy Mac that is
   months of rows: without it a row's date scrolls free of the name of the shoot
   it belongs to, and two shoots can run on the same date. The background is the
   sheet's own colour rather than transparent so rows pass *under* it. */
.day-lookup-group {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 18px 6px 18px;
  background: var(--surface-elevated);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 0.5px solid var(--separator);
}

/* The row you are already on. A word, not a highlight: "showing" says which
   board is open, where a colour alone would say only "different". */
.day-lookup-here {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: var(--ds-radius-pill);
  background: var(--surface-row);
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.onsite-empty {
  padding: 24px 18px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.onsite-foot {
  flex: 0 0 auto;
  padding: 12px 18px calc(var(--safe-bottom) + 16px) 18px;
  border-top: 0.5px solid var(--separator);
}

/* Toast Notifications */
.toast-stack {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  z-index: 200;
  pointer-events: none;
}

.toast-pill {
  background: var(--surface-elevated);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 0.5px solid var(--separator-strong);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--ds-radius-pill);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--ds-shadow-overlay);
  animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease;
}

.toast-pill.bad {
  border-color: var(--coral);
  color: var(--coral);
}

@keyframes toastIn {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Modal Mode Switcher (Manual vs QR Pass) */
.modal-mode-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 3px;
  margin: 12px 20px 4px;
  gap: 4px;
}

.mode-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mode-tab.active {
  background: var(--text-primary);
  color: var(--bg);
}

/* QR Code Display Panel */
.qr-panel {
  padding: 16px 0;
  display: flex;
  justify-content: center;
}

.qr-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--ds-radius-card);
  padding: 24px 20px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.qr-canvas-box {
  background: var(--text-primary);
  padding: 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-canvas-box img, .qr-canvas-box canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.qr-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.qr-headline {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.qr-subtext {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.qr-link-badge {
  font-size: 11px;
  color: var(--ds-link-on-dark);
  background: rgba(0, 113, 227, 0.14);
  padding: 4px 10px;
  border-radius: var(--ds-radius-pill);
  word-break: break-all;
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* --- NDA Row & Action Controls (Mobile-First Apple Layout) ----------------- */
.row-nda {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px;
  padding: 14px 16px;
}

/* Dedicated Document Card (when an NDA file is on record) */
.nda-doc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid var(--separator);
  border-radius: 12px;
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
}

.nda-doc-card.mismatch {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.4);
}

.nda-doc-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.nda-doc-meta svg.ic {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.nda-doc-card.mismatch .nda-doc-meta svg.ic {
  color: var(--amber);
}

.nda-doc-text-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.nda-doc-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  line-height: 1.2;
  margin-bottom: 2px;
}

.nda-doc-card.mismatch .nda-doc-title {
  color: var(--amber);
}

.nda-doc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nda-doc-card.mismatch .nda-doc-name {
  color: var(--amber);
}

/* Document View Pill Button */
.btn-view-nda {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
  height: 32px;
  padding: 0 12px;
  border-radius: var(--ds-radius-pill);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  /* This is a <button> now, not an <a>. A button inherits neither the page font nor
     the pointer cursor, so both have to be asked for. */
  font-family: inherit;
  cursor: pointer;
}

.btn-view-nda svg.ic {
  width: 14px;
  height: 14px;
}

.btn-view-nda:active {
  background: rgba(50, 199, 102, 0.25);
}

/* ------------------------------------------------------------- Document Viewer
   See openDocViewer() in app.js for why documents open in an overlay rather than by
   navigating to the file. Sits above .modal-scrim (z-index 100): a document can be
   opened from a card, and must never be buried under a dialog opened from it. */
.doc-scrim {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* Pins the page behind the overlay, so the list underneath cannot scroll while a
   signature is being read. `top` is set inline to the negative scroll offset, which
   is what keeps the page from jumping when it is released again. */
body.doc-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

/* THE SAME LOCK, for the console's sheets — see `syncSheetLock` in admin.js, which
   is what applies it and which explains why it is driven from an observer.

   Scoped to `body.admin-body` rather than sharing `body.doc-locked` for two
   reasons. The class is applied by `admin.js` alone, and the door board loads that
   file on no page — but the CSS is one stylesheet served to both, so an unscoped
   rule would still be a promise the board has to keep. And the two locks are
   genuinely independent: on the board the document viewer is the only overlay, and
   nothing there should be able to pin `body` by accident. */
body.admin-body.sheet-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

.doc-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  min-height: 0;
}

.doc-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-top) + 10px) calc(12px + var(--safe-right)) 10px
           calc(16px + var(--safe-left));
  background: rgba(29, 29, 31, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--separator);
}

/* flex: 1 with min-width: 0 is what makes the long-document-name case safe: the name
   truncates instead of pushing the close button off the edge of the screen. The close
   button is the only way out of a document, so it must never be the thing that gives. */
.doc-head-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-sub {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* This button is the entire way out of a document, and it has to be reachable with
   a thumb while the other hand is holding a phone — hence the full 44px target
   rather than an icon-sized tap area. */
.doc-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 0.5px solid var(--separator-strong);
  border-radius: var(--ds-radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.doc-close .ic {
  width: 16px;
  height: 16px;
}

.doc-close:active {
  background: rgba(255, 255, 255, 0.18);
}

.doc-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 12px calc(var(--safe-bottom) + 20px) 12px;
}

.doc-page {
  margin: 0 0 12px 0;
}

.doc-page-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 2px 6px 2px;
}

/* The scans are dark ink on white. Holding the white page against the dark chrome
   keeps the handwriting at full contrast instead of washing it out. */
.doc-page-img {
  display: block;
  width: 100%;
  height: auto;
  background: #FFFFFF;
  border-radius: 10px;
}

.doc-loading,
.doc-page-error {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Only used when the server has no PDF renderer — still inside this overlay, with
   the same close button, so it degrades instead of trapping. */
.doc-frame {
  width: 100%;
  height: 100%;
  min-height: 70vh;
  border: 0;
  border-radius: 10px;
  background: #FFFFFF;
}

.doc-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.doc-error .ic {
  width: 28px;
  height: 28px;
}

.doc-error-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.doc-error-sub {
  font-size: 13px;
}

/* NDA Action Buttons Toolbar */
.nda-action-group {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

/* Unified Action Buttons: consistent height, border-radius, font-size and alignment */
.btn-snap-nda,
.btn-replace-nda,
.btn-toggle-nda {
  flex: 1 1 calc(50% - 4px);
  min-width: 120px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--ds-radius-pill);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-snap-nda svg.ic,
.btn-replace-nda svg.ic,
.btn-toggle-nda svg.ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Primary camera action (when no document is on file yet) */
.btn-snap-nda {
  background: rgba(0, 113, 227, 0.14);
  color: var(--ds-link-on-dark);
  border: 1px solid rgba(41, 151, 255, 0.35);
}

.btn-snap-nda:active {
  background: rgba(0, 113, 227, 0.28);
}

/* Secondary replacement action (when a document already exists) */
.btn-replace-nda {
  background: var(--surface-row);
  color: var(--text-primary);
  border: 1px solid var(--separator-strong);
}

.btn-replace-nda:active {
  background: var(--ds-surface-pressed);
  color: var(--text-primary);
}

/* Toggle NDA status */
.btn-toggle-nda {
  background: var(--surface-row);
  color: var(--text-primary);
  border: 1px solid var(--separator-strong);
}

.btn-toggle-nda.is-pending {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.btn-toggle-nda.is-pending:active {
  background: rgba(50, 199, 102, 0.25);
}

.btn-toggle-nda.is-signed {
  background: var(--surface-row);
  color: var(--text-secondary);
  border: 1px solid var(--separator);
}

.btn-toggle-nda.is-signed:active {
  background: var(--ds-surface-pressed);
  color: var(--text-primary);
}

/* Department Requirement Override Button */
.btn-nda-required {
  flex: 1 1 100%;
  height: 34px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--ds-radius-pill);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-sizing: border-box;
  margin-top: 2px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-nda-required svg.ic {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-nda-required:active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.3);
}

/* --------------------------------------------------- A person's card: Documents
   The section that says what this shoot asks of THIS person, one row per document,
   and the control that corrects it. Split from `080-documents.css` on 2026-10-13,
   when adding it there took that file over the 400-line budget; the two are
   different subjects anyway — 080 is the document VIEWER, this is the card.
*/
/* THE CLASS FAMILY IS `doc-answer-*` AND NOT `form-row-*`, and that is a fix
   rather than a preference. `.form-row` is an established name in this app — it
   is the add-person sheet's field row (050-modals.css) and the console's admin
   modal (240-admin-rest.css, which scopes itself for exactly this reason) — so a
   generic `.form-row` here restyled the New Person sheet: its labels picked up
   this bottom hairline and this padding, on a page that has nothing to do with
   documents. Caught in the browser, not by a gate: an add sheet nobody opened
   during the pass would have gone on looking wrong in silence. */

/* --- The Documents section on a person's card ------------------------------
   One row per document the shoot collects, replacing the single "NDA Agreement —
   Required / Not required" line this card used to carry. That line was the whole
   vocabulary of a project with one form to sign; a shoot now collects six, and a
   boolean cannot say WHICH of them somebody owes. The rows are built from
   `S.documents`, the same array the board's own counter reads, so the two cannot
   disagree about who owes what.

   They reuse the card's existing idiom — a label and its value on one line, held
   apart by a hairline — rather than becoming six cards stacked inside a card. */
.row-forms {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0;
  padding: 13px 16px;
}

.forms-list {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}

.doc-answer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  row-gap: 6px;
  padding: 9px 0;
  border-bottom: 0.5px solid var(--separator);
}

.doc-answer-row:last-child {
  border-bottom: none;
}

/* The NDA's own machinery — the scan on file, the snap and drop targets, the
   signing link — belongs to its answer rather than being a section of its own,
   so it takes a full line of the row it is joined to. Without this it would sit
   beside the label as a third column. */
.doc-answer-row > .row-nda {
  flex: 0 0 100%;
  padding: 4px 0 0;
  border-bottom: none;
}

.doc-answer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 150px;
  min-width: 0;
}

.doc-answer-name {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* A full line under the name, because it answers the question the operator is
   actually asking — "does this stop them coming in" — and that sentence is
   longer than the space left beside a button. */
.doc-answer-detail,
.doc-answer-note {
  flex: 1 0 100%;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.doc-answer-btn {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--ds-radius-pill);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.doc-answer-btn:active {
  transform: scale(0.97);
}

/* Three answers, three colours, and the colour says what the answer COSTS.
   Required is the amber the card already uses for "we are waiting on them";
   once the document is on file it turns green, because the same answer has
   stopped being a reason to hold somebody at the barrier. "Not required" is
   deliberately grey rather than green for that reason — it is the absence of a
   demand, not a signature we received. */
.doc-answer-btn.ans-required {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
  color: var(--amber);
}

.doc-answer-btn.ans-required.is-on-file {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
}

.doc-answer-btn.ans-not_required {
  background: rgba(161, 161, 166, 0.15);
  border-color: rgba(161, 161, 166, 0.3);
}

.doc-answer-btn.ans-unset {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}
/* ==================== NDA SIGNING LINK ====================
   The row under the NDA box: how far this person's signing link has got, and the
   three things the desk can do to it. Set apart by a hairline and a little air,
   because it is a different subject from the buttons above it — those record
   facts about a document on file, and this one is only about a message that may
   or may not have gone out. */
.nda-link-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--separator);
}

/* The state line. Muted by default: "Not sent" is the starting position, not a
   failure, and it must not read like an alarm on a card where the real alarm is
   the amber Pending badge above it. The three colours below are the ones that
   mean something has happened. */
.nda-link-status {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
}

/* Sent but not yet signed — the link is out and the ball is in their court. */
.nda-link-status.nda-link-sent { color: var(--blue); }
/* Opened: they have seen it. The one state that turned a re-send into a "they
   are looking at it" answer, which is why it is worth its own colour. */
.nda-link-status.nda-link-opened { color: var(--amber); }
/* Signed — the same green the badge uses, so the two never disagree on screen. */
.nda-link-status.nda-link-signed { color: var(--green); }

/* Same metrics as the NDA action buttons above, so the two groups stack as one
   column of controls rather than two different-looking toolbars. They wrap
   two-per-row at phone width, which is why "Send on WhatsApp" keeps its full
   wording instead of being shortened to fit a third column. */
.btn-copy-link,
.btn-send-wa,
.btn-revoke-link {
  flex: 1 1 calc(50% - 4px);
  min-width: 120px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--ds-radius-pill);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* The two sendable actions wear the blue of the primary NDA action; they add
   work rather than removing it. */
.btn-copy-link,
.btn-send-wa {
  background: rgba(0, 113, 227, 0.14);
  color: var(--ds-link-on-dark);
  border: 1px solid rgba(41, 151, 255, 0.35);
}

.btn-copy-link:active,
.btn-send-wa:active {
  background: rgba(0, 113, 227, 0.28);
}

/* Revoke is the only destructive control in this row, and it is tinted the same
   red as the confirm sheet's danger button so the colour it is tapped in is the
   colour it is confirmed in. Outline rather than filled — it should not be the
   thing a thumb lands on by reflex. */
.btn-revoke-link {
  background: rgba(255, 90, 95, 0.12);
  color: var(--coral);
  border: 1px solid rgba(255, 90, 95, 0.35);
}

.btn-revoke-link:active {
  background: rgba(255, 90, 95, 0.25);
}


/* ==================== SESSION EXPIRY ====================
   A 401 on the board is a session that ran out, not the venue Wi-Fi dropping, and
   the whole point of this block is that the door team can tell the two apart at a
   glance and fix the right one. Nothing here hides or clears the board: the bar and
   the sign-in sheet are added OVER the last roster fetched, which stays on screen
   and stays readable underneath. See the Auth state section of app.js. */

/* The persistent "signed out" bar. Not a toast: it never fades, it cannot be
   dismissed, and only a session that works again takes it down. It lives inside the
   sticky header (see showAuthBanner()), so it is on screen whatever the list is
   scrolled to and it pushes the board down instead of covering the day tabs, the
   pills or the search field. */
.auth-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.16);
  border: 0.5px solid rgba(248, 113, 113, 0.45);
  color: #FECACA;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  cursor: pointer;
}

.auth-banner .ic {
  color: var(--coral);
}

.auth-banner:active {
  background: rgba(248, 113, 113, 0.3);
}

/* The third failure, and the quietest of the three. Nothing is broken and nothing is
   lost YET: the board is drawing fine and every write is landing — on the wrong day.
   `S.day` is set once, by an operator tapping a tab, and the server then echoes back
   whichever day it was asked for, so a phone left open overnight keeps writing to
   yesterday. The person is inside and today's board says they never arrived.
   Blue, not coral and not amber: the other two bars mean something has already gone
   wrong, and this one has to be read before the next tap rather than after it. */
.day-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(0, 113, 227, 0.14);
  border: 0.5px solid rgba(41, 151, 255, 0.4);
  color: var(--ds-link-on-dark);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  cursor: pointer;
}

.day-banner .ic {
  color: var(--ds-link-on-dark);
}

.day-banner:active {
  background: rgba(0, 113, 227, 0.28);
}

/* The banner saying the board is on a day this shoot does not run.

   It is still a <button> — the element is reused rather than swapped, so the
   strip does not jump when the state changes — but there is nothing to press, so
   it must not behave like one. `.day-banner:active` above is the rule being
   undone: without this, tapping a statement flashes the button blue. */
.day-banner.is-static {
  cursor: default;
}

.day-banner.is-static:active {
  background: rgba(0, 113, 227, 0.14);
}

/* The sign-in sheet. Above the header (50) and a dialog (100) so a tap on the bar
   always brings it to the front; below the toasts (200), which stay the top layer. */
.login-scrim {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(var(--safe-top) + 20px);
  padding-bottom: calc(var(--safe-bottom) + 20px);
}

.login-box {
  width: 100%;
  max-width: 360px;
  background: var(--surface-elevated);
  border: 0.5px solid var(--separator-strong);
  border-radius: var(--ds-radius-card);
  padding: 22px 20px 18px 20px;
  box-shadow: var(--ds-shadow-overlay);
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  text-align: center;
}

.login-sub {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-secondary);
  margin: 0 0 18px 0;
  text-align: center;
}

.login-field {
  margin-bottom: 10px;
}

.login-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 6px 4px;
}

/* Typed into with a thumb at a door, so it is a box of its own rather than the
   label-left / value-right .form-row used inside the add sheet. 17px is the global
   input rule: under 16px iOS zooms the page on focus and the form slides off
   screen mid-typing. */
.login-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--bg);
  border: 0.5px solid var(--separator-strong);
  border-radius: var(--ds-radius-inner);
  color: var(--text-primary);
  outline: none;
}

.login-input::placeholder {
  color: var(--text-tertiary);
}

/* Wrong password is a normal message, not an alarm: the server's own words, under
   the fields, where the operator is already looking. */
.login-error {
  margin: 4px 0 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.16);
  border: 0.5px solid rgba(248, 113, 113, 0.45);
  color: #FECACA;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

/* The remedy, for the one refusal the headline cannot distinguish from a typo: a
   password autofilled from before a rotation is rejected in exactly the same words
   as one typed wrong. Quieter than the headline, because it is a footnote to it. */
.login-error-hint {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(254, 202, 202, 0.82);
}

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  border-radius: 8px;
  background: #FFFFFF;
  color: #000000;
  font-size: 16px;
  font-weight: 600;
}

.login-submit:active {
  transform: scale(0.98);
}

.login-submit:disabled {
  opacity: 0.6;
}

/* The way out that keeps the board: the last roster is still on screen and the door
   can keep working from it, so this is a real choice and not a hidden escape hatch. */
.login-stay {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
}

.login-stay:active {
  color: var(--text-primary);
}

/* Fourth NDA state: the document is in, and it is waiting on staff to check it.
   Blue, deliberately neither the amber of Pending (they still owe us something)
   nor the green of Signed (nothing left to do). */
.nda-badge.submitted {
  background: var(--blue-bg);
  color: var(--blue);
  border: 0.5px solid var(--blue-border);
}

/* The one action on the card that is waiting on staff rather than on the crew
   member, so it gets a full-width row of its own above the capture buttons,
   in the green of the status it turns the badge into. */
.btn-confirm-nda {
  flex: 1 1 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--ds-radius-pill);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-confirm-nda svg.ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-confirm-nda:active {
  background: rgba(50, 199, 102, 0.25);
}

/* ---- Outbox: the queue that will not survive, and the acknowledgement.

   Both rules are additions; nothing above is reordered or changed.

   The volatile pill. `.pending-chip` is the same orange as the reminder pill beside
   it on purpose — "N pending" is door work sitting on the connection. That reading
   is only true while the queue is IN storage. In private mode, or against a full
   quota, the queue lives in this tab's memory and dies with it, so the pill has to
   stop looking like a status and start looking like a fault: coral, the colour this
   app reserves for a person who is not in the database, and the words "NOT SAVED" on
   the pill itself. A `title` attribute, which this used to rely on, is never shown
   on the touch screens this is written for. */
.pending-chip-volatile {
  background: var(--coral);
  color: #3B0707;
}

/* ===========================================================================
   Dropping an NDA onto a name, and the batch importer.

   `.drag-over` was already being added by the card's drop handlers with no rule
   behind it, so a file dragged over the capture box highlighted nothing. It has
   a rule now, and the row version shares it.
   =========================================================================== */

.drag-over {
  background: rgba(0, 113, 227, 0.14);
  box-shadow: inset 0 0 0 2px var(--ds-accent);
}

/* The row keeps its own layout untouched the rest of the time: `position` and
   the pseudo-element only exist while a file is actually over it. */
.result-row.drag-over {
  position: relative;
  background: rgba(0, 113, 227, 0.14);
  box-shadow: inset 0 0 0 2px var(--ds-accent);
}

/* Names the person being dropped on. A mis-drop files a signature under the
   wrong name and says nothing, so the row has to state who it is about to
   become rather than just lighting up.

   Built as a node in createResultRow and revealed here, so it costs nothing
   until a drag is in progress. */
.drop-label {
  display: none;
}

.result-row.drag-over .drop-label {
  display: block;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--ds-radius-pill);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

/* An upload is in flight for this row. Pointer events off so a second drop
   cannot start a second file against the same person. */
.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

/* The toast stack is pointer-events:none so it never eats a tap meant for the
   board underneath. Undo is a real button and has to opt back in. */
.undo-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.undo-btn {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--ds-radius-pill);
  min-height: 32px;
  white-space: nowrap;
}

.undo-btn:active {
  background: rgba(255, 255, 255, 0.26);
}

.undo-btn:disabled {
  opacity: 0.6;
}

/* ------------------------------------------------------------- importer */

/* Above a dialog (100) so the panel is not buried by one, below the sign-in
   scrim (150) so an expired session covers it, and below the toasts (200). */
.imp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* BELOW the dialog (100), not above it. At 140 this panel covered
     `#confirmModal`, so the confirmation step — the one that asks before a batch
     of contracts is filed — rendered underneath the panel it was asking about
     and could not be seen or answered. The house rule is that every sheet goes
     through `#confirmModal` and nothing paints over it except the sign-in scrim
     (150) and the toasts (200); this overlay has no business breaking that. It
     still clears the header (50) and the board. */
  z-index: 90;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-top: calc(var(--safe-top) + 16px);
  padding-bottom: calc(var(--safe-bottom) + 16px);
}

.imp-panel {
  width: 100%;
  max-width: 560px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface-elevated);
  border: 0.5px solid var(--separator-strong);
  border-radius: var(--ds-radius-card);
  box-shadow: var(--ds-shadow-overlay);
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.imp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px 18px;
  flex: 0 0 auto;
}

.imp-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
}

.imp-close {
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}

.imp-note {
  padding: 0 18px 14px 18px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-tertiary);
  flex: 0 0 auto;
}

.imp-zone {
  margin: 0 18px 14px 18px;
  padding: 26px 16px;
  border: 2px dashed var(--separator-strong);
  border-radius: var(--ds-radius-card);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex: 0 0 auto;
}

.imp-zone:active {
  background: var(--surface-row);
}

.imp-zone.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

/* The list scrolls, never the panel — the footer button has to stay reachable
   on a phone, and a 60-row list is taller than any screen here. */
.imp-list {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 0.5px solid var(--separator);
  min-height: 60px;
}

.imp-summary,
.imp-empty {
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  border-bottom: 0.5px solid var(--separator);
  position: sticky;
  top: 0;
  background: var(--surface-elevated);
  z-index: 1;
}

.imp-empty {
  border-bottom: none;
  font-weight: 400;
  text-align: center;
  padding: 26px 18px;
}

.imp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 0.5px solid var(--separator);
}

.imp-row:last-child {
  border-bottom: none;
}

/* 24px, not 20. This is the tick that decides whether a person is filed, and 20×20
   was under 1.5.8's 24×24 floor for a target. The visual box grows 4px; the row it
   sits in is 59px, so nothing around it moves. */
.imp-check {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  accent-color: var(--blue-deep);
}

.imp-check:disabled {
  opacity: 0.4;
}

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

.imp-filename {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imp-detail {
  margin-top: 3px;
}

.imp-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
}

/* Green means it resolved to one person and needs no thought; blue means a
   human should look; grey means it did not resolve at all. */
.imp-tag-ok {
  background: var(--green-bg);
  color: var(--green);
}

.imp-tag-done {
  background: var(--surface-row);
  color: var(--text-secondary);
}

.imp-tag-ask {
  background: var(--orange-bg);
  color: var(--orange);
}

/* A failure, kept on the row it belongs to. The row stays in the list and stays
   ticked, so the retry is pressing the same button again. */
.imp-tag-bad {
  background: rgba(255, 90, 95, 0.16);
  color: var(--coral);
}

/* The upload strip. Sits directly above the footer so it is on screen for every
   row without scrolling — a batch of 400 is taller than any phone, and a status
   line that scrolls away is not a status line. */
.imp-prog {
  flex: 0 0 auto;
  padding: 10px 18px 0 18px;
  border-top: 0.5px solid var(--separator);
}

.imp-prog-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.imp-prog-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-row);
  overflow: hidden;
}

.imp-prog-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: var(--ds-accent);
  transition: width 0.2s ease-out;
}

/* The row currently in flight, and the ones that came back wrong. */
.imp-row.is-filing {
  background: rgba(0, 113, 227, 0.14);
}

.imp-row.is-failed {
  background: rgba(255, 90, 95, 0.10);
}

.imp-row.is-done {
  opacity: 0.62;
}

.imp-tag-none {
  background: var(--surface-row);
  color: var(--text-tertiary);
}

.imp-pick {
  flex: 0 0 auto;
  max-width: 46%;
}

.imp-select {
  max-width: 100%;
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 0.5px solid var(--separator-strong);
  border-radius: var(--ds-radius-inner);
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 600;
}

/* A select on a row that was already Signed is doing nothing but explaining
   itself, so it should not look like something to operate. */
.imp-select:disabled {
  opacity: 0.5;
}

/* The drop zone's caption is its own node — see `impZoneMsg`. Writing it with
   `zone.textContent` deleted the hidden file input that lives inside the zone,
   which is the only way in on a phone. */
.imp-zone-msg {
  pointer-events: none;
}

/* An unmatched row carries the WHOLE roster in its picker, so it gets more of
   the row than the two-or-three-candidate rows do — a truncated name cannot be
   verified, and verifying it is the entire job of this row. */
.imp-row-wide .imp-pick {
  max-width: 62%;
}

.imp-select-all {
  max-width: 100%;
  font-size: 12px;
}

.imp-foot-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.imp-tick-all {
  flex: 0 0 auto;
  white-space: nowrap;
}

.imp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  /* No `safe-bottom` here. `.imp-overlay` already insets the whole panel by the
     safe area, so adding it again in the footer stacked ~34px of dead space
     under the buttons and, in landscape where vertical room is scarce, ate the
     space the footer needed to stay on screen. */
  padding: 12px 18px;
  border-top: 0.5px solid var(--separator);
  flex: 0 0 auto;
}

.imp-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  flex: 1 1 auto;
  min-width: 0;
}

.imp-foot .btn-text-primary:disabled {
  opacity: 0.45;
}

/* The import trigger, first row of the Missing-NDA list. Follows the
   `.add-unfound-row` treatment — dashed blue, the app's existing "there is an
   action here" idiom — so it reads as the same kind of offer. */
.imp-open-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: rgba(0, 113, 227, 0.14);
  border-bottom: 0.5px solid var(--separator);
  cursor: pointer;
  transition: background 0.15s;
}

.imp-open-row:active {
  background: rgba(0, 113, 227, 0.22);
}

.imp-open-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.imp-open-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.imp-open-text {
  min-width: 0;
}

.imp-open-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.imp-open-sub {
  font-size: 12px;
  line-height: 1.35;
  color: var(--ds-link-on-dark);
  margin-top: 2px;
}

.imp-open-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--ds-link-on-dark);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

/* Sits between the caption and the rows. The drop target is invisible until a
   file is already over it, so the gesture has to be written down somewhere. */
.drop-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-tertiary);
  padding: 8px 16px;
  border-bottom: 0.5px solid var(--separator);
  background: var(--surface);
}

/* ===========================================================================
   ADMIN CONSOLE

   Four pages — projects, calendar, project detail, directory — sharing the
   board's stylesheet, its colours and its segmented-control idiom, because this
   is the same application seen from the desk rather than the door.

   Everything new is prefixed `.admin-`. Nothing above this line is redefined
   except where a rule here deliberately overrides one: `.admin-layout` widens
   `.app-layout`, and `.admin-input` re-colours a text field. Both are
   single-class selectors matching the ones they override, so what makes them
   win is that they come last — which is the reason this section is at the end
   of the file and must stay there.

   THE NAVBAR IS NOT IN THIS FILE ANY MORE. It has its own part,
   `015-globalnav.css`, because it was ported whole from the design lab and
   because `body.admin-body` scopes every rule of it. The console header is still
   `templates/partials/admin_header.html`; what changed is which stylesheet draws
   it.

   Desktop-first. The one place that cannot fit on any screen is the crew
   table, whose width is the length of the shoot: it scrolls sideways inside
   `.admin-scroll`, with the person's name pinned to the left edge, and the page
   itself never scrolls horizontally.
   =========================================================================== */

/* ---------------------------------------------------------------- layout */

.admin-layout {
  max-width: none;
  width: 100%;
}

.admin-main {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 24px calc(var(--safe-bottom) + 48px) 24px;
}

@media (max-width: 720px) {
  .admin-main { padding: 14px 12px calc(var(--safe-bottom) + 40px) 12px; }
}


/* THE CONSOLE NAV USED TO BE BUILT HERE, and everything that drew it is gone.

   `.admin-nav` was a flex row, `.admin-nav-tab` re-shaped the board's `.day-tab`
   into a nav link, `.admin-userbox` held the undo/redo pair, and a long measured
   comment below them recorded the exact width at which the eight-tab row wrapped
   and by how much. All of it drew ONE header, the console's, and that header
   still exists — it is just not this. It is `templates/partials/admin_header.html`
   with `015-globalnav.css`: the design lab's global nav, five grouped items with
   flyouts, at §6.3's 48px.

   THE MOVED RULES ARE NOT A LOSS. The nav-link treatment they carried is §6.3's
   and is written out verbatim in the new file; the measured wrap band is not,
   because there is no longer anything to measure — the bar went from eight tabs
   over 570px to five items at roughly half that, and `test_design_audit.py`
   re-derives the height from a real browser on every run rather than trusting a
   number in a comment. That check used to assert a wrapping band at 821-877px;
   it asserts the absence of one now.

   `.admin-main`, `.admin-layout` and the toolbar below are untouched: this file
   is still the console's layout and furniture, and the navbar stopped being part
   of it.

   WHO IS SIGNED IN WAS DRAWN HERE TOO, on the hub page, as a panel using
   `.hub-signed-in` and a coral `.hub-signout`. Both are gone: the account is a
   sheet behind an icon in the navbar now, and the sheet's own rules are in
   `015-globalnav.css`. The IDS did not move — `#adminUserName`, `#adminUserRole`,
   `#adminSignOut` and `#adminUser` are still the ones `mountChrome()` fills,
   which is why none of that wiring changed when the markup did. */



/* ---------------------------------------------------------------- toolbar */

.admin-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-toolbar-text { min-width: 0; }

.admin-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  /* A `<select>` SHORTER THAN ITS WIDEST OPTION NEEDS THIS ON THE ROW, NOT ON THE
     SELECT. `.form-select` already carries `min-width: 0`, and it is not enough:
     the automatic minimum size of a flex ITEM is its min-content contribution, so
     this row — a flex item of `.admin-toolbar` — reports the widest `<option>` in
     the shoot list as its own floor and refuses to wrap narrower than that. With a
     51-character shoot name the row measured 447px inside a 393px page and the
     whole console scrolled sideways: scrollWidth 459, clientWidth 393.

     Measured, not reasoned about, on 2026-10-07: it was found on `/admin/wraps`
     and it is ALREADY LIVE on `/admin/meals`, which has the same two `<select>`s
     and which no audit visits — so the wraps page inherited the defect rather than
     introducing it. `min-width: 0` here lets the row shrink to its line and the
     select take the rest; the reachable width is then the shoot's own, which is
     the point of the row rather than a compromise. */
  min-width: 0;
}

/* PHONE ONLY, hidden here. On a laptop this wrapper is an ordinary block: the
   chrome stays put because the frame is fixed and the list pane is the only thing
   that scrolls, not because anything is sticky. On a phone the page is the
   scroller, so the search box and the three buttons have to be pinned to stay
   reachable while the list moves under them.

   `--admin-hdr-h` is the height of the sticky app header they sit beneath. It is
   measured rather than guessed (see `publishHeaderHeight` in admin.js) because it
   moves with the safe-area inset and with whether the brand and the nav have
   wrapped onto two lines. */
/* Two classes, not one. `.admin-btn` above sets `display: inline-flex` and comes
   later in the file, so a single-class rule here would lose to it however it was
   written — the button would simply never hide. */
.admin-btn.admin-filters-btn,
.admin-btn.admin-filters-done { display: none; }

.admin-filters-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 7px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 768px) {
  .admin-pinned {
    position: sticky;
    top: var(--admin-hdr-h, 0px);
    z-index: 30;
    background: var(--bg);
    padding-bottom: 8px;
  }

  /* A PINNED BAR IS PAID FOR IN LIST, so it is built tight. The heading drops to
     the size of a heading rather than a page hero, and every gap is the smallest
     one that still reads as a gap. Measured on a 390pt phone this is about 160px
     — roughly a fifth of the screen for the search box, the three buttons and the
     line that says what the list below is showing. The laptop's spacing for the
     same three rows costs nearly twice that, which is affordable only because
     nothing up there is fixed there.

     The rows are also one object, so the space between them is a gap rather than
     a margin that would scroll apart from them. */
  .admin-pinned .admin-toolbar {
    margin-bottom: 8px;
    gap: 10px;
  }

  .admin-pinned .admin-h1 { font-size: var(--text-md); }
  .admin-pinned .admin-sub { margin-top: 2px; font-size: var(--text-xs); }

  /* Height only. The 16px font size is not touched on purpose — anything smaller
     makes iOS zoom the whole page in when the field takes focus. */
  .admin-pinned .admin-search { height: 44px; }
  .admin-pinned .admin-searchbar { margin-bottom: 0; }
}

.admin-h1 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: #FFFFFF;
}

.admin-sub {
  margin: 4px 0 0 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  max-width: 70ch;
}

.admin-muted {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-tertiary);
}

/* `.admin-crumb` and `.admin-crumb-link` WERE HERE AND ARE DELETED, not by a
   spring clean but because the markup they styled is gone: the single-project
   page's way back to the list was an 11px crumb and is a `.admin-back-btn` in
   `216-admin-modules.css` now. Nothing in `templates/`, `static/` or `web/`
   emits either class — the two mentions left in the tree are prose, in that
   button's own comment and in the overview template, explaining what it
   replaced. A rule whose class nothing draws is a rule the next person edits
   by mistake. */

/* ---------------------------------------------------------------- buttons */

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--ds-dur-fast) linear, border-color var(--ds-dur-fast) linear, transform var(--ds-dur-fast) var(--ds-ease), opacity var(--ds-dur-fast) linear;
}

.admin-btn:disabled { opacity: var(--ds-disabled); }
.admin-btn:active:not(:disabled) { transform: scale(0.98); }

.admin-btn-primary {
  background: #ffffff;
  color: #000000;
}
.admin-btn-primary:hover:not(:disabled) { background: #e5e5e7; }
.admin-btn-primary:active:not(:disabled) { background: #d4d4d8; }

.admin-btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--separator-strong);
  color: var(--text-primary);
}
.admin-btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.24); }
.admin-btn-ghost:active:not(:disabled) { background: var(--ds-surface-pressed); color: #FFFFFF; }

.admin-btn-small {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: var(--text-xs);
  font-weight: 600;
}

.admin-btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ---------------------------------------------------------------- panels */

.admin-panel {
  background: var(--surface);
  border: 0.5px solid var(--separator);
  border-radius: 18px;
  margin-bottom: 16px;
  overflow: hidden;
}

/* A panel that reports rather than controls. It keeps the same shape so it still
   reads as part of the page, but drops the surface and the title size so it
   cannot compete with the Projects list above it — which is the whole point of
   de-emphasising Accounts. */
.admin-panel-quiet {
  background: transparent;
}

.admin-panel-quiet .admin-panel-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.admin-panel-quiet .admin-panel-head { border-bottom: none; }
.admin-panel-quiet .admin-account-name { font-size: var(--text-base); }

.admin-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--separator);
}

.admin-panel-title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: #FFFFFF;
}

.admin-panel-body { padding: 14px 16px; }
.admin-panel-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 0.5px solid var(--separator);
}

.admin-form-narrow { max-width: 720px; }

/* The one horizontally-scrolling box in the console. Everything inside it is
   sized to its content; nothing outside it moves. */
.admin-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-empty {
  margin: 0;
  padding: 16px;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-tertiary);
}

.admin-notice {
  max-width: 560px;
  margin: 56px auto;
  padding: 26px 24px;
  background: var(--surface);
  border: 0.5px solid var(--separator-strong);
  border-radius: 18px;
  text-align: center;
}

.admin-notice-title {
  margin: 0 0 8px 0;
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  color: #FFFFFF;
}

.admin-notice-text {
  margin: 0 0 18px 0;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

.admin-input {
  min-width: 0;
  background: var(--surface-elevated);
  border: 1px solid var(--separator-strong);
  border-radius: var(--ds-radius-inner);
  color: #FFFFFF;
  font-size: 15px !important;
  padding: 9px 11px;
  text-align: left;
  outline: none;
  /* Without this the native date field and its picker draw light-on-light
     against the console's near-black inputs. */
  color-scheme: dark;
}

.admin-input::placeholder { color: var(--text-tertiary); }

/* A `type="date"` FIELD IS SIZED BY ITS CONTENTS, AND CHROME'S OWN FLOOR IS BELOW
   WHAT IT HAS TO DRAW. Chrome lays a date input out at the width of the value plus
   the picker button and clips the rest, so a field narrower than about 140px shows
   a year with the leading digits cut off — no ellipsis, no scroll, and nothing on
   the page to say a character is missing. It is worse in `.admin-toolbar-actions`
   than on its own, because that row is a flex container and `.admin-input`'s
   `min-width: 0` lets the field shrink past even its own content.

   A FLOOR, not a width: the field still grows with its content and the row still
   wraps (`flex-wrap: wrap` on `.admin-toolbar-actions`) rather than overflowing on
   a phone. Only the date range controls carry it, so no other text field is held
   open to a width it does not need. */
.admin-input[type="date"] {
  min-width: 140px;
}

.admin-search {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: var(--ds-radius-inner);
  background: var(--surface);
  font-size: 16px !important;
}

.admin-searchbar { margin-bottom: 10px; }

/* ------------------------------------------------------- directory filters */

.admin-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.admin-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.admin-filter-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* The one checkbox in a row of selects, so it gets a pointer and a tappable
   label rather than just the 13px box. `.admin-filter` already supplies the
   inline-flex and the gap. */
.admin-filter-check {
  cursor: pointer;
  user-select: none;
}

.admin-filter-check input {
  accent-color: var(--ds-accent, #0071e3);
  width: 15px;
  height: 15px;
  cursor: pointer;
  margin: 0;
}

.admin-filter-check:has(input:checked) .admin-filter-label {
  color: var(--text-primary);
}

/* Its own rule rather than `.form-select`: that one is sized for the modal
   sheets at 17px, which is right for a thumb on a phone and far too loud for a
   row of three on a laptop toolbar. */
.admin-filter-select {
  background: var(--surface-elevated);
  border: 1px solid var(--separator-strong);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 13px;
  padding: 7px 11px;
  border-radius: var(--ds-radius-pill);
  outline: none;
  max-width: 200px;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.admin-filter-select:hover { background: var(--surface-row); }

.admin-filter-select:focus-visible {
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: var(--ds-focus-ring, 0 0 0 2px rgba(255, 255, 255, 0.2));
}

/* A select that is actually narrowing the list is tinted, so a short result set
   is never mistaken for a short directory. */
.admin-filter-select.is-active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  font-weight: 600;
}

@media (max-width: 768px) {
  /* COLLAPSED UNTIL ASKED FOR. Stacked one per line the three selects are about a
     third of a phone screen, and holding that permanently open above the list
     costs more than the narrowing is worth — you cannot see what you narrowed
     *to* with the panel covering it. The Filters button stands in for them and
     carries the count, so a collapsed panel is never silent about being active.
     `is-open` is set by the script; above this breakpoint the rule does nothing
     and the selects are simply always there. */
  .admin-filters { display: none; }
  .admin-filters.is-open { display: flex; }
  .admin-btn.admin-filters-btn,
  .admin-btn.admin-filters-done { display: inline-flex; }

  /* Same tint as a narrowing select, so the button reads as "this is on" at a
     glance from a collapsed state. */
  .admin-filters-btn.is-active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #FFFFFF;
  }

  /* One filter per line, so the labels become a column and have to line up:
     "CITY" is half the width of "DEPARTMENT", and without a shared floor the
     three selects would start at three different places down the page. */
  .admin-filter { flex: 1 1 100%; }
  .admin-filter-label { min-width: 82px; }
  /* `min-width: 0` is not decoration. A flex item defaults to `min-width: auto`,
     which refuses to shrink below its content — and for a `<select>` the content
     is its widest option, so "Any department" pushed the select 21px past the
     right edge of a 390px phone and cut the chevron off. */
  .admin-filter-select { flex: 1 1 auto; min-width: 0; max-width: none; }
  .admin-filters { gap: 8px; margin-bottom: 12px; }
}

/* ---------------------------------------------------------------- badges */

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-badge.is-planned {
  background: var(--blue-bg);
  border: 0.5px solid var(--blue-border);
  color: var(--blue);
}

.admin-badge.is-active {
  background: var(--green-bg);
  border: 0.5px solid var(--green-border);
  color: var(--green);
}

.admin-badge.is-archived {
  background: var(--surface-elevated);
  border: 0.5px solid var(--separator-strong);
  color: var(--text-tertiary);
}

.admin-scope {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--orange-bg);
  border: 0.5px solid var(--orange-border);
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Deliberately NOT the orange of `.admin-scope` beside it. Orange is this
   console's "needs your attention" colour, and an archived row is the opposite:
   it is settled and out of the way, which is what the neutral treatment on
   `.admin-badge.is-archived` above already says for shoots. Reusing that tone
   keeps "archived" reading the same on both halves of the console. */
.admin-scope.is-archived {
  background: var(--surface-elevated);
  border: 0.5px solid var(--separator-strong);
  color: var(--text-tertiary);
}

.admin-chip {
  /* inline-block rather than inline-flex: this chip holds a bare text node, and
     `text-overflow` has no effect on a flex container, so a long project name
     was hard-clipped mid-word with no ellipsis to show it had been cut. */
  display: inline-block;
  vertical-align: middle;
  padding: 3px 10px;
  border-radius: var(--ds-radius-pill);
  border: 0.5px solid var(--separator);
  background: var(--surface-elevated);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chip:hover { color: #FFFFFF; }
.admin-chip.is-active { border-color: var(--green-border); color: var(--green); }
.admin-chip.is-planned { border-color: var(--blue-border); color: var(--blue); }
.admin-chip.is-archived { color: var(--text-tertiary); }

/* ---------------------------------------------------------------- project cards */

.admin-groups { margin-bottom: 8px; }

.admin-group-title {
  margin: 20px 0 10px 2px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--surface);
  border: 0.5px solid var(--separator);
  border-radius: var(--ds-radius-card);
  text-decoration: none;
  color: inherit;
  transition: background 0.13s, border-color 0.13s;
}

.admin-card:hover,
.admin-card:active {
  background: var(--surface-elevated);
  border-color: var(--separator-strong);
}

/* `.admin-card-icon` WAS HERE, and it is deleted rather than left alone. It was
   the rounded icon tile on a Hub card, and the Hub was its only user — no
   template, no script and no other page ever named it. A rule whose selector
   matches nothing is the CSS twin of a test that has stopped asserting: it
   survives every run, reports nothing, and reads to the next person as a
   component that is in use. The Hub's tiles now carry a photograph in
   `.hub-tile-media` (see `215-admin-hub.css`), and the sizing trap this rule
   guarded — `.ic` is `1em`, so a tile that forgets its font-size draws a glyph of
   nothing — moved with them. `test_console.py` pins the new form. */

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.admin-card-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: #FFFFFF;
  min-width: 0;
}

.admin-card-meta {
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--text-secondary);
}

.admin-card-days {
  margin-top: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
}

/* Sits below the dates and says the one thing the dates cannot: how far off it
   is. Coloured rather than plain because it is the only field on the card that
   changes on its own — a shoot that was "in 3 weeks" is "Day 2 of 5" tomorrow,
   and that needs to be visible while scanning, not read. */
.admin-card-countdown {
  margin-top: 8px;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: var(--ds-radius-pill);
  background: rgba(0, 113, 227, 0.14);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* THE REMOVE CONTROL ON A PROJECT CARD, and why the card changed shape.

   A project card used to BE an `<a>`. It now carries a second control, and a
   `<button>` cannot live inside an `<a>` — interactive content cannot nest in
   interactive content, and a click on the button would follow the link as well,
   so "Remove" would open the shoot and remove nothing. So the card is a box
   holding `.admin-card-link` (the whole-link target it always was) and this
   button beside it.

   `.admin-card-link` carries the column layout the card's own children used to
   inherit, which is why the HUB is untouched: a hub card is still a bare
   `<a class="admin-card">` whose children are laid out by the rule above, and
   no hub card ever contains a `.admin-card-link`.

   Outlined and red-tinted like `.btn-person-lifecycle`, and the reason holds
   here even more sharply: a shoot with nothing behind it is DESTROYED for real,
   so this is one of the few controls in the console that can lose data, and it
   must not be what a thumb lands on while opening a shoot. */
.admin-card-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}

.admin-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.admin-card-remove {
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--ds-radius-pill);
  background: rgba(220, 38, 38, 0.14);
  color: var(--coral);
  border: 1px solid rgba(220, 38, 38, 0.38);
  font-size: 13px;
  font-weight: 600;
}

.admin-card-remove:active {
  background: rgba(220, 38, 38, 0.24);
}

/* ---------------------------------------------------------------- hub */

/* The Hub's own grid, cards and group colours used to live here. They moved to
   `215-admin-hub.css` when the Hub became the first page on the design-system
   layer: `.admin-grid` and `.admin-card` in this file are shared with Projects,
   Documents and Links, and the Hub no longer uses them at all. Leaving a
   `body[data-admin-page="hub"]`-scoped rule behind would be a rule that matches
   nothing — the same failure as a test that has stopped asserting, except that
   nothing would ever report it. */

/* The two addresses a phone can reach this Mac on used to be styled here, under
   a panel on the hub page. The panel is gone and they are a sheet hanging off
   the navbar now, so their rules are `.globalnav-sheet-address*` in
   `015-globalnav.css` — on the `--ds-*` layer, with the rest of the navbar they
   are part of. Nothing here drew them; this note is here so the next person
   grepping for the list finds the move rather than an absence. */

/* ------------------------------------------------------------------ calendar */

.admin-cal-nav { gap: 6px; }

.admin-cal-month {
  font-size: 19px;
  font-weight: 800;
  min-width: 12ch;
}

.admin-cal-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-tertiary);
}

.admin-legend { font-size: 12px; color: var(--text-tertiary); }
.admin-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.admin-cal-swatch {
  width: 14px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.admin-cal-swatch.is-planned { background: rgba(0, 113, 227, 0.55); }
.admin-cal-swatch.is-active { background: rgba(50, 199, 102, 0.6); }
.admin-cal-swatch.is-archived { background: rgba(142, 142, 147, 0.5); }

.admin-cal { padding: 4px 12px 12px 12px; }

.admin-cal-dow,
.admin-cal-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.admin-cal-dow {
  padding: 8px 0 6px 0;
}

.admin-cal-dow span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-align: center;
}

.admin-cal-week {
  border-top: 0.5px solid var(--separator);
  padding-bottom: 6px;
}

.admin-cal-day {
  min-height: 30px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  cursor: pointer;
}

/* THE RANGE BAND IS THE CELL, NOT THE NUMBER. Filling the whole cell is what
   makes consecutive days read as one span rather than as a row of separate
   chips; the rounded ends are then put back only on the outermost two, so the
   join between them stays square. A one-day shoot is both ends at once and takes
   the full pill.

   Hover comes first because it and `is-selected` are both two-class selectors —
   at equal specificity the later rule wins, so the order here is what stops the
   hover tint from overriding a day that is already picked. */
.admin-cal-day:hover { background: rgba(255, 255, 255, 0.05); }

.admin-cal-day.is-selected { background: rgba(0, 113, 227, 0.22); }
.admin-cal-day.is-range-start { border-radius: 8px 0 0 8px; }
.admin-cal-day.is-range-end { border-radius: 0 8px 8px 0; }
.admin-cal-day.is-range-start.is-range-end { border-radius: 8px; }

.admin-cal-day.is-selected .admin-cal-daynum { color: #FFFFFF; }

/* A range crossing a month or week boundary is left SQUARE where it continues
   and rounded only at its two real ends, so a band that stops at the edge of a
   row reads as continuing into the next one rather than as a finished range that
   happens to resume below. Each week is its own grid, so nothing can be done
   about the 6px gap between rows — but the shape is honest about the range, and
   the reader is being told the truth rather than shown a closed pill. */

/* The strip is a sibling of the grid, inside the panel, so it pushes the dates
   down rather than covering the ones you are choosing between. */
.admin-cal-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 12px 10px 12px;
  padding: 10px 12px;
  border: 0.5px solid rgba(0, 113, 227, 0.45);
  background: rgba(0, 113, 227, 0.14);
  border-radius: var(--ds-radius-inner);
}

.admin-cal-pick-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-cal-pick-dates {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-cal-pick-note {
  font-size: 12px;
  color: var(--coral);
}

.admin-cal-pick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.admin-cal-daynum {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Blank cells, not hidden ones: a month grid with holes in it is unreadable,
   and the neighbouring month's dates are what tell you which week you are in. */
.admin-cal-day.is-outside .admin-cal-daynum {
  color: var(--ds-text-on-dark-tertiary);
}

.admin-cal-day.is-today .admin-cal-daynum {
  background: var(--ds-accent);
  color: #FFFFFF;
}

.admin-cal-lanes {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 20px;
}

.admin-cal-lane {
  position: relative;
  height: 20px;
}

.admin-cal-lane.is-empty { height: 20px; }

/* One bar per project, positioned as a fraction of the seven-day week. The
   transparent left/right borders are what separate two bars that touch, and
   background-clip keeps the fill inside them.

   `display: block` with `line-height` equal to the bar's height, NOT the
   `display: flex; align-items: center` this was. Flex was there to centre one
   line of text, and it did that — but a flex container does not honour
   `text-overflow`, so the `ellipsis` two rules down silently did nothing and a
   bar narrower than its own name was cut mid-word: "Adidas commercial — Hawai"
   on a phone, with no mark saying the rest existed. A block box with inline
   content is what `text-overflow` is defined for, and the line box centres the
   text just as well. Vertical padding and borders are both zero here, so the
   content box is the full 20px and the text sits exactly where it did.

   The full name is on the `title` either way — this is about the truncation
   reading as truncation rather than as a glitch. */
.admin-cal-bar {
  position: absolute;
  top: 0;
  height: 20px;
  left: calc(var(--col) * 100% / 7);
  width: calc(var(--span) * 100% / 7);
  display: block;
  line-height: 20px;
  padding: 0 8px;
  border-left: 2px solid transparent;
  border-right: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Square on the side that carries on into next week, so a shoot that spans a
   week boundary reads as one bar rather than two. */
.admin-cal-bar.is-open-left { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.admin-cal-bar.is-open-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.admin-cal-bar.is-planned { background-color: rgba(0, 113, 227, 0.78); }
.admin-cal-bar.is-active { background-color: rgba(14, 122, 58, 0.85); }
.admin-cal-bar.is-archived { background-color: var(--surface-row); }

.admin-cal-bar:hover { filter: brightness(1.18); }

.admin-cal-note { margin: 0 2px; max-width: 80ch; }

@media (max-width: 720px) {
  .admin-cal { padding: 4px 6px 10px 6px; }
  .admin-cal-bar { padding: 0 4px; font-size: 10px; }
  .admin-cal-month { font-size: 16px; min-width: 0; }
}

/* ---------------------------------------------------------------- day editor */

/* THE ROWS SIZE THEMSELVES AGAINST THIS, NOT AGAINST THE VIEWPORT, and that is
   the point of the `container-type` rather than a flourish. The same day editor
   is rendered twice on one screen at two very different widths: 752px inside the
   project page at a 1280 viewport, and 523px inside `.admin-modal-card`, which
   is `max-width: 560px` — so the viewport says "wide" while the modal is the
   narrowest home this component has. A media query cannot see the difference,
   and the first draft of this fix shipped exactly that bug: the modal's row took
   the wide template, whose tracks total 720px, into a 523px box and ran 197px
   out of the sheet. (It is worse than the bug being fixed, because flex had been
   crushing the label there instead of overflowing — the old failure at least
   stayed inside the card.) */
.admin-day-editor {
  display: block;
  container-type: inline-size;
  container-name: dayeditor;
}

/* Day row: 8 controls (date, label, 5 labeled time fields, Remove) in a single
   desktop line; wraps to a multi-row grid below 948px. Keep 140px / 96px floors. */
.admin-schedule-intro {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-tertiary);
  max-width: 72ch;
}

.admin-schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.admin-day-row {
  display: grid;
  grid-template-columns: 140px minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 0.5px solid var(--separator);
}

.admin-day-times-toggle {
  appearance: none;
  background: transparent;
  color: var(--text-secondary);
  border: 0.5px solid var(--separator-strong, rgba(255, 255, 255, 0.18));
  border-radius: var(--ds-radius-pill);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  min-height: 32px;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.admin-day-times-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.admin-day-times-toggle.is-unset {
  color: var(--text-tertiary);
  border-style: dashed;
}

.admin-day-times-toggle.is-unset:hover {
  color: var(--text-primary);
  border-style: solid;
}

.admin-day-times {
  display: none;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: 8px;
  padding-top: 6px;
}

.admin-day-row.is-times-open .admin-day-times {
  display: grid;
}

.admin-day-time-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.admin-day-time-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-day-time-field > .admin-input {
  width: 100%;
  min-width: 0;
}

.admin-day-row:last-child { border-bottom: none; }

.admin-day-empty {
  border-bottom: none;
}

/* Below 948px: date & label span full width; time fields & Remove auto-fit. */
@container dayeditor (max-width: 947px) {
  .admin-day-row {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 14px 12px;
  }
  .admin-day-date,
  .admin-day-label { grid-column: 1 / -1; }
  .admin-day-times { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
  .admin-day-row .admin-input,
  .admin-day-times-toggle { min-height: 44px; }
  .admin-day-row > .admin-btn {
    justify-self: end;
    min-height: 44px;
  }
}

/* ------------------------------------------------------ the day's coverage line

   A NINTH CHILD IN AN EIGHT-TRACK GRID, AND IT SAYS SO RATHER THAN HOPING. The
   template above names one track per control, so an extra child lands on an
   implicit line whether that is intended or not — which is precisely how the
   fifth time input produced a 607px Remove button. This one IS meant to have a
   line: `grid-column: 1 / -1` states it, instead of leaving it to auto-placement,
   and `test_design_audit.py` measures that a row carrying this element draws on
   exactly two bands. A row that grew a control WITHOUT this rule would be three,
   and go red.

   It is drawn only by the project page — `renderDayEditor`'s `opts` — so the new
   project sheet's rows have no footer at all and stay one line, which is the case
   the audit's one-line rule is stated against. */
.admin-day-cover {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-day-cover-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* A day somebody is still owed a place on reads as a caution and never as an
   error — nothing is broken, the shoot has simply grown a day. The same `--amber`
   the console's other "nobody has said yet" counters use. */
.admin-day-cover-text.is-gap { color: var(--amber); }

/* ------------------------------------------------------------- shoot cards modern */

.admin-card-shoot {
  position: relative;
  overflow: hidden;
  padding: 0;
  border-radius: var(--ds-radius-card);
  background: var(--surface);
  border: 0.5px solid var(--separator);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.15s;
}

.admin-card-shoot:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.admin-card-shoot .admin-card-link {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-decoration: none;
  color: inherit;
}

.admin-card-shoot .admin-card-media {
  position: relative;
  height: 160px;
  background: var(--ds-surface-media);
  overflow: hidden;
  border-bottom: 0.5px solid var(--separator);
}

.admin-card-shoot .admin-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.admin-card-shoot:hover .admin-card-img {
  transform: scale(1.04);
}

.admin-card-shoot .admin-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.7) 100%);
  pointer-events: none;
}

.admin-card-shoot .admin-card-overlay-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}

.admin-card-shoot .admin-card-body {
  padding: 14px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-card-shoot .admin-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 14px;
  margin-top: 4px;
}

.admin-card-open-hint {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ds-link-on-dark);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Toolbar filter & search */
.admin-toolbar-filter-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 18px 0;
}

.admin-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.admin-filter-pills::-webkit-scrollbar { display: none; }

/* DELIBERATELY LEFT AS CAPSULES. The Hub's category row (`215-admin-hub.css`,
   `.hub-seg-btn`) is the same species and is the one the crew asked to keep
   exactly as it is; these filters are its sibling, not the counter chip in a
   pane's strip (`214d`), which is the one that changed. */
.admin-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ds-control-h);
  padding: 0 18px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-text-secondary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  letter-spacing: var(--ds-type-body-reduced-tracking);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--ds-dur-fast) linear,
              color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.admin-filter-pill:hover {
  background: var(--ds-surface);
  color: var(--ds-text-primary);
}

.admin-filter-pill.active {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

.admin-filter-pill:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus-ring);
}

.admin-filter-pill .pill-count {
  font-size: var(--ds-type-caption-size);
  opacity: 0.7;
}

.admin-filter-pill.active .pill-count {
  opacity: 0.85;
}

.admin-search-wrap {
  position: relative;
  width: 100%;
  max-width: 260px;
}

.admin-search-input {
  width: 100%;
  height: 36px;
  border-radius: var(--ds-radius-pill);
  background: var(--surface);
  border: 0.5px solid var(--separator);
  padding: 0 14px 0 32px;
  font-size: 13px;
  color: #ffffff;
  outline: none;
  box-sizing: border-box;
}

.admin-search-input:focus {
  border-color: var(--ds-accent);
}

.admin-search-ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
}

/* ============================================================= The shoot

   The shoot's own pane, and the page you land on — which is now only its
   CHROME, because the cover itself is `217-admin-hero.css`. This file holds what
   surrounds the banner: the shoot's settings form, which is the banner card's
   second face, and the pane's own scroller.

   IT IS NOT THE SHOOT'S WHOLE PAGE, and splitting it in two is not tidying for
   its own sake. The hero slate is one component — a poster, three badges pinned
   over it, a title block and a metrics bar — and it carries its own responsive
   rules, its own mobile block and its own rule about absorbing the pane's spare
   height. Everything in it changes together when the cover changes, which is
   what a file boundary is for.

   WHAT IS NOT HERE EITHER is the page's furniture — the way back to the list and
   the module cards — which is `216-admin-modules.css` for the same reason one
   level up: it is about the shoot rather than about a section of it. */

/* ------------------------------------------------------- The section row

   IT IS ONE ROW, DIRECTLY UNDER THE CONSOLE'S OWN NAV BAR, and it is the way
   between sections. Switching from one to another never means scrolling to find
   the switcher, because it is a row of the fixed shell's own column rather than
   something inside the pane.

   IT IS NOT ON THE SHOOT'S OWN PAGE. There the module cards below the banner
   are the way in, and this row would be the same five destinations a second
   time on the one screen where the banner is already tall. `switchWorkspace`
   hides it there; this rule is the half that makes setting that attribute mean
   anything.

   `[hidden]` IS NOT ENOUGH ON ITS OWN: the browser's own `[hidden] { display:
   none }` is a UA declaration, so `display: flex` below outranks it and a bar
   carrying the attribute would still be laid out and still take its height.

   No `position: sticky` either. The bar is not inside a scroller — it is a row
   of the shell's own column — so layout has already pinned it. */
.workspace-nav-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0 0 18px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.workspace-nav-bar[hidden] { display: none; }

.workspace-nav-bar::-webkit-scrollbar { display: none; }

.workspace-nav-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ds-control-h);
  padding: 0 18px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-text-secondary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  letter-spacing: var(--ds-type-body-reduced-tracking);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ds-dur-fast) linear,
              color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.workspace-nav-pill:hover {
  background: var(--ds-surface);
  color: var(--ds-text-primary);
}

.workspace-nav-pill.is-active {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
  font-weight: 600;
}

.workspace-nav-pill:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus-ring);
}

/* THE SHOOT IS NOT A SECTION, AND THIS IS WHERE IT SAYS SO.

   Five pills cut the shoot up into its departments; the sixth is the thing
   those departments are OF, and it reads as one of them unless it is marked.
   Accent rather than a divider or a gap, because the row scrolls sideways on a
   narrow window and a structural marker would be the first thing off the edge.

   It needs NO ACTIVE STATE, and that is not an omission: this row is hidden
   while the shoot's own pane is showing (`switchWorkspace`), so the pill back
   to the shoot is never the one you are on while it is visible. One rule, not
   two — and the day that stops being true, this comment is the thing that says
   why it was. */
.workspace-nav-pill[data-workspace="overview"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--ds-text-primary);
  font-weight: 600;
}

.workspace-nav-pill[data-workspace="overview"]:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

/* ------------------------------------------------------- Shoot settings

   Renaming the shoot, its client, its production company, its timezone, its
   status, the hour its day starts and its poster. These are the fields the
   deleted "Production Details" section held, and there is exactly one copy of
   them on the page — two `#pName` inputs would mean `saveDetails` posted
   whichever the browser listed first and the other one silently lost.

   NO GROUND OF ITS OWN. It used to be a bordered card in the page, which is
   what a form standing on its own wants; it now stands on the hero card's
   second face, and a second bordered box inside the first reads as a mistake.
   The padding that face needs is on `.hero-settings` in
   `216-admin-modules.css`, next to the rest of it. */
.overview-settings .form-group { margin-bottom: 4px; }

.overview-settings .admin-btn-row { margin-top: 14px; }

/* ------------------------------------------------------- The shoot's meals

   The services it runs and the length of its break. Both sit in a `.form-row`
   beside the same 110px label as every other setting, so the value side is
   right-aligned like the rest of the form rather than inventing a second
   alignment inside one card.

   The checkboxes are the browser's own, tinted with `accent-color` — the same
   choice `240-admin-rest.css` makes for its checkboxes, and for the same reason:
   bespoke artwork for a control the platform already draws correctly is a second
   thing to keep in step with the platform. */
.meal-services {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 14px;
}

.meal-service-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.meal-service-opt input {
  accent-color: var(--accent-blue);
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.meal-break-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* The number input's own spinner is a second control inside a row that is one
   line high, and it is what pushes the hint off the row on a narrow panel. */
.meal-break-field input[type="number"] {
  max-width: 84px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.meal-break-field input[type="number"]::-webkit-outer-spin-button,
.meal-break-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.meal-break-field .admin-muted { white-space: nowrap; }

/* Below the width at which `.form-row` stacks (see 050-modals.css), a right-
   aligned checkbox group has nothing to align to, so it starts at the label's
   edge like every other stacked value. */
@media (max-width: 460px) {
  .meal-services, .meal-break-field {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  /* The hint stops being one line here — "minutes (0 = no reminder)" beside a
     84px field is wider than the phone, and `nowrap` would push it off the row
     rather than letting it fall under. */
  .meal-break-field .admin-muted { white-space: normal; }
}

/* The pane's own scroller — this pane scrolls inside itself from 900px up. The
   padding keeps the hero's shadow from being clipped by the pane's
   `overflow: hidden`. */
.overview-scroll {
  padding: 2px 2px 0;
}
/* --------------------------------------------- Modular workspace panes

   Five sections, one of them on screen. The shell around them is the next
   block; this one is how a pane behaves wherever it is drawn. */
.workspace-panes-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

/* NO `forwards`, AND THAT IS A LAYOUT FIX RATHER THAN A MOTION TASTE.
   `wsFadeIn` ends on `transform: translateY(0)`, and with `forwards` that
   identity transform stays on the pane for the rest of its life — permanently.
   **Any** transform, identity included, makes the element a containing block
   for `position: fixed` descendants, and every sheet in this pane is one: the
   enroll picker and the department manager are both inside `#module-crew`.
   Measured at 393px, opening "Departments…" gave a scrim of 368×2468 at
   `top: 138px` — the pane's box, not the viewport — so the card was laid out at
   the bottom of a 2468px box, 1,990px below the fold, and the sheet looked like
   it never opened. On a desktop the pane is nearly the viewport, which is why
   it went unseen. Without `forwards` the fade and the 6px rise still play; the
   pane simply reverts to its own (identical) styles when they finish. */
.workspace-pane {
  display: none;
  animation: wsFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-pane.is-active {
  display: block;
}

#module-overview {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

@keyframes wsFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* The pane's own header: which section this is, and the two ways out of it.
   Its text is written by `fillPaneChrome` from the same list the strip is drawn
   from, so the five templates hold no other section's name. The overview pane
   deliberately has none — it is the shoot rather than a workspace inside it. */
.workspace-pane-head {
  display: none !important;
}

.workspace-pane-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tint, var(--ds-link-on-dark));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-pane-quick-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.workspace-pane-quick-nav button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--ds-radius-pill);
  white-space: nowrap;
  transition: all 0.15s ease;
}

.workspace-pane-quick-nav button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.workspace-pane-quick-nav .ws-sep {
  color: var(--text-tertiary);
  font-size: 11px;
}

/* Scroll offset for `scrollIntoView`, below the shell breakpoint only — inside
   the fixed shell there is no document scroll for it to land in. */
.workspace-module-section {
  scroll-margin-top: 110px;
}

/* ======================================================= The desktop shell

   900px and up, the page is exactly one viewport tall and does not scroll. The
   section row is its own row; the active section takes the rest and scrolls
   inside itself.

   WHY THIS IS A BOUNDED BOX AND NOT A `overflow: hidden` ON THE BODY: the
   section has to keep a scrollbar of its own, and the box that holds it has to
   be allowed to be smaller than its content. That is `min-height: 0` on every
   flex child between the body and the pane — a flex item's default `min-height:
   auto` refuses to shrink below its content, so without it every row below
   takes the height it wants, the column grows past 100vh, and the page scrolls
   exactly as it did before the shell existed. It is the one line here that is
   load-bearing rather than shaping. */
@media (min-width: 900px) {
  body[data-admin-page="project"] {
    height: 100vh;
    overflow: hidden;
  }

  body[data-admin-page="project"] .app-layout {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  body[data-admin-page="project"] .admin-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
    padding-top: 12px;
    padding-bottom: 10px;
  }

  /* The one row that is allowed to grow. `flex-basis: 0` rather than `auto` so
     it is sized by what is LEFT OVER rather than by what is inside it — with
     `auto` a long crew table would push the pane past the viewport, which is
     the failure this whole block exists to prevent. */
  .workspace-panes-container {
    flex: 1 1 0;
    min-height: 0;
    margin-top: 0;
  }

  /* THE PANE IS A FRAME, NOT A SCROLLER.

     It used to scroll as one block, which is fine for a pane that is three
     paragraphs and wrong for the two that are tables: the section's own header
     scrolled away with the content, and the crew table's `position: sticky`
     header stuck to the top of the PANE — so you could be forty rows into a
     roster with the name of the shoot still on screen and no idea which section
     you were in.

     Instead: the pane is a fixed frame, and exactly ONE region inside it takes
     the leftover height and scrolls. Everything else — the section header, the
     panel head, the legend — stays put. Which region that is, per pane, is the
     rule below. */
  .workspace-pane.is-active {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    /* `.admin-panel`'s own `overflow: hidden` is what rounds the pane's corners;
       this keeps it and adds nothing, because the scrolling is now the child's
       job. */
    overflow: hidden;
    margin-bottom: 0;
    overscroll-behavior: contain;
  }

  .workspace-pane.is-active > .workspace-pane-head,
  .workspace-pane.is-active > .admin-panel-head,
  .workspace-pane.is-active > .admin-panel-foot {
    flex: 0 0 auto;
  }

  .workspace-pane.is-active > .admin-panel-head {
    padding: 10px 16px;
  }

  .workspace-pane.is-active > .admin-panel-foot {
    padding: 8px 16px;
  }

  /* THE ONE REGION THAT GROWS. `flex-basis: 0` so it is sized by what is left
     over rather than by what is inside it, and `min-height: 0` so it is allowed
     to be smaller than its content — the same argument as the row above, one
     level down, and the reason the roster scrolls instead of pushing the legend
     off the bottom of the window.

     `overflow-y` is added here rather than left to `.admin-scroll`, whose own
     rule is `overflow-x` only: a table taller than the frame needs both axes.

     IN THE SHOOT'S PANE THIS IS THE REGION ABOVE THE SECTION ROW — the row is
     the pane's other child, `flex: 0 0 auto` off its own rule, so the poster
     and the settings scroll past above a row that does not move. That is the
     whole reason the row is a sibling of this box rather than its last child. */
  .workspace-pane.is-active > .admin-panel-body,
  .workspace-pane.is-active > .admin-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
  }

  /* ...EXCEPT WHERE A PANE HAS TWO REGIONS. A pane whose body is a short block
     of prose above a table — Documents' rules above the grid — must not split
     the height between them: the prose would take half the frame and the grid
     would get the rest. The block says so itself, with this class, rather than
     the stylesheet guessing from element order. */
  .workspace-pane.is-active > .admin-panel-body-fixed {
    flex: 0 0 auto;
    overflow-y: visible;
  }
}

/* THE WIDTH THIS PAGE IS ALLOWED.
   `.admin-layout` is full-bleed (100% width) so the top `.app-header` navbar
   bar spans edge-to-edge while `.globalnav-content` stays centered at
   `--ds-nav-max` (1024px).
   Project pages share the unified console center zone (max-width: 1360px), matching
   the projects tab and the other central console sections. */
@media (min-width: 900px) {
  body[data-admin-page="project"] .admin-main {
    max-width: 1360px;
  }
}
/* ---- Project Poster Selection & Modal ----

   The hero slate's "Change Poster" pill, floating over the shoot's photograph
   in the top-right of the badge row. It is a dark blur scrim on purpose: over a
   picture, a translucent WHITE ground reads as a hole in the image, and this
   one has to stay legible against whatever poster the shoot uploaded. The
   sibling pills either side of it are scrims for the same reason. */
.hero-poster-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--ds-radius-pill);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 10;
  transition: all 0.15s ease;
}

.hero-poster-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.hero-poster-btn:active {
  transform: scale(0.97);
}

.admin-modal-poster {
  max-width: 640px;
  width: 90%;
}

.poster-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--ds-radius-pill);
  margin-bottom: 20px;
  border: 0.5px solid var(--separator);
}

.poster-tab-btn {
  flex: 1;
  height: 34px;
  border-radius: var(--ds-radius-pill);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.poster-tab-btn:hover {
  color: var(--text-primary);
}

.poster-tab-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
}

.poster-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.poster-preset-card {
  position: relative;
  border-radius: var(--ds-radius-inner);
  overflow: hidden;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.15s ease;
  aspect-ratio: 16 / 9;
}

.poster-preset-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.poster-preset-card.active {
  border-color: var(--tint, var(--ds-accent));
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.3);
}

.poster-preset-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-preset-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
  display: flex;
  align-items: flex-end;
  padding: 8px;
}

.poster-preset-label {
  font-size: 11px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.poster-preset-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--tint, var(--ds-accent));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
}

.poster-upload-dropzone {
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--ds-radius-inner);
  padding: 32px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.poster-upload-dropzone:hover,
.poster-upload-dropzone.dragover {
  border-color: var(--tint, var(--ds-accent));
  background: rgba(0, 113, 227, 0.14);
}

.poster-drop-text {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.poster-upload-preview-wrap {
  margin-top: 16px;
}

.poster-upload-preview-box {
  border-radius: var(--ds-radius-inner);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--separator);
}

.poster-upload-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-setting-row {
  margin-top: 12px;
}

.poster-preview-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 12px;
  border: 0.5px solid var(--separator);
}

.poster-thumb-preview {
  width: 96px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
  flex-shrink: 0;
  border: 0.5px solid rgba(255, 255, 255, 0.15);
}

.poster-preview-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.poster-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--separator);
  background: var(--surface);
  border-radius: 0 0 var(--ds-radius-card) var(--ds-radius-card);
}




/* ===================================================== The crew section (214a)

   THE PANE ALWAYS ON SCREEN: the rail/stage split, the department rail, the trade
   line and its contract tag. The two things this pane opens OVER itself — the
   enroll picker and the department manager — are `214e`, split off on the day this
   file crossed the 400-line budget, at the one seam in it that is a different
   surface rather than a different region of the same one.

   `220-admin-table.css` is still the table itself; this is the frame, the rail and
   the parts of a row that the old roster did not have.
*/

/* ------------------------------------------------- Modular split layout */
.crew-workspace-split {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 16px;
  overflow: visible;
}

/* THE RAIL APPEARS WHERE IT CAN BE PAID FOR, which is 1200px and not 900.
   At 1024 the 260px rail left the stage 699px wide: the filter row wrapped to a
   second line, the person column lost the width its trade line needs, and the
   roster — the thing this pane exists for — paid for all of it. Below 1200 the
   rail is `display:none` and the stage takes the whole pane, which is exactly the
   pane as it was before the rail existed. Nothing is disabled by that: the
   department filter is `#crewFilterDept` in the toolbar, which stays at every
   width. */
@media (min-width: 1200px) {
  .crew-workspace-split {
    flex-direction: row;
    overflow: hidden;
  }
}

/* ------------------------------------------------- Left Department Rail */
.crew-dept-rail {
  display: none;
}

@media (min-width: 1200px) {
  .crew-dept-rail {
    display: flex;
    flex-direction: column;
    width: 260px;
    flex: 0 0 260px;
    background: rgba(255, 255, 255, 0.02);
    border: 0.5px solid var(--separator);
    border-radius: var(--ds-radius-inner);
    padding: 10px 8px;
    gap: 4px;
    min-height: 0;
    max-height: 100%;
    /* It hugs its own content instead of stretching to the pane. A full-height
       rail whose list ends two-thirds of the way down was a 260×780 empty box on
       every shoot that has no contract types — the section that used to fill the
       bottom of it is hidden until somebody fills one in. */
    align-self: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.crew-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 8px horizontally, the same inset as a row's own padding: the section titles
     line up with the department names under them and the pencil lines up with
     the right edge the counts are pinned to. It was 6px on both counts, which
     left every header off by 2px against its own list. */
  padding: 4px 8px;
  min-height: 26px;
}

/* The list's one pencil. Quiet until it is wanted: tertiary at rest, white on
   its own 10% fill on hover, with the app's blue ring for keyboard focus. The
   icon is an inline Lucide path like every other icon in the console — a `✎`
   character is a font glyph that renders differently on every machine. */
.crew-rail-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-tertiary);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}

.crew-rail-edit:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.1); }

.crew-rail-edit:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
}

.crew-rail-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.crew-rail-list,
.crew-rail-contract-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.crew-rail-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
  box-sizing: border-box;
}

.crew-rail-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

/* `--accent-blue-text` rather than `--accent-blue`, and it is the token's own
   documented job: the 11–12px label on a blue tint is TEXT, and `#0A84FF` measures
   4.15:1 there where `#409CFF` measures 5.35:1. Same pairing as the QR badge. */
.crew-rail-item.is-active {
  background: rgba(0, 113, 227, 0.14);
  color: var(--ds-link-on-dark);
  font-weight: 600;
}

.crew-rail-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

.crew-rail-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.crew-rail-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  min-width: 22px;
  text-align: center;
  border-radius: var(--ds-radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  box-sizing: border-box;
}

.crew-rail-item.is-active .crew-rail-badge {
  background: rgba(0, 113, 227, 0.18);
  color: var(--ds-link-on-dark);
}

.crew-rail-divider {
  height: 0.5px;
  background: var(--separator);
  margin: 6px 2px;
}

/* ------------------------------------------------- Right Stage (Table Area) */
.crew-main-stage {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0;
}

@media (min-width: 900px) {
  .crew-main-stage {
    overflow: hidden;
  }
}

#module-crew > .admin-scroll,
.crew-main-stage > .admin-scroll {
  flex: 1 1 auto;
  min-height: 160px;
}

/* ------------------------------------------------- Contract & Payment Badges */
.crew-contract-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 6px;
  vertical-align: middle;
}

/* The three tints are the palette's own green/fuchsia/amber, not a second set of
   saturated hexes: `#34D399`, `#FBBF24` and the fuchsia already had tokens, and a
   tag that reads "Vendor" must be the same amber as every other amber in the app. */
.crew-contract-tag.is-alta {
  background: var(--green-bg);
  color: var(--green);
  border: 0.5px solid var(--green-border);
}

.crew-contract-tag.is-autonomo {
  background: rgba(223, 115, 223, 0.14);
  color: var(--fuchsia);
  border: 0.5px solid var(--fuchsia-border);
}

.crew-contract-tag.is-vendor {
  background: rgba(245, 166, 35, 0.14);
  color: var(--amber);
  border: 0.5px solid rgba(245, 166, 35, 0.35);
}

.crew-contract-tag.is-other {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
}

/* THE TRADE LINE TRUNCATES, THE TAG DOES NOT.
   `.admin-crew-meta` used to live in `220-admin-table.css` as one truncating
   `nowrap` span. It is a row now — trade · contract tag — with exactly one child
   allowed to ellipsis, so a long "Agent Photographer · PROD COMPANY / VISITING
   CREW" gives way instead of carrying the tag off the end of the cell. It moved
   here rather than growing `220`, which is on a line budget, and it moved
   whole: no rule in that file declares `.admin-crew-meta` any more. */
.admin-crew-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11px;
  color: var(--text-tertiary);
}

.admin-crew-meta-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 899px) {
  #module-crew .admin-panel-head {
    padding: 12px 14px;
    gap: 10px;
  }

  #module-crew .admin-panel-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  #module-crew .admin-panel-actions .admin-btn {
    flex: 1 1 auto;
    min-height: 36px;
    justify-content: center;
    white-space: nowrap;
  }

  #module-crew #crewScroll {
    overflow-x: visible;
  }

  #module-crew .admin-legend {
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 10px 14px;
  }
}
/* ============================================ The roster's own chrome (214b)

   WHAT IS LEFT OF THE ROSTER'S CHROME AFTER THE SHARED HALF MOVED OUT. The
   toolbar, the counters and the bulk bar are no longer here — they are the same
   three strips the documents pane draws, and they live in
   `214d-admin-pane-strips.css`, which is their one home. Their measured budgets
   are there too, both panes side by side.

   WHAT REMAINS IS THE PART THAT IS ONLY THE ROSTER'S: the controls that go INSIDE
   those strips — the four tiers as shapes, the kind buttons, the department select
   and its Apply, and the "grouped by department" toggle — plus the tier picker
   popover and the group header rows. None of it has a documents equivalent, and
   none of it should: a documents grid has no tiers and no departments of its own.

   `214a-admin-crew.css` is still the pane underneath — its scroll floor and the
   folded enroll drawer. This file is everything the roster put on top of it. */

/* `.crew-filter-check` WAS HERE AND IS DELETED, not by a spring clean: its only
   markup was `#crewFilterDays`, which duplicated the "N people with days
   unanswered" chip in the counters strip. Nothing draws the class now, and a rule
   nothing draws is a rule the next person edits by mistake — the same reasoning
   `200-admin-core.css` gives where `.admin-crumb` was removed. */

/* ------------------------------------------------- Controls inside the bulk bar

   Everything below sits in the shared `.crew-bulk-group` (214d) and is the
   roster's own answer to "what can be set for a selection": a tier, a kind, or a
   department. */

/* The four tiers as shapes, one tap each. Deliberately NOT a `<select>`: a select
   fires `change` on every arrow key, so an operator reading the options with the
   keyboard would apply a different access level at each step. */
.crew-tier-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.crew-tier-pick:hover { background: rgba(255, 255, 255, 0.14); }
.crew-tier-pick:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 1px; }

.crew-kind-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 9px;
  border: none;
  border-radius: var(--ds-radius-pill);
  background: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.crew-kind-pick:hover { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.crew-kind-pick:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 1px; }

/* A department list is long enough that a row of buttons would not fit, and
   unlike the tiers there is no shape to recognise one by — so there is nothing
   for a one-tap control to trade against the risk of an accidental change, and
   this one keeps a select and its own Apply.

   THE DAY SELECT TAKES THE SAME TREATMENT for the same reason — a shoot's days
   are as numerous as it runs and have no shape to recognise — so the two share
   one rule rather than two that would drift. */
.crew-bulk-dept,
.crew-bulk-day {
  max-width: 170px;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

/* `#crewGroupToggle.is-active` WAS HERE and went with the toggle: grouping by
   department is the roster's only view now, so a pressed state for it would be a
   lit button that can never be unlit. */

/* ------------------------------------------------- The tier button on a row

   The tier dot, promoted from a mark to a button. `.tier-dot-indicator` already
   carries the shape-and-colour vocabulary (circle / triangle / square / diamond),
   so the control says what it sets without a word — the same gesture the door
   board's person card offers. */
.crew-tier-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.crew-tier-btn:hover { background: rgba(255, 255, 255, 0.10); }
.crew-tier-btn:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 1px; }

/* ------------------------------------------------- The tier picker

   `position: fixed` and placed from the trigger's own rect, because both the
   roster and the pane clip: `.admin-crew-who` is `overflow: hidden` and the
   scroll box is `overflow: auto`, so an absolutely-positioned popover inside the
   row would be cut off by one or the other. It closes on scroll for the same
   reason — a fixed box cannot follow a row that is scrolling under it, and a
   picker pointing at the wrong person is worse than one that shut.

   Under the modal scrim's `z-index: 100` on purpose: a sheet is the more
   important thing on screen. */
.crew-tier-pop {
  position: fixed;
  z-index: 60;
  min-width: 190px;
  padding: 8px;
  border-radius: var(--ds-radius-inner);
  background: var(--surface-elevated);
  border: 0.5px solid var(--separator-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.crew-tier-pop-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.crew-tier-pop-item:hover { background: rgba(255, 255, 255, 0.08); }
.crew-tier-pop-item.is-current { background: rgba(255, 255, 255, 0.12); font-weight: 600; }

.crew-tier-pop-hint {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.crew-tier-pop-sep {
  height: 0.5px;
  margin: 6px 4px;
  background: var(--separator);
}

/* ------------------------------------------------- Department groups

   A full-width row inside `.admin-crew` that deliberately does NOT carry
   `.admin-crew-row` — the documents grid shares that class, and a group header
   has no meaning there. `min-width: max-content` on the container keeps it as
   wide as the widest row, so the header's bar spans the whole scroll width
   rather than stopping at the fold. */
/* THE DEPARTMENT BAND. It used to be the same near-black as the table head with
   a secondary-grey name — with every row in the roster grouped, the band is the
   only thing separating one department from the next and it has to be read at a
   glance, so it takes a surface a step above the rows, a white name and the count
   in a pill of its own. Nothing louder than that: the roster is a work surface
   and the bands are structure, not headings to admire. */
.crew-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  position: sticky;
  left: 0;
  background: var(--surface-elevated);
  border-bottom: 0.5px solid var(--separator-strong);
}

.crew-group-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFFFFF;
}

.crew-group-count {
  padding: 1px 8px;
  border-radius: var(--ds-radius-pill);
  background: rgba(255, 255, 255, 0.07);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------- Left Rail & Client Groups */
/* `.crew-rail-header-actions` WAS HERE and went with its only button: the rail's
   `Manage` moved to the pane header, because the rail is `display:none` below
   1200px and that made the department manager unreachable on a narrow laptop. */
.crew-rail-section-header { padding: 10px 6px 3px; display: flex; align-items: center; justify-content: space-between; }
.crew-rail-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-tertiary); display: inline-flex; align-items: center; gap: 6px;
}

/* Standout Client & Agency Box.

   The blue here is the palette's own (`--blue`, `--blue-bg`, `--blue-border`) and
   not a fourth set of Tailwind slate/sky hexes. The 5px dot also lost its
   `box-shadow: 0 0 6px` halo: a zero-offset glow on a dot is decoration that reads
   as a lit LED, and this is a label. */
.crew-rail-client-box {
  background: var(--blue-bg);
  border: 0.5px solid var(--blue-border);
  border-radius: var(--ds-radius-inner);
  padding: 4px;
  margin-bottom: 8px;
}
.crew-rail-client-header { display: flex; align-items: center; justify-content: space-between; padding: 3px 6px 4px; }
.crew-rail-client-title {
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--blue); display: inline-flex; align-items: center; gap: 5px;
}
.crew-rail-client-icon { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-blue); display: inline-block; }
.crew-rail-client-tag-top {
  font-size: 8px; font-weight: 700; letter-spacing: 0.06em; padding: 1px 4px; border-radius: 3px;
  background: rgba(0, 113, 227, 0.14); color: var(--ds-link-on-dark); border: 0.5px solid var(--blue-border);
}
.crew-rail-item.is-client { color: var(--text-primary); }
.crew-rail-item.is-client:hover { background: var(--blue-bg); color: var(--text-primary); }
.crew-rail-item.is-client .crew-rail-badge { background: rgba(0, 113, 227, 0.18); color: var(--ds-link-on-dark); font-weight: 700; }

/* `.crew-client-tag` AND `.crew-rail-item-edit` WERE HERE AND ARE DELETED.
   The client pill repeated the box's own frame on every row; the per-row pencil
   is now the one pencil in the rail header (`214a`). Their markup is gone, and a
   rule nothing draws is a rule the next person edits by mistake. */
/* ======================================== The Documents pane's chrome (214c)

   A NEW NUMBER RATHER THAN ANOTHER LETTER ON `214b`, and the reason is the
   one `214a`'s own header gives: CSS resolves same-specificity rules by SOURCE
   ORDER, so a part that jumped the sequence would land on the wrong side of
   `215-admin-hub.css` without ever saying so. `214c` sits between the crew
   chrome and the hub, which is where it belongs.

   WHY IT IS NOT SIMPLY ADDED TO `214b`: the crew's chrome and the documents'
   chrome are two surfaces that change for different reasons — the same argument
   `214a`/`214b` were split on.

   WHAT IS IN HERE. The documents pane's OWN rules and the controls that live
   INSIDE the shared strips and have no crew equivalent — the state select that
   is inert until a document is chosen, the three answer buttons, the rule group's
   two selects, and the "no documents can be set in bulk" note. The strips
   themselves (toolbar, counters, bulk bar) are `214d-admin-pane-strips.css`,
   which is SHARED WITH THE ROSTER and holds both panes' measured budgets — read
   that file rather than a number here. The rules themselves are a sheet now, and
   how it looks is `224`.

   THE SPLIT WAS MADE ON THAT SEAM AND NOT ON A LINE COUNT, which is worth saying
   because a line count is what forced it: this file crossed 400 lines, and the
   alternative to splitting was a grandfather entry reading "this is a big file",
   which teaches the next reader nothing.

   THE FOLDED RULES BLOCK USED TO LIVE HERE, and its three shapes are worth
   keeping as history rather than deleting. First it was an always-open
   `.admin-panel-body`, and because `.admin-panel-body` and `.admin-scroll` share
   `flex: 1 1 0` in `212-admin-workspace.css` it split the frame 50/50 with the
   grid — measured at 1280x800 on 26 people and 55 chips: 255px of rules over
   227px of grid. Then it was a `<details>` row, 38px shut and bounded to 40% of
   the pane when open, with the same 160px floor under the grid. On 2026-11-15 it
   became a sheet opened from the header (`173-doc-rules.js`, styled in `224`),
   which costs the pane nothing in either state. The floor rule below is kept
   because the grid is still the region that takes the leftover height. */

/* THE GRID'S FLOOR. The pane is a frame around the grid, and the grid is what
   this pane is FOR, so it keeps a minimum whatever the chrome above it does.
   Scoped to the pane because `#module-documents` is the one section whose region
   list has changed shape three times; nothing else needs the floor. Below 900px
   neither is a flex item and the floor is inert. */
#module-documents > .admin-scroll {
  min-height: 160px;
}

/* ------------------------------------- The documents' own controls in the strips

   Everything below sits inside the SHARED strips (`214d`) and is the documents
   grid's own answer to "what can be set for a selection". Nothing here has a
   roster equivalent, which is why it did not travel with the strips. */

/* The state select is inert until a document is chosen, and it must LOOK inert:
   the pair is the point of this row, and a control that silently matches every
   column reads as a filter that does not work. `fillDocFilters` sets the real
   `disabled`; this only makes it legible. */
.doc-toolbar .doc-filter:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* The three answers as one tap each, carrying the grid's own glyphs so the meaning
   does not depend on reading the label. Deliberately NOT a `<select>`: a select
   fires `change` on every arrow key, so an operator reading the options with the
   keyboard would apply a different answer at each step. The roster reaches the
   same conclusion for its tiers, in `214b`. */
.doc-bulk-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: none;
  border-radius: var(--ds-radius-pill);
  background: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.doc-bulk-state:hover { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.doc-bulk-state:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 1px; }

.doc-bulk-doc,
.doc-bulk-scope,
.doc-bulk-answer {
  max-width: 200px;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

/* The document picker in the FIRST group is the one the three answers apply to, so
   it gets the room; the rule group's two selects share what is left. */
.doc-bulkbar > .doc-bulk-group:first-of-type .doc-bulk-doc { max-width: 240px; }

/* Shown instead of the picker when a shoot has no bulk-writable document at all —
   i.e. one whose only document is the NDA, which is per person and refused by the
   server (`db/bulk.py`). A control that cannot be used must say why rather than
   simply not being drawn. */
.doc-bulk-note {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ---------------------------------------- has this person been sent their link?

   THE COUNT ON THE STRIP ABOVE SAYS HOW MANY; THIS SAYS WHICH ONES. "133 people
   sent their link" is only actionable if you can find them in the grid, and until
   this existed the only way was to tap the strip's chip and read the filtered list
   — which tells you the same number back. A per-row mark is what lets an operator
   scan the grid and see who is already holding a link and who is not.

   BLUE, NOT AMBER, AND THAT IS THE SAME RULE THE STRIP'S CHIPS FOLLOW: "sent" is a
   neutral fact about a hand-off, not something needing action. Amber on this pane is
   reserved for the three counts that mean somebody has to do something.

   `.doc-meta-line` EXISTS ONLY HERE. `.admin-crew-meta` does its ellipsis inside a
   flex column, and the roster shares that rule — so the row is a flex line built in
   the documents grid rather than a change to the shared class, which would restripe
   and re-truncate the roster's rows as a side effect of a documents feature.
   `min-width: 0` on both is what keeps a long meta ellipsising instead of pushing
   the mark off the edge.

   THE MARK IS ON THE META LINE AND NOT BESIDE THE NAME, and that was measured rather
   than chosen. The `who` cell is a fixed 248px and its name gets whatever the tick,
   the tier dot and this chip leave; put the chip on the name line and `Adrià Masnou`
   renders as `Adria Masn…` on every marked row — the documents grid losing surnames
   the roster next door still shows, for a status fact. On the meta line the chip
   costs the row NOTHING: it is 15px in a 17px line, so the row stays 53px and the
   grid's scrollHeight is unchanged (measured, 1417px either way). */
.doc-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.doc-meta-line .admin-crew-meta { min-width: 0; }

.doc-sent-mark {
  flex: 0 0 auto;
  /* A FIXED 13px BOX, AND IT IS A MEASUREMENT RATHER THAN A STYLE CHOICE.
     `.admin-crew-meta` is 11px type in a 13px line box and this chip is its SIBLING
     in a flex line, so the line is as tall as the taller of the two: a 15px chip took
     the documents rows from 53px to 55px, and 14px still cost 1 (measured —
     `#projDocsTable` scrollHeight 1417 -> 1425 -> 1421 against the 13px original).
     Padding and a font-size alone could not land on 13 (`1.5px` rounds to 2 and gives
     14), so the height is stated and `box-sizing` makes the border part of it. Re-run
     the same measurement if the font or the height changes. */
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  height: 13px;
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(0, 113, 227, 0.14);
  color: var(--ds-link-on-dark);
  border: 0.5px solid var(--blue-border);
  white-space: nowrap;
}
/* ============================== The shared pane chrome (214d)

   THE TOOLBAR, THE COUNTERS AND THE BULK BAR, WRITTEN ONCE FOR BOTH PANES.

   These three strips were built twice — once for the crew roster (`214b`) and once
   for the documents grid (`214c`) — and the second copy was byte-identical to the
   first in **seventeen rules**. That is the shape this project keeps paying for: a
   rule stated in two places is a rule that will disagree with itself, and nothing
   notices when it does. So they are one run now, and this file is its one home.

   EVERY RULE HERE NAMES ITS TWO CLIENTS IN THE SELECTOR, and that is a deliberate
   choice against the obvious alternative. The alternative is to invent one class
   (`.pane-toolbar`) and add it to both panes' markup, so a rule names nobody and
   the reader has to go and find out who carries the class. Naming both panes
   costs a second selector line per rule and buys two things: `grep crew-toolbar`
   finds the rule that styles it, and a third pane is added by appending a name to
   the list rather than by discovering which of two classes actually matters. On a
   codebase edited by machine as much as by hand that is the better trade — the
   failure mode is loud (a pane renders unstyled, the design audit sees it) where
   the failure of a class nobody carries is a silent no-op. It was also the change
   that left the two panes' markup and all six of their JS parts untouched, which
   matters: the crew pane is live and was hand-verified this week.
   `[hidden]` is the case that shows the cost plainly, below.

   WHAT IS NOT HERE is anything only one pane has. The crew's tier picker, kind
   picker, department select and group headers are `214b`; the documents' state
   select, answer buttons and result-set selects are `214c`. This file is only the
   part that is genuinely the same.

   THE ONE THING THE MERGE CHANGED: `.crew-pick` did not carry `cursor: pointer`
   and `.doc-pick` did. They are the same control — a `<label>` wrapping a
   checkbox — so the unified rule has it and the crew's pick label gained a pointer
   cursor. Measured as a no-op on geometry; stated rather than slipped in, because
   "unify the two so they agree" is exactly the move that has bitten this project
   before. */

/* ------------------------------------------------- The toolbar

   THE SAME BUDGET IN BOTH PANES, and every number below is small because of it.
   Each pane gives its grid the leftover height, so chrome added above the table
   comes straight out of the table's box — and both panes have already lost that
   fight once: the roster gave the enroll drawer 570px of itself and squeezed the
   rows to zero (`214a`), and the documents grid lost half its frame to the rules
   block (`214c`).

   MEASURED AT 1280x800 on the sandbox shoot, per pane, and these are the numbers
   to re-take if either strip grows:

     crew:       pane 654px -> toolbar 57px + counters 45px, roster box 340px
                 against the roster's 160px floor.
     documents:  RE-TAKEN 2026-11-15 at 1440x900 on a 14-person shoot with six
                 documents in play: pane 770px -> header 66px + folded rule
                 summary 32px + toolbar 53px + the people row 45px + footer
                 49px, grid 523px against the same floor. Opened, the rules block
                 is capped at 40% (307px) and the grid keeps 248px. The reference-links sheet
                 is a modal and costs the frame nothing.
                 THE ROW BEFORE THIS ONE, for the record: 654px -> folded rules
                 37 + toolbar 57 + five KPI cards 94 + footer 57, grid 292 — and
                 with both of that pane's inline disclosures open the grid fell to
                 its 160px floor with 560px of strip above it. The KPI cards, the
                 quick-send bar and the links fold were the three that went; the
                 first two are now one 42px row and the third is a sheet.

   THE DOCUMENTS ROW WAS RE-TAKEN ON 2026-10-11, the day the pane was redesigned,
   and again on 2026-11-15 when the KPI cards went. Before the first: folded rules
   38 + toolbar 57 + a row of five counter chips 45 + a strip of per-document chips
   117, grid 222. The redesign replaced that first row with KPI cards (141px
   stacked, 94px as a row) and moved the per-document chips INSIDE the fold, where
   they cost 37px closed instead of 123px always. Net that day: the grid went
   222 -> 292. The cards then measured 88px to print three numbers — the counter
   set had been cut from five to three, so the five-column grid also left two
   empty tracks — and on 2026-11-15 they became chips in a 45px row shared with the
   two bulk sends, which is the row above. The pane stays exactly one viewport
   tall in every state (`document.scrollHeight == clientHeight`), which is the
   property the floor and the bound are jointly for.

   THE COUNTERS FIGURE IS THE ONE TO WATCH. `.doc-stats` is shared with the
   roster, whose chips are short; the documents strip's read "Ficha informativa de
   riesgos laborales en proyectos audiovisuales · 26 people undecided", and five
   of those wrap to three rows. That is why the pair above is a measured pair
   rather than one figure with a note — and it is why the documents' counters now
   sit inside a block that is allowed to scroll.

   MEASURED ON 2026-10-11, the day the two panes' chrome became one, on the
   synthetic sandbox at 1280x800 (26 people, every registered document in play).
   The roster box has been written down as 344px since 2026-10-10 on a different
   shoot, and both numbers are real: the handful of pixels between them is the
   shoot, not this merge. The merge was proven not to move either pane by diffing
   the computed style and geometry of **every one of the 421 chrome elements in
   both panes** before and after it, to zero differences — and then mutating a
   shared rule and watching BOTH panes move, because byte-identity alone can also
   mean the new rules are dead and the old path is still doing the work. Re-take
   these if either strip grows rather than reasoning about them.

   THE TWO COUNTER STRIPS ARE NOT THE SAME HEIGHT AND THAT IS NOT A BUG — though
   since 2026-11-15 they are much closer. The roster's chips read "6 with no
   access level"; the documents' people chips read "14 need a nudge". Both are
   short and both are one row. The strip that is still allowed to wrap is the
   per-document one, whose chips read "Ficha informativa de riesgos laborales en
   proyectos audiovisuales · 26 people undecided" — and that is why it lives
   inside the rules block, where it is allowed to scroll: the name is the only
   thing telling two of them apart and the two `riesgos` documents truncate to
   the same string.

   The filters WRAP rather than scrolling sideways: this is a desktop-first console
   and a horizontally scrolling filter row hides the control you want behind the
   edge of a pane nobody thinks to swipe. */
.crew-toolbar,
.doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 0.5px solid var(--separator);
  background: rgba(255, 255, 255, 0.02);
}

/* Desktop keeps the toolbar as one flat flex row; mobile collapses the
   selects under a toggle so the roster starts near the top of the phone. */
.crew-toolbar-top,
.crew-toolbar-filters,
.doc-toolbar-top,
.doc-toolbar-filters {
  display: contents;
}

.crew-filter-toggle,
.doc-filter-toggle {
  display: none;
}

/* THE HEIGHT IS OVERRIDDEN DELIBERATELY, AND THE FONT SIZE IS NOT.
   `.admin-search` (`200-admin-core.css`) is a 48px box with a `16px !important`
   font, and the `!important` is not decoration: an input under 16px makes iOS
   Safari zoom the whole viewport on focus, which on a console used at the door is
   a bug you cannot scroll your way out of. But 48px is the door board's search
   field, and in a filter row whose selects are 32px it made the roster's toolbar
   **69px tall against the 52px it is budgeted for** — measured, and 17px straight
   out of the roster's box on a pane that has already been squeezed to zero once.
   Capping the height here and leaving the font alone keeps the anti-zoom behaviour
   and takes the row back. Scoped to each toolbar: `.admin-search` is shared with
   the directory picker below and with the door board, and a shared rule changed
   for one surface is a bug on the other. */
.crew-toolbar .crew-filter-search,
.doc-toolbar .doc-filter-search {
  flex: 1 1 180px;
  min-width: 140px;
  height: 36px;
  min-height: 36px;
  border-radius: var(--ds-radius-inner);
}

.crew-toolbar .crew-filter,
.doc-toolbar .doc-filter {
  flex: 0 1 auto;
  max-width: 190px;
  min-height: 32px;
  padding: 0 8px;
  /* `!important` because `.form-select` (`050-modals.css`) declares 17px with
     one, which is the anti-zoom rule for iOS text FIELDS. It never applied to a
     select — selects do not zoom — and without this the 12.5px line above has
     been dead since it was written: a 32px control rendering 17px type. */
  font-size: 12.5px !important;
}

/* ------------------------------------------------- The counters

   Each chip is a FILTER. A number an operator cannot act on is decoration, and
   the numbers these strips exist for — how many people have no access level, how
   many have a day nobody has answered, how many have not answered for a given
   document — are exactly the ones you want to see the list of.

   `:empty` hides the strip, so a shoot with nothing to report (everybody tiered,
   every day answered) does not carry 37px of empty chrome above its roster. */
.crew-stats,
.doc-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-bottom: 0.5px solid var(--separator);
}

.crew-stats:empty,
.doc-stats:empty { display: none; }

/* ------------------------------------------------- The chip

   ONE CHIP, FOR BOTH PANES, AND THIS IS THE APPROVED SURFACE: a borderless tonal
   block at 8px radius. It replaced two species that had drifted apart — the
   roster's bordered 999px capsule and the documents' tonal block — because an
   operator reading two counters side by side should not have to work out whether
   they are the same kind of control. They are: a number, its own tap, and a zero
   that is not a control. The roster's was the one the crew asked to lose.

   `is-gap` is what keeps a count honest: amber means "something needs doing". A
   completed shoot is a fact, not a warning, so `is-good` is green and nothing
   else in the strip is coloured. `is-active` is the accent, the same blue the
   pane's own selected chips use.

   A CHIP IS 30px TALL, which is also why the roster's counter strip and the
   documents' people row are the same height. Do not set a height per pane — the
   two rows are compared at a glance all day. */
.crew-stat,
.doc-stat {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--separator);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.crew-stat:hover,
.doc-stat:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--separator-strong); color: #ffffff; }

.crew-stat.is-gap,
.doc-stat.is-gap { background: rgba(255, 255, 255, 0.04); border-color: rgba(245, 166, 35, 0.28); color: var(--amber); }
.crew-stat.is-gap:hover,
.doc-stat.is-gap:hover { background: rgba(245, 166, 35, 0.10); color: var(--amber); }

.crew-stat.is-good,
.doc-stat.is-good { background: rgba(255, 255, 255, 0.04); border-color: rgba(50, 199, 102, 0.28); color: var(--green); }
.crew-stat.is-good:hover,
.doc-stat.is-good:hover { background: rgba(50, 199, 102, 0.10); color: var(--green); }

.crew-stat.is-active,
.doc-stat.is-active { background: #ffffff; border-color: #ffffff; color: #000000; }

.crew-stat.is-plain,
.doc-stat.is-plain { cursor: default; background: transparent; border-color: transparent; color: var(--text-secondary); }
.crew-stat.is-plain:hover,
.doc-stat.is-plain:hover { background: transparent; border-color: transparent; color: var(--text-secondary); }

/* ------------------------------------------------- The bulk bar

   Drawn only while something is ticked. It REPLACES the toolbar rather than
   stacking under it — see `renderCrewBulkBar` and `renderDocBulkBar` — so neither
   pane ever pays for both at once. That is why both `[hidden]` pairs below exist:
   a bare `display: flex` beats the attribute's own `display: none`, so a "hidden"
   toolbar would keep drawing and the pane would be carrying two rows of chrome for
   a job the operator is only doing one of. THIS IS THE RULE THAT WOULD HAVE ROTTED
   THE FASTEST under a shared class: the attribute selector has to be written
   against each pane's own name, because `[hidden]` on the strip is what carries
   the state. */
.crew-bulkbar,
.doc-bulkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--separator-strong);
  background: var(--surface-elevated);
}

.crew-bulkbar[hidden],
.doc-bulkbar[hidden] { display: none; }

.crew-toolbar[hidden],
.doc-toolbar[hidden] { display: none; }

.crew-bulk-count,
.doc-bulk-count {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

/* One field per group, so "Access" reads as a unit rather than as five loose
   buttons beside "Kind". A hairline border and a small-caps label are enough —
   anything heavier turns a working strip into a second toolbar. */
.crew-bulk-group {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 0.5px solid var(--separator-strong);
  border-radius: 9px;
}

.doc-bulk-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.crew-bulk-label,
.doc-bulk-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.crew-bulk-actions,
.doc-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* ------------------------------------------------- Ticking a row

   THE BOX IS A CHILD OF `.admin-crew-who`, NOT A COLUMN OF ITS OWN, and that is a
   layout decision rather than a shortcut. That cell is `position: sticky; left: 0`
   with a fixed 248px basis, and `.admin-crew-row` is shared by both grids — a
   leading column would move the sticky edge for both and change every row's
   geometry as a side effect. As a child of `who` it costs nothing.

   `flex: 0 0 auto` so the box never shrinks under the name it sits beside — the
   same treatment a tier dot gets. */
.crew-pick,
.doc-pick {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin-right: 2px;
  cursor: pointer;
}

.crew-pick input,
.doc-pick input { accent-color: var(--accent-blue); cursor: pointer; }

/* The "nothing here" line, in both panes — a filtered-to-nothing table needs a
   different sentence from an empty shoot, or an operator reads their own filter as
   data loss. */
.crew-none,
.doc-none {
  padding: 18px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
/* cache bust */
/* ============================== The crew pane's context windows (214e)

   THE ENROLL PICKER AND THE DEPARTMENT MANAGER — the two things the Crew pane
   opens OVER itself. They are a part of their own rather than more of `214a`
   for the reason `214a` and `214b` were split: they change for a different
   reason (a row layout and a form, not the pane's frame), and `214a` crossed the
   400-line budget the day the rail landed. The seam is the `aside`/stage split
   above it, which is also the seam between "always on screen" and "opened on
   demand".

   WHAT IS DELIBERATELY NOT HERE: the modal shell itself. `.modal-card`,
   `.modal-scrim`, the header and the body are `050-modals.css` and these two
   only widen them, which is why every selector below carries
   `.admin-modal-enroll` or `.admin-modal-dept-manage` rather than re-styling a
   shared class. */

/* ------------------------------------------------- Unified Context Window & Modals */
/* Harmonized size & centered position on desktop/tablet (>= 600px) across all
   crew modals (Departments, Enroll, New Person, Edit Member). On mobile (< 600px),
   `240-admin-rest.css` makes every `.admin-modal-card` a full-bleed bottom sheet. */
@media (min-width: 600px) {
  .admin-modal-card.admin-modal-enroll,
  .admin-modal-card.admin-modal-dept-manage,
  #newPersonModal .admin-modal-card,
  #memberModal .admin-modal-card,
  #docRulesModal .admin-modal-card,
  #docLinksModal .admin-modal-card {
    width: 720px;
    max-width: min(720px, calc(100vw - 40px));
  }
}

.modal-card-header-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-card-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
}

.crew-enroll-search-wrap {
  margin-bottom: 12px;
}

.crew-enroll-search-wrap .admin-search {
  width: 100%;
}

.admin-modal-enroll .admin-picker-list {
  max-height: 420px;
  overflow-y: auto;
  border: 0.5px solid var(--separator);
  border-radius: var(--ds-radius-inner);
  background: rgba(0, 0, 0, 0.25);
}

.admin-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--separator);
  transition: background 0.12s ease;
}

.admin-picker-row:last-child {
  border-bottom: none;
}

.admin-picker-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.admin-picker-row.is-on {
  opacity: 0.75;
}

.admin-picker-who {
  flex: 1 1 220px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-picker-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
}

.admin-picker-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-picker-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* THE COMPACT FIELD, AND WHY ITS FONT SIZE IS `!important`.
   `.form-input` and `.form-select` (`050-modals.css`) are 17px `!important` —
   that is the anti-zoom rule for iOS, and it applied here too: a 28px control
   rendering 17px text, which is why every department name longer than
   "PRODUCTION" was clipped in the enroll picker and the "PRODUCTION CREW"
   select read like a heading next to its 12px siblings. Same `!important`,
   later in the cascade, scoped to the compact control only — the guest fields
   keep their 17px. */
.form-select-tiny,
.form-input-tiny {
  height: 28px;
  font-size: 12px !important;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--surface-elevated);
  border: 0.5px solid var(--separator-strong);
  color: var(--text-primary);
}

/* `.form-input-tiny` did not exist, so the department-name fields in the
   manager fell through to `.form-input`: transparent, borderless and
   right-aligned. An editable name that looks exactly like a row heading is the
   one control here nobody would think to click. */
.form-input-tiny {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.form-select-tiny:focus,
.form-input-tiny:focus {
  outline: none;
  border-color: var(--ds-accent);
  box-shadow: var(--ds-focus-ring);
}

/* The rail's and the manager's own button size. `.admin-btn-tiny` was already on
   both surfaces' markup with nothing defining it, so they rendered at the base
   40px — taller than the 48px rail header could hold beside a 10.5px label.
   Defined here rather than in `200-admin-core.css` because these two are its only
   callers and that file is on a line budget. */
.admin-btn-tiny {
  min-height: 26px;
  padding: 0 8px;
  border-radius: var(--ds-radius-pill);
  font-size: 11px;
  font-weight: 600;
}

.crew-picker-dept {
  width: 170px;
  max-width: 170px;
  text-align: left;
}

.crew-picker-kind {
  width: 100px;
  max-width: 100px;
}

.crew-picker-contract {
  width: 135px;
  max-width: 135px;
}

.crew-enroll-footer-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 0.5px solid var(--separator);
}

.crew-enroll-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crew-enroll-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: var(--ds-radius-inner);
  background: rgba(255, 255, 255, 0.02);
  border: 0.5px solid var(--separator);
}

.crew-enroll-bulk-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.crew-bulk-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
}

/* ------------------------------------------------- Dept & Client Group Manager Modal */
.dept-create-box {
  padding: 12px 14px;
  border-radius: var(--ds-radius-inner);
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid var(--separator);
  margin-bottom: 16px;
}

.dept-box-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.dept-create-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dept-create-name { flex: 1 1 auto; }
/* `flex: 0 0` and not just `width`: `.form-select` is `flex: 1 1 auto`, so a
   width by itself is a starting point it immediately grows past. */
.dept-create-kind { flex: 0 0 180px; width: 180px; }

/* The one caption size in these two windows. It is the console's `--text-xs`,
   the same 11px every button and section caption in the app uses, written as a
   class because it was an inline `style="font-size:11px"` in two places. */
.crew-hint { font-size: var(--text-xs); line-height: 1.35; }

.dept-manage-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-text-secondary);
  margin-bottom: 8px;
}

.dept-manage-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.dept-manage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
  border: 1px solid var(--ds-separator-strong);
  transition: background-color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.dept-manage-item:hover {
  background: var(--ds-surface-elevated);
}

.dept-manage-name-input { flex: 1 1 auto; min-width: 140px; }
.dept-manage-kind-select { flex: 0 0 170px; width: 170px; }
.dept-manage-count {
  font-size: 11.5px;
  color: var(--text-tertiary);
  min-width: 60px;
  text-align: right;
}

.dept-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 0.5px solid var(--separator);
}

/* ------------------------------------------------- On a phone

   Both windows are two-column rows on a desktop and neither one fits a 393px
   sheet: measured in the manager, the create row left the name field 43px wide
   ("G|") while the 180px kind select and the Create button took the rest, and
   the list rows pushed "8 people" and Save clean off the card. Stack them
   instead — the name owns a full line, the select and its action share the next,
   which is the same bargain `.form-row` makes in `050-modals.css`. */
@media (max-width: 599px) {
  .dept-create-row,
  .dept-manage-item { flex-wrap: wrap; }

  .dept-create-name,
  .dept-manage-name-input { flex: 1 0 100%; }

  .dept-create-kind,
  .dept-manage-kind-select { flex: 1 1 auto; width: auto; }

  .dept-manage-count { text-align: left; }

  /* The enroll picker's row is who + four controls on one line on a desktop
     (455px of controls beside a 397px name block). Measured at 393px it was
     323px wide with 511px of content — every control on the right of the name
     was cut off the card. The name takes its own line and the controls wrap
     under it: department across the full width, then kind, pay type and Add. */
  .admin-picker-row { flex-wrap: wrap; gap: 8px; }
  .admin-picker-who { flex: 1 0 100%; min-width: 0; }
  .admin-picker-actions { flex-wrap: wrap; width: 100%; }
  .crew-picker-dept { flex: 1 1 100%; width: auto; max-width: none; }
  .crew-picker-kind,
  .crew-picker-contract { flex: 1 1 auto; width: auto; max-width: none; }

  /* The two bulk groups are `inline-flex`, so each one is as wide as its select
     wants to be and the pair ran off the right of the card — then wrapped, which
     is why "Add dept" and "Copy" were nowhere on a phone. One group per line. */
  .crew-enroll-bulk-group { flex: 1 1 100%; width: 100%; }
  .crew-enroll-bulk-group .form-select { flex: 1 1 auto; min-width: 0; }
}
/* ============================================================================
   THE HUB — the first page on the design-system layer
   ============================================================================

   Every rule below reads `--ds-*` and nothing else, which is what makes this the
   first page of the redesign rather than a third dialect. See
   `005-design-tokens.css` for the layer and for the rule about moving whole.

   WHY NEW CLASS NAMES RATHER THAN A RESTYLE OF `.admin-card`. That class, its
   grid, and `.admin-card-name` / `.admin-card-meta` are shared with the
   Projects, Documents and Links pages (`110-overview.js`, `170-docgrid.js`,
   `240-documents.js`, `180-links.js`). Restyling them here would redesign four
   pages as a side effect of touching one, and the side effect would be invisible
   until somebody opened the Projects page. `.hub-*` is new in this file, so the
   blast radius of an edit here is the Hub and only the Hub.

   THE ONE DELIBERATE DEVIATION FROM DESIGN.md, stated where it lives. §13.4
   describes a tool index as a "dense task" register and says to "fix the rhythm,
   flatten the styling, and drop the photography." This page keeps its
   photography, and the reasoning is about which register it actually is: the Hub
   is eight items, not Support's hundred-topic index, and §13.1 gives exactly
   this treatment — a card-led grid of product photography — to a page whose
   whole job is to be scanned by eye. §13.4's own text scopes its tile shadow to
   Support, so deviating from it here is following the document rather than
   fighting it.

   WHAT IS *NOT* KEPT FROM THE PROTOTYPE, and both were cut for the same reason
   (§2.11 forbids a glow and forbids depth drawn with a shadow):

     * the radial-gradient cursor spotlight on the card border, and
     * the hover LIFT (`translateY(-4px)` plus `--shadow-card-hover`).

   Hover keeps a transform-only response (§2.9) and a border change — a surface
   colour, which is how §5.5 says height is expressed. A card here is raised by
   being `--ds-surface` on `--ds-bg`, not by casting anything.
   ============================================================================ */

/* ------------------------------------------------------------------- the page */

/* The console's own `.admin-main` already supplies the gutter and the bottom
   padding, and `.admin-layout` its 1180px ceiling. Nothing here redeclares
   either — a second container width is how a page ends up one gutter different
   from every other page in the same console. */
.hub-main {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ------------------------------------------------------- the shoot status strip */

/* WHAT SHOOT AM I ON. Server-rendered, first thing in `main`, and absent between
   shoots rather than empty — `hub_status_html()` in `web/assets.py` returns "" and
   the whole element goes with it, so there is no shell here to render an empty
   state into. What that function may and may not say is documented there, and the
   short version is that every fact in this strip is one the server actually holds:
   no call time, because the app has none.

   A SURFACE STRIP, NOT A CARD. It is the same kind of thing as the bar above it —
   ambient context about WHERE the console is — so §5.5 applies and it is raised by
   being `--ds-surface` on `--ds-bg`, with one hairline where it meets the content.
   Nothing here casts a shadow, and nothing here is a link. */
.hub-status {
  padding: 12px 16px;
  border: 1px solid var(--ds-separator);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
}

/* THE ITEMS ARE SEPARATED BY SPACE AND NOTHING ELSE, and that was arrived at by
   looking rather than by preferring it.

   The first cut drew a `::before` dot on every item but the first. That is correct
   on one line and wrong the moment the strip wraps, which it does on every phone:
   a separator owned by an item travels with it, so the wrapped line opened on a
   bullet — "· 0 on set of 157 expected". A dot that leads a line is not a
   separator, it is a stray mark, and no arrangement of `::before`/`::after` on a
   wrapping flex row avoids it: whichever element carries the mark, the mark can
   end up first or last on a line. Whitespace cannot. So the four facts are held
   apart by the column gap, and the name — the only one at full contrast — is what
   the eye groups them around.

   The items are joined with a space in the served markup as well, so the line still
   reads as a sentence when the stylesheet has not loaded. Inside a flex container
   that whitespace is not rendered — a whitespace-only child is not a flex item —
   which is why the gap is what separates them here. */
.hub-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin: 0;
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  line-height: var(--ds-type-body-reduced-leading);
  letter-spacing: var(--ds-type-body-reduced-tracking);
  color: var(--ds-text-secondary);
}

/* EVERY OTHER STRING ON THIS PAGE IS WRITTEN IN THE TEMPLATE. These four are not:
   the shoot's name and its location are typed into the console by whoever is
   running the shoot, and nothing bounds their length. A flex item's automatic
   minimum size is its own `min-content` width, so one long unbroken word sets a
   floor the row cannot go below and the strip pushes the whole page wider than the
   phone — the failure `test_design_audit.py` catches at 393px, and one it only
   catches because that audit's shoot has a deliberately long name.

   `anywhere` rather than `break-word`, and the difference is the fix rather than
   the taste: only `anywhere` also applies to intrinsic sizing, so it is the one
   that lowers the floor instead of merely breaking the line after it has already
   overflowed. Ordinary spaces are still preferred over a mid-word break, so an
   everyday name breaks between its words as before. */
.hub-status-line > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* The shoot's name is the subject of the sentence, so it is the one part of the
   strip at full contrast. Not `<strong>`: this is not emphasis, it is what the
   other four facts are about. */
.hub-status-name {
  font-weight: 600;
  color: var(--ds-text-primary);
}

/* --------------------------------------------------------------------- hero */

.hub-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

/* §4.5's `headline` row — 48 / 40 / 32 across the two content breakpoints, with
   the tracking V-curve the tokens carry. `--ds-type-headline-*` is the whole
   reason the tokens exist as separate size/leading/tracking values: this rule
   names the role once and the three steps come from the media queries in
   `005-design-tokens.css`, with no magic number here to fall out of step. */
.hub-headline {
  margin: 0;
  font-family: var(--ds-font-display);
  font-size: var(--ds-type-headline-size);
  line-height: var(--ds-type-headline-leading);
  letter-spacing: var(--ds-type-headline-tracking);
  font-weight: var(--ds-type-headline-weight);
  color: var(--ds-text-primary);
}

.hub-subhead {
  margin: 0;
  max-width: 62ch;
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-size);
  line-height: var(--ds-type-body-leading);
  letter-spacing: var(--ds-type-body-tracking);
  color: var(--ds-text-secondary);
}

/* ------------------------------------------------------------------- search */

/* HIDDEN UNTIL THE SCRIPT REVEALS IT, and the `[hidden]` guard below is load
   bearing. An `<input>` with no script behind it is a control that takes typing
   and does nothing — which reads as a broken page, not as a page without
   JavaScript. The Hub's own principle is that it must not be the page that fails
   to render, and a promise it cannot keep is worse than an absent feature. */
.hub-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 440px;
  margin-top: 6px;
}

.hub-search[hidden] { display: none; }

.hub-search-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--ds-text-tertiary);
  pointer-events: none;
}

.hub-search-field {
  width: 100%;
  height: var(--ds-control-h);
  padding: 0 54px 0 40px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-size);
  letter-spacing: var(--ds-type-body-tracking);
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--ds-dur-fast) linear;
}

.hub-search-field::placeholder { color: var(--ds-text-tertiary); }

.hub-search-field:focus {
  outline: none;
  border-color: var(--ds-accent);
  box-shadow: var(--ds-focus-ring);
}

/* The ⌘K affordance. A `<kbd>` rather than a span because it is a key, and it is
   the only place in the app that documents a keyboard shortcut — sitting in the
   field, where the reader is already looking, rather than in a tooltip they would
   have to discover. */
.hub-search-kbd {
  position: absolute;
  right: 12px;
  padding: 3px 7px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: 6px;
  background: var(--ds-surface-elevated);
  color: var(--ds-text-tertiary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-caption-size);
  line-height: 1.2;
  pointer-events: none;
}

/* ------------------------------------------------------- the filter control */

.hub-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Same hiding rule and the same reason as `.hub-search` above. */
.hub-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hub-seg[hidden] { display: none; }

/* A PILL, NOT A SEGMENTED BAR WITH A SLIDING THUMB. §2.9 allows `transform` and
   `opacity`; a sliding thumb also needs a measured `width`/`translateX` per
   button, which is a second source of truth about the label's rendered size and
   goes wrong the first time a translation changes the text. Four independent
   pills have no such state, and `aria-pressed` already carries which one is on. */
.hub-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ds-control-h);
  padding: 0 18px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-text-secondary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  letter-spacing: var(--ds-type-body-reduced-tracking);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--ds-dur-fast) linear,
              color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.hub-seg-btn:hover {
  background: var(--ds-surface);
  color: var(--ds-text-primary);
}

/* THE PRESSED STATE IS THE ACCENT, and it is the only place on this page that
   colour says "you are here". §2.7/§2.11: one accent, and it means the thing you
   have selected. */
.hub-seg-btn[aria-pressed="true"] {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

.hub-seg-btn:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus-ring);
}

.hub-seg-count {
  font-size: var(--ds-type-caption-size);
  opacity: 0.7;
}

/* ---------------------------------------------------------------- the groups */

.hub-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* `[hidden]` CANNOT BE RELIED ON ONCE A RULE SETS `display`. The UA stylesheet
   gives `[hidden]` `display: none`, but any author rule with a `display` beats
   it — so `tile.hidden = true` in the script would be a no-op on a `display:
   flex` element, silently, and the filter would appear to do nothing. Every
   element the Hub's script hides gets its own guard here. Two of them exist
   because two of them are `display: flex`; the third (`.hub-seg`) and the
   search wrapper are guarded beside their own rules above. */
.hub-group[hidden] { display: none; }

/* UPPERCASE, SO THE TRACKING GOES POSITIVE. `--ds-type-caption-tracking` is
   -0.01em because §4.3's V-curve is measured for sentence case; at 12px in caps
   the letters collide, which is a real legibility defect and not a matter of
   taste. This is the one place on the page that overrides a scale token, and it
   overrides exactly one property. */
.hub-group-title {
  margin: 0;
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-caption-size);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-text-tertiary);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

/* ----------------------------------------------------------------- the tiles */

.hub-tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--ds-dur-ui) var(--ds-ease),
              border-color var(--ds-dur-fast) linear;
}

/* Transform only, per §2.9 — and it is `-2px` rather than the prototype's
   `-4px` because the prototype also cast a shadow on hover and this does not.
   Without the shadow, a 4px lift reads as the card coming loose from the grid. */
.hub-tile:hover {
  transform: translateY(-2px);
  border-color: var(--ds-accent);
}

.hub-tile:active { transform: scale(0.99); }

.hub-tile:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus-ring);
}

/* See the note on `.hub-group[hidden]` — this element is `display: flex` too. */
.hub-tile[hidden] { display: none; }

/* THE MEDIA WELL IS A FIXED HEIGHT, so the eight tiles form even rows whatever
   their photographs' aspect ratios are. `overflow: hidden` is what makes the
   hover zoom a crop rather than a bulge. */
.hub-tile-media {
  display: block;
  position: relative;
  height: 150px;
  overflow: hidden;
  background: var(--ds-surface-media);
  border-bottom: 1px solid var(--ds-separator);
}

.hub-tile-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* §2.9 again: the zoom is a transform, so it composites. A transition on
     `object-position` or on the frame's height would repaint every frame. */
  transition: transform var(--ds-dur-content) var(--ds-ease);
}

.hub-tile:hover .hub-tile-photo { transform: scale(1.04); }

.hub-tile-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 16px 16px;
}

.hub-tile-title {
  font-family: var(--ds-font-display);
  font-size: var(--ds-type-body-size);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ds-text-primary);
}

.hub-tile-meta {
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  line-height: var(--ds-type-body-reduced-leading);
  letter-spacing: var(--ds-type-body-reduced-tracking);
  color: var(--ds-text-secondary);
}

/* Shown by the script when a search or a filter leaves nothing, and never
   otherwise. Static markup in the page like every other group head — the script
   toggles the attribute, it does not build the element. */
.hub-empty {
  padding: 40px 0;
  text-align: center;
}

.hub-empty[hidden] { display: none; }

.hub-empty-title {
  margin: 0 0 6px 0;
  font-family: var(--ds-font-display);
  font-size: var(--ds-type-body-size);
  font-weight: 600;
  color: var(--ds-text-primary);
}

.hub-empty-desc {
  margin: 0;
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  color: var(--ds-text-secondary);
}

/* ------------------------------------------------------------------ responsive */

/* TWO TO A ROW ON A PHONE, and this is the fix the page already had rather than
   a new opinion. At 390px the shell is ~366px wide, and `auto-fill` with a 290px
   floor can only fit ONE column — which is the eight-tall-cards problem that made
   the scanner unreachable in the first place. `repeat(2, 1fr)` gives each tile
   ~177px.

   The media well drops to 112px with it: at 177px wide a 150px well is nearly
   square, and a nearly-square crop of a 16:9 photograph throws away most of the
   picture and shows a texture instead of a subject. */
@media (max-width: 720px) {
  .hub-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hub-tile-media { height: 112px; }
  .hub-tile-body { padding: 10px 12px 12px 12px; gap: 2px; }
  .hub-tile-title { font-size: var(--ds-type-body-reduced-size); }
  .hub-tile-meta { font-size: var(--ds-type-caption-size); }
  .hub-main { gap: 22px; }
  .hub-search { max-width: 100%; }
  /* The strip wraps to two or three lines at this width, so the 16px gutter it
     keeps on a desktop is 4px of dead space on each side of every line. */
  .hub-status { padding: 10px 12px; }
}

/* The tile's photo zoom is a hover affordance and a phone has no hover: on touch
   it fires on tap, so the picture is still moving when the navigation starts.
   `prefers-reduced-motion` is the other half of the same rule, and §6.1 makes it
   a requirement rather than a courtesy. */
@media (hover: none), (prefers-reduced-motion: reduce) {
  .hub-tile { transition: border-color var(--ds-dur-fast) linear; }
  .hub-tile:hover { transform: none; }
  .hub-tile-photo { transition: none; }
  .hub-tile:hover .hub-tile-photo { transform: none; }
}
/* ============================================ The shoot page's own furniture

   Three things that belong together because they are about the shoot RATHER
   than about any one of its sections: the way back to the project list, the row
   of module cards that is this page's only navigation, and the settings face the
   banner's gear opens.

   WHY THERE ARE CARDS HERE AT ALL, one commit after a strip of poster cards was
   deleted from this page. The strip was on EVERY view and cost 246px of each of
   them. These are on ONE view, under a banner, on a page that already scrolls
   inside itself — and they replace a settings column that was capped at 720px
   on a 1552px page and left the other half of the width empty. Same idea, the
   right size, and the pills are still what a section switches with.

   THE FILE IS 216 AND SORTS AFTER THE HUB because the parts manifest is load
   order and 215 is taken. Nothing here collides with the hub: every selector is
   a class that did not exist before it. */

/* ------------------------------------------------------------- The module row

   `auto-fit` rather than a fixed five columns, so the row reflows instead of
   overflowing — but THE FLOOR IS A MEASUREMENT RATHER THAN A TASTE, and 155 is
   the number the shoot's cover needs to fit the window it is drawn in.

   At 900px — the width the fixed shell switches on at — the pane is 846px
   across. Five cards and four 12px gaps want `5f + 48 <= 846`, so anything above
   159 splits the row and drops the fifth card onto a second line. That costs
   140px of height on the ONE page that has to be a single screenful, and it is
   the difference between the cover fitting and the pane scrolling to its own
   last card. Measured after the change: the row is one line at every width the
   shell is active at, 900 through 1600.

   `1fr` is the other half and does the opposite job: five cards in 1498px are
   five 290px cards, not five 155px ones with a gap where a sixth would be. */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  margin: 0 0 18px 0;
}

.module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 118px;
  /* NO PADDING ON THE CARD ITSELF, because the photograph is full-bleed: the
     media takes the card's whole width and the corners are rounded by the
     card's own `overflow: hidden` rather than by the image being inset. The
     text keeps its padding on `.module-card-body`, which is the only thing
     that wanted it. */
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-separator-strong);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--ds-dur-ui) var(--ds-ease),
              border-color var(--ds-dur-fast) linear;
}

/* THE PHOTOGRAPH IS THE TOP OF THE CARD, AT A HEIGHT AND NOT A SHARE.

   IT WAS `flex: 1` FOR ONE ROUND AND THAT WAS WRONG IN A WAY A MEASUREMENT AT
   ONE WINDOW SIZE CANNOT SEE. Stretched by the grid, the picture took every
   pixel the card had left over — so a 1600x900 window measured 164 and a
   1600x1200 window produced 284, and the section cards became the biggest thing
   on a page whose subject is the shoot. A number does not do that.

   `height` IS NOT OPTIONAL HERE, AND IT IS NOT THE `height: auto` MISTAKE THE
   POSTER MADE. With no height and `flex-basis: auto`, a flex item's base size
   is its CONTENT — and this one's content is an `<img>` at `height: 100%` of an
   auto-height parent, which resolves to the image's own size. That is a card
   carrying a photo as tall as the card is wide.

   `min-height` is the floor, because a picture squeezed to a sliver reads as a
   broken image rather than as a design, and `object-fit: cover` because the
   five sources are landscape photographs of five different shapes going into
   one card shape. `background` rather than nothing: these are 340-530KB JPEGs,
   and a card briefly empty in the right colour is a card that is loading. */
.module-card-media {
  position: relative;
  display: block;
  height: 96px;
  flex: 0 0 auto;
  min-height: 74px;
  background: var(--ds-surface-media);
  border-bottom: 1px solid var(--ds-separator);
  overflow: hidden;
}

.module-card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--ds-dur-content) var(--ds-ease);
}

.module-card:hover .module-card-img { transform: scale(1.04); }

/* The text block: the icon, the name and the live figure, exactly as they were
   before the photograph arrived. `margin-top: auto` on the figure still pins it
   to the bottom, so five cards whose names wrap to one, two and three lines
   still line their figures up. */
.module-card-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 0 0 auto;
  padding: 12px 15px 13px;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
}

.module-card:active { transform: scale(0.99); }

/* These are `<button>`s, so they get none of a link's affordances for free and
   the browser's focus ring is the only keyboard signal there is. It is stated
   rather than left to the UA because `border-radius` clips the default ring into
   something that reads as a rendering fault. */
.module-card:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus-ring);
}

.module-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--separator);
  color: var(--text-primary);
}

.module-card-label {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #ffffff;
}

/* `margin-top: auto` pins the figure to the bottom, so five cards whose names
   wrap to one, two and three lines still line their figures up — the same
   argument the deleted `.strip-card-stat` made, and it held there too. */
.module-card-stat {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-secondary);
}

/* IT SITS ON THE PHOTOGRAPH NOW, so it needs a ground — the same dark blur
   scrim `.hero-icon-btn` and `.hero-poster-btn` use, and for the same reason:
   a translucent WHITE ground over a picture reads as a hole in it. It was a
   bare grey chevron on a flat card, which is a thing you can only do when the
   thing behind it is a known colour. */
.module-card-arrow {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--ds-radius-pill);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.85);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.module-card:hover .module-card-arrow {
  transform: translateX(3px);
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
}

/* ------------------------------------------------------- The banner's faces

   `[hidden]` IS NOT ENOUGH ON ITS OWN, and that is the whole reason these two
   rules exist rather than being left to the UA. The browser's own
   `[hidden] { display: none }` is an author-origin declaration at UA
   specificity, so ANY class rule that sets `display` outranks it and the
   attribute then hides nothing at all while reading as though it does. Neither
   face sets `display` today — which is why these are belt-and-braces today, and
   exactly why they are written down: the first person to give `.hero-settings`
   a `display: flex` for its rows is the person who needs to know. */
.hero-banner[hidden],
.hero-settings[hidden] {
  display: none;
}

.hero-settings {
  padding: 18px 22px 22px;
}

.hero-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid var(--separator);
}

.hero-settings-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.hero-settings-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 15px;
  border-radius: var(--ds-radius-pill);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hero-settings-done:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.36);
}

/* THE FORM USES THE WIDTH IT IS GIVEN, which is the whole reason it moved in
   here. As a 720px column under the cards it left 830px of a 1552px page empty;
   behind the gear it gets the full 1552 and reads as two columns of fields with
   the poster spanning both. Below 900px it is one column, as it was. */
@media (min-width: 900px) {
  .hero-settings .form-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }

  .hero-settings .poster-setting-row {
    grid-column: 1 / -1;
  }
}

/* ------------------------------------------------------------- The gear button

   The sibling of `.hero-poster-btn` in `213-admin-poster.css` and stylistically
   the same object — a dark blur scrim over the shoot's photograph, because a
   translucent WHITE ground reads as a hole in an image. It is here rather than
   beside that rule because it belongs to the face it opens. */
.hero-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--ds-radius-pill);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  cursor: pointer;
  /* `.hero-floating-badges` is `pointer-events: none` so the poster underneath
     stays draggable; every control in it has to opt back in. */
  pointer-events: auto;
  position: relative;
  z-index: 10;
  transition: all 0.15s ease;
}

.hero-icon-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.hero-icon-btn:active {
  transform: scale(0.97);
}

/* The countdown, the poster button and the gear as ONE cluster, so the
   countdown stays beside the right-hand edge. They used to be three siblings of
   the live badge under `justify-content: space-between`, which spread them
   across the whole row and left the countdown floating in the middle of the
   photograph once there were three of them. */
.hero-badge-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ------------------------------------------------- The way back to the list

   IT WAS A `.admin-crumb` AND IT SHOULD NOT HAVE BEEN ONE. Eleven pixels,
   tertiary grey, the word "Projects" and a slash — the only route out of a
   shoot, styled as the least important thing on a page whose every other
   control edits that shoot. Reported as "not obvious", which was generous.

   A button now, above the shoot's name, because that is the order you read
   them in: where you can go, then where you are. */
.admin-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px 0 11px;
  margin-bottom: 12px;
  border-radius: var(--ds-radius-pill);
  background: rgba(255, 255, 255, 0.07);
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-back-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}
/* ==================================================== The shoot's cover

   The hero slate and nothing else: the poster, the three badges pinned over it,
   the client and title block, and the four-number metrics bar under them.

   IT IS ITS OWN FILE BECAUSE IT IS ONE COMPONENT, and because the cover has a
   rule no other part of the page has — it absorbs whatever height the pane has
   left over, so that the shoot page is one screenful at any desktop window size.
   That rule and the four that decide how much there is to absorb (the media
   queries below, the poster's own height, the module row's floor over in
   `216-admin-modules.css`) have to be read together or not at all.

   The shoot's settings are this slate's SECOND FACE — the gear in its corner
   swaps the two — and the panel that swaps in is styled in `216-admin-modules.css`
   with the rest of the furniture, because it is a form rather than part of the
   cover. */

/* ------------------------------------------------------------- Master Hero Slate */
.hero-landing-card {
  position: relative;
  border-radius: var(--ds-radius-card);
  background: var(--surface);
  border: 0.5px solid var(--separator);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.hero-slate-media {
  position: relative;
  height: 250px;
  background: var(--ds-surface-media);
  overflow: hidden;
}

.hero-slate-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
  pointer-events: none;
}

.hero-slate-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(22, 22, 23, 0.95) 90%, var(--surface) 100%);
  pointer-events: none;
}

.hero-floating-badges {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
  pointer-events: none;
}

.hero-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: var(--ds-radius-pill);
  background: rgba(22, 22, 23, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 0.5px solid var(--green-border);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-live-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.hero-countdown-pill {
  padding: 5px 14px;
  border-radius: var(--ds-radius-pill);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-slate-info {
  position: absolute;
  bottom: 18px;
  left: 24px;
  right: 24px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-client-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.hero-client-tag {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-link-on-dark);
}

.hero-production-co {
  color: rgba(255, 255, 255, 0.7);
}

.hero-project-name {
  font-size: clamp(22px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-metrics-bar {
  padding: 18px 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  background: var(--surface);
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

/* FOUR METRICS ACROSS DO NOT FIT IN 846px, which is the pane at the narrowest
   width the fixed shell is active at. The sub-lines ("18 passes provisioned",
   "Across 22 departments") are what run out of room, and 900 was measured
   against them rather than chosen.

   IT WAS 899 FOR ONE COMMIT AND CAME BACK, and the reason is worth keeping. At
   exactly 900 the shell's `min-width: 900px` and this rule's `max-width: 900`
   both apply, so the metrics wrap on the one width where the cover also has to
   fit a window — and the cover overflowed there by 92px, with the module row
   split across two lines. Lowering the row's floor to 155 fixed that BY ITSELF.
   A mutation that put this rule back to 900 then survived the whole gate,
   because there was nothing left for it to break — and an ungated rule is one
   the next person deletes. So it is 900, the number the metrics need, and what
   holds the cover inside the pane is the floor in `216-admin-modules.css`. */
@media (max-width: 900px) {
  .hero-metrics-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .hero-metrics-bar {
    grid-template-columns: 1fr;
    padding: 14px 16px;
  }
  /* Three pills across a phone's 353px of badge row do not fit, and the row is
     `space-between` with no wrapping — so on a phone the badge, the countdown
     and the poster button used to sit on top of one another. Wrapping is the
     fix; the row is absolutely positioned, so growing it downward is free. */
  .hero-floating-badges {
    flex-wrap: wrap;
    gap: 8px;
  }
  .hero-slate-media {
    height: 210px;
  }
  .hero-slate-info {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}

.hero-metric-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.hero-metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-metric-value {
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The glyphs in the metric rows are inline `<svg>` in the template rather than
   `lucideIcon` output, so they are addressed as elements and not as `.ic`. */
.hero-metric-value svg { color: var(--text-tertiary); flex: 0 0 auto; }

.hero-metric-value > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-metric-sub {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------------------------------------- The cover fills the pane

   FROM 900px UP THE SHOOT PAGE IS ONE SCREENFUL AND THE SCREENFUL IS THE
   WINDOW. The shell bounds this pane by the height of the window (see
   `212-admin-workspace.css`), so a 250px poster, the metrics bar and the five
   cards came to about 580px of a pane that is 815 on a 900px-tall window — the
   cover sat in the top two thirds and the rest was empty panel. Measured: 237px
   of nothing at 1600x900.

   SOMETHING HAS TO ABSORB WHAT THE RULES ABOVE LEAVE, AND IT IS THE POSTER —
   but only the poster, and that took three tries to get right. It is worth
   writing down, because each attempt was defensible and the first two were
   wrong in ways that a measurement at ONE window size could not see.

   1. THE POSTER TOOK EVERYTHING. `flex: 1` on the media, the banner, the card,
      all the way up. Fine arithmetic, wrong page: at 900px tall it made the
      shoot's photograph 455 and the five section cards 118, so the one picture
      nobody has to read was the largest thing on a page about the shoot.

   2. THE CARDS TOOK EVERYTHING INSTEAD. `flex: 1` on `.module-grid` moved the
      slack to the section photographs — which measured a perfectly reasonable
      164px at 1600x900 and produced 284px on a 1600x1030 window, because a
      `flex: 1` grid row has no ceiling. A single-size measurement called it
      correct.

   3. THE POSTER TAKES EVERYTHING AGAIN, AND NOW THE CARDS CANNOT FOLLOW. The
      difference is not which element grows; it is that the other one no longer
      can. The section cards and their 96px pictures are FIXED SIZES in
      `216-admin-modules.css` — no `flex` at all — so the only thing left to
      absorb a tall window is the poster, at whatever height that window has
      to give it.

   THE LESSON IS ABOUT THE MEASUREMENT RATHER THAN THE FLEXBOX: "the cards take
   the slack" and "the poster takes the slack" measure the same at 900px tall
   and are different designs. Anything here that grows has to be checked at
   more than one window height, which is why 1030 and 1200 are now in the
   probe's own list.

   `height: auto` IS THE ONE THING THE POSTER MAY NOT BE. With
   `flex-basis: auto` an auto height resolves to the image's own size, so an
   early attempt at this measured a 935px poster; a definite `height` gives it
   a basis instead, and `flex: 1` grows from that basis. `min-height` is still
   the floor that keeps a short window honest — the cover reaches its smallest
   legible size and the pane scrolls, which is the correct degradation — and
   `overflow-y: auto` on the scroller still means what it says.

   BELOW 900px NONE OF THIS APPLIES. The page down there is the flowing document
   it has always been and "fill the window" is not a thing it can mean. */
@media (min-width: 900px) {
  .overview-scroll {
    display: flex;
    flex-direction: column;
  }

  .overview-scroll > .admin-toolbar,
  .hero-metrics-bar {
    flex: 0 0 auto;
  }

  .hero-landing-card { flex: 1 1 auto; min-height: 0; }

  .hero-banner {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  /* The settings face fills too, so that opening the gear does not change
     the card's height — the panel is the tall thing then, and the module row below
     stays where it was. */
  .hero-settings { flex: 1 1 auto; }

  /* THE POSTER IS THE ONLY THING ON THIS PAGE THAT STRETCHES. `height: 300px`
     is what it is when there is nothing spare to give it; `flex: 1 1 auto`
     above a 200px floor is what it does when there is. Every other element —
     the toolbar, the metrics bar, the section cards — is a fixed height, so
     this is where a tall window spends its height, and there is none left over
     at the foot of the page.

     THE TWO `flex: 1`s ABOVE ARE PART OF THIS ONE RULE. A media query cannot
     give a child free space its parent never had: with the card and the banner
     at `flex: 0 1 auto` they are content-height, the media's basis of 300 IS
     its height, and this declaration would do nothing at all. */
  .hero-slate-media {
    height: 300px;
    flex: 1 1 auto;
    min-height: 200px;
  }
}
/* ---------------------------------------------------------------- crew table */

/* Fixed name column, a day column per shoot day, then the row's actions. It is
   a flex row rather than a grid on purpose: a sticky grid item is constrained
   by its own grid area and cannot be pinned to the scrollport, whereas a sticky
   flex item's containing block is the whole (wide) row. */
.admin-crew { min-width: max-content; }

.admin-crew-head,
.admin-crew-row {
  display: flex;
  align-items: stretch;
}

.admin-crew-head {
  background: var(--surface-elevated);
  border-bottom: 0.5px solid var(--separator-strong);
  position: sticky;
  top: 0;
  z-index: 2;
}

.admin-crew-row {
  border-bottom: 0.5px solid var(--separator);
}

.admin-crew-row:last-child { border-bottom: none; }

.admin-crew-who {
  flex: 1 1 248px;
  max-width: 420px;
  /* min-width:0 defeats the flex item's automatic minimum size. Without it a
     long unbreakable name raises that minimum above the 248px basis, this cell
     grows to fit the name, and the row's day columns slide out of line with
     every other row — the ellipsis on .admin-crew-name never gets a chance to
     fire because the box it lives in grew to fit it. */
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  border-right: 0.5px solid var(--separator);
}

.admin-crew-head .admin-crew-who {
  background: var(--surface-elevated);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  z-index: 3;
}

.admin-crew-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-crew-name {
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-crew-days {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
}

/* Pinned so Remove is reachable without scrolling a sixty-day shoot to the
   end. Its background is the panel's, so the day buttons pass underneath it. */
.admin-crew-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px 12px;
  margin-left: auto;
  position: sticky;
  right: 0;
  background: var(--surface);
  border-left: 0.5px solid var(--separator);
}

.admin-crew-head .admin-crew-actions {
  background: var(--surface-elevated);
  border-left: none;
}

/* The tri-state. Three visually distinct states, because two of them are
   answers and the third is the absence of one — a checkbox could only ever
   show two, and would call every unanswered day a no. */
.admin-tri {
  width: 34px;
  min-width: 34px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 0.5px solid var(--separator);
  background: var(--surface-row);
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.admin-tri.is-yes {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
}

.admin-tri.is-no {
  background: rgba(255, 90, 95, 0.14);
  border-color: rgba(255, 90, 95, 0.4);
  color: var(--coral);
}

.admin-tri.is-none {
  background: transparent;
  border-style: dashed;
  color: var(--ds-text-on-dark-tertiary);
}

.admin-tri:disabled { opacity: 0.5; }

.admin-tri-head {
  width: 34px;
  min-width: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.05;
}

.admin-tri-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.admin-tri-month {
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ---------------------------------------------------------------- documents */

/* The library. One card per document, and the card is deliberately NOT a link:
   the two things you can do to a document (edit its wording, retire it) are
   buttons, and everything else on it is a fact you read. The hover elevation
   every other `.admin-card` carries is cancelled for the same reason — a card
   that lifts under the cursor promises it will take you somewhere. */
.admin-docs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

/* Only the bottom margin goes. The heading's `margin-top` is what separates the
   list from the toolbar, exactly as it does over `.admin-groups` — a flex gap
   falls *between* children, so it never applied above the first one and there
   was nothing to collapse. The bottom margin is a different case: it would add
   to the container's 10px gap and put the heading twice as far from its own
   list as the rows sit from each other. */
.admin-docs .admin-group-title {
  margin-bottom: 0;
}

.admin-doc-card:hover,
.admin-doc-card:active,
.admin-doc-rule:hover,
.admin-doc-rule:active {
  background: var(--surface);
  border-color: var(--separator);
}

.admin-doc-card .admin-card-head,
.admin-doc-rule .admin-card-head {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.admin-doc-card .admin-card-meta,
.admin-doc-rule .admin-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* The slug is how a document is addressed in a manifest, in a URL and on disk,
   so it is shown beside the title rather than hidden behind it: the two are not
   always the same, and the slug is the one that has to match. */
.admin-doc-slug {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  padding: 2px 6px;
  flex: none;
}

.admin-doc-def {
  width: auto;
  min-width: 170px;
  padding: 6px 10px;
  font-size: 13px;
}

/* The summary and the "Create all links" button, kept together as one flex item
   so `.admin-panel-head`'s space-between still puts exactly two things on the
   line — the title, and this. Added as a third direct child it would spread the
   title, the count and the button evenly across the header instead. */
.admin-doc-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* The department and kind rules. Wrapping rather than scrolling: a shoot with
   twenty departments is a wall of chips either way, and a wall you can see the
   end of is one you can finish setting up. */
.admin-doc-rules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-doc-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.doc-rule-chip {
  font-family: inherit;
  cursor: pointer;
}

.doc-rule-chip.is-none { border-style: dashed; color: var(--ds-text-on-dark-tertiary); }

/* The documents grid. Same skeleton as the crew table — the person pinned left,
   the answers running right — with wider columns, because a cell has to say
   which document it belongs to and a tick the width of a tick labels nothing. */
.admin-doc-grid .admin-tri {
  width: 88px;
  min-width: 88px;
}

.admin-doc-col-head {
  width: 88px;
  min-width: 88px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  text-align: center;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: none;
  border: none;
  font-family: inherit;
}

.admin-doc-col-head.is-btn {
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.admin-doc-col-head.is-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

/* A read-only state still has to look like a state and not like a disabled
   button waiting to be enabled. It keeps the colours of its three siblings and
   only loses the border, so "the NDA answers this itself" reads as a fact
   rather than as something broken. */
.admin-tri.is-readonly {
  border-color: transparent;
  cursor: default;
}

.admin-tri.is-required {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
}

.admin-tri.is-not_required {
  background: rgba(255, 90, 95, 0.14);
  border-color: rgba(255, 90, 95, 0.4);
  color: var(--coral);
}

/* One person's signing links. High-craft, borderless tonal cards */
.admin-modal-links {
  max-width: 620px;
  width: 100%;
}

.admin-modal-links .admin-card {
  border: none;
  border-radius: var(--ds-radius-inner);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

.admin-modal-links .admin-card-unified {
  background: rgba(0, 113, 227, 0.14);
}

.admin-doc-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--ds-radius-inner);
  border: none;
  transition: background 0.15s ease;
}

.admin-doc-link-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.admin-doc-link-row:last-child {
  margin-bottom: 0;
}

.admin-doc-link-what {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 200px;
}

.admin-doc-link-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-doc-link-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-tertiary);
}

.admin-modal-links .modal-card-title {
  flex: 1;
  text-align: left;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------- picker */

.admin-picker-list {
  margin-top: 12px;
  border: 0.5px solid var(--separator);
  border-radius: var(--ds-radius-inner);
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
}

.admin-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--separator);
}

.admin-picker-row:last-child { border-bottom: none; }
.admin-picker-row.is-on { opacity: 0.62; }

.admin-picker-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-picker-name {
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
}

.admin-picker-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-picker-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.admin-picker-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
}

/* The person cell is the row's only elastic column; a phone has no slack, so it
   goes back to 248px, and under 480 that plus the pinned actions column is wider
   than the screen — measured at 393px, the actions sat ON the day cells. Both
   live in THIS file, at the END: `214a` loads first, and `.admin-crew-actions`
   is declared above these. */
@media (max-width: 899px) { .admin-crew-who { flex: 0 0 248px; max-width: none; } }
@media (max-width: 480px) { .admin-crew-actions { position: static; margin-left: 0; border-left: none; } }
/* ============================================ Crew Roster & Calls — Mobile (221)

   Mobile card layout, collapsible filter drawer, and bulk action bar for
   `#module-crew` (plus shared mobile toolbar/stats/bulk primitives) at <= 899px.
   Loaded after `220-admin-table.css` so its `@media (max-width: 899px)` rules
   override the desktop table geometry cleanly without touching desktop (>= 900px).
*/

/* Desktop keeps the table header's columns; mobile shows each day's date or
   document title inside its own tap tile so vertical scrolling never loses context. */
.crew-head-label-mobile,
.doc-head-label-mobile,
.admin-tri-day,
.admin-tri-doc {
  display: none;
}

.admin-tri-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 899px) {
  /* ------------------------------------------------- Toolbars & filter drawers */
  .crew-toolbar,
  .doc-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    gap: 8px;
  }

  .crew-toolbar-top,
  .doc-toolbar-top {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .crew-toolbar .crew-filter-search,
  .doc-toolbar .doc-filter-search {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    min-height: 38px;
  }

  .crew-filter-toggle,
  .doc-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .crew-toolbar.is-filters-open .crew-filter-toggle,
  .doc-toolbar.is-filters-open .doc-filter-toggle {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
  }

  .crew-filter-badge,
  .doc-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-accent);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
  }

  .crew-filter-badge[hidden],
  .doc-filter-badge[hidden] { display: none; }

  .crew-toolbar-filters,
  .doc-toolbar-filters {
    display: none;
    width: 100%;
  }

  .crew-toolbar.is-filters-open .crew-toolbar-filters,
  .doc-toolbar.is-filters-open .doc-toolbar-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 2px;
  }

  .crew-toolbar .crew-filter,
  .doc-toolbar .doc-filter,
  #crewInherit,
  #crewFilterClear,
  #docFilterClear {
    max-width: none;
    width: 100%;
    min-height: 36px;
  }

  #crewFilterDept,
  #docFilterDept {
    grid-column: 1 / -1;
  }

  /* ------------------------------------------------- Stats strips */
  #crewStats.crew-stats,
  #docSentStats.doc-stats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 14px;
    gap: 6px;
  }

  #crewStats.crew-stats::-webkit-scrollbar,
  #docSentStats.doc-stats::-webkit-scrollbar { display: none; }

  #crewStats .crew-stat,
  #docSentStats .doc-stat {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 32px;
    padding: 0 11px;
  }

  /* ------------------------------------------------- Bulk action bars (shared) */
  #crewBulkBar.crew-bulkbar,
  #docBulkBar.doc-bulkbar {
    padding: 10px 14px;
    gap: 8px;
  }

  #crewBulkBar .crew-bulk-count,
  #docBulkBar .doc-bulk-count {
    flex: 1 1 auto;
    order: -2;
  }

  #crewBulkBar .crew-bulk-actions,
  #docBulkBar .doc-bulk-actions {
    margin-left: 0;
    order: -1;
  }

  #crewBulkBar .crew-bulk-actions .admin-btn,
  #docBulkBar .doc-bulk-actions .admin-btn {
    min-height: 32px;
    padding: 0 10px;
  }

  #crewBulkBar .crew-bulk-group,
  #docBulkBar .doc-bulk-group {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 6px;
  }

  /* Every <select> in both bulk bars MUST have min-width: 0 so long option text
     ellipsises inside the box instead of pushing the chevron or sibling buttons
     off-screen. */
  #crewBulkBar .form-select,
  #docBulkBar .form-select {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    height: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #crewBulkBar .crew-tier-pick { width: 36px; height: 36px; }
  #crewBulkBar .crew-kind-pick { min-height: 36px; padding: 4px 8px; }

  #crewBulkBar .crew-bulk-group-day {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  #crewBulkBar .crew-bulk-group-day .crew-bulk-day { grid-column: 1 / -1; }

  #crewBulkBar .crew-bulk-group-dept {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  #crewBulkBar .crew-bulk-group-dept .admin-btn {
    min-height: 36px;
    padding: 0 12px;
  }

  /* ------------------------------------------------- Crew person cards (#crewTable) */
  #crewTable.admin-crew { min-width: 0; width: 100%; }
  #crewTable .crew-head-label-desktop { display: none; }
  #crewTable .crew-head-label-mobile { display: inline; }
  #crewTable .admin-crew-head { position: static; padding: 0; }
  #crewTable .admin-crew-head .admin-crew-who {
    flex: 1 1 auto;
    position: static;
    border-right: none;
    padding: 8px 14px;
    min-height: 40px;
  }
  #crewTable .admin-crew-head .admin-crew-days,
  #crewTable .admin-crew-head .admin-crew-actions { display: none; }
  #crewTable .crew-group { position: static; padding: 8px 14px; gap: 8px; }

  #crewTable .admin-crew-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "who actions" "days days";
    gap: 10px;
    padding: 12px 14px;
    align-items: start;
  }

  #crewTable .admin-crew-who {
    grid-area: who;
    position: static;
    flex: none;
    max-width: none;
    width: 100%;
    padding: 0;
    border-right: none;
    background: transparent;
    gap: 8px;
    align-items: flex-start;
  }

  #crewTable .crew-pick {
    min-width: 30px;
    min-height: 36px;
    justify-content: center;
    margin-right: 0;
  }

  #crewTable .crew-tier-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
  }

  #crewTable .admin-crew-id { padding-top: 1px; }
  #crewTable .admin-crew-name { font-size: 15px; line-height: 1.25; white-space: normal; }
  #crewTable .admin-crew-meta { flex-wrap: wrap; font-size: 12px; gap: 4px 6px; }
  #crewTable .admin-crew-meta-text { white-space: normal; }

  #crewTable .admin-crew-actions {
    grid-area: actions;
    position: static;
    margin-left: 0;
    border-left: none;
    background: transparent;
    padding: 0;
    gap: 6px;
  }

  #crewTable .admin-crew-actions .admin-btn { min-height: 34px; padding: 0 10px; font-size: 12px; }
  #crewTable .admin-crew-days { grid-area: days; padding: 2px 0 0 0; display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }

  #crewTable .admin-tri {
    width: auto;
    min-width: 48px;
    height: 48px;
    padding: 5px 9px;
    flex-direction: column;
    gap: 3px;
    border-radius: var(--ds-radius-inner);
  }

  #crewTable .admin-tri-day {
    display: flex;
    align-items: baseline;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    opacity: 0.85;
  }
}
/* ============================================ Signable Documents — Mobile (222)

   Mobile card layout, quick-sends grid, and bulk action bar for
   `#module-documents` at <= 899px. Loaded right after `221-admin-crew-mobile.css`.
*/

@media (max-width: 899px) {
  #module-documents .admin-panel-head {
    padding: 12px 14px;
    gap: 10px;
  }

  #module-documents .admin-doc-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  #module-documents .admin-doc-head-actions > button {
    min-height: 36px;
    justify-content: center;
    white-space: nowrap;
  }

  #module-documents #projDocsScroll { overflow-x: visible; }

  #module-documents .admin-legend {
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 10px 14px;
  }

  #module-documents .doc-people-row {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
  }
  #module-documents #docSentStats.doc-stats {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  #module-documents .doc-people-row .doc-quick-sends {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    margin-left: 0;
    padding: 0 14px 8px;
  }

  #module-documents .doc-people-row .doc-quick-sends .admin-btn {
    min-width: 0;
    min-height: 36px;
    padding: 5px 8px;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
    justify-content: center;
  }

  /* ------------------------------------------------- Documents bulk bar */
  #docBulkBar .doc-bulk-group-portal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  #docBulkBar .doc-bulk-group-portal .doc-bulk-label { grid-column: 1 / -1; }

  #docBulkBar .doc-bulk-group-portal .admin-btn {
    min-width: 0;
    min-height: 36px;
    justify-content: center;
    padding: 0 8px;
  }

  #docBulkBar .doc-bulk-group-states {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #docBulkBar .doc-bulk-group-states .doc-bulk-label { grid-column: 1 / -1; }

  #docBulkBar .doc-bulk-state {
    min-width: 0;
    min-height: 38px;
    padding: 4px 6px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    font-size: 11.5px;
    text-align: center;
  }

  #docBulkBar .doc-bulk-state .admin-tri {
    width: 22px;
    min-width: 22px;
    height: 22px;
    border-radius: 8px;
  }

  #docBulkBar .doc-bulk-group-rule {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  #docBulkBar .doc-bulk-group-rule .doc-bulk-label,
  #docBulkBar .doc-bulk-group-rule .doc-bulk-doc,
  #docBulkBar .doc-bulk-group-rule .doc-bulk-scope {
    grid-column: 1 / -1;
  }

  #docBulkBar .doc-bulk-group-rule .admin-btn {
    min-height: 36px;
    padding: 0 12px;
    white-space: nowrap;
  }

  /* ------------------------------------------------- Documents person cards */
  #projDocsTable.admin-crew { min-width: 0; width: 100%; }
  #projDocsTable .doc-head-label-desktop { display: none; }
  #projDocsTable .doc-head-label-mobile { display: inline; }
  #projDocsTable .admin-crew-head { position: static; padding: 0; }
  #projDocsTable .admin-crew-head .admin-crew-who {
    flex: 1 1 auto;
    position: static;
    border-right: none;
    padding: 8px 14px;
    min-height: 40px;
  }
  #projDocsTable .admin-crew-head .admin-crew-days,
  #projDocsTable .admin-crew-head .admin-crew-actions { display: none; }

  #projDocsTable .admin-crew-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "who" "days" "actions";
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
  }

  #projDocsTable .admin-crew-who {
    grid-area: who;
    position: static;
    flex: none;
    max-width: none;
    width: 100%;
    padding: 0;
    border-right: none;
    background: transparent;
    gap: 8px;
    align-items: flex-start;
  }

  #projDocsTable .doc-pick {
    min-width: 30px;
    min-height: 36px;
    justify-content: center;
    margin-right: 0;
  }

  #projDocsTable .crew-tier-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
  }

  #projDocsTable .admin-crew-id { padding-top: 1px; }
  #projDocsTable .admin-crew-name { font-size: 15px; line-height: 1.25; white-space: normal; }
  #projDocsTable .doc-meta-line { flex-wrap: wrap; font-size: 12px; gap: 4px 6px; }
  #projDocsTable .admin-crew-meta { white-space: normal; }

  #projDocsTable .admin-crew-actions {
    grid-area: actions;
    position: static;
    margin-left: 0;
    border-left: none;
    background: transparent;
    padding: 0;
    gap: 6px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  #projDocsTable .admin-crew-actions .admin-btn { min-height: 34px; padding: 0 10px; font-size: 12px; }
  #projDocsTable .admin-crew-days { grid-area: days; padding: 2px 0 0 0; display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }

  #projDocsTable .admin-tri {
    width: auto;
    min-width: 96px;
    max-width: 100%;
    height: 48px;
    padding: 5px 9px;
    flex-direction: column;
    gap: 3px;
    border-radius: var(--ds-radius-inner);
  }

  #projDocsTable .admin-tri-doc {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.1;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.9;
  }
}
/* ============================== The Documents pane, as a surface (224)

   THE THIRD NUMBER FOR THIS PANE, AND IT IS NOT A THIRD COPY. `214c` is the
   pane's own chrome (the rules sheet and the floor under the grid),
   `214d` is the strips it SHARES with the roster, and `220` is the grid skeleton
   it shares with the crew table. All three are structure. This file is only
   how the pane LOOKS: the tonal card surface the redesign was drawn on.

   WHY IT SITS AT 224 AND NOT AT 214e. It overrides `220-admin-table.css` —
   `.admin-crew-row`, `.admin-crew-who`, `.admin-crew-actions` — and CSS resolves
   same-specificity rules by SOURCE ORDER, so a part placed before `220` would
   lose every one of those and read as though it had not been written. `220` is
   the last file that styles this grid, so this is the first number after it.
   `.claude/rules/assets.md` has the general form of that rule; the survey that
   produced this placement was `grep -n 'admin-crew-row\|admin-tri\|doc-stat'
   230-admin-directory.css 240-admin-rest.css`, which is empty.

   WHAT IT DOES NOT TOUCH, deliberately:

     * `.admin-crew-row` OUTSIDE `.admin-doc-grid`. The roster shares the row,
       the sticky name cell and the actions cell, and the crew pane is live —
       every rule below is scoped to the documents grid so a documents redesign
       cannot restripe the roster as a side effect.
     * THE PANEL FOOT. `test_design_audit.py` asserts the legend is ONE ROW by
       comparing its children's vertical centres, and a footer that grew a
       border or a line of padding pays for itself out of the grid. Left alone.
     * THE BULK BAR AND THE TOOLBAR. Both are paired `crew-x, doc-x` rules in
       `214d`, and a documents-only override there is exactly the seam that file
       exists to close. They are already the padded tonal row the redesign drew.

   THE TOKENS ARE LOCAL AND NAMED `--doc-*`. `--ds-*` is the console's
   design-system layer (`005-design-tokens.css`) and is migrated component by
   component; this pane is not on it, and adding a page's colours to that layer
   is how a layer stops meaning anything. These three values sit inside the
   palette ramp `000-base.css` already publishes (`--surface` #16171B,
   `--surface-elevated` #1F2128, `--surface-row` #242630), so a card, its hover
   and the row it sits in stay on one ladder. */
#module-documents {
  --doc-card: var(--surface);
  --doc-hover: var(--surface-elevated);
  --doc-edge: rgba(255, 255, 255, 0.07);
}

/* ------------------------------------------- The pane's own header actions

   The gear that opens the rules block. The `<details>` summary is still
   clickable — that is the element's own behaviour and nothing here removes it —
   so this is a SECOND way to the same place, which is the one thing in the
   redesign that is deliberately redundant: the summary sits directly under the
   header and reads as a sentence, and an operator looking for "where do I set
   which documents this shoot wants" looks in the header first. It is a
   `<button>` and not a link because it moves a block inside a page that is
   already loaded. */
.doc-rules-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: none;
  /* The chip's surface and radius (`214d`): a tonal block, not a bordered
     capsule. A header button and the counters under it are the same control
     vocabulary at two sizes. */
  border-radius: 8px;
  background: var(--surface-elevated);
  color: #ffffff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease;
}

.doc-rules-toggle:hover { background: var(--surface-row); }
.doc-rules-toggle:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.doc-rules-toggle .ic { opacity: 0.75; }

/* ------------------------------------------- The people row: counts + sends

   THE KPI CARDS ARE GONE, AND THIS IS THE REPLACEMENT RATHER THAN A SHRINK. Three
   counts stacked figure-over-label-over-note-over-badge measured 88px to say
   "14", "14" and "0"; the roster one pane over says the same kind of thing in a
   28px chip row. This pane's grid pays for every pixel above it, so the counts
   are chips and the row is the roster's.

   THE FIVE-COLUMN GRID WAS ALSO WRONG BY THE TIME IT WAS MEASURED: the counter
   set had already been cut from five to three (`sent` and `signed` merged into
   one, the two unreachable-contact counters dropped), so `repeat(5, 1fr)` drew
   three cards and left two empty tracks — a strip that reads as broken data at
   any width.

   THE ROW CARRIES THE TWO BULK SENDS, and that is what lets this be ONE row where
   the pane had a counters strip AND a quick-send bar. Both sends act on everyone
   the filters match, not on the ticks, so they must survive the bulk bar
   replacing the toolbar — and they belong beside the numbers that say whether
   pressing one will reach anybody. `#docSentStats` is `clear()`ed and redrawn by
   `renderDocPersonStats`, so the buttons are a sibling of the strip, never a
   child of it.

   `:empty` still does the work: a shoot with nobody crewed draws no chips, and
   `214d`'s `.doc-stats:empty` hides the strip inside the row without taking the
   sends with it. */
.doc-people-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 6px 16px;
  border-bottom: 0.5px solid var(--separator);
  /* It is chrome, not a region: it must not be the strip a short pane shrinks
     to pay for itself. `212` gives only the three named chrome rows
     `flex: 0 0 auto`, and this one is newer than that list. */
  flex: 0 0 auto;
}

.doc-people-row .doc-stats {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border-bottom: 0;
}

.doc-people-row .doc-quick-sends {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* The chip's tones — `is-gap`, `is-good` and `is-active` — are `214d`'s, because
   the roster's counters are the same chip. Nothing here restates them. */

/* -------------------------------------------------------- The rules sheet

   The rules are a window now (`173-doc-rules.js`), not a region of the pane. It
   is wider than the console's default 540px because a rule row is a select plus a
   wrap of department and kind chips, and at 540 the chips ran to four lines.
   Width, not height: the sheet scrolls its own body like every other one. */
.doc-rules-sheet {
  max-width: 760px;
}

.doc-rules-note {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.5;
}

/* The per-document counters sit at the top of the sheet and are still filters.
   `214d`'s strip carries the pane's border and inset padding, which belong to a
   row inside a pane rather than the first block of a sheet's body. */
#docRulesModal .doc-stats {
  padding: 0 0 14px;
  border-bottom: none;
}

/* -------------------------------------------------------- The rules drawer

   One card per document, on the surface the KPI cards use. The structure under
   it — the switch, the slug, the shoot default select, the department and kind
   chips — is `renderDocRules`' and is unchanged; this is the sheet it is drawn
   on. The register matters more here than anywhere else in the pane: this block
   is the one place an operator sets an answer that will apply to people they
   cannot see, so it is the one block allowed to be a wall of chips. */
.admin-doc-rules { gap: 10px; }

.admin-doc-rule {
  padding: 14px 16px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
  transition: background-color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.admin-doc-rule:hover,
.admin-doc-rule:active {
  background: var(--ds-surface-elevated);
  border-color: var(--ds-accent);
}

.doc-rule-more {
  margin-top: 8px;
}

.doc-rule-more-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ds-accent);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.doc-rule-more-summary::-webkit-details-marker { display: none; }

.doc-rule-more[open] .doc-rule-more-summary {
  margin-bottom: 8px;
}

/* ------------------------------------------------- The grid, as card rows

   THE ROWS BECAME CARDS, which is the other half of what the redesign drew:
   `.admin-crew-row` is a hairline-separated table row for the roster, and on
   this pane every row is a person you act on rather than a line in a list, so
   the row is a rounded box with air above and below it.

   THE STICKY CELLS FOLLOW THE CARD, and that is the whole difficulty of doing
   this to a shared row. `.admin-crew-who` is `position: sticky; left: 0` and
   `.admin-crew-actions` is `sticky; right: 0`; both carry their own opaque
   background and a hairline against the neighbouring cells, so a row that
   changed colour under them would show two rectangles sliding over a third. So
   the card's background is stated on all three, and the two hairlines are
   dropped — on a card, the seam is the card's own edge.

   `overflow: hidden` IS NOT USED TO CLIP THE CORNERS, and that is deliberate:
   it would make the row a scroll container, and a sticky child sticks to its
   nearest scroll ancestor — the 8px radius would take the pinned name column
   with it. The corners are not clipped; the cells' backgrounds match the card,
   which is what makes that invisible. */
.admin-doc-grid .admin-crew-row {
  margin: 3px 0;
  border: 0.5px solid var(--doc-edge);
  border-radius: var(--ds-radius-inner);
  background: var(--doc-card);
}

/* `220`'s `.admin-crew-row:last-child { border-bottom: none }` is the same
   specificity as the rule above and older, so it would take the bottom edge off
   the final card. Stated rather than left to source order. */
.admin-doc-grid .admin-crew-row:last-child {
  border-bottom: 0.5px solid var(--doc-edge);
}

.admin-doc-grid .admin-crew-row:hover { background: var(--doc-hover); }

.admin-doc-grid .admin-crew-who {
  background: var(--doc-card);
  border-right-color: transparent;
}

.admin-doc-grid .admin-crew-actions {
  background: var(--doc-card);
  border-left-color: transparent;
}

.admin-doc-grid .admin-crew-row:hover .admin-crew-who,
.admin-doc-grid .admin-crew-row:hover .admin-crew-actions {
  background: var(--doc-hover);
}

/* The column headings, on the card surface rather than on the table's. They are
   in the sticky head row, which keeps its own darker background (`220`) — this
   only takes the hairline off the wide document columns so the head reads as a
   line of labels over the cards rather than as the top of a table. */
.admin-doc-grid .admin-doc-col-head { text-align: center; }

/* The list sits inside the sheet's own body, so it keeps the card surface and
   loses the inline block's border and outer padding — the `.modal-card-body`
   already owns both. */
.doc-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.doc-links-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
}
.doc-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
  transition: background-color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}
.doc-link-row:hover {
  background: var(--ds-surface-elevated);
  border-color: var(--ds-accent);
}
/* The title keeps its line and the URL gives up the room: an operator scans this
   list by title, and a two-word title wrapping to two lines makes every row a
   different height over a link that is already ellipsised. */
.doc-link-label {
  flex: 0 0 auto;
  white-space: nowrap;
}
.doc-link-url {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--ds-accent);
  text-decoration: none;
}
.doc-link-url:hover { text-decoration: underline; }
/* TWO ROWS, NOT A WRAPPING FLEX LINE. In the sheet's 560px the old single-line
   form squeezed the title field to "Document title (e.g. PRL" and dropped the
   button onto a line of its own at the left — a form that wraps into the wrong
   reading order. Title pairs with the category, URL pairs with the button, and
   both inputs take the width the sheet has. */
.doc-links-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-links-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-links-row .admin-input { flex: 1 1 auto; min-width: 0; }
.doc-links-row .form-select { flex: 0 0 auto; }
.doc-links-row .admin-btn { flex: 0 0 auto; }

.doc-row-action,
.doc-bulk-portal-act {
  height: 28px;
  padding: 0 24px 0 8px;
  font-size: 12px;
  width: auto;
}

.doc-rules-section { margin-bottom: 16px; }
.doc-rules-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ds-ink-muted);
  margin-bottom: 8px;
}
.doc-rules-docs { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-rule-doc-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface);
  font-size: 13px;
  cursor: pointer;
}
.doc-rule-doc-pill.is-on { border-color: var(--ds-accent); }
.doc-rules-list { display: flex; flex-direction: column; gap: 6px; }
.doc-rule-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface);
  font-size: 13px;
}
.doc-rule-scope {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-row);
}
.doc-rule-scope.is-global { background: var(--ds-accent); color: #fff; }
.doc-rule-sentence { flex: 1 1 auto; min-width: 0; line-height: 1.4; }
.doc-rule-acts { flex: 0 0 auto; display: flex; gap: 6px; }
.doc-rule-builder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface);
  font-size: 13px;
}
.doc-rule-builder .form-select { width: auto; max-width: 220px; }
.doc-rule-global-chk { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }
/* ============================================================================
   DOCUMENTS LIBRARY & FIELD PREVIEWER — on the --ds-* design-system layer
   ============================================================================
   Matches the Hub's visual language (`215-admin-hub.css`): card-led grid with
   media wells, segmented filter pills, pill search bar with ⌘K, and one blue
   accent (`--ds-accent`) for selection/focus. Scoped to `.docs-*` and
   `.doc-*` so no other console page is affected.
   ============================================================================ */

.docs-main {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* --------------------------------------------------------------------- hero */

.docs-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.docs-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
}

.docs-headline {
  margin: 0;
  font-family: var(--ds-font-display);
  font-size: var(--ds-type-headline-size);
  line-height: var(--ds-type-headline-leading);
  letter-spacing: var(--ds-type-headline-tracking);
  font-weight: var(--ds-type-headline-weight);
  color: var(--ds-text-primary);
}

.docs-subhead {
  margin: 6px 0 0 0;
  max-width: 64ch;
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-size);
  line-height: var(--ds-type-body-leading);
  letter-spacing: var(--ds-type-body-tracking);
  color: var(--ds-text-secondary);
}

.docs-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}

.docs-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--ds-control-h);
  padding: 0 16px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  font-weight: 500;
  letter-spacing: var(--ds-type-body-reduced-tracking);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.docs-action-btn .ic {
  width: 15px;
  height: 15px;
  color: var(--ds-text-secondary);
}

.docs-action-btn:hover {
  background: var(--ds-surface-elevated);
  border-color: var(--ds-accent);
}

.docs-action-btn.is-primary {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

.docs-action-btn.is-primary:hover {
  background: var(--ds-accent-hover);
  border-color: var(--ds-accent-hover);
}

.docs-action-btn:disabled {
  opacity: var(--ds-disabled);
  cursor: default;
}

.docs-action-btn:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus-ring);
}

/* ------------------------------------------------------------------- search */

.docs-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 460px;
  margin-top: 4px;
}

.docs-search[hidden] { display: none; }

.docs-search-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--ds-text-tertiary);
  pointer-events: none;
}

.docs-search-field {
  width: 100%;
  height: var(--ds-control-h);
  padding: 0 54px 0 40px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-size);
  letter-spacing: var(--ds-type-body-tracking);
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--ds-dur-fast) linear;
}

.docs-search-field::placeholder { color: var(--ds-text-tertiary); }

.docs-search-field:focus {
  outline: none;
  border-color: var(--ds-accent);
  box-shadow: var(--ds-focus-ring);
}

.docs-search-kbd {
  position: absolute;
  right: 12px;
  padding: 3px 7px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: 6px;
  background: var(--ds-surface-elevated);
  color: var(--ds-text-tertiary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-caption-size);
  line-height: 1.2;
  pointer-events: none;
}

/* ---------------------------------------------------------- filter controls */

.docs-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.docs-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.docs-seg[hidden] { display: none; }

.docs-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ds-control-h);
  padding: 0 18px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-text-secondary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  letter-spacing: var(--ds-type-body-reduced-tracking);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--ds-dur-fast) linear,
              color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.docs-seg-btn:hover {
  background: var(--ds-surface);
  color: var(--ds-text-primary);
}

.docs-seg-btn[aria-pressed="true"] {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

.docs-seg-btn:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus-ring);
}

.docs-seg-count {
  font-size: var(--ds-type-caption-size);
  opacity: 0.75;
}

/* ---------------------------------------------------------- groups & grid */

.docs-groups {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.docs-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.docs-group-title {
  margin: 0;
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-caption-size);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-text-tertiary);
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* ------------------------------------------------------------ document tile */

.doc-tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
  color: inherit;
  transition: transform var(--ds-dur-ui) var(--ds-ease),
              border-color var(--ds-dur-fast) linear;
}

.doc-tile:hover {
  transform: translateY(-2px);
  border-color: var(--ds-accent);
}

.doc-tile.is-retired {
  opacity: 0.72;
}

/* Media well: frames a real rendered page 1 thumbnail of the PDF */
.doc-tile-media {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 184px;
  padding: 16px 22px 0 22px;
  overflow: hidden;
  background: var(--ds-surface-media);
  border-bottom: 1px solid var(--ds-separator);
  cursor: pointer;
}

.doc-tile-thumb {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  border-radius: 6px 6px 0 0;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform var(--ds-dur-content) var(--ds-ease);
}

.doc-tile:hover .doc-tile-thumb {
  transform: translateY(-3px) scale(1.02);
}

.doc-tile-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  color: var(--ds-text-tertiary);
  font-size: var(--ds-type-caption-size);
}

.doc-tile-fallback .ic {
  width: 28px;
  height: 28px;
  opacity: 0.6;
}

/* Corner badges inside the media well */
.doc-tile-status {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border-radius: var(--ds-radius-pill);
  background: rgba(18, 18, 20, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--ds-separator-strong);
  font-family: var(--ds-font-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ds-text-primary);
}

.doc-tile-status.is-active {
  color: var(--green);
  border-color: var(--green-border);
}

.doc-tile-status.is-retired {
  color: var(--ds-text-tertiary);
}

.doc-tile-stats {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: var(--ds-radius-pill);
  background: rgba(18, 18, 20, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--ds-separator-strong);
  font-family: var(--ds-font-text);
  font-size: 11px;
  font-weight: 500;
  color: var(--ds-text-secondary);
}

.doc-tile-hover-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
  font-family: var(--ds-font-text);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity var(--ds-dur-fast) linear,
              transform var(--ds-dur-fast) var(--ds-ease);
  pointer-events: none;
}

.doc-tile-media:hover .doc-tile-hover-pill {
  opacity: 1;
  transform: translateY(0);
}

/* Card body */
.doc-tile-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 12px 16px;
  flex: 1 1 auto;
}

.doc-tile-title {
  margin: 0;
  font-family: var(--ds-font-display);
  font-size: var(--ds-type-body-size);
  line-height: 1.32;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ds-text-primary);
  cursor: pointer;
}

.doc-tile-title:hover {
  color: var(--ds-link-on-dark);
}

.doc-tile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-caption-size);
  color: var(--ds-text-secondary);
}

.doc-tile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 2px;
}

.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--ds-separator);
  background: var(--ds-surface-elevated);
  font-family: var(--ds-font-text);
  font-size: 11px;
  color: var(--ds-text-secondary);
}

.doc-chip.is-scope {
  color: var(--ds-link-on-dark);
  border-color: var(--blue-border);
  background: rgba(0, 113, 227, 0.14);
}

/* Card footer */
.doc-tile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 14px 16px;
  border-top: 1px solid var(--ds-separator);
}

.doc-tile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--ds-radius-pill);
  border: 1px solid var(--ds-separator-strong);
  background: transparent;
  color: var(--ds-text-secondary);
  font-family: var(--ds-font-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--ds-dur-fast) linear,
              color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.doc-tile-btn:hover:not(:disabled) {
  background: var(--ds-surface-elevated);
  color: var(--ds-text-primary);
}

.doc-tile-btn.is-preview {
  background: var(--ds-surface-elevated);
  color: var(--ds-text-primary);
  margin-right: auto;
}

.doc-tile-btn.is-preview:hover {
  border-color: var(--ds-accent);
  color: var(--ds-link-on-dark);
}

.doc-tile-btn:disabled {
  opacity: var(--ds-disabled);
  cursor: default;
}

/* --------------------------------------------------- preview & field studio */

.doc-preview-card {
  width: min(1140px, 95vw);
  max-width: 1140px;
  height: min(88vh, 840px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
}

.doc-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ds-separator);
  background: var(--ds-surface);
}

.doc-preview-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 240px;
}

.doc-preview-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.doc-preview-title {
  margin: 0;
  font-family: var(--ds-font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ds-text-primary);
}

.doc-pill {
  padding: 2px 9px;
  border-radius: var(--ds-radius-pill);
  border: 1px solid var(--ds-separator-strong);
  font-size: 11px;
  font-weight: 600;
  color: var(--ds-text-secondary);
}

.doc-pill.is-active {
  color: var(--green);
  border-color: var(--green-border);
}

.doc-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--ds-text-secondary);
}

.doc-preview-mode {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-bg);
  border: 1px solid var(--ds-separator);
  gap: 2px;
}

.doc-mode-btn {
  padding: 5px 12px;
  border: 0;
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-text-secondary);
  font-family: var(--ds-font-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--ds-dur-fast) linear,
              color var(--ds-dur-fast) linear;
}

.doc-mode-btn:hover { color: var(--ds-text-primary); }

.doc-mode-btn[aria-pressed="true"] {
  background: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

/* Split workspace */
.doc-preview-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.doc-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--ds-surface-media);
  border-right: 1px solid var(--ds-separator);
}

.doc-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--ds-separator);
  background: var(--ds-surface);
}

.doc-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.doc-pager-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface-elevated);
  color: var(--ds-text-primary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.doc-pager-btn:disabled {
  opacity: var(--ds-disabled);
  cursor: default;
}

.doc-pager-label {
  font-size: 12px;
  color: var(--ds-text-secondary);
  min-width: 78px;
  text-align: center;
}

.doc-overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ds-text-secondary);
  cursor: pointer;
  user-select: none;
}

.doc-overlay-toggle input {
  accent-color: var(--ds-accent);
}

.doc-stage-viewport {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.doc-stage-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.doc-stage-img {
  display: block;
  max-width: 100%;
  width: 680px;
  height: auto;
}

.doc-stage-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 20, 0.72);
  color: var(--ds-text-primary);
  font-size: 13px;
}

.doc-stage-loading[hidden] { display: none; }

/* Field overlays drawn in exact normalized PDF % coordinates */
.doc-stage-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.doc-stage-overlays[hidden] { display: none; }

.doc-ov-box {
  position: absolute;
  border: 1.5px solid var(--ds-accent);
  background: rgba(0, 113, 227, 0.14);
  border-radius: 3px;
  pointer-events: auto;
  cursor: pointer;
  transition: background-color var(--ds-dur-fast) linear,
              box-shadow var(--ds-dur-fast) linear;
}

.doc-ov-box.is-image {
  border-color: var(--green);
  background: var(--green-bg);
}

.doc-ov-box.is-choice {
  border-color: var(--fuchsia);
  background: rgba(223, 115, 223, 0.14);
}

.doc-ov-box.is-stamp {
  border-color: var(--amber);
  background: rgba(245, 166, 35, 0.14);
}

.doc-ov-box.is-active,
.doc-ov-box:hover {
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.42);
  background: rgba(0, 113, 227, 0.24);
  z-index: 4;
}

.doc-ov-box.is-image.is-active,
.doc-ov-box.is-image:hover {
  box-shadow: 0 0 0 3px var(--green-border);
  background: rgba(50, 199, 102, 0.24);
}

.doc-ov-tag {
  position: absolute;
  top: -17px;
  left: -1px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--ds-accent);
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

.doc-ov-box.is-image .doc-ov-tag { background: var(--green-deep); }
.doc-ov-box.is-choice .doc-ov-tag { background: var(--fuchsia-deep); }
.doc-ov-box.is-stamp .doc-ov-tag { background: var(--orange-deep); }

/* Text / clause preview */
.doc-text-view {
  width: 100%;
  max-width: 680px;
  padding: 24px 28px;
  border-radius: var(--ds-radius-inner);
  border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface);
  color: var(--ds-text-primary);
  font-size: 13.5px;
  line-height: 1.6;
}

.doc-text-view[hidden] { display: none; }
.doc-text-view p { margin: 0 0 12px 0; }
.doc-text-view p:last-child { margin-bottom: 0; }

/* Right-hand inspector */
.doc-inspector {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
  overflow-y: auto;
  background: var(--ds-surface);
}

.doc-inspector-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-inspector-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-text-tertiary);
}

.doc-inspector-count {
  padding: 1px 7px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface-elevated);
  color: var(--ds-text-secondary);
}

.doc-inspector-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 12px;
}

.doc-inspector-dl dt {
  color: var(--ds-text-tertiary);
}

.doc-inspector-dl dd {
  margin: 0;
  color: var(--ds-text-primary);
  word-break: break-word;
}

.doc-fields-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-field-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--ds-separator);
  background: var(--ds-surface-elevated);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--ds-dur-fast) linear,
              background-color var(--ds-dur-fast) linear;
}

.doc-field-item:hover,
.doc-field-item.is-active {
  border-color: var(--ds-accent);
  background: rgba(0, 113, 227, 0.14);
}

.doc-field-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.doc-field-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ds-accent);
  flex: 0 0 auto;
}

.doc-field-dot.is-image { background: var(--green); }
.doc-field-dot.is-choice { background: var(--fuchsia); }
.doc-field-dot.is-stamp { background: var(--amber); }
.doc-field-dot.is-input { background: var(--blue); }

.doc-field-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--ds-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-field-page {
  margin-left: auto;
  font-size: 11px;
  color: var(--ds-text-tertiary);
  flex: 0 0 auto;
}

.doc-field-sub {
  font-size: 11px;
  color: var(--ds-text-secondary);
}

.doc-inspector-notes {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ds-text-secondary);
  white-space: pre-wrap;
}

.doc-preview-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--ds-separator);
  background: var(--ds-surface);
}

.doc-preview-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--ds-text-tertiary);
}

.doc-preview-foot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 900px) {
  .doc-preview-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .doc-stage {
    border-right: 0;
    border-bottom: 1px solid var(--ds-separator);
  }
  .doc-inspector {
    max-height: 240px;
  }
}

@media (max-width: 720px) {
  .docs-grid {
    grid-template-columns: 1fr;
  }
  .docs-search {
    max-width: 100%;
  }
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  .doc-tile { transition: border-color var(--ds-dur-fast) linear; }
  .doc-tile:hover { transform: none; }
  .doc-tile-thumb { transition: none; }
  .doc-tile:hover .doc-tile-thumb { transform: none; }
}
/* ============================================================================
   MEALS RECONCILIATION & PASSES — on the --ds-* design-system layer
   ============================================================================
   Matches the Hub & Documents visual language: display hero, pill selects and
   actions, ⌘K search bar, segmented filter pills, card-based KPIs, and clean
   split workspace. Scoped to `.meals-*` so no other page is affected.
   ============================================================================ */

.meals-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --------------------------------------------------------------------- hero */

.meals-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.meals-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
}

.meals-headline {
  margin: 0;
  font-family: var(--ds-font-display);
  font-size: var(--ds-type-headline-size);
  line-height: var(--ds-type-headline-leading);
  letter-spacing: var(--ds-type-headline-tracking);
  font-weight: var(--ds-type-headline-weight);
  color: var(--ds-text-primary);
}

.meals-subhead {
  margin: 6px 0 0 0;
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-size);
  line-height: var(--ds-type-body-leading);
  letter-spacing: var(--ds-type-body-tracking);
  color: var(--ds-text-secondary);
}

.meals-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  max-width: 100%;
  min-width: 0;
}

.meals-select {
  height: var(--ds-control-h);
  padding: 0 32px 0 14px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  letter-spacing: var(--ds-type-body-reduced-tracking);
  max-width: 240px;
  min-width: 0;
  cursor: pointer;
}

.meals-select:focus {
  outline: none;
  border-color: var(--ds-accent);
  box-shadow: var(--ds-focus-ring);
}

.meals-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--ds-control-h);
  padding: 0 16px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.meals-btn .ic {
  width: 15px;
  height: 15px;
  color: var(--ds-text-secondary);
}

.meals-btn:hover:not(:disabled) {
  background: var(--ds-surface-elevated);
  border-color: var(--ds-accent);
}

.meals-btn.is-primary {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

.meals-btn.is-primary:hover:not(:disabled) {
  background: var(--ds-accent-hover);
  border-color: var(--ds-accent-hover);
}

.meals-btn:disabled {
  opacity: var(--ds-disabled);
  cursor: default;
}

/* ---------------------------------------------------------------------- KPIs */

.meals-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.meals-kpis[hidden] { display: none; }

.meals-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
}

.meals-kpi-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.meals-kpi-num {
  font-family: var(--ds-font-display);
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ds-text-primary);
}

.meals-kpi.is-scanned .meals-kpi-num { color: var(--green); }
.meals-kpi.is-manual .meals-kpi-num { color: var(--amber); }

.meals-kpi-badge {
  padding: 2px 8px;
  border-radius: var(--ds-radius-pill);
  border: 1px solid var(--ds-separator);
  background: var(--ds-surface-elevated);
  font-size: 11px;
  font-weight: 500;
  color: var(--ds-text-secondary);
}

.meals-kpi-label {
  font-size: var(--ds-type-body-reduced-size);
  color: var(--ds-text-secondary);
}

/* Per-service breakdown strip */
.meals-services {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.meals-services[hidden] { display: none; }

.meals-service-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface);
  color: var(--ds-text-secondary);
  font-family: var(--ds-font-text);
  font-size: 12.5px;
  cursor: pointer;
  transition: background-color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear,
              color var(--ds-dur-fast) linear;
}

.meals-service-chip:hover {
  background: var(--ds-surface-elevated);
  color: var(--ds-text-primary);
}

.meals-service-chip[aria-pressed="true"] {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

.meals-service-count {
  font-size: 11px;
  opacity: 0.78;
}

/* ---------------------------------------------------------- search & filters */

.meals-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meals-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  max-width: 420px;
}

.meals-search-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--ds-text-tertiary);
  pointer-events: none;
}

.meals-search-field {
  width: 100%;
  height: var(--ds-control-h);
  padding: 0 54px 0 40px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-size);
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--ds-dur-fast) linear;
}

.meals-search-field::placeholder { color: var(--ds-text-tertiary); }

.meals-search-field:focus {
  outline: none;
  border-color: var(--ds-accent);
  box-shadow: var(--ds-focus-ring);
}

.meals-search-kbd {
  position: absolute;
  right: 12px;
  padding: 3px 7px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: 6px;
  background: var(--ds-surface-elevated);
  color: var(--ds-text-tertiary);
  font-size: var(--ds-type-caption-size);
  line-height: 1.2;
  pointer-events: none;
}

.meals-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meals-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--ds-control-h);
  padding: 0 16px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-text-secondary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--ds-dur-fast) linear,
              color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.meals-seg-btn:hover {
  background: var(--ds-surface);
  color: var(--ds-text-primary);
}

.meals-seg-btn[aria-pressed="true"] {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

/* ----------------------------------------------------------- split panels */

.meals-split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}

.meals-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
  min-width: 0;
}

.meals-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.meals-panel-title {
  margin: 0;
  font-family: var(--ds-font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ds-text-primary);
}

.meals-panel-note {
  margin: 0;
  font-size: var(--ds-type-caption-size);
  line-height: 1.45;
  color: var(--ds-text-secondary);
}

.meals-pass-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meals-pass-tab {
  min-height: 28px;
  padding: 4px 11px;
  border-radius: var(--ds-radius-pill);
  border: 1px solid var(--ds-separator-strong);
  background: transparent;
  color: var(--ds-text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.meals-pass-tab[aria-pressed="true"] {
  background: var(--ds-surface-elevated);
  border-color: var(--ds-accent);
  color: var(--ds-text-primary);
}

.meals-cli-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--ds-separator);
  background: var(--ds-surface-media);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--ds-text-secondary);
}

.meals-cli-copy {
  min-height: 28px;
  padding: 3px 10px;
  border-radius: var(--ds-radius-pill);
  border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface-elevated);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-text);
  font-size: 11px;
  cursor: pointer;
  flex: 0 0 auto;
}

.meals-cli-copy:hover {
  border-color: var(--ds-accent);
}

@media (max-width: 960px) {
  .meals-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .meals-kpis {
    grid-template-columns: 1fr;
  }
  .meals-hero-actions {
    width: 100%;
  }
  .meals-select {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }
}
/* WRAPS WORKBENCH — on the --ds-* design-system layer (Hub/Documents/Meals) */

.wraps-main { display: flex; flex-direction: column; gap: 22px; }
.wraps-hero { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.wraps-hero-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 20px; }
.wraps-hero-copy { min-width: 0; flex: 1 1 280px; }
.wraps-headline {
  margin: 0;
  font-family: var(--ds-font-display);
  font-size: var(--ds-type-headline-size);
  line-height: var(--ds-type-headline-leading);
  letter-spacing: var(--ds-type-headline-tracking);
  font-weight: var(--ds-type-headline-weight);
  color: var(--ds-text-primary);
}
.wraps-sub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; }
.wraps-subhead {
  margin: 0;
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-size);
  line-height: var(--ds-type-body-leading);
  letter-spacing: var(--ds-type-body-tracking);
  color: var(--ds-text-secondary);
}
.wraps-shoot-link {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px;
  border-radius: var(--ds-radius-pill); border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface); font-family: var(--ds-font-text);
  font-size: var(--ds-type-caption-size); font-weight: 500;
  color: var(--ds-link-on-dark); text-decoration: none;
  transition: background-color var(--ds-dur-fast) linear, border-color var(--ds-dur-fast) linear;
}
.wraps-shoot-link:hover { background: var(--ds-surface-elevated); border-color: var(--ds-accent); }
.wraps-shoot-link[hidden] { display: none; }

.wraps-hero-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding-top: 6px; max-width: 100%; min-width: 0;
}
.wraps-select {
  height: var(--ds-control-h); padding: 0 32px 0 14px;
  border: 1px solid var(--ds-separator-strong); border-radius: var(--ds-radius-pill);
  background: var(--ds-surface); color: var(--ds-text-primary);
  font-family: var(--ds-font-text); font-size: var(--ds-type-body-reduced-size);
  max-width: 260px; min-width: 0; cursor: pointer;
}
.wraps-select:focus { outline: none; border-color: var(--ds-accent); box-shadow: var(--ds-focus-ring); }

.wraps-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--ds-control-h); padding: 0 16px;
  border: 1px solid var(--ds-separator-strong); border-radius: var(--ds-radius-pill);
  background: var(--ds-surface); color: var(--ds-text-primary);
  font-family: var(--ds-font-text); font-size: var(--ds-type-body-reduced-size);
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color var(--ds-dur-fast) linear, border-color var(--ds-dur-fast) linear;
}
.wraps-btn .ic { width: 15px; height: 15px; color: var(--ds-text-secondary); flex-shrink: 0; }
.wraps-btn:hover:not(:disabled) { background: var(--ds-surface-elevated); border-color: var(--ds-accent); }
.wraps-btn.is-primary { background: var(--ds-accent); border-color: var(--ds-accent); color: var(--ds-text-on-accent); }
.wraps-btn.is-primary .ic { color: var(--ds-text-on-accent); }
.wraps-btn.is-primary:hover:not(:disabled) { background: var(--ds-accent-hover); border-color: var(--ds-accent-hover); }
.wraps-btn:disabled { opacity: var(--ds-disabled); cursor: default; }

/* --------------------------------------------------------------------- KPIs */
.wraps-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wraps-kpis:empty { display: none; }
.wraps-kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 15px 18px;
  border: 1px solid var(--ds-separator-strong); border-radius: var(--ds-radius-card);
  background: var(--ds-surface); text-align: left; cursor: pointer;
  transition: border-color var(--ds-dur-fast) linear, background-color var(--ds-dur-fast) linear;
}
.wraps-kpi:hover { background: var(--ds-surface-elevated); border-color: var(--ds-accent); }
.wraps-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wraps-kpi-val {
  font-family: var(--ds-font-display); font-size: 26px; line-height: 1.15;
  font-weight: 700; letter-spacing: -0.02em; color: var(--ds-text-primary);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wraps-kpi.is-warn .wraps-kpi-val { color: var(--amber); }
.wraps-kpi.is-ok .wraps-kpi-val { color: var(--green); }
.wraps-kpi-pill {
  padding: 2px 9px; border-radius: var(--ds-radius-pill); border: 1px solid var(--ds-separator);
  background: var(--ds-surface-elevated); font-size: 11px; font-weight: 600;
  color: var(--ds-text-secondary); white-space: nowrap; flex-shrink: 0;
}
.wraps-kpi.is-warn .wraps-kpi-pill { color: var(--amber); border-color: rgba(245, 166, 35, 0.35); background: rgba(245, 166, 35, 0.12); }
.wraps-kpi.is-ok .wraps-kpi-pill { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.wraps-kpi-label { font-size: var(--ds-type-body-reduced-size); color: var(--ds-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------------------------------------- workspace tabs */
.wraps-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.wraps-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.wraps-seg-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 15px;
  border: 1px solid var(--ds-separator-strong); border-radius: var(--ds-radius-pill);
  background: var(--ds-surface); color: var(--ds-text-secondary);
  font-family: var(--ds-font-text); font-size: var(--ds-type-body-reduced-size); font-weight: 500; cursor: pointer;
  transition: background-color var(--ds-dur-fast) linear, border-color var(--ds-dur-fast) linear, color var(--ds-dur-fast) linear;
}
.wraps-seg-btn:hover { background: var(--ds-surface-elevated); color: var(--ds-text-primary); }
.wraps-seg-btn[aria-pressed="true"] { background: var(--ds-accent); border-color: var(--ds-accent); color: var(--ds-text-on-accent); }
.wraps-seg-count {
  padding: 1px 7px; border-radius: var(--ds-radius-pill); background: var(--ds-surface-elevated);
  color: var(--ds-text-secondary); font-size: 11px; font-weight: 600;
}
.wraps-seg-btn[aria-pressed="true"] .wraps-seg-count { background: rgba(255, 255, 255, 0.22); color: var(--ds-text-on-accent); }

/* ---------------------------------------------------------------- workbench */
.wraps-workbench { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.wraps-primary-col, .wraps-sidebar-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.wraps-workbench[data-wraps-view="deliverables"] [data-wraps-panel="audit"],
.wraps-workbench[data-wraps-view="deliverables"] [data-wraps-panel="settings"],
.wraps-workbench[data-wraps-view="audit"] [data-wraps-panel="deliverables"],
.wraps-workbench[data-wraps-view="audit"] [data-wraps-panel="settings"],
.wraps-workbench[data-wraps-view="settings"] [data-wraps-panel="deliverables"],
.wraps-workbench[data-wraps-view="settings"] [data-wraps-panel="audit"] { display: none; }
.wraps-workbench[data-wraps-view="settings"] .wraps-sidebar-col { max-width: 680px; }

/* -------------------------------------------------------------------- cards */
.wraps-card {
  display: flex; flex-direction: column; border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-card); background: var(--ds-surface);
}
.wraps-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--ds-separator);
}
.wraps-card-title { margin: 0; font-family: var(--ds-font-display); font-size: 16px; font-weight: 600; color: var(--ds-text-primary); }
.wraps-card-sub { margin: 2px 0 0 0; font-size: 12px; color: var(--ds-text-secondary); }
.wraps-card-badge {
  padding: 3px 10px; border-radius: var(--ds-radius-pill); border: 1px solid var(--ds-separator);
  background: var(--ds-surface-elevated); font-size: 11px; font-weight: 600;
  color: var(--ds-text-secondary); white-space: nowrap; flex-shrink: 0;
}
.wraps-card-badge.is-ok { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.wraps-card-badge.is-warn { color: var(--amber); border-color: rgba(245, 166, 35, 0.35); background: rgba(245, 166, 35, 0.12); }
.wraps-card-body { padding: 16px 18px; }
.wraps-card-note { margin: 0 0 12px 0; font-size: var(--ds-type-caption-size); line-height: 1.5; color: var(--ds-text-secondary); }
.wraps-info-details > summary { list-style: none; cursor: pointer; }
.wraps-info-details > summary::-webkit-details-marker { display: none; }
.wraps-info-title { display: inline-flex; align-items: center; gap: 8px; font-family: var(--ds-font-text); font-size: var(--ds-type-body-reduced-size); font-weight: 600; color: var(--ds-text-secondary); }
.wraps-info-title .ic { width: 16px; height: 16px; }

/* -------------------------------------------------------------- deliverables */
.wraps-deliv-list { display: flex; flex-direction: column; gap: 8px; }
.wraps-deliv-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--ds-separator); background: var(--ds-surface-elevated);
  transition: border-color var(--ds-dur-fast) linear;
}
.wraps-deliv-row:hover { border-color: var(--ds-separator-strong); }
.wraps-format-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; height: 30px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--ds-separator-strong); background: var(--ds-surface-media);
  font-family: var(--ds-font-text); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; color: var(--ds-text-secondary); flex-shrink: 0;
}
.wraps-format-badge.is-csv, .wraps-format-badge.is-xlsx { color: var(--green); border-color: var(--green-border); }
.wraps-format-badge.is-zip { color: var(--amber); border-color: rgba(245, 166, 35, 0.35); }
.wraps-format-badge.is-xml { color: var(--ds-link-on-dark); border-color: var(--blue-border); }
.wraps-deliv-info { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.wraps-deliv-name { font-size: 14px; font-weight: 600; color: var(--ds-text-primary); }
.wraps-deliv-note { font-size: 12px; color: var(--ds-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------------------------------------- signature audit */
.wraps-clear-state {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--ds-radius-inner);
  background: var(--green-bg); border: 1px solid var(--green-border);
  color: var(--ds-text-primary); font-size: var(--ds-type-body-reduced-size);
}
.wraps-audit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.wraps-search-wrap { position: relative; display: flex; align-items: center; flex: 1 1 220px; min-width: 0; }
.wraps-search-icon { position: absolute; left: 14px; width: 15px; height: 15px; color: var(--ds-text-tertiary); pointer-events: none; }
.wraps-audit-search {
  width: 100%; height: var(--ds-control-h); padding: 0 14px 0 38px;
  border-radius: var(--ds-radius-pill); border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface-media); color: var(--ds-text-primary);
  font-family: var(--ds-font-text); font-size: 13.5px;
}
.wraps-audit-search::placeholder { color: var(--ds-text-tertiary); }
.wraps-audit-search:focus { outline: none; border-color: var(--ds-accent); box-shadow: var(--ds-focus-ring); }
.wraps-audit-nav { display: inline-flex; align-items: center; gap: 6px; }
.wraps-nav-btn { min-width: 32px; padding: 0 10px; font-size: 15px; line-height: 1; }
.wraps-audit-list {
  display: grid; grid-auto-flow: column;
  grid-template-rows: repeat(3, minmax(0, auto));
  grid-auto-columns: minmax(260px, 290px);
  gap: 10px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; overscroll-behavior-x: contain;
  padding-bottom: 8px; scrollbar-width: thin;
}
.wraps-audit-row {
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  padding: 13px 14px; border: 1px solid var(--ds-separator); border-radius: 12px;
  background: var(--ds-surface-elevated); scroll-snap-align: start;
  transition: border-color var(--ds-dur-fast) linear, background-color var(--ds-dur-fast) linear;
}
.wraps-audit-row.is-clickable { cursor: pointer; }
.wraps-audit-row.is-clickable:hover,
.wraps-audit-row.is-clickable:focus-visible {
  border-color: var(--ds-accent); background: rgba(255, 255, 255, 0.03); outline: none;
}
.wraps-audit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.wraps-audit-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.wraps-audit-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--ds-surface-media); border: 1px solid var(--ds-separator-strong);
  font-size: 12px; font-weight: 600; color: var(--ds-text-secondary);
}
.wraps-audit-avatar.is-lg { width: 42px; height: 42px; font-size: 14px; }
.wraps-audit-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.wraps-audit-name {
  font-size: 13.5px; font-weight: 600; color: var(--ds-text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wraps-audit-dept {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--ds-text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wraps-audit-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 9px; border-top: 1px solid var(--ds-separator);
}
.wraps-audit-count {
  padding: 2px 9px; border-radius: var(--ds-radius-pill); border: 1px solid rgba(245, 166, 35, 0.35);
  background: rgba(245, 166, 35, 0.12); color: var(--amber); font-size: 11px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.wraps-audit-manage { font-size: 11.5px; font-weight: 500; color: var(--ds-text-secondary); }
.wraps-audit-row.is-clickable:hover .wraps-audit-manage { color: var(--ds-text-primary); }
.wraps-mini-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 30px; padding: 0 12px; flex-shrink: 0;
  border-radius: var(--ds-radius-pill); border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface); color: var(--ds-text-primary);
  font-family: var(--ds-font-text); font-size: 12px; font-weight: 500; cursor: pointer;
  transition: border-color var(--ds-dur-fast) linear, background-color var(--ds-dur-fast) linear;
}
.wraps-mini-btn:hover:not(:disabled) { border-color: var(--ds-accent); background: var(--ds-surface-media); }
.wraps-mini-btn:disabled { opacity: var(--ds-disabled); cursor: default; }
.wraps-mini-btn.is-danger { color: var(--coral); }
.wraps-mini-btn.is-danger:hover:not(:disabled) { border-color: rgba(255, 90, 95, 0.6); }

/* ----------------------------------------------------- person context modal */
.wraps-person-backdrop {
  position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(10px);
}
.wraps-person-modal {
  width: min(680px, 100%); max-height: calc(100vh - 40px); padding: 0; overflow: hidden;
  border-radius: var(--ds-radius-card); border: 1px solid var(--ds-separator-strong); background: var(--ds-surface-elevated);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55); display: flex; flex-direction: column;
}
.wraps-person-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px 16px; border-bottom: 1px solid var(--ds-separator);
}
.wraps-person-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wraps-person-meta { min-width: 0; }
.wraps-person-title { margin: 0; font-family: var(--ds-font-display); font-size: 17px; font-weight: 600; color: var(--ds-text-primary); }
.wraps-person-sub { margin: 2px 0 0 0; font-size: 12px; color: var(--ds-text-secondary); overflow-wrap: anywhere; }
.wraps-person-head-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.wraps-modal-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface-media); color: var(--ds-text-secondary); font-size: 18px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.wraps-modal-close:hover { color: var(--ds-text-primary); border-color: var(--ds-accent); }
.wraps-person-body { padding: 18px 22px; overflow-y: auto; overscroll-behavior: contain; }
.wraps-modal-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.wraps-modal-sec-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ds-text-secondary);
}
.wraps-modal-docs {
  border: 1px solid var(--ds-separator); border-radius: 12px; background: var(--ds-surface-media); overflow: hidden;
}
.wraps-modal-doc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 14px; border-bottom: 1px solid var(--ds-separator);
}
.wraps-modal-doc-row:last-child { border-bottom: none; }
.wraps-modal-doc-title { font-size: 13px; font-weight: 500; color: var(--ds-text-primary); line-height: 1.4; min-width: 0; flex: 1 1 auto; }
.wraps-person-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px 18px; border-top: 1px solid var(--ds-separator); background: rgba(255, 255, 255, 0.02);
}
.wraps-person-foot-sec { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.wraps-text-btn {
  padding: 4px 2px; border: 0; background: transparent; color: var(--ds-text-secondary);
  font-family: var(--ds-font-text); font-size: 12px; font-weight: 500; cursor: pointer;
  transition: color var(--ds-dur-fast) linear;
}
.wraps-text-btn:hover { color: var(--ds-text-primary); }
.wraps-text-btn.is-danger { color: var(--coral); }
.wraps-text-btn.is-danger:hover { color: var(--coral); opacity: 0.85; }

/* ---------------------------------------------------------- export settings */
.wraps-settings-stack { display: flex; flex-direction: column; gap: 18px; }
.wraps-setting-label {
  display: block; margin-bottom: 7px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ds-text-secondary);
}
.wraps-input {
  width: 100%; box-sizing: border-box; height: var(--ds-control-h); padding: 0 14px;
  border-radius: var(--ds-radius-inner); border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface-media); color: var(--ds-text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}
.wraps-input:focus { outline: none; border-color: var(--ds-accent); box-shadow: var(--ds-focus-ring); }
.wraps-preview { margin-top: 8px; padding: 10px 12px; border-radius: var(--ds-radius-inner); border: 1px solid var(--ds-separator); background: var(--ds-surface-media); }
.wraps-preview-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-text-tertiary); }
.wraps-preview-name { margin-top: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 600; color: var(--ds-text-primary); overflow-wrap: anywhere; }
.wraps-preview-for { margin-top: 2px; font-size: 11.5px; color: var(--ds-text-secondary); }
.wraps-tokens-fold { margin-top: 8px; border: 1px solid var(--ds-separator); border-radius: var(--ds-radius-inner); background: var(--ds-surface-media); padding: 9px 12px; }
.wraps-tokens-fold > summary { font-size: 12px; font-weight: 500; color: var(--ds-text-secondary); cursor: pointer; user-select: none; }
.wraps-tokens-fold[open] > summary { margin-bottom: 9px; }
.wraps-scope-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.wraps-scope-btn {
  min-height: 36px; padding: 0 10px; border-radius: var(--ds-radius-pill);
  border: 1px solid var(--ds-separator-strong); background: var(--ds-surface-media);
  color: var(--ds-text-secondary); font-family: var(--ds-font-text); font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background-color var(--ds-dur-fast) linear, border-color var(--ds-dur-fast) linear, color var(--ds-dur-fast) linear;
}
.wraps-scope-btn:hover:not(:disabled) { color: var(--ds-text-primary); border-color: var(--ds-accent); }
.wraps-scope-btn.active { background: var(--ds-accent); border-color: var(--ds-accent); color: var(--ds-text-on-accent); }
.wraps-scope-btn:disabled { opacity: var(--ds-disabled); cursor: default; }

@media (max-width: 960px) {
  .wraps-workbench { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .wraps-kpis { grid-template-columns: 1fr; }
  .wraps-hero-actions { width: 100%; }
  .wraps-select { flex: 1 1 100%; width: 100%; max-width: 100%; }
  .wraps-audit-list { grid-template-rows: repeat(2, minmax(0, auto)); grid-auto-columns: minmax(245px, 84%); }
  .wraps-audit-nav { display: none; }
}

/* ------------------------------------------------ reusable nudge modal */
.nudge-overlay[hidden] { display: none; }
.nudge-overlay {
  position: fixed; inset: 0; z-index: 1300;
  background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.nudge-modal {
  width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--ds-surface-elevated, var(--ds-surface, #161618));
  color: var(--ds-text-primary, #f3f4f6);
  font-family: var(--ds-font-text, inherit);
  border: 1px solid var(--ds-separator-strong, rgba(255,255,255,.14));
  border-radius: var(--ds-radius-card);
  box-shadow: 0 24px 60px rgba(0,0,0,.55); overflow: hidden;
}
.nudge-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--ds-separator, rgba(255,255,255,.1));
}
.nudge-title {
  margin: 0; font-family: var(--ds-font-display, inherit);
  font-size: 1.08rem; font-weight: 600; color: var(--ds-text-primary);
}
.nudge-sub { margin: 3px 0 0; font-size: .85rem; color: var(--ds-text-secondary); }
.nudge-close {
  background: none; border: none; color: var(--ds-text-secondary); font-size: 1.4rem;
  line-height: 1; cursor: pointer; padding: 2px 6px;
}
.nudge-close:hover { color: var(--ds-text-primary); }
.nudge-tabs {
  display: flex; gap: 6px; padding: 10px 20px;
  border-bottom: 1px solid var(--ds-separator, rgba(255,255,255,.08));
}
.nudge-tab {
  background: var(--ds-surface); border: 1px solid var(--ds-separator-strong);
  color: var(--ds-text-secondary); padding: 6px 14px;
  border-radius: var(--ds-radius-pill, 999px); font-size: .84rem; cursor: pointer;
}
.nudge-tab.is-active {
  background: var(--ds-accent); border-color: var(--ds-accent); color: #fff;
}
.nudge-body { padding: 16px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.nudge-section { display: flex; flex-direction: column; gap: 8px; }
.nudge-label { font-size: .8rem; font-weight: 600; color: var(--ds-text-secondary); }
.nudge-select, .nudge-input, .nudge-textarea {
  width: 100%; box-sizing: border-box;
  background: var(--ds-surface); color: var(--ds-text-primary);
  border: 1px solid var(--ds-separator-strong); border-radius: var(--ds-radius-inner);
  padding: 8px 10px; font-family: var(--ds-font-text, inherit); font-size: .86rem;
}
.nudge-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.nudge-pill {
  font-size: .78rem; padding: 4px 10px; border-radius: var(--ds-radius-pill, 999px);
  background: var(--ds-surface); border: 1px solid var(--ds-separator-strong);
  color: var(--ds-text-secondary);
}
.nudge-pill.is-wa { border-color: var(--green-border); color: var(--green); }
.nudge-pill.is-em { border-color: var(--blue-border); color: var(--ds-link-on-dark); }
.nudge-pill.is-skip { opacity: .7; }
.nudge-check { display: flex; align-items: center; gap: 8px; font-size: .86rem; cursor: pointer; color: var(--ds-text-primary); }
.nudge-preview {
  padding: 10px 12px; border-radius: var(--ds-radius-inner);
  background: var(--ds-surface); border: 1px solid var(--ds-separator-strong);
}
.nudge-preview-cap { font-size: .76rem; color: var(--ds-text-secondary); margin-bottom: 4px; }
.nudge-preview-subj { font-size: .84rem; font-weight: 600; margin-bottom: 4px; color: var(--ds-text-primary); }
.nudge-preview-text {
  margin: 0; white-space: pre-wrap; font-family: inherit; font-size: .84rem;
  line-height: 1.45; color: var(--ds-text-primary);
}
.nudge-recipients {
  max-height: 150px; overflow-y: auto; border: 1px solid var(--ds-separator-strong);
  border-radius: 8px; padding: 4px 10px; background: var(--ds-surface);
}
.nudge-rec-row {
  display: flex; justify-content: space-between; gap: 10px; padding: 5px 0;
  font-size: .82rem; border-bottom: 1px solid var(--ds-separator);
}
.nudge-rec-row:last-child { border-bottom: none; }
.nudge-rec-meta { color: var(--ds-text-secondary); white-space: nowrap; }
.nudge-result-box {
  padding: 10px 12px; border-radius: var(--ds-radius-inner); font-size: .85rem;
  background: var(--green-bg); border: 1px solid var(--green-border);
}
.nudge-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.nudge-edit-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nudge-seg { display: flex; gap: 4px; }
.nudge-seg-btn {
  background: var(--ds-surface); border: 1px solid var(--ds-separator-strong);
  color: var(--ds-text-secondary); padding: 5px 12px;
  border-radius: var(--ds-radius-pill, 999px); font-size: .82rem; cursor: pointer;
}
.nudge-seg-btn.is-active { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; }
.nudge-muted { margin: 0; font-size: .8rem; color: var(--ds-text-secondary); }
.nudge-editor-list { display: flex; flex-direction: column; gap: 10px; }
.nudge-var-card {
  display: flex; flex-direction: column; gap: 6px; padding: 10px;
  border-radius: var(--ds-radius-inner); background: var(--ds-surface); border: 1px solid var(--ds-separator-strong);
}
.nudge-var-head { display: flex; justify-content: space-between; align-items: center; }
.nudge-var-num { font-size: .78rem; font-weight: 600; color: var(--ds-text-secondary); }
.nudge-var-del {
  background: none; border: none; color: var(--coral); font-size: .78rem; cursor: pointer;
}
/* ============================================================================
   EMAILS & PROTOCOLS REVIEWER — on the --ds-* design-system layer
   ============================================================================ */

.emails-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.emails-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.emails-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
}

.emails-headline {
  margin: 0;
  font-family: var(--ds-font-display);
  font-size: var(--ds-type-headline-size);
  line-height: var(--ds-type-headline-leading);
  letter-spacing: var(--ds-type-headline-tracking);
  font-weight: var(--ds-type-headline-weight);
  color: var(--ds-text-primary);
}

.emails-subhead {
  margin: 6px 0 0 0;
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-size);
  line-height: var(--ds-type-body-leading);
  letter-spacing: var(--ds-type-body-tracking);
  color: var(--ds-text-secondary);
}

.emails-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}

.emails-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--ds-control-h);
  padding: 0 16px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.emails-btn:hover {
  background: var(--ds-surface-elevated);
  border-color: var(--ds-accent);
}

.emails-btn[aria-pressed="true"] {
  border-color: var(--ds-accent);
  color: var(--ds-accent);
}

.emails-btn.is-primary {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

.emails-btn.is-primary:hover {
  background: var(--ds-accent-hover);
  border-color: var(--ds-accent-hover);
}

/* ---------------------------------------------------------- search & filters */

.emails-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.emails-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  max-width: 420px;
}

.emails-search-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--ds-text-tertiary);
  pointer-events: none;
}

.emails-search-field {
  width: 100%;
  height: var(--ds-control-h);
  padding: 0 16px 0 40px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-size);
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--ds-dur-fast) linear;
}

.emails-search-field::placeholder {
  color: var(--ds-text-tertiary);
}

.emails-search-field:focus {
  outline: none;
  border-color: var(--ds-accent);
  box-shadow: var(--ds-focus-ring);
}

.emails-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emails-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--ds-control-h);
  padding: 0 16px;
  border: 1px solid var(--ds-separator-strong);
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-text-secondary);
  font-family: var(--ds-font-text);
  font-size: var(--ds-type-body-reduced-size);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--ds-dur-fast) linear,
              color var(--ds-dur-fast) linear,
              border-color var(--ds-dur-fast) linear;
}

.emails-seg-btn:hover {
  background: var(--ds-surface);
  color: var(--ds-text-primary);
}

.emails-seg-btn[aria-pressed="true"] {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: var(--ds-text-on-accent);
}

/* --------------------------------------------------------------- split layout */

.emails-split {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.emails-list-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emails-item {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--ds-radius-card);
  border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color var(--ds-dur-fast) linear,
              background-color var(--ds-dur-fast) linear;
}

.emails-item:hover {
  background: var(--ds-surface-elevated);
  border-color: var(--ds-divider);
}

.emails-item.is-active {
  border-color: var(--ds-accent);
  background: var(--ds-surface-elevated);
}

.emails-item-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ds-text-tertiary);
}

.emails-item.is-active .emails-item-cat {
  color: var(--ds-link-on-dark);
}

.emails-item-title {
  font-size: var(--ds-type-body-reduced-size);
  font-weight: 600;
  color: var(--ds-text-primary);
}

.emails-item-aud {
  font-size: var(--ds-type-caption-size);
  line-height: 1.45;
  color: var(--ds-text-secondary);
}

.emails-preview-panel {
  border-radius: var(--ds-radius-card);
  border: 1px solid var(--ds-separator-strong);
  background: var(--ds-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.emails-meta-bar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ds-separator);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.emails-meta-title {
  font-family: var(--ds-font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ds-text-primary);
}

.emails-meta-sub {
  font-size: var(--ds-type-body-reduced-size);
  color: var(--ds-text-secondary);
}

.emails-meta-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.emails-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--ds-radius-pill);
  border: 1px solid var(--ds-separator-strong);
  color: var(--ds-text-secondary);
  background: var(--ds-surface-elevated);
}

.emails-stage {
  padding: 20px;
  background: var(--ds-surface-media);
  display: flex;
  justify-content: center;
  min-height: 700px;
}

.emails-frame {
  width: 100%;
  height: 700px;
  border: 1px solid var(--ds-separator);
  border-radius: 10px;
  background: #ffffff;
  transition: width var(--ds-dur-fast) var(--ds-ease);
}

.emails-frame.is-mobile {
  width: 375px;
  max-width: 100%;
}

.emails-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: var(--ds-type-body-reduced-size);
  color: var(--ds-text-secondary);
  border: 1px dashed var(--ds-separator-strong);
  border-radius: var(--ds-radius-card);
}

@media (max-width: 900px) {
  .emails-split {
    grid-template-columns: 1fr;
  }
  .emails-stage {
    padding: 12px;
  }
}
/* ---------------------------------------------------------------- directory */

/* Column visibility popover */
/* Column visibility & organizer popover */
/* Full width, because the thing being organised is. A 540px popover managing a
   1,500px table made every tile a guess about which column it meant; here the
   tiles sit in the same left-to-right order as the columns they control, so the
   menu and the table read as one picture. */
.admin-cols-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 0.5px solid var(--separator-strong);
  border-radius: var(--ds-radius-card);
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.admin-cols-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 0.5px solid var(--separator);
  padding-bottom: 8px;
}

.admin-cols-menu-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-cols-hint {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.admin-cols-title {
  font-weight: 700;
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-cols-device {
  font-size: 11px;
  color: var(--ds-link-on-dark);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 113, 227, 0.14);
  padding: 2px 8px;
  border-radius: var(--ds-radius-pill);
}

.admin-cols-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Desktop: the tiles run left to right and wrap, each one about as wide as the
   label needs. `align-items: stretch` on the row keeps every tile the same
   height when one of them wraps its grip. */
.admin-cols-list.is-horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.admin-col-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--ds-radius-inner);
  background: rgba(255, 255, 255, 0.02);
  border: 0.5px solid var(--separator);
}

.admin-cols-list.is-horizontal .admin-col-item {
  flex: 0 1 auto;
  min-width: 0;
}

/* A hidden column's tile is dimmed rather than absent: the whole point of the
   menu is to show what could be on the table, so removing its own tile when it
   is off would leave no way back. */
.admin-col-item.is-hidden .admin-col-toggle { opacity: 0.45; }

.admin-col-locked {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 5px;
}

.admin-col-item.is-locked {
  background: rgba(255, 255, 255, 0.05);
}

.admin-col-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.admin-col-toggle input {
  accent-color: var(--primary);
  cursor: pointer;
}

.admin-col-item.is-locked .admin-col-toggle {
  cursor: default;
  color: var(--text-secondary);
}

/* ------------------------------------------------------ column move grip */

/* The drag handle, at the LEFT of a tile. Dragging it reorders the column; the
   matching grip at the right edge sets its width. Same look, same gesture,
   opposite ends of the tile.

   It is a handle rather than the whole tile on purpose, and both reasons are
   about not doing something the operator did not ask for:

     * the tile carries a checkbox. A drag that begins on a checkbox is a tap
       that wobbled, and reordering somebody's columns because their finger
       moved four pixels on the way to hiding one is a worse outcome than
       making them aim at a handle;
     * a drag has to beat the page's own scroll, which means `touch-action:
       none` on whatever starts it. Put that on the whole tile and the menu
       stops scrolling on a phone — where the tiles ARE the scrollable area,
       all nine of them. */
.admin-col-move {
  flex: 0 0 auto;
  align-self: stretch;
  width: 18px;
  min-height: 26px;
  margin-right: 2px;
  border-radius: 4px;
  cursor: grab;
  touch-action: none;
  background-image: radial-gradient(circle, var(--text-tertiary) 1px, transparent 1px);
  background-size: 4px 4px;
  background-position: center;
  opacity: 0.55;
  transition: opacity 0.12s ease, background-color 0.12s ease;
}

.admin-col-move:hover,
.admin-col-move:focus-visible,
.admin-col-move.is-dragging {
  opacity: 1;
  background-color: rgba(0, 113, 227, 0.18);
}

.admin-col-move:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus-ring);
}

.admin-col-move:active { cursor: grabbing; }

/* The tile being dragged, and the list it is being dragged through. The tile
   stays in the flow — it is moved for real as the pointer passes each
   neighbour, which is what makes the reorder legible while it happens. */
.admin-col-item.is-dragging {
  opacity: 0.75;
  border-color: var(--ds-accent);
  background: rgba(0, 113, 227, 0.14);
}

.admin-cols-list.is-reordering { user-select: none; }

/* ----------------------------------------------------- column width grip */

/* The drag target. Wide enough to hit without aiming (a 3px line is a 3px
   mistake on a trackpad) and drawn as a grip so it reads as draggable rather
   than as the tile's border. `touch-action: none` is what stops the browser
   scrolling the page instead of tracking the drag, which is the whole gesture
   failing on a touchscreen. */
.admin-col-grip {
  flex: 0 0 auto;
  align-self: stretch;
  width: 14px;
  min-height: 26px;
  margin-left: 2px;
  border-radius: 4px;
  cursor: col-resize;
  touch-action: none;
  background-image: radial-gradient(circle, var(--text-tertiary) 1px, transparent 1px);
  background-size: 4px 4px;
  background-position: center;
  background-repeat: repeat-y;
  opacity: 0.55;
  transition: opacity 0.12s ease, background-color 0.12s ease;
}

.admin-col-grip:hover,
.admin-col-grip.is-dragging {
  opacity: 1;
  background-color: rgba(0, 113, 227, 0.18);
}

/* A column that has been dragged away from its default is tinted, so the menu
   answers "what have I changed?" at a glance and Reset has an obvious target. */
.admin-col-grip.is-custom:not(:hover):not(.is-dragging) {
  background-color: rgba(0, 113, 227, 0.14);
  opacity: 0.85;
}

/* No grips on a phone: the table is a stack of cards there and a column has no
   width to drag. The element is not built at all below the breakpoint, so this
   only catches a window resized across it. */
@media (max-width: 768px) {
  .admin-col-grip { display: none; }
  .admin-cols-menu { padding: 12px; }
}


/* ---------------------------------------------------------------- directory table */

/* TWO SCREENS, TWO ANSWERS, and the reason is the thumb.

   ON A LAPTOP the console is a frame and the list is the only thing in it that
   moves: the options stay where they are, because they are what you reach for
   while reading a 200-row list. The pane takes whatever height the chrome above
   leaves over.

   ON A PHONE the same frame would trap the list in a box a thumb cannot flick
   past, so there the page scrolls normally and only the bar above it is pinned.
   `overflow: visible` is what makes that work — `overflow-x: hidden` would coerce
   the other axis to `auto` and hand back a scroll container with nothing to
   scroll, which on iOS swallows the drag instead of chaining it to the page, so
   the list would not move and the page would not move either. */
.admin-dir-scroll {
  border: 0.5px solid var(--separator);
  border-radius: var(--ds-radius-card);
  background: var(--surface);
  overflow-x: auto;
  overflow-y: auto;
}

/* `flex: 1` rather than the `calc(100dvh - 290px)` this pane used to be sized by.
   The chrome above is not a fixed height — opening the column organiser makes it
   taller, a wrapped toolbar makes it taller again — so any hardcoded offset is
   wrong the moment something up there changes size, and it cannot be right at
   every width. `min-height: 0` on the chain is what lets a flex item shrink below
   its content and scroll rather than stretching its parent to fit all 10,000px of
   table; the pane's own `min-height` then sets the floor a very short window
   cannot go under. */
@media (min-width: 769px) {
  body[data-admin-page="directory"] .admin-layout {
    min-height: 100dvh;
  }

  body[data-admin-page="directory"] .admin-main {
    min-height: 0;
    /* The page bottom padding is there so a scrolling page does not end flush
       against the edge of the screen. Nothing scrolls here but the pane, whose
       own bottom edge is the margin, so 48px of it is just list the frame cannot
       use. */
    padding-bottom: 20px;
  }

  body[data-admin-page="directory"] .admin-dir-scroll {
    flex: 1 1 0;
    min-height: 180px;
  }
}

.admin-dir-table {
  min-width: max-content;
  width: 100%;
}

.admin-dir-head,
.admin-dir-row {
  display: flex;
  align-items: stretch;
}

/* PINNED TO THE PANE, NOT THE PAGE, and that distinction is the whole reason this
   works. A sticky element sticks to its nearest scrolling ancestor, and on a
   laptop that is `.admin-dir-scroll` — which scrolls, because the frame gives it
   the leftover height and it is what the list moves inside. So the column labels
   stay put across 200 rows while the options above them do not: the options are
   in the frame, this is inside the thing that scrolls.

   On a phone the pane is not a scroll container and this row is `display: none`
   anyway, so none of it applies there. */
.admin-dir-head {
  background: var(--surface-elevated);
  border-bottom: 0.5px solid var(--separator-strong);
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.admin-dir-row {
  border-bottom: 0.5px solid var(--separator);
  transition: background-color 0.1s ease;
}

.admin-dir-row:last-child {
  border-bottom: none;
}

.admin-dir-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Fixed Name Column */
.admin-dir-who {
  flex: 0 0 240px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 10px 14px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  border-right: 0.5px solid var(--separator);
}

.admin-dir-row:hover .admin-dir-who {
  background: var(--surface-elevated);
}

.admin-dir-head .admin-dir-who {
  background: var(--surface-elevated);
  z-index: 3;
}

.admin-dir-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dynamic columns */
.admin-dir-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 14px;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  border-right: 0.5px solid var(--separator);
  min-width: 0;
}

.admin-dir-head .admin-dir-cell {
  border-right: 0.5px solid var(--separator-strong);
}

.admin-dir-cell.col-quick {
  flex: 0 0 130px;
}

.admin-dir-cell.col-trade {
  flex: 0 0 160px;
}

.admin-dir-cell.col-dept {
  flex: 0 0 160px;
}

.admin-dir-cell.col-location {
  flex: 0 0 130px;
}

.admin-dir-cell.col-phone {
  flex: 0 0 170px;
}

.admin-dir-cell.col-email {
  flex: 0 0 210px;
}

/* Resizable Column Headers */
.admin-dir-head .admin-dir-cell,
.admin-dir-head .admin-dir-who {
  position: relative;
  user-select: none;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 10;
  transition: background-color 0.15s ease;
}

.col-resizer:hover,
.col-resizer.is-resizing {
  background-color: var(--primary);
}

/* Allow text cells to automatically line-break and wrap cleanly when columns are resized */
.admin-dir-cell-text {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.35;
}

/* Lucide Icon Quick Action Buttons (strictly SVG, zero emojis) */
.admin-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-row);
  border: 0.5px solid var(--separator);
  color: var(--text-secondary);
  transition: all 0.14s ease;
  text-decoration: none;
  cursor: pointer;
}

.admin-quick-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-quick-btn:hover {
  transform: translateY(-1px);
}

.admin-quick-btn.is-wa-call {
  color: var(--green);
  border-color: var(--green-border);
}

.admin-quick-btn.is-wa-call:hover {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

.admin-quick-btn.is-wa-chat {
  color: var(--green);
  border-color: var(--green-border);
}

.admin-quick-btn.is-wa-chat:hover {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

.admin-quick-btn.is-mail {
  color: var(--ds-link-on-dark);
  border-color: var(--blue-border);
}

.admin-quick-btn.is-mail:hover {
  background: rgba(0, 113, 227, 0.14);
  border-color: var(--ds-accent);
  color: var(--ds-link-on-dark);
}

.admin-quick-btn.is-disabled {
  opacity: 0.2;
  pointer-events: none;
  cursor: not-allowed;
}

.admin-dir-cell.col-notes {
  flex: 0 0 220px;
}

.admin-dir-cell.col-projects {
  flex: 0 0 220px;
}

.admin-dir-notes-text {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.admin-dir-actions {
  flex: 0 0 110px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 14px;
  margin-left: auto;
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--surface);
  border-left: 0.5px solid var(--separator);
}

.admin-dir-row:hover .admin-dir-actions {
  background: var(--surface-elevated);
}

.admin-dir-head .admin-dir-actions {
  background: var(--surface-elevated);
  border-left: none;
  z-index: 3;
}

/* Mobile-Specific Directory Presentation */
.admin-dir-mobile-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}

/* Label and value share a line, and the value drops to the next one only when it
   has to. Stacking them unconditionally — the label above, the value below — cost
   two lines per enabled column, so a card with six of them was twelve lines tall
   and the roster stopped being scannable. `flex-wrap` is what makes the break
   automatic instead of chosen: a short value sits beside its label, a long one
   wraps under it, and neither is ever truncated. */
.admin-dir-sub-badge {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
}

.admin-dir-sub-badge strong {
  font-weight: 700;
  color: var(--text-tertiary);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.admin-dir-sub-badge span {
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .admin-dir-head {
    display: none; /* Mobile uses clean row cards; columns are shown as subtitle notes */
  }

  /* Not a scroll container at all down here — see the note on the rule itself.
     The cards fit the screen width, so there is nothing to scroll sideways
     either; anything too wide for the screen is clipped by
     `html, body { overflow-x: hidden }`, as it was before. */
  .admin-dir-scroll {
    overflow: visible;
  }

  .admin-dir-table {
    min-width: 100%;
    width: 100%;
  }

  /* `flex-start`, not `center`. A card whose name and phone were turned on is
     several lines tall, and centring the action buttons against that put them
     beside whatever value happened to land in the middle — so the buttons moved
     from person to person depending on how long their job title was, and it was
     no longer obvious which row they belonged to. Pinned to the top, they line up
     with the name, which is the row they act on. */
  .admin-dir-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 8px;
    border-bottom: 0.5px solid var(--separator);
  }

  .admin-dir-who {
    flex: 1 1 auto;
    position: static;
    border-right: none;
    padding: 0;
    background: transparent !important;
  }

  .admin-dir-name {
    font-size: 15px;
    font-weight: 700;
  }

  .admin-dir-cell.col-quick {
    flex: 0 0 auto;
    border-right: none;
    padding: 0;
  }

  .admin-dir-actions {
    flex: 0 0 auto;
    position: static;
    border-left: none;
    padding: 0;
    background: transparent !important;
  }
}

/* ---------------------------------------------------------------- accounts */

.admin-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--separator);
}

.admin-account-row:last-child { border-bottom: none; }

.admin-account-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-account-name {
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
}

.admin-account-date {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* The role, printed rather than chosen. Two explicit states because "door only"
   is a real, deliberate answer here and not the absence of admin — a blank cell
   next to a name reads as "nobody has decided yet". */
.admin-account-role {
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: var(--ds-radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-account-role.is-admin {
  background: rgba(0, 113, 227, 0.14);
  color: var(--text-primary);
}

.admin-account-role.is-staff {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-tertiary);
}

/* ---------------------------------------------------------------- modal */

.admin-modal-card { max-width: 560px; }

/* THE SHEET BODY, PROPERLY SIZED AND PROPERLY FENCED OFF.

   `flex: 1 1 auto` with `min-height: 0` is the whole reason the bottom of a long
   form is reachable. `.modal-card-body` had no `flex` of its own, so it fell back
   to `flex: 0 1 auto` — its natural height — and a body taller than the card's
   `max-height` simply overflowed, putting the last fields and the note past the
   bottom edge where no gesture could reach them. A flex child only scrolls
   instead of overflowing once it is allowed to shrink below its content, and
   `min-height: 0` is what lifts the automatic minimum that would otherwise refuse.

   `overscroll-behavior: contain` is the second half of "the page behind does not
   scroll". `syncSheetLock` in admin.js pins the page, but the gesture that starts
   inside this element still belongs to it — and with the default `auto`, reaching
   the end of the form handed the remaining momentum to the document underneath,
   moving the list the operator could no longer see. The board's document viewer
   carries the same declaration for the same reason (`.doc-body`). */
.admin-modal-card .modal-card-body {
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}

/* Deleting a person from inside their own sheet.
   It sits between the fields and the footer, on its own ground with a rule above
   it, so that Cancel/Save stay the last thing on the sheet and this never reads
   as one of the ways to leave without saving. `flex: none` keeps it out of the
   body's scroll region — a destructive control that scrolls out of sight is one
   you find by accident, having forgotten it was there. */
.admin-modal-card .modal-card-lifecycle {
  flex: none;
  padding: 14px 18px;
  border-top: 0.5px solid var(--separator);
}

/* Outlined and red-tinted, exactly like `.btn-revoke-link` on a signing link,
   and for the same reason it is not filled: this is the one control on the sheet
   that removes somebody from view, so it should be unmistakable and it should
   never be the thing a thumb lands on by reflex when reaching for Save. */
.btn-person-lifecycle {
  width: 100%;
  min-height: 44px;
  border-radius: var(--ds-radius-pill);
  background: rgba(255, 90, 95, 0.12);
  color: var(--coral);
  border: 1px solid rgba(255, 90, 95, 0.4);
  font-size: 15px;
  font-weight: 600;
}

.btn-person-lifecycle:active {
  background: rgba(255, 90, 95, 0.24);
}

/* The sentence that carries the truth the button's label does not: nothing is
   erased, and this is reversible. Above the button would be read first and skip
   the button; beside it there is no room on a phone. So it goes under, which is
   where a caption to a control belongs, and the button is what stops the eye. */
.modal-card-lifecycle-note {
  margin: 10px 0 0 0;
  color: var(--text-tertiary);
  font-size: 12.5px;
  line-height: 1.45;
}

/* ------------------------------------------------------ console sheet fields

   The console's sheets now speak the same field language the guest signing page
   already speaks (`templates/sign/`, the NDA page): label above, boxed control
   below, a focus border in the interactive colour.

   What this replaces was an iOS-Settings row — label left, value right — and at
   phone width it put the placeholder exactly where a real value sits, at the same
   size and in the same colour. "Gaffer", "Barcelona" and "Europe/Madrid" read as
   answers somebody had already typed, so an operator could not tell an empty
   field from a filled one. The label above is what settles it: it names the
   field, and the hint is demoted to an italic aside the browser drops the moment
   there is a value.

   EVERY RULE HERE IS SCOPED TO `.admin-modal-card`, and the extra `.form-row` in
   the selector is deliberate rather than noise. `.form-row`, `.form-input` and
   `.modal-card` are shared with the DOOR BOARD (templates/index.html — the live
   `/`) and the export sheet (static/app/90-export.js), and they must not move.
   The longer selector also puts these declarations out of reach of the
   `@media (max-width: 460px)` block that stacks `.form-row` for the board, which
   sets `flex: 1 0 100%` on the same elements — a tie decided by source order is
   a tie that breaks the day somebody moves this block. */
.admin-modal-card .form-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

/* A group with no `.form-section-title` above it. The heading contributes
   `margin-top: 20px`, and since nothing else spaces one group from the next that
   margin *is* the separation — so a group that drops its heading has to say so
   here, or it runs into the field above it. Match the 20px exactly. */
.admin-modal-card .form-group.is-spaced { margin-top: 20px; }

.admin-modal-card .form-row {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 0;
  border-bottom: none;
}

.admin-modal-card .form-row .form-label {
  flex: none;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
}

.admin-modal-card .form-row .form-input,
.admin-modal-card .form-row .form-select {
  flex: none;
  box-sizing: border-box;
  width: 100%;
  text-align: left;
  background: var(--surface-row);
  border: 1px solid var(--separator);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-modal-card .form-row .form-input {
  /* Not a style preference. iOS Safari zooms the whole viewport when a field it
     focuses is under 16px, and `!important` is what beats the browser's own rule.
     The guest page carries the same declaration for the same reason. */
  font-size: 17px !important;
}

.admin-modal-card .form-row .form-input::placeholder {
  font-style: italic;
  color: var(--text-tertiary);
}

/* `.form-textarea` had NO rule anywhere in this stylesheet — its only occurrence
   in the repo is the class list on #peNotes. So the Notes box was simply a
   `.form-input`: right-aligned, single-line metrics, and resizable. */
.admin-modal-card .form-row .form-textarea {
  min-height: 76px;
  line-height: var(--leading-normal);
  resize: none;
  font-family: inherit;
}

/* The focus ring this replaces was a 3px hard white box. `input:focus-visible` in
   the global sheet matches ANY focused text input whatever the input modality —
   the browser treats a field you can type into as keyboard territory by
   definition — so every tap on a phone drew it, and it read as an error state
   rather than as focus. A border in the palette's interactive colour, with a soft
   halo behind it, says "this field is live" and stays a real keyboard indicator. */
.admin-modal-card .form-row .form-input:focus,
.admin-modal-card .form-row .form-select:focus,
.admin-modal-card .form-row .form-textarea:focus {
  outline: none;
  border-color: var(--ds-accent);
  box-shadow: var(--ds-focus-ring);
}

.admin-modal-card .form-row .form-input:focus-visible,
.admin-modal-card .form-row .form-select:focus-visible,
.admin-modal-card .form-row .form-textarea:focus-visible {
  outline: none;
}

/* Composite row controls: pairs an input (like coordinates) with an inline action button
   within the standard two-column .form-row in the admin details view. */
.form-row-composite {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  justify-content: flex-end;
}

.form-row-composite .form-input {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
}

/* In modal cards where form-rows are stacked vertically, pairs an input with an inline action button */
.admin-input-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.admin-input-btn-group .form-input,
.admin-modal-card .form-row .admin-input-btn-group .form-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

/* Apple HIG styled button for inline geofence pinning */
.admin-btn-pin {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  white-space: nowrap;
  background: rgba(0, 113, 227, 0.14);
  border: 1px solid var(--blue-border);
  color: var(--ds-link-on-dark);
  border-radius: var(--ds-radius-pill);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.admin-btn-pin:hover {
  background: rgba(0, 113, 227, 0.22);
  border-color: var(--ds-accent);
}

.admin-btn-pin:active {
  transform: scale(0.97);
}

.admin-btn-pin:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.admin-modal-card .admin-btn-pin {
  padding: 12px 14px;
  border-radius: var(--ds-radius-pill);
  font-size: 14px;
}

/* --------------------------------------------------------- console sheet foot

   Cancel and the primary action, pinned below the scrolling body. The header
   already kept its buttons on screen — it sits outside `.modal-card-body` — so
   this is not about persistence; it is about reach. On a phone the top corners of
   a full-width sheet are the two hardest points to hit one-handed, and Add /
   Create / Save were both of them. */
.admin-modal-card .modal-card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 12px 18px calc(var(--safe-bottom) + 12px) 18px;
  border-top: 0.5px solid var(--separator);
  background: var(--surface-elevated);
}

.admin-modal-card .modal-card-foot .btn-text-ghost {
  flex: 0 0 auto;
}

.admin-modal-card .modal-card-foot .btn-text-primary {
  flex: 1 1 auto;
  justify-content: center;
}

/* The close control the header keeps in place of Cancel. Sized to the 44px
   minimum rather than to its glyph, because it is the smallest target on the
   sheet and the only way out that does not require reading anything. */
.admin-modal-card .modal-card-close {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -8px -10px -8px 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.admin-modal-card .modal-card-close:active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.admin-modal-note {
  margin: 14px 4px 0 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-tertiary);
}

.admin-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 12px 0 12px;
}

/* --------------------------------------------------- shared-directory tick box

   Sits in the same row rhythm as the fields above it, but the control is inline
   with its label rather than pushed to the right edge: a lone checkbox stranded
   at the far margin of the modal reads as belonging to nothing in particular.
   `accent-color` is the whole reason this needs no bespoke artwork — the browser
   draws the tick in --blue, which is the palette's interactive colour. */
.form-row-check {
  justify-content: flex-start;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
  color: var(--text-primary);
  -webkit-user-select: none;
  user-select: none;
}

.form-check input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--blue);
}

/* ------------------------------------------------------------------- meals
   The console's reconciliation screen. It reuses `.admin-panel` for its two
   halves, so what is defined here is what no other page has: the number strip,
   the two-column split, the sent/not-sent pill, and the meal table's own grid.
   The table deliberately does NOT borrow `.admin-dir-*` — see the note above it.

   The numbers are the reason the page exists. `--green` for what the scanner
   read, `--text-secondary` for what a human typed, and the total in white — so
   the two are never mistaken for each other at a glance, which is the whole
   point of not adding them together on the server. */
.admin-meals-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.admin-meal-stat {
  flex: 1 1 150px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 0.5px solid var(--separator-strong);
  border-radius: 12px;
}

.admin-meal-stat-num {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums;
}

/* Scanned is the number a caterer is asked to trust, so it is the only one that
   gets a colour — and it is the same green the board uses for "on site". */
.admin-meal-stat.is-scanned .admin-meal-stat-num { color: var(--green); }

.admin-meal-stat-label {
  margin-top: 3px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.admin-meals-split {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 14px;
  align-items: start;
}

/* The table scrolls sideways inside its own panel. The page body must never
   scroll horizontally — on a phone that is how a column becomes unreachable. */
.admin-meals-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 62vh;
}

/* Its own grid rather than the directory's `.admin-dir-*`, which is resizable,
   carries an actions column and collapses to a different shape on a phone — none
   of which this table wants. Six fixed columns, and a `min-width` so they stop
   squeezing and start scrolling instead. */
.admin-meals-table { min-width: 700px; }

.admin-meals-tr {
  display: grid;
  grid-template-columns: minmax(150px, 1.7fr) minmax(110px, 1.1fr) 100px 92px 66px 84px;
  align-items: center;
  border-bottom: 0.5px solid var(--separator);
}

.admin-meals-tr:last-child { border-bottom: none; }
.admin-meals-tr:not(.admin-meals-th):not(.admin-meals-day-banner):hover { background: rgba(255, 255, 255, 0.02); }

.admin-meals-day-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid var(--separator-strong);
  border-bottom: 1px solid var(--separator);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal);
}

/* Pinned to the pane, not the page — the same reasoning `.admin-dir-head` gives:
   a sticky element sticks to its nearest scrolling ancestor, and here that is
   `.admin-meals-scroll`. So the column labels stay put down four hundred rows. */
.admin-meals-th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-elevated);
  border-bottom: 0.5px solid var(--separator-strong);
}

.admin-meals-th .admin-meals-td {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.admin-meals-td {
  padding: 9px 14px;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-meals-td.is-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: #FFFFFF;
}

/* The one column a caterer is entitled to look at and discount, so it is marked
   rather than hidden: amber, which is a note and not an alarm. */
.admin-meals-td.is-manual { color: var(--amber); }

/* The one thing the send list says out loud: this person has no phone number on
   file, so the sender cannot reach them however many times it runs. Not an alarm
   — a walk-in crew member is normal — so it is quiet until somebody looks. */
.admin-pass-pill {
  display: inline-block;
  flex: none;
  padding: 2px 8px;
  border-radius: var(--ds-radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border: 0.5px solid var(--separator-strong);
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* The send list scrolls inside itself, for the same reason the table does and
   with the same limit. A panel that grew to the full height of two hundred crew
   rows would make the whole page a scrollbar and leave the numbers it is meant to
   sit beside far above the fold. */
.admin-meals-passes {
  margin-top: 4px;
  max-height: 62vh;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .admin-meals-split { grid-template-columns: minmax(0, 1fr); }
  .admin-meals-scroll { max-height: none; }
  .admin-meals-passes { max-height: 46vh; }
}

/* legacy wraps console rules removed — styled on --ds-* in 227-admin-wraps.css */

/* legacy wraps-preflight-panel border removed; styled on --ds-* in 227-admin-wraps.css */

.wraps-preflight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--ds-radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--coral);
  background: rgba(255, 90, 95, 0.12);
  border: 0.5px solid rgba(255, 90, 95, 0.35);
  margin-bottom: 10px;
}

.wraps-preflight-badge svg {
  width: 14px;
  height: 14px;
}

.wraps-preflight-list {
  max-height: 240px;
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-sm);
  background: var(--surface-table);
}

.wraps-debt-row {
  padding: 6px 10px;
  border-bottom: 0.5px solid var(--separator);
}

.wraps-debt-row:last-child {
  border-bottom: none;
}

.wraps-debt-docs {
  color: var(--coral);
  font-size: 11px;
}

.wraps-info-details {
  cursor: pointer;
}

.wraps-info-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.wraps-info-summary::-webkit-details-marker {
  display: none;
}

.wraps-info-details[open] .wraps-info-summary {
  border-bottom: none;
}

.wraps-format-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--surface-row);
  border: 0.5px solid var(--separator-strong);
  color: var(--text-secondary);
}

.wraps-format-badge.is-zip { color: var(--amber); border-color: rgba(245, 166, 35, 0.35); background: rgba(245, 166, 35, 0.12); }
.wraps-format-badge.is-csv { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.wraps-format-badge.is-xlsx { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.wraps-format-badge.is-xml { color: var(--ds-link-on-dark); border-color: var(--blue-border); background: rgba(0, 113, 227, 0.14); }

.wraps-deliverable-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--separator);
}

.wraps-deliverable-row:last-child {
  border-bottom: none;
}

/* --------------------------------------------------- Mobile UI & Modal Containment

   Ensures all dialogs, modals, and sheets remain strictly within the viewport,
   accounting for iOS bottom home-indicator bars, notch safe-areas, and small screens.
   Prevents any context window or action buttons from being cut off. */

@media (max-width: 600px) {
  .modal-scrim {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    width: 100%;
    max-width: 100vw;
    border-radius: var(--ds-radius-card) var(--ds-radius-card) 0 0;
    max-height: 90vh;
  }

  .admin-modal-card {
    max-width: 100vw;
  }

  .confirm-box {
    width: calc(100vw - 32px);
    max-width: 360px;
    margin: auto 16px;
    box-sizing: border-box;
  }

  .login-scrim {
    padding: 16px;
    padding-top: calc(var(--safe-top) + 16px);
    padding-bottom: calc(var(--safe-bottom) + 16px);
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
  }

  .login-box {
    width: 100%;
    max-width: 360px;
    margin: auto;
    box-sizing: border-box;
  }

  /* `.admin-userbox` was tightened here to 6px, because the undo/redo pair and
     the account block used to sit in one cluster on the header's right and had
     to be clamped against each other on a phone. Neither is in this header any
     more — the pair is `.globalnav-actions .globalnav-icon` and the account is a
     sheet — so there is nothing left here to tighten. */
}

