/* =====================================================================
   Dale Carnegie ASEAN Summit 2027 — core design system.
   Implements DESIGN.md, which derives from the Dale Carnegie Brand Toolkit
   (March 2019). Loaded by every page; public.css layers the public site
   and the participant portal on top.

   The rules below are brand-mandated. They look like things worth
   "tidying up" and are not:

   * Colour Set 3 only — blue, purple, and limited-use navy. No orange,
     green, yellow or teal: mixing colour sets is a brand breach. (§2)
   * Blue and purple never carry body text, links or small labels on
     white — both sit at ~3.6:1 there. Text on a colour field is black.
     This is why the primary button is black rather than blue. (§2, §6)
   * Navy is limited use: it is what a blue band and a purple band make
     where they overlap, never a fill, button or text colour. (§2)
   * No shadows, no gradients. Depth comes from overlapping fields. (§4)
   * Sentence case — no ALL-CAPS labels, no tracked-out eyebrows. (§3)
   * Square corners on fields, bands and the foundation bar. 4px only on
     things you click, so they read as controls. (§4)
   * Focus is always visible: 3px black outline, 2px offset. (§11)
   ===================================================================== */

/* ── Sanchez, self-hosted ─────────────────────────────────────────────
   Was three <link> tags to fonts.googleapis.com in the public <head>.
   sw.js returns early for cross-origin requests, so that face was never
   cached and went to the network on every cold load — and the portal is
   now an installable app, whose whole point is a phone with a weak signal
   at the resort. Same argument that made the QR libraries and TinyMCE
   local. Licence, provenance and why latin-ext is kept:
   assets/fonts/README.md.

   Paths are relative to this file, so they resolve to /assets/fonts/ with
   no asset_url() stamp — and want none: a font is immutable in practice,
   a new cut would arrive under a new filename. The unicode-range
   descriptors are Google's own, kept so a browser still downloads only the
   subset it needs. */
@font-face{
  font-family:'Sanchez';font-style:normal;font-weight:400;font-display:swap;
  src:url(../fonts/sanchez-regular-latin.woff2) format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face{
  font-family:'Sanchez';font-style:normal;font-weight:400;font-display:swap;
  src:url(../fonts/sanchez-regular-latin-ext.woff2) format('woff2');
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face{
  font-family:'Sanchez';font-style:italic;font-weight:400;font-display:swap;
  src:url(../fonts/sanchez-italic-latin.woff2) format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face{
  font-family:'Sanchez';font-style:italic;font-weight:400;font-display:swap;
  src:url(../fonts/sanchez-italic-latin-ext.woff2) format('woff2');
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root{
  /* Core brand elements [BRAND] */
  --dc-black:#000000;
  --dc-white:#ffffff;

  /* Colour Set 3 [BRAND] — the only set this site uses */
  --dc-blue:#0090cf;      /* PMS 2925 C — primary event accent */
  --dc-purple:#7c7fbd;    /* PMS 2715 C — secondary */
  --dc-navy:#2f519a;      /* PMS 7684 C — LIMITED USE, blend only */

  /* Neutrals (event layer) */
  --dc-grey-900:#000000;  /* body text */
  --dc-grey-500:#6e6e6e;  /* meta text, captions, disabled */
  --dc-grey-200:#e5e5e5;  /* hairlines, table rules */
  --dc-grey-050:#f6f6f6;  /* alternating section background */
  /* Stands in for a photograph until an approved one exists. The photo
     element ALWAYS renders (DESIGN.md §7): a translucent band floating
     over white has nothing to be translucent against, the blue goes
     muddy, and the whole device collapses into a coloured stripe. */
  --dc-photo-well:#3d3d3d;

  /* Semantic aliases — components reference these, not the palette. */
  --ink:var(--dc-grey-900);
  --muted:var(--dc-grey-500);
  --line:var(--dc-grey-200);
  --bg:var(--dc-white);       /* the page is white; there is no dark theme */
  --card:var(--dc-white);
  --bg-soft:var(--dc-grey-050);

  /* THE accent. Every accented surface in this file and in public.css
     reads --accent (or --accent-rgb for a translucent wash) rather than
     naming a palette colour, so the site's accent changes in these two
     lines only. Mirrored in PHP by brand_color() in src/helpers.php, for
     the surfaces a stylesheet cannot reach. Keep the two in step. */
  --accent:var(--dc-blue);
  --accent-rgb:0,144,207;

  /* Status colours — ADMIN CONSOLE ONLY, and only for state (active /
     cancelled / overdue). Set 3 contains no red or green, so these are
     deliberately outside the brand palette: a brand set governs brand
     surfaces, and an organiser scanning a list for cancellations is not
     one. They must never appear on the public site, in email, or on a
     badge. Chosen dark enough to pass AA on white as text. */
  --ok:#0b6b3a;
  --warn:#8a5a00;
  --bad:#b3261e;

  /* Typography [BRAND] — Neue Haas Grotesk Display and Sanchez Slab.
     Neue Haas is NOT loaded as a webfont: the toolkit's licence is
     desktop-only and does not cover @font-face, so --font-display falls
     through to Arial, which the toolkit itself sanctions as the approved
     default. Anyone with the real face installed gets it. Intended interim
     state, not an omission — see DESIGN.md §3 and §12.

     Sanchez IS loaded, from the @font-face block below. That is the
     Google/OFL release, not the toolkit's file, and the OFL expressly
     permits web embedding. It was already being served to every visitor
     from Google's CDN; only the delivery is ours now. The Light weight the
     toolkit wants for subheads does not exist in that release — still open,
     see DESIGN.md §3. */
  --font-display:"Neue Haas Grotesk Display","Helvetica Neue",Arial,Helvetica,sans-serif;
  --font-text:"Sanchez","Sanchez Slab",Cambria,Georgia,serif;

  /* Type scale — major third (1.25) on an 18px body. */
  --text-hero:clamp(2.75rem,7vw,5rem);
  --text-h1:clamp(2rem,4.5vw,3.052rem);
  --text-h2:clamp(1.6rem,3vw,2.441rem);
  --text-h3:1.953rem;
  --text-h4:1.563rem;
  --text-lead:1.25rem;
  --text-body:1.125rem;   /* 18px */
  --text-small:0.9rem;
  --text-meta:0.8rem;

  /* Grid — the toolkit's 18-unit rhythm carried to the web. */
  --container:1152px;     /* 18 × 64px — the admin console's measure */
  /* The public site's side padding, from reference/home.html. Sections
     there run full width inside this padding rather than sitting in a
     fixed container. */
  --page-pad:clamp(20px,5vw,144px);
  --unit:64px;
  --gutter:24px;
  --gutter-sm:16px;

  /* Spacing scale, 8px base */
  --s1:8px; --s2:16px; --s3:24px; --s4:32px; --s5:48px; --s6:64px; --s7:96px; --s8:128px;
  --section-y:96px;
  --section-y-sm:48px;

  /* Square is the brand geometry; 4px marks a control. */
  --radius:0;
  --radius-sm:4px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}

/* The `hidden` attribute has to outrank our own display rules, because any
   author rule at all beats the browser's [hidden]{display:none} — author
   styles win over the UA sheet whatever the specificity. `.btn` sets
   display:inline-flex, so `<button class="btn" hidden>` was VISIBLE: the
   "Add to my home screen" button showed on iPhones, where the install
   prompt it replays does not exist and tapping it did nothing. Anything
   toggled by .hidden = true in JS depends on this one line. */
[hidden]{display:none !important}
/* The public header is sticky, so anything scrolled to — an #anchor, a
   field the browser jumps to on validation, a focused control reached by
   keyboard — would otherwise land underneath it. */
html{scroll-padding-top:96px}
body{
  font-family:var(--font-text);
  font-size:var(--text-body);
  color:var(--ink);
  background:var(--bg);
  line-height:1.7;              /* slab serifs need the extra leading */
  -webkit-font-smoothing:antialiased;
}

/* Links are black and underlined. Blue is 3.6:1 on white, so it cannot
   carry a link; the underline does the work the colour used to. (§2) */
a{color:var(--ink);text-decoration:underline;text-underline-offset:.15em}
a:hover{text-decoration-thickness:3px}

h1,h2,h3,h4{
  font-family:var(--font-display);
  font-weight:700;
  line-height:1.05;
  letter-spacing:-.02em;        /* Neue Haas is meant to be set tight */
  margin:0 0 .4em;
}
h1{font-size:clamp(2.5rem,6vw,3.5rem);letter-spacing:-.025em}
h2{font-size:clamp(1.75rem,4vw,2.5rem)}
h3{font-size:1.35rem;letter-spacing:-.015em}
h4{font-size:var(--text-h4)}
p{margin:0 0 1em;max-width:62ch}
.lead{font-size:var(--text-lead);font-weight:300}
.muted{color:var(--muted)}
.small{font-size:var(--text-small)}
.meta{font-size:var(--text-meta)}

/* Keyboard focus, everywhere, never removed. (§11) */
:focus-visible{outline:3px solid var(--dc-black);outline-offset:2px}
/* …and in white on the two black surfaces, where black would vanish. */
.sidebar :focus-visible,.pub-topbar :focus-visible,.foundation :focus-visible{
  outline-color:var(--dc-white)}

/* Motion is limited to interaction feedback. (§11) */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.01ms !important;animation-iteration-count:1 !important;
    transition-duration:.01ms !important;scroll-behavior:auto !important}
}

/* ── Foundation bar [BRAND] ───────────────────────────────────────────
   A solid black bar across the bottom of every page. It is a core brand
   element: not optional, not decorative, not themeable. The centred
   credit line inside it is the one centred thing on the site. */
.foundation{
  background:var(--dc-black);color:var(--dc-white);
  padding:var(--s3) var(--gutter);
  text-align:center;font-family:var(--font-display);font-size:var(--text-meta);
  line-height:1.6;
}
.foundation a{color:var(--dc-white);text-decoration:underline}
.foundation .mono{font-weight:700;letter-spacing:-.01em;font-size:var(--text-small)}

/* ── Foundation bar [BRAND] ───────────────────────────────────────────
   Bottom of every page, never the masthead. Emitted by foundation_bar() in
   src/layout.php for BOTH chromes so a new page cannot ship without it
   (DESIGN.md §6, §10) — which is why it is styled here, in the stylesheet
   both load, and not in public.css.
   It was in public.css until 2026-09-23, and nothing showed on the public
   site, because that is where it worked. On every admin page the footer
   got no rules at all: no black ground, and the 2000×694 logo at its
   natural size — an invisible white image 783px tall that made the whole
   admin scroll sideways on a phone and printed onto every badge sheet.
   padding-inline repeats what .wrap gives it on public pages (.wrap is
   public-only), so the admin bar is inset the same way; on public pages
   public.css loads later and .wrap sets the identical value. */
.foundation-bar{
  background:var(--dc-black);min-height:96px;
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;
  gap:var(--s3);padding-block:var(--s3);padding-inline:var(--page-pad)}
.foundation-bar img{height:var(--logo-h-foot,32px);width:auto}
.foundation-bar p{font-size:14px;color:var(--dc-white);margin:0;max-width:none}
.foundation-bar a{color:var(--dc-white)}
/* Never on paper. public.css already hid it when printing public pages;
   the admin print pages (badges, packs) hide their own chrome but not this,
   and a solid black bar at the foot of every badge sheet is ink and a page. */
@media print{.foundation-bar{display:none !important}}

/* ── Admin shell ──────────────────────────────────────────────────────
   Internal console. Same tokens and type as the public site; the black
   sidebar is brand geometry, not a dark theme. */
.app{display:flex;min-height:100vh}
.sidebar{width:236px;background:var(--dc-black);color:var(--dc-white);flex-shrink:0;display:flex;flex-direction:column}
.sidebar .brand{padding:20px 18px;font-family:var(--font-display);font-weight:700;font-size:1.05rem;line-height:1.2;border-bottom:1px solid rgba(255,255,255,.14)}
.sidebar .brand small{display:block;color:var(--accent);font-weight:700;font-size:.72rem;margin-top:4px}
.sidebar nav{padding:10px 0;flex:1;overflow:auto}
.sidebar nav a{display:block;color:#cfd4d9;padding:10px 18px;font-family:var(--font-display);font-size:.92rem;border-left:3px solid transparent;text-decoration:none}
.sidebar nav a:hover{background:rgba(255,255,255,.07);color:var(--dc-white);text-decoration:underline}
.sidebar nav a.active{color:var(--dc-white);border-left-color:var(--accent);background:rgba(var(--accent-rgb),.16)}
.sidebar nav .group{padding:14px 18px 4px;font-family:var(--font-display);font-size:.74rem;color:#9aa3ad}
.sidebar .foot{padding:14px 18px;border-top:1px solid rgba(255,255,255,.14);font-size:.8rem;color:#cfd4d9}
.sidebar .foot a{color:var(--dc-white)}

.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{min-height:60px;background:var(--card);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:10px 24px;gap:14px}
.topbar .title{font-family:var(--font-display);font-weight:700;font-size:1.2rem;letter-spacing:-.01em}
.content{padding:24px;max-width:1240px;width:100%;flex:1}

/* ── Buttons (§6) ─────────────────────────────────────────────────────
   Primary is black, not blue: white on blue is 3.6:1 and black on blue is
   4.5:1, so a blue button cannot carry a label at button size either way. */
.btn{
  display:inline-flex;align-items:center;gap:8px;
  font-family:var(--font-display);font-weight:700;font-size:.95rem;line-height:1.2;
  padding:11px 18px;border-radius:var(--radius-sm);cursor:pointer;text-decoration:none;
  min-height:44px;justify-content:center;
  border:2px solid var(--dc-black);background:transparent;color:var(--dc-black);
  transition:background .12s,color .12s;
}
.btn:hover{background:var(--dc-grey-050);text-decoration:none}
.btn-primary{background:var(--dc-black);border-color:var(--dc-black);color:var(--dc-white)}
.btn-primary:hover{background:#262626;color:var(--dc-white)}
/* On a colour field the primary button stays black — white on blue or
   purple fails contrast at label size. (§6) */
.on-colour .btn,.on-colour .btn-primary{border-color:var(--dc-black)}
.btn-dark{background:var(--dc-black);border-color:var(--dc-black);color:var(--dc-white)}
/* Small buttons carry a 1px rule rather than the spec's 2px: admin rows
   stack three or four of them, and at that density the heavier border
   reads as a wall of boxes. Event-layer call, admin only. */
.btn-sm{padding:6px 12px;font-size:.82rem;border-width:1px}
.btn-danger{color:var(--bad);border-color:var(--bad)}
.btn-danger:hover{background:rgba(179,38,30,.08)}
.btn:disabled,.btn[aria-disabled=true]{opacity:.45;cursor:not-allowed}

/* ── Surfaces ─────────────────────────────────────────────────────────
   Square, hairline-bordered, no shadow. (§4) */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius)}
.card .hd{padding:14px 18px;border-bottom:1px solid var(--line);font-family:var(--font-display);font-weight:700;display:flex;align-items:center;justify-content:space-between;gap:12px}
.card .bd{padding:18px}
.grid{display:grid;gap:var(--s3)}
.cols-2{grid-template-columns:repeat(2,1fr)}
.cols-3{grid-template-columns:repeat(3,1fr)}
.cols-4{grid-template-columns:repeat(4,1fr)}
.cols-5{grid-template-columns:repeat(5,1fr)}
@media(max-width:980px){.cols-3,.cols-4,.cols-5{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.cols-2,.cols-3,.cols-4,.cols-5{grid-template-columns:1fr}}

/* KPI tiles */
.kpi{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px}
.kpi .label{font-family:var(--font-display);font-size:var(--text-small);color:var(--muted);font-weight:700}
.kpi .value{font-family:var(--font-display);font-size:2.1rem;font-weight:700;line-height:1.05;letter-spacing:-.02em;margin-top:6px}
.kpi .sub{font-size:var(--text-meta);color:var(--muted);margin-top:4px}
.kpi.accent{border-top:4px solid var(--accent)}

/* Rating bar — a decorative measure, so the accent is allowed here. */
.ratingbar{display:flex;height:10px;overflow:hidden;background:var(--dc-grey-200)}
.ratingbar > span{display:block;background:var(--accent)}

/* ── Tables ───────────────────────────────────────────────────────────
   Long data tables are set in the display face, per the toolkit. */
table.tbl{width:100%;border-collapse:collapse;font-family:var(--font-display);font-size:.92rem}
table.tbl th,table.tbl td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--line)}
table.tbl th{font-size:var(--text-small);color:var(--muted);font-weight:700}
table.tbl th a{color:inherit}
table.tbl tbody tr:hover{background:var(--bg-soft)}
/* Let a cell's long unbroken tokens — an email address, the support URL at the
   end of a mail server's refusal — break anywhere, so they wrap inside the
   column instead of widening the table past a phone's edge. */
.wrap-any{overflow-wrap:anywhere}
/* A table wider than its card scrolls INSIDE the card instead of dragging the
   whole page sideways. The admin is run from a phone, and before this every
   page with a 5-plus column table (participants, the notification queue, the
   dashboard's missing-transfer list) scrolled horizontally as a whole — the
   sidebar button, headings and flash messages sliding off with it.
   Scoped with :has() to card bodies that actually hold a table, because a
   scroll container clips anything positioned outside it; cards without a
   table are left exactly as they were. Browsers without :has() (older than
   Safari 15.4) keep the previous behaviour — nothing worse. */
.card .bd:has(table.tbl){overflow-x:auto}
/* Two more things that pushed admin pages sideways on a phone, found by
   measuring every page at 402px after the rule above:
   - A grid item's default min-width is its content, so a card holding a wide
     table grew its grid track instead of letting the table scroll (the
     dashboard). min-width:0 lets the track stay 1fr and the card do its job.
   - A card header is one flex row; a title plus a long tag ("RM 66,600.00
     outstanding") could not fit and could not wrap (Accommodation). */
.grid > *{min-width:0}
.card .hd{flex-wrap:wrap}
.num{text-align:right;font-variant-numeric:tabular-nums}

/* ── Forms ────────────────────────────────────────────────────────────
   Controls are set in the display face: a slab serif in a text input
   reads as content rather than as something you type into. */
.form-row{margin-bottom:var(--s2)}
label.lbl{display:block;font-family:var(--font-display);font-weight:700;font-size:.92rem;margin-bottom:6px}
/* Every text-like input, by exclusion rather than by list. An explicit
   list silently missed datetime-local, so the arrival and departure fields
   rendered as tiny unstyled controls on both the registration form and the
   portal — and the next new type would have gone the same way. */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]):not([type=reset]):not([type=image]):not([type=range]):not([type=color]):not([type=hidden]),
select,textarea{
  width:100%;padding:11px 12px;border:1px solid var(--dc-black);border-radius:var(--radius-sm);
  font-family:var(--font-display);font-size:1rem;background:var(--dc-white);color:var(--ink)}
input:focus,select:focus,textarea:focus{outline:3px solid var(--dc-black);outline-offset:1px;border-color:var(--dc-black)}
.help{font-size:var(--text-small);color:var(--muted);margin-top:4px;max-width:68ch}
.inline{display:flex;gap:10px;flex-wrap:wrap;align-items:end}

/* ── Flashes and status tags ──────────────────────────────────────────
   Black text on a tinted wash with a 4px rule in the status colour: the
   colour is a marker, never the thing you have to read. */
.flash{padding:12px 16px;border-left:4px solid var(--dc-black);background:var(--bg-soft);
  border-radius:0;margin-bottom:14px;font-size:var(--text-small);color:var(--ink)}
.flash.info{border-left-color:var(--accent)}
.flash.success{border-left-color:var(--ok)}
.flash.error{border-left-color:var(--bad)}

.tag{display:inline-block;background:var(--dc-grey-050);border:1px solid var(--line);
  border-radius:var(--radius-sm);padding:2px 9px;font-family:var(--font-display);
  font-size:var(--text-meta);color:var(--ink);font-weight:700}
.tag-green{border-left:4px solid var(--ok)}
.tag-red{border-left:4px solid var(--bad)}
.tag-amber{border-left:4px solid var(--warn)}
.tag-blue{border-left:4px solid var(--accent)}

/* ── Admin login ──────────────────────────────────────────────────────
   No gradient wash (§10): a black field, as the toolkit would use. */
.auth-wrap{min-height:100vh;display:grid;place-items:center;background:var(--dc-black);padding:var(--gutter)}
.auth-card{background:var(--dc-white);border-radius:var(--radius);width:420px;max-width:92vw;padding:var(--s5) var(--s4)}
.auth-card .brand{font-family:var(--font-display);font-weight:700;font-size:1.3rem;letter-spacing:-.02em;margin-bottom:2px}
.auth-card .brand small{display:block;color:var(--ink);font-size:.8rem;font-weight:400}

/* ── Filters, tabs ────────────────────────────────────────────────────*/
.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:end;margin-bottom:var(--s3)}
.reftabs{display:flex;gap:var(--s3);flex-wrap:wrap;border-bottom:1px solid var(--line);margin-bottom:var(--s3)}
.reftabs a{padding:10px 0;font-family:var(--font-display);font-size:.95rem;font-weight:700;
  color:var(--muted);border-bottom:3px solid transparent;margin-bottom:-1px;text-decoration:none}
.reftabs a:hover{color:var(--ink)}
.reftabs a.active{color:var(--ink);border-bottom-color:var(--accent)}

/* ── Misc ─────────────────────────────────────────────────────────────*/
.row-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--s2);align-items:end}
.form-grid label{display:block;font-family:var(--font-display);font-weight:700;font-size:.92rem}
.form-grid label input,.form-grid label select,.form-grid label textarea{margin-top:6px;font-weight:400}
.form-grid .full{grid-column:1 / -1}
.mt{margin-top:var(--s3)}
.mb{margin-bottom:var(--s3)}
details > summary.btn{list-style:none;display:inline-flex}
details > summary.btn::-webkit-details-marker{display:none}

/* Mobile sidebar drawer (below 768px the sidebar becomes an overlay) */
.sidebar-toggle{display:none}
.sidebar-close{display:none}

@media(max-width:768px){
  .sidebar-toggle{
    display:inline-flex;align-items:center;justify-content:center;
    width:40px;height:40px;border:2px solid var(--dc-black);border-radius:var(--radius-sm);
    background:var(--dc-white);color:var(--ink);font-size:1.3rem;line-height:1;cursor:pointer;flex-shrink:0
  }
  .sidebar{
    position:fixed;top:0;left:0;height:100vh;z-index:1000;
    transform:translateX(-100%);transition:transform .22s ease
  }
  .sidebar.open{transform:translateX(0)}
  .sidebar-close{
    display:inline-flex;align-items:center;justify-content:center;
    position:absolute;top:14px;right:14px;width:32px;height:32px;
    border:none;background:transparent;color:var(--dc-white);font-size:1.5rem;line-height:1;cursor:pointer
  }
  .sidebar-backdrop{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:999}
  .sidebar-backdrop.open{display:block}
  body.sidebar-locked{overflow:hidden}
  .content{padding:var(--gutter-sm)}
}

/* ── photo editor ─────────────────────────────────────────────────────────
   Lives in theme.css rather than public.css, against the split CLAUDE.md
   describes (theme = tokens + admin shell, public = public site + portal),
   because this one component is mounted on BOTH chromes — the delegate's
   portal and admin → Participants — and admin loads only this stylesheet.
   Keeping one copy beats keeping two in step.

   It is rendered INLINE, expanding under the file input, rather than as a
   modal. There is no <dialog> anywhere in this project, and a hand-rolled
   overlay would have to bring its own focus trap, scroll lock, Escape
   handling and iOS soft-keyboard workarounds to be usable. Inline needs none
   of that. Buttons use .btn/.btn-sm, which live in this file and therefore
   work on both chromes; .btn--primary is public-only and would render
   unstyled in admin. */
.pe{margin:var(--s3) 0 0;padding:var(--s3);border:1px solid var(--line);
  border-radius:var(--radius-sm);background:var(--dc-white);max-width:360px}
.pe__stage{position:relative;width:320px;max-width:100%;aspect-ratio:1/1;margin:0 auto}
.pe__canvas{display:block;width:100%;height:100%;background:var(--dc-photo-well);
  border-radius:var(--radius-sm);cursor:grab;
  /* Without this a one-finger drag scrolls the page and panning never works
     on a phone — the single most common Pointer Events mistake. */
  touch-action:none}
.pe__canvas:active{cursor:grabbing}
.pe__canvas:focus{outline:3px solid var(--dc-black);outline-offset:2px}
/* A sibling of the canvas, never a parent: a CSS filter on an ancestor would
   filter this ring along with the photograph. */
.pe__mask{position:absolute;inset:0;border-radius:var(--radius-sm);pointer-events:none;
  box-shadow:0 0 0 999px rgba(255,255,255,.72) inset;
  -webkit-mask:radial-gradient(circle at 50% 50%, transparent 49.5%, #000 50%);
  mask:radial-gradient(circle at 50% 50%, transparent 49.5%, #000 50%)}
.pe__mask::after{content:"";position:absolute;inset:0;border-radius:50%;
  box-shadow:0 0 0 2px var(--dc-black)}
.pe__hint{margin:var(--s2) 0 var(--s1);font-size:.8rem;color:var(--muted);text-align:center}

.pe__presets{display:flex;flex-wrap:wrap;gap:6px;margin:var(--s2) 0}
.pe__preset[aria-pressed="true"]{background:var(--dc-black);color:var(--dc-white);
  border-color:var(--dc-black)}
.pe__fine{margin:var(--s2) 0}

.pe-slider{display:flex;align-items:center;gap:10px;margin:6px 0;font-size:.82rem}
.pe-slider span{flex:0 0 5.5rem;color:var(--muted)}
/* theme.css deliberately excludes [type=range] from its generic input rule, so
   a range renders with UA defaults — and Chrome's default accent is blue,
   which is a brand miss. accent-color is the one-line fix. */
.pe-slider input[type=range]{flex:1;min-width:0;accent-color:var(--accent)}

.pe__bar{display:flex;flex-wrap:wrap;gap:6px;margin-top:var(--s3)}
.pe__use{background:var(--dc-black);color:var(--dc-white);border-color:var(--dc-black)}

/* Re-editing: the button and the status line the editor script creates
   beside the file input. Both exist only when the script runs, so a page
   with JS off shows nothing it cannot honour. */
.pe__edit{margin-top:8px}
.pe__status{margin:6px 0 0;font-size:.82rem;color:var(--muted)}
.pe__status[hidden]{display:none}   /* now redundant — see [hidden] in the reset */

/* ── Key dates editor (admin → Settings) ──────────────────────────────
   One row per Guide-page date. A grid across a laptop, stacked on a phone,
   where organisers are as likely to be editing as at a desk. */
.kd-rows{display:grid;gap:var(--s1)}
.kd-row{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,2fr) minmax(0,1.4fr) auto;
  gap:var(--s1) 12px;align-items:end;padding:12px 0;border-bottom:1px solid var(--line)}
.kd-row--bad{border-left:4px solid var(--bad);padding-left:12px}
.kd-cell{display:flex;flex-direction:column;gap:4px;min-width:0}
.kd-cell > span{font-size:var(--text-meta);color:var(--muted)}
.kd-date[hidden]{display:none !important}
/* Each box keeps its own column, so hiding the date cannot shuffle "What
   happens" into the narrow date slot; "When" takes that slot instead. */
.kd-when{grid-column:1}
.kd-date{grid-column:2}
.kd-what{grid-column:3}
.kd-who{grid-column:4}
.kd-remove{grid-column:5}
.kd-row:has(.kd-date[hidden]) .kd-when{grid-column:1/3}
.kd-remove{display:flex;gap:6px;align-items:center;font-size:var(--text-small);white-space:nowrap;padding-bottom:10px}
.kd-flag{grid-column:1/-1;margin:0;font-size:var(--text-small);color:var(--bad)}
@media(max-width:900px){
  .kd-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .kd-what,.kd-who,.kd-remove{grid-column:1/-1}
  .kd-remove{padding-bottom:0}
}
@media(max-width:520px){
  .kd-row{grid-template-columns:minmax(0,1fr)}
  .kd-when,.kd-date,.kd-row:has(.kd-date[hidden]) .kd-when{grid-column:1/-1}
}
