/* ===========================================================================
   CONNECT by SMFEST — shared stylesheet
   One design system for the whole product: attendee screens, the admin
   console and the door all use this file (guide §21 — no second design
   system). Mobile-first: base rules target a 320–360px Android browser and
   scale up. Light surfaces, navy navigation, blue actions, teal for positive
   context. "The right connection changes everything."
   Release 11 — CONNECT identity.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1a. CONNECT BRAND TOKENS
   ---------------------------------------------------------------------------
   THIS IS THE ONLY BLOCK TO EDIT WHEN THE BRAND CHANGES.
   Every surface, accent, button, border, status and focus ring in the product
   resolves to one of these values. Nothing else in this file, and nothing in
   any template, hard-codes a colour.

   Release 11 moved the product from the dark SMFEST prototype palette to the
   CONNECT identity: light surfaces, midnight navy for navigation and hero
   moments, Connect blue for every action, opportunity teal for positive
   context only. SMFEST endorsement stays visible but subordinate.
   --------------------------------------------------------------------------- */
:root {
  /* -----------------------------------------------------------------------
     THE CONNECT PALETTE — the exact tokens from the brand directive.
     These twelve values are the whole brand. Nothing else in this file and
     nothing in any template may hard-code a colour; everything resolves here.
     ----------------------------------------------------------------------- */
  --navy:          #0B1220;   /* midnight navy — hero, navigation, executive */
  --navy-mid:      #17283F;   /* hero gradient stop */
  --navy-deep:     #123E59;   /* hero gradient end */
  --blue:          #2563EB;   /* Connect blue — every primary action */
  --blue-hover:    #1D4ED8;
  --teal:          #0D9488;   /* opportunity teal — positive context only */
  --teal-bright:   #39D5C0;   /* on navy only; too light for text on white */

  --page:          #F8FAFC;
  --surface:       #FFFFFF;
  --surface-muted: #F1F5F9;

  --ink:           #0F172A;   /* primary text */
  --ink-2:         #475569;   /* secondary text */
  /* The directive's muted text is #64748B. On white that is 4.76:1, but on
     the muted surface it is 4.34:1 and the directive also requires AA at
     4.5:1 — the two asks collide, and accessibility wins. This is the
     smallest darkening that clears AA on both surfaces: 4.94 and 5.41. */
  --ink-muted:     #5E6B7E;   /* muted text — see note */

  --line:          #E2E8F0;
  --line-strong:   #CBD5E1;

  --success:       #15803D;
  --warning:       #B45309;
  --error:         #DC2626;
  --focus:         #2563EB;

  /* Status colours used as TEXT on their own tinted surface. The fill values
     above are correct behind white text (4.9, 4.6 and 4.5 to one) but sit at
     4.26 and 4.35 as dark text on their own washes, which is under AA. These
     are the same hues, darkened just enough. */
  --success-ink:   #15803D;
  --warning-ink:   #9A4708;
  --error-ink:     #C81E1E;

  /* -----------------------------------------------------------------------
     Derived tints. Not new colours: each one is a named token above at low
     opacity, so a tinted surface can never drift away from the hue it is
     meant to echo. The directive forbids inventing accents, not shading the
     ones it gave.
     ----------------------------------------------------------------------- */
  --blue-wash:     rgba(37, 99, 235, .07);
  --blue-edge:     rgba(37, 99, 235, .22);
  --blue-ink:      #1D4ED8;   /* blue dark enough to be body text on white */
  --teal-wash:     rgba(13, 148, 136, .08);
  --teal-edge:     rgba(13, 148, 136, .26);
  --teal-ink:      #0F766E;
  --success-wash:  rgba(21, 128, 61, .08);
  --success-edge:  rgba(21, 128, 61, .26);
  --warning-wash:  rgba(180, 83, 9, .09);
  --warning-edge:  rgba(180, 83, 9, .26);
  --error-wash:    rgba(220, 38, 38, .07);
  --error-edge:    rgba(220, 38, 38, .24);
  --navy-wash:     rgba(11, 18, 32, .05);

  /* On navy surfaces — the sidebar, the hero, the admin rail. */
  --on-navy:       #F1F5F9;
  --on-navy-muted: #94A3B8;
  --on-navy-line:  rgba(255, 255, 255, .12);
  --on-navy-hover: rgba(255, 255, 255, .07);

  --hero-gradient: linear-gradient(135deg, #0B1220 0%, #17283F 55%, #123E59 100%);

  /* -----------------------------------------------------------------------
     Typography. Manrope carries hero and major headings; Inter does the work.
     Both degrade to a system stack if the WOFF2 files are not installed —
     the page never waits on a font it may not have.
     ----------------------------------------------------------------------- */
  --font-display: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* -----------------------------------------------------------------------
     Legacy aliases. Every rule written across Releases 0-10 resolves through
     these, so the rebrand is a remap rather than a rewrite of 900 lines — and
     any rule missed in the sweep still lands on a sane light value instead of
     an invisible one.
     ----------------------------------------------------------------------- */
  --brand-primary:    var(--blue);
  --brand-on-primary: #FFFFFF;
  --brand-secondary:  var(--teal);
  --brand-ink:        var(--navy);
  --bg:        var(--page);
  --panel:     var(--surface);
  --panel2:    var(--surface-muted);
  --surface-2: var(--surface-muted);
  --text:      var(--ink);
  --muted:     var(--ink-muted);
  --accent:    var(--blue);
  --lime:      var(--blue);
  --cyan:      var(--teal);
  --on-accent: #FFFFFF;
  --orange:    var(--warning);
  --danger:    var(--error);
  --ok:        var(--success);
  --border:    var(--line);

  /* Restrained, not heavy — the directive is explicit about this. */
  --shadow:    0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);

  /* Card 16, button 10, per the directive. */
  --radius-sm: 10px;
  --radius-2:  12px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* 8px rhythm. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --font: var(--font-body);
  --nav-height: 64px;
}

/* ---------------------------------------------------------------------------
   1c. Fonts.

   Inter and Manrope arrive from Google Fonts with display=swap, linked from
   the shared <head>. Text is readable on the first paint and the typeface
   lands when it lands, which is the right trade on venue mobile data: a
   blocking font request is how a page looks broken for two seconds.

   The self-hosting path is below, commented, for whenever the third-party
   request is worth removing.
   --------------------------------------------------------------------------- */
/* Commented out on purpose. Live these rules fire two requests per page for
   files that are not in this release, and two 404s on every page load for
   several hundred people on venue mobile data is a real cost for nothing.

   TO SELF-HOST: put inter-variable.woff2 and manrope-variable.woff2 in
   assets/fonts/, uncomment this block, and delete the three Google Fonts
   lines from resources/views/partials/head.php. Nothing else changes.

@font-face {
  font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/inter-variable.woff2") format("woff2");
}
@font-face {
  font-family: Manrope; font-style: normal; font-weight: 600 800; font-display: swap;
  src: url("../fonts/manrope-variable.woff2") format("woff2");
}
*/

/* ---------------------------------------------------------------------------
   2. Reset / base
   --------------------------------------------------------------------------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--page); }

body {
  margin: 0;
  font-family: var(--font);
  /* Flat, not gradient. A page-wide gradient on a light UI reads as a printing
     fault on cheap phone screens, and it was there to hide banding the dark
     palette had. The directive keeps gradients for hero sections only. */
  background-color: var(--page);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue-ink); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; color: var(--blue-hover); }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.02em; color: var(--ink); }
h1 { font-weight: 800; }
h2, h3, h4 { font-weight: 700; }
img { max-width: 100%; height: auto; }

/* Visible focus for keyboard users — accessibility baseline. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--brand-primary); color: var(--on-accent); padding: 10px 14px;
  border-radius: var(--radius-sm); font-weight: 800;
}
.skip-link:focus { left: 8px; }

/* ---------------------------------------------------------------------------
   3. App shell
   --------------------------------------------------------------------------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  /* Navy, on a light product, on purpose. The directive reserves midnight
     navy for navigation and executive moments; it also means the bottom bar
     a door volunteer has used all week does not change under them. */
  background: var(--navy); border-top: 1px solid var(--on-navy-line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 16px rgba(11, 18, 32, .10);
}
/* On a phone the sidebar IS the bottom nav bar, so it carries the nav and
   nothing else. The brand lives in the top bar and the profile-strength meter
   moves onto the dashboard at this width. */
.sidebar .brand, .sidebar .side-card, .sidebar .sidebar-signout { display: none; }

.brand {
  font-weight: 900; letter-spacing: -.04em; font-size: 22px;
  display: flex; align-items: center; gap: var(--space-2);
}
.brand { font-family: var(--font-display); }
.brand .mark {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--brand-primary); color: var(--on-accent);
  display: grid; place-items: center; font-size: 18px; font-weight: 900;
  flex: 0 0 auto;
}
.brand small {
  display: block; color: var(--muted); font-size: 10px;
  letter-spacing: .16em; margin-top: 2px; font-weight: 700;
}

/* The rail is navy while the page is light, so everything sitting on it needs
   its own colours. Without this the wordmark renders in --ink and disappears
   into the navy, which is exactly what happened the first time. */
.sidebar .brand { color: var(--on-navy); }
.sidebar .brand small { color: var(--on-navy-muted); }
.sidebar .brand .mark { background: var(--blue); color: #fff; }
.sidebar .sidebar-signout .btn {
  background: transparent; color: var(--on-navy);
  border: 1px solid var(--on-navy-line);
}
.sidebar .sidebar-signout .btn:hover {
  background: var(--on-navy-hover); color: #fff; border-color: rgba(255, 255, 255, .28);
}
.sidebar :focus-visible { outline-color: var(--teal-bright); }

/* Logo file variant: when assets/img/logo.svg exists, brand_mark() renders it
   in place of the letter tile. Sized to the same 36px box so no layout shifts. */
.brand .mark.has-logo { background: none; border-radius: 0; width: auto; height: 36px; }
.brand .mark.has-logo img { height: 36px; width: auto; display: block; }
.brand.lockup .words { display: none; }   /* full-lockup logo: image carries the wordmark */
.brand.stacked { flex-direction: column; text-align: center; gap: 8px; }

.nav { display: flex; overflow-x: auto; gap: 2px; scrollbar-width: none; }
/* The groups exist for the rule below; they must not become flex items of their
   own or every link in a group would be squeezed into one column. */
.nav-group { display: contents; }
/* The HTML `hidden` attribute, made to actually hide things.
   Every utility in this file that sets `display` — .block, .chips, .person and
   the rest — outranks the browser's own `[hidden] { display: none }`, so a
   script hiding an element by setting `.hidden = true` was silently ignored.
   It showed up as an iPhone being offered a big "Start the camera" button
   directly above the paragraph explaining that this phone cannot scan. */
[hidden] { display: none !important; }

/* Release 10. The door link is the one thing a volunteer is doing for the next
   four hours, so it is marked rather than merely present — at a glance, on a
   phone held at arm's length, in a queue. */
.nav-door a { color: var(--lime, var(--blue)); }
.nav-door a.active { background: var(--blue-wash); color: var(--blue-ink); }

/* On a phone, an administrator's bar carries the console and nothing else.
   Sixteen destinations in a bar that fits five is a bar nobody can use, and the
   attendee half is the half an operator is not in. The attendee screens are
   still reachable — the admin pages link to them — and above 981px both groups
   are shown as usual. */
.admin-mode .nav-attendee { display: none; }
.nav::-webkit-scrollbar { display: none; }
.nav .section { display: none; }
.nav a, .nav button {
  border: 0; background: transparent; color: var(--on-navy-muted); text-align: center;
  padding: 8px 6px; border-radius: 12px; min-width: 62px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; text-decoration: none; flex: 1 0 auto;
}
.nav a .icon, .nav button .icon { font-size: 18px; line-height: 1; }
.nav a.active, .nav button.active { background: var(--blue); color: #fff; }
/* Five destinations is what a 360px bottom bar holds. Profile is reached from
   the top-bar avatar at this width; the sidebar carries it again from 981px. */
.nav a.desktop-only { display: none; }

.identity {
  display: flex; align-items: center; gap: var(--space-2);
  color: inherit; text-decoration: none; border-radius: 999px; min-width: 0;
}
.identity:hover { text-decoration: none; opacity: .85; }
.nav a:hover, .nav button:hover { background: var(--on-navy-hover); color: #fff; text-decoration: none; }
.nav .badge-dot {
  position: absolute; transform: translate(14px, -4px);
  width: 8px; height: 8px; border-radius: 50%; background: var(--lime);
}

.side-card {
  margin-top: var(--space-5); padding: var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--on-navy-hover); border-color: var(--on-navy-line);
}
.side-card b { display: block; margin-bottom: 7px; color: var(--on-navy); }
.side-card p { color: var(--on-navy-muted); font-size: 12px; line-height: 1.5; margin: 8px 0 0; }

.progress { height: 8px; background: var(--surface-muted); border-radius: 30px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand-primary); border-radius: 30px; transition: width .4s ease; }

.main { padding: var(--space-3) var(--space-3) calc(var(--nav-height) + 28px); }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-2); margin-bottom: var(--space-4);
  flex-wrap: wrap;   /* brand + identity + sign-out do not fit on one 360px line */
  padding: var(--space-3);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.topbar .brand { font-size: 18px; }
.search {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--surface-muted); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px var(--space-3); width: 100%;
}
.search input { width: 100%; background: transparent; border: 0; outline: none; color: var(--ink); }
.search input::placeholder { color: var(--ink-muted); }

.user { display: flex; align-items: center; gap: var(--space-2); flex: 1 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.user .meta { display: none; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: var(--blue);
  color: #fff; display: grid; place-items: center; font-weight: 700;
  overflow: hidden; font-size: 14px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 54px; height: 54px; font-size: 18px; }
.avatar.xl { width: 84px; height: 84px; font-size: 26px; }

.badge {
  font-size: 11px; background: var(--surface-muted); color: var(--ink-2);
  padding: 5px 9px; border-radius: 999px; font-weight: 700; white-space: nowrap;
}
.badge.lime { background: var(--blue-wash); color: var(--blue-ink); }
.badge.admin-tag { background: var(--navy-wash); color: var(--navy); border: 1px solid var(--line-strong); }

/* ---------------------------------------------------------------------------
   4. Hero / page headers
   --------------------------------------------------------------------------- */
.hero {
  padding: var(--space-5); border-radius: var(--radius-xl);
  /* The one place a gradient is allowed, and it is the directive's exact one.
     Bright teal appears here and nowhere else: it has the contrast for navy
     and nothing like enough for white. */
  background:
    radial-gradient(circle at 85% 18%, rgba(57, 213, 192, .16), transparent 30%),
    var(--hero-gradient);
  border: 0; box-shadow: var(--shadow); color: var(--on-navy);
}
.hero h1, .hero h2 { color: #fff; }
.hero .eyebrow {
  color: var(--brand-primary); font-weight: 800; font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase;
}
.hero h1 { font-size: 28px; line-height: 1.08; letter-spacing: -.04em; max-width: 780px; margin: 12px 0; }
.hero p { color: var(--on-navy-muted); max-width: 720px; line-height: 1.6; margin: 0; }
.hero-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); flex-wrap: wrap; }

.section-title {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--space-3); margin: var(--space-5) 0 var(--space-3); flex-wrap: wrap;
}
.section-title h2 { margin: 0; font-size: 18px; }
.section-title p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------------------
   5. Buttons
   --------------------------------------------------------------------------- */
.btn {
  border: 0; border-radius: var(--radius-sm); padding: 12px 16px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; /* Android touch target */
  text-decoration: none; line-height: 1.2; text-align: center;
}
/* A button with no colour modifier falls through to the secondary look, so a
   forgotten modifier is a plain button rather than an unreadable one. */
.btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
/* brightness() on a light button washes it out instead of darkening it, so
   hover is an explicit colour per variant from here down. */
.btn:hover { text-decoration: none; background: var(--surface-muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; background: var(--surface-muted); color: var(--ink-muted); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }
.btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn.primary:disabled { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn.secondary:hover { background: var(--surface-muted); border-color: var(--ink-muted); }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line-strong); }
.btn.ghost:hover { background: var(--surface-muted); color: var(--ink); }
.btn.danger { background: var(--surface); color: var(--error-ink); border: 1px solid var(--error-edge); }
.btn.danger:hover { background: var(--error-wash); border-color: var(--error); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: 13px; }

/* ---------------------------------------------------------------------------
   6. Layout grid & cards
   --------------------------------------------------------------------------- */
.grid { display: grid; gap: var(--space-3); }
.grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
/* Grid children must be allowed to shrink, or a wide table or a long
   unbroken string inside one pushes the whole page sideways on a phone. */
.grid > * { min-width: 0; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.card.flush { padding: 0; overflow: hidden; }
.card h2, .card h3 { margin-top: 0; }

.metric strong { font-size: 26px; display: block; letter-spacing: -.04em; line-height: 1.1; }
.metric span { color: var(--muted); font-size: 12px; }

/* `auto` rather than a fixed 54px, so the xl avatar on the match detail
   screen gets its own width instead of spilling over the name beside it. */
.person { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; }
.person h3 { margin: 0 0 3px; font-size: 16px; }
.person p { margin: 0; color: var(--muted); font-size: 12px; }
.person .score { grid-column: 2; font-weight: 900; color: var(--brand-primary); }

.reason {
  margin: var(--space-3) 0; padding: var(--space-3); border-radius: 12px;
  background: var(--surface-muted); color: var(--ink-2); font-size: 13px; line-height: 1.55;
}
.reason b { color: var(--ink); }

/* ---------------------------------------------------------------------------
   Score breakdown (match detail) — every number the engine stored, shown.
   --------------------------------------------------------------------------- */
.big-score {
  font-family: var(--font-display); font-weight: 900; font-size: 34px; line-height: 1;
  color: var(--brand-primary);
}

.score-row {
  display: grid; grid-template-columns: 1fr auto; gap: 2px var(--space-3);
  align-items: baseline; margin-bottom: var(--space-3);
}
.score-row .label { font-size: 13px; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.score-row .value { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }

.score-track {
  grid-column: 1 / -1; display: block; height: 6px; border-radius: 999px;
  background: var(--surface-muted); border: 1px solid var(--line); overflow: hidden;
}
.score-track > span {
  display: block; height: 100%; border-radius: 999px;
  background: var(--brand-secondary); transition: width .2s ease;
}
.score-track.primary > span { background: var(--brand-primary); }

.legend {
  display: flex; flex-wrap: wrap; gap: 6px var(--space-3);
  margin-top: var(--space-3); font-size: 11px; color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }

.privacy-note {
  display: flex; gap: 9px; align-items: flex-start;
  margin-top: var(--space-3); padding: var(--space-3);
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted);
  font-size: 12px; line-height: 1.5; color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Connections — the request box, the activity trail, the notification list.
   --------------------------------------------------------------------------- */
/* On a phone the nav item is a column (icon over label), so the count rides on
   the icon. From 981px the sidebar item is a row and it sits at the far end. */
.nav-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px;
  background: var(--brand-primary); color: var(--brand-on-primary);
  font-size: 10px; font-weight: 900; line-height: 1;
}
.nav a { position: relative; }
.nav a .nav-badge { position: absolute; top: 2px; right: 8px; }

.bell {
  position: relative; display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  background: var(--surface-muted); border: 1px solid var(--line); color: var(--ink-2);
  text-decoration: none; font-size: 15px;
}
.bell:hover { background: var(--surface-muted); }
.bell.has-unread { border-color: var(--brand-primary); }
.bell .nav-badge {
  position: absolute; top: -5px; right: -5px; margin-left: 0;
  border: 2px solid var(--panel);
}

.request-box {
  margin-top: var(--space-3); padding: var(--space-3);
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted);
}
.request-box .field { margin-bottom: var(--space-3); }
.request-box label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 7px; font-weight: 600; }

/* ---------------------------------------------------------------------------
   Meetings — the facts strip, and the admin zone editor rows.
   --------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------
   The notification opt-in card. One card, five states, only one ever visible.
   --------------------------------------------------------------------------- */
.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rating-option {
  position: relative; display: grid; place-items: center; gap: 2px; padding: 10px 4px;
  cursor: pointer; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  text-align: center; min-width: 0;
}
/* The selector carries .field because the generic `.field input { width: 100% }`
   rule below would otherwise win on source order and stretch each radio to the
   full page width — which it did, pushing the layout 1089px sideways. */
.field .rating-option input, .rating-option input {
  position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; padding: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden;
}
.rating-option b { font-size: 16px; color: var(--ink); }
.rating-option span { font-size: 9px; line-height: 1.2; color: var(--muted); }
.rating-option:hover { border-color: var(--brand-primary); }
.rating-option:has(input:checked), .rating-option.is-chosen {
  border-color: var(--blue); background: var(--blue-wash);
}
.rating-option:has(input:focus-visible) { outline: 2px solid var(--brand-secondary); outline-offset: 2px; }

.checkline {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  font-size: 12px; color: var(--ink-2); line-height: 1.5; cursor: pointer;
}
.field .checkline input, .checkline input {
  margin-top: 2px; width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--brand-primary);
}

.qr-frame {
  display: inline-block; padding: var(--space-3);
  background: #fff; border-radius: var(--radius-lg); line-height: 0;
}
.qr-frame svg { display: block; width: 100%; max-width: 280px; height: auto; }
.qr-url { font-size: 11px; word-break: break-all; color: var(--muted); margin: var(--space-3) 0; }

.push-card {
  margin-bottom: var(--space-4); padding: var(--space-4);
  border: 1px solid var(--success-edge); border-radius: var(--radius-lg);
  background: linear-gradient(140deg, var(--success-wash), var(--surface-muted));
}
.push-card > div { display: none; }
.push-card[data-state="asking"] .push-ask,
.push-card[data-state="working"] .push-working,
.push-card[data-state="done"] .push-done,
.push-card[data-state="failed"] .push-failed,
.push-card[data-state="unsupported"] .push-unsupported { display: block; }

.push-ask { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; }
.push-icon {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-primary); color: var(--brand-on-primary); font-size: 18px; flex: 0 0 auto;
}
.push-body { min-width: 0; }
.push-card h3 { margin: 0 0 6px; font-size: 16px; }
.push-card p { margin: 0 0 var(--space-3); font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.push-card p:last-child { margin-bottom: 0; }

.push-list { margin: 0 0 var(--space-3); padding: 0; list-style: none; }
.push-list li {
  position: relative; padding-left: 20px; font-size: 13px; color: var(--ink); line-height: 1.7;
}
.push-list li::before {
  content: '\2713'; position: absolute; left: 0; color: var(--brand-primary); font-weight: 900;
}

.meeting-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-3); margin: var(--space-3) 0;
  padding: var(--space-3); border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted);
}
.meeting-facts > div { min-width: 0; }
.meeting-facts .mini { display: block; margin-bottom: 3px; }
.meeting-facts b { color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }

.zone-row {
  display: grid; grid-template-columns: 1fr; gap: 9px; align-items: center;
  padding: var(--space-3) 0; border-bottom: 1px solid var(--line);
}
.zone-row:last-child { border-bottom: 0; }
.zone-row b { font-size: 13px; color: var(--ink); }
.zone-row form { display: grid; grid-template-columns: 80px 1fr auto; gap: 7px; align-items: center; }
.zone-row form:last-child { grid-template-columns: 1fr; }
.zone-row input {
  width: 100%; min-width: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 9px 11px; font-size: 13px; font-family: inherit;
}
@media (min-width: 981px) {
  .zone-row { grid-template-columns: 170px 1fr auto; }
  .zone-row form:last-child { grid-template-columns: auto; }
}

/* The proposal form shows only the fields that the chosen meeting type needs.
   Visible by default so the form still works with JavaScript switched off. */
[data-when-type] { display: block; }

.trail { list-style: none; margin: 0; padding: 0; }
.trail li {
  position: relative; padding: 0 0 var(--space-3) var(--space-4);
  border-left: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}
.trail li:last-child { border-left-color: transparent; padding-bottom: 0; }
.trail li::before {
  content: ''; position: absolute; left: -4px; top: 5px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand-secondary);
}
.trail li b { color: var(--ink); font-weight: 700; }

.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li { border-bottom: 1px solid var(--line); }
.notice-list li:last-child { border-bottom: 0; }
.notice-list li.unread { background: var(--blue-wash); }
.notice {
  display: block; width: 100%; text-align: left; padding: var(--space-3);
  background: none; border: 0; color: var(--ink-2); font: inherit; font-size: 13px;
  line-height: 1.5; cursor: pointer; border-radius: 10px;
}
.notice:hover { background: var(--surface-muted); }
.notice b { color: var(--ink); }
.notice-list li.unread .notice b::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-primary); margin-right: 7px; vertical-align: middle;
}

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-muted); color: var(--ink-2); font-size: 12px; font-weight: 500;
}
.chip.need { border-color: var(--teal-edge); background: var(--teal-wash); color: var(--teal-ink); }
.chip.offer { border-color: var(--blue-edge); background: var(--blue-wash); color: var(--blue-ink); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: var(--space-3); }

.status { font-size: 12px; padding: 5px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.status.ok { background: var(--success-wash); color: var(--success-ink); }
.status.pending { background: var(--warning-wash); color: var(--warning-ink); }
.status.new { background: var(--blue-wash); color: var(--blue-ink); }
.status.off { background: var(--error-wash); color: var(--error-ink); }
.status.neutral { background: var(--navy-wash); color: var(--ink-2); }

/* ---------------------------------------------------------------------------
   7. Forms
   --------------------------------------------------------------------------- */
/* align-content: start keeps the last row from absorbing spare height when a
   short form sits beside a taller one in a two-column grid. */
.form { display: grid; gap: var(--space-3); align-content: start; }
.field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 7px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 12px; outline: none; min-height: 46px;
  font-size: 16px; /* 16px prevents iOS zoom-on-focus */
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan); }
.field .hint { color: var(--muted); font-size: 11px; margin-top: 6px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field .error { color: var(--error-ink); font-size: 12px; margin-top: 6px; font-weight: 500; }

.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice {
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); min-height: 42px;
}
.choice.selected { background: var(--brand-primary); color: var(--on-accent); border-color: var(--lime); font-weight: 800; }
.choice:disabled { opacity: .4; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input { width: 20px; height: 20px; min-height: 0; flex: 0 0 auto; margin-top: 2px; }
.checkbox-row label { margin: 0; font-size: 13px; color: var(--ink-2); }

/* ---------------------------------------------------------------------------
   8. Tables (horizontal scroll on phones — never break the page)
   --------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: var(--surface); min-width: 560px; }
/* A two- or three-column table does not need 560px, and forcing it clips the
   last column inside a half-width card. Wide tables keep the floor and scroll. */
.table-wrap.compact table { min-width: 0; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--ink-2); background: var(--surface-muted); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; position: sticky; top: 0; }
td { color: var(--ink); }
tr:last-child td { border-bottom: 0; }
.mini { color: var(--muted); font-size: 11px; }

/* ---------------------------------------------------------------------------
   9. Tabs, timeline, charts, QR
   --------------------------------------------------------------------------- */
.tabs { display: flex; gap: 8px; margin-bottom: var(--space-4); flex-wrap: wrap; }
.tabs a, .tabs button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px;
  text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; gap: 6px;
}
.tabs a.active, .tabs button.active { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }
/* Anything nested in a filled control inherits it, or a muted span keeps its
   own grey and lands on blue at 1.09:1. */
.tabs a.active *, .tabs button.active *,
.btn.primary *, .door-card.ok *, .door-card.warn *, .door-card.bad *, .door-card.ask * { color: inherit; }
.tabs a:hover, .tabs button:hover { text-decoration: none; }

.timeline { display: grid; gap: var(--space-2); }
.event {
  display: grid; grid-template-columns: 1fr; gap: 8px;
  border-left: 3px solid var(--brand-secondary); padding: var(--space-3);
  background: var(--surface-muted); border-radius: 12px;
}
.event .time { font-weight: 900; }

.bar { height: 10px; background: var(--surface-muted); border-radius: 10px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand-secondary); border-radius: 10px; }

.chart { height: 160px; display: flex; align-items: flex-end; gap: 8px; padding-top: 22px; }
.chart i { flex: 1; background: linear-gradient(var(--brand-secondary), var(--teal)); border-radius: 8px 8px 2px 2px; min-width: 18px; position: relative; }
.chart i b { position: absolute; top: -20px; width: 100%; text-align: center; font-size: 10px; color: var(--ink-muted); }

.qr {
  width: 180px; height: 180px; margin: auto;
  border: 12px solid #fff; border-radius: 12px; background: #fff;
  display: grid; place-items: center;
}
.qr img, .qr svg { width: 100%; height: 100%; display: block; }

/* ---------------------------------------------------------------------------
   10. Modal, toast, flash, empty states
   --------------------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; background: rgba(11, 18, 32, .55);
  display: none; place-items: center; padding: var(--space-4); z-index: 40;
  overflow-y: auto;
}
.modal.open { display: grid; }
.modal-card {
  width: min(620px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: var(--space-5); box-shadow: var(--shadow);
  max-height: 90vh; overflow-y: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.modal-head h3 { margin: 0; }
.close { background: transparent; border: 0; color: var(--ink-muted); font-size: 26px; line-height: 1; padding: 4px 8px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-height) + 16px); background: var(--brand-primary); color: var(--on-accent);
  padding: 12px 18px; border-radius: 12px; font-weight: 900; display: none;
  z-index: 50; box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { display: block; }

.flash-stack { display: grid; gap: 8px; margin-bottom: var(--space-4); }
.flash {
  border-radius: var(--radius); padding: 12px var(--space-3); font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--line); background: var(--surface); display: flex; gap: 10px; align-items: flex-start;
}
.flash.success { border-color: var(--success-edge); background: var(--success-wash); color: var(--success-ink); }
.flash.error { border-color: var(--error-edge); background: var(--error-wash); color: var(--error-ink); }
.flash.info { border-color: var(--blue-edge); background: var(--blue-wash); color: var(--blue-ink); }
.flash.warning { border-color: var(--warning-edge); background: var(--warning-wash); color: var(--warning-ink); }

.empty {
  padding: var(--space-6) var(--space-4); text-align: center; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-muted);
}
.empty { color: var(--ink-2); }
.empty h3 { color: var(--ink); margin: 0 0 8px; }
.empty p { margin: 0 auto 16px; max-width: 420px; font-size: 13px; }

/* ---------------------------------------------------------------------------
   11. Auth / centred pages
   --------------------------------------------------------------------------- */
.centre-shell {
  min-height: 100vh; display: grid; place-items: center;
  padding: var(--space-4);
}
.centre-card { width: min(460px, 100%); }
.centre-card.wide { width: min(900px, 100%); }
.centre-card .brand { justify-content: center; margin-bottom: var(--space-4); }

.page-footer {
  margin-top: var(--space-6); padding-top: var(--space-4);
  border-top: 1px solid var(--line); color: var(--muted); font-size: 12px;
  display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: space-between;
}

/* Status-check list used by the installer page */
.check-list { display: grid; gap: 8px; }
.check {
  display: grid; grid-template-columns: 22px 1fr; gap: 10px;
  padding: 11px var(--space-3); border-radius: 12px; background: var(--surface-muted);
  border: 1px solid var(--line); font-size: 13px;
}
.check .dot { font-weight: 900; }
.check.pass .dot { color: var(--ok); }
.check.warn .dot { color: var(--orange); }
.check.fail .dot { color: var(--danger); }
.check .detail { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; word-break: break-word; }

code, pre, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px;
  overflow-wrap: anywhere; word-break: break-word;
}
pre {
  background: var(--surface-muted); border: 1px solid var(--line); border-radius: 12px;
  padding: var(--space-3); overflow-x: auto; color: var(--ink);
}
code { background: var(--surface-muted); padding: 2px 6px; border-radius: 6px; color: var(--ink); }
pre code { background: none; padding: 0; }

/* ---------------------------------------------------------------------------
   12. Tablet
   --------------------------------------------------------------------------- */
@media (min-width: 681px) {
  body { font-size: 15.5px; }
  .main { padding: var(--space-5) var(--space-5) calc(var(--nav-height) + 32px); }
  .grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 34px; }
  .person { grid-template-columns: auto 1fr auto; }
  .person .score { grid-column: auto; }
  .event { grid-template-columns: 92px 1fr auto; align-items: center; }
  .user .meta { display: block; }
  .metric strong { font-size: 30px; }
}

/* ---------------------------------------------------------------------------
   13. Desktop — sidebar returns, as in the prototype
   --------------------------------------------------------------------------- */
.topbar-signout { display: block; }

@media (min-width: 981px) {
  /* The rail is sticky and one viewport tall, so on a long page the column
     beneath it would show the light page through — the navy would look like a
     floating block rather than a rail. Painting the column on the grid itself
     keeps it full height whatever the content does. */
  .app {
    display: grid; grid-template-columns: 260px 1fr;
    background: linear-gradient(to right, var(--navy) 0 260px, var(--page) 260px);
  }
  .topbar-signout { display: none; }  /* the sidebar carries it at this width */
  .sidebar {
    position: sticky; top: 0; left: auto; right: auto; bottom: auto;
    height: 100vh; padding: 26px 18px; border-top: 0;
    border-right: 1px solid var(--on-navy-line);
    background: var(--navy);
    overflow-y: auto;
  }
  .admin-mode .nav-attendee { display: contents; }
  .sidebar .brand { display: flex; }
  .sidebar .side-card { display: block; }
  .sidebar .sidebar-signout { display: block; margin-top: var(--space-4); }
  .nav { display: grid; gap: 7px; margin-top: var(--space-6); overflow: visible; }
  .nav .section {
    display: block; color: var(--on-navy-muted); text-transform: uppercase; font-size: 10px;
    font-weight: 800; letter-spacing: .18em; margin: var(--space-4) var(--space-2) var(--space-1);
  }
  .nav a, .nav button {
    flex-direction: row; text-align: left; justify-content: flex-start;
    padding: 12px 13px; font-size: 14px; font-weight: 600; min-width: 0; gap: var(--space-2);
  }
  .nav a .nav-badge { position: static; margin-left: auto; }
  .nav a.desktop-only { display: flex; }
  .main { padding: var(--space-5) 28px 60px; }
  /* On desktop the rail already carries the brand, so the top bar holds only
     the identity cluster on the right. A full-width white panel behind one
     cluster reads as an empty box, so the surface treatment is for phones. */
  .topbar {
    justify-content: flex-end; background: transparent;
    border: 0; padding: 0; margin-bottom: var(--space-4);
  }
  .topbar .brand { display: none; }
  .search { min-width: 330px; width: auto; }
  .grid { gap: var(--space-4); }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 28px; }
  .hero h1 { font-size: 42px; line-height: 1.02; }
  .chart { height: 180px; gap: 12px; }
  .toast { left: auto; right: 24px; bottom: 24px; transform: none; }
}

/* ---------------------------------------------------------------------------
   13b. Release 6 — verification queue, operations
   --------------------------------------------------------------------------- */

/* One outcome and its decision, side by side on a desktop and stacked on a
   phone. The decision form is deliberately next to the thing being decided:
   an operator working through forty outcomes should never have to remember
   which row they are on. */
.outcome-row {
  display: grid; grid-template-columns: 1fr; gap: var(--space-3);
  padding: var(--space-4) 0; border-bottom: 1px solid var(--border);
}
.outcome-row:last-child { border-bottom: 0; padding-bottom: 0; }
.outcome-main { min-width: 0; overflow-wrap: anywhere; }

.outcome-actions {
  display: grid; gap: var(--space-2); align-content: start;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-2); padding: var(--space-3);
}
.outcome-actions .field { margin: 0; }
.outcome-actions .field input,
.outcome-actions .field select { width: 100%; }
.outcome-actions .btn { justify-self: start; }

/* The cancel-a-meeting control lives inside a table cell, so it has to stay
   narrow and must never force the table wider than its wrapper. */
.inline-cancel { display: grid; gap: 6px; min-width: 0; }
.inline-cancel input { width: 100%; min-width: 0; }
.inline-cancel .btn { justify-self: start; }

/* Buttons that sit in a row and wrap on a phone rather than overflowing. */
.form-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.form-row form { margin: 0; }

@media (min-width: 981px) {
  .outcome-row { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: var(--space-5); }
}

/* A value the operator has to read out loud or copy exactly once — a
   password-reset URL at the registration desk. Selectable in one click,
   wrapping rather than overflowing, and visually distinct from body text so
   nobody mistakes it for prose. */
.key {
  background: var(--surface-muted); border: 1px solid var(--line); border-radius: var(--radius-2);
  padding: var(--space-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: var(--teal-ink); overflow-wrap: anywhere; word-break: break-all;
  -webkit-user-select: all; user-select: all;
}

/* ---------------------------------------------------------------------------
   The ladder: tiers and roles.

   Deliberately NOT a table. The organiser's screen has a summary and an edit
   form for every row, and a table forces that pair into one cell, which at
   360px means a horizontally scrolling box with the save button off the edge
   of it. A row that stacks on a phone and goes side by side on a laptop reads
   correctly at both, and nothing is ever out of reach of a thumb.
   --------------------------------------------------------------------------- */
.ladder-row {
  display: grid; grid-template-columns: 1fr; gap: var(--space-3);
  padding: var(--space-4) 0; border-bottom: 1px solid var(--border);
}
.ladder-row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.ladder-main { min-width: 0; overflow-wrap: anywhere; }
.ladder-main h4 { margin: 0 0 4px; font-size: 15px; color: var(--ink); }
.ladder-facts { display: grid; gap: 4px; margin-top: 8px; }
/* Label above value on a phone, beside it once there is room: at 360px a
   132px label column leaves "Who may approach them" wrapping over three
   lines next to its answer. */
.ladder-fact { display: grid; grid-template-columns: 1fr; gap: 2px; font-size: 13px; }
.ladder-fact span { color: var(--muted); }
.ladder-rank {
  display: inline-block; min-width: 22px; text-align: center; margin-left: 6px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 8px; font-size: 12px; color: var(--ink-2);
}
.ladder-edit {
  display: grid; gap: var(--space-2); align-content: start;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-2); padding: var(--space-3);
}
.ladder-edit .field { margin: 0; }
.ladder-edit .field input, .ladder-edit .field select { width: 100%; }
.ladder-edit .checkline { font-size: 12.5px; }
/* The action column of a compact row carries no form, so it needs no panel
   around it — just the buttons, at a size a thumb can still find. */
.ladder-row.compact .ladder-edit { background: none; border: 0; padding: 0; }

@media (min-width: 681px) {
  .ladder-fact { grid-template-columns: 170px minmax(0, 1fr); gap: 8px; }
}

@media (min-width: 981px) {
  .ladder-row { grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: var(--space-4); }
  /* A row whose action column is one or two buttons rather than a form. The
     wide column is sized for the tier editor's inputs; a 420px-wide "Undo"
     beside every arrival is both loud and easy to hit by accident. */
  .ladder-row.compact { grid-template-columns: minmax(0, 1fr) 150px; }
}

/* ---------------------------------------------------------------------------
   The two doors.

   Release 11. Almost everybody signing in before an event holds a ticket and
   has never set a password, so the screen asks which of the two they are
   before it asks for anything else. The tabs are links rather than a script
   toggle: a phone on venue wifi that has not finished loading JavaScript
   still gets a working sign-in screen.
   --------------------------------------------------------------------------- */
.authtabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--surface-muted); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 4px; margin-bottom: var(--space-4);
}
.authtab {
  text-align: center; padding: 10px 8px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none;
  min-height: 44px; display: flex; align-items: center; justify-content: center;
  line-height: 1.25;
}
.authtab:hover { text-decoration: none; color: var(--ink); background: var(--surface); }
/* The selected tab is not signalled by colour alone — it is the only one on a
   raised white surface, and aria-selected carries it for a screen reader. */
.authtab.on {
  background: var(--surface); color: var(--blue-ink);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}

/* ---------------------------------------------------------------------------
   The door.

   Different rules from the rest of the product, because the reader is holding
   a phone in daylight with eight people waiting: bigger type, bigger targets,
   and a verdict that can be read at arm's length without being peered at.
   Nothing here is decorative.
   --------------------------------------------------------------------------- */
.door-shell { max-width: 560px; margin: 0 auto; padding: var(--space-4) var(--space-4) 60px; }

.door-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3);
  padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); margin-bottom: var(--space-4);
}
.door-top b { display: block; font-size: 15px; color: var(--ink); }
.door-top .mini { display: block; }
.door-count { text-align: right; flex: none; }
.door-count strong { display: block; font-size: 32px; line-height: 1; color: var(--teal-ink); font-weight: 800; }

.door-offline {
  background: var(--warning-wash); border: 1px solid var(--warning-edge); border-radius: var(--radius-2);
  padding: var(--space-3); margin-bottom: var(--space-4); font-size: 13.5px; color: var(--warning-ink);
}

/* The verdict. One card, filling the view, in a colour somebody can act on
   from a metre away without reading the words.

   SOLID, not a pale tint, and this is the one place the light palette is
   pushed hard. A volunteer reads this at arm's length, outdoors, in Abuja in
   October, through a phone screen at whatever brightness the battery has left.
   A wash of colour behind dark text loses that fight; a filled card does not.
   Every one of the four passes AA for white text (green 4.9:1, amber 4.6:1,
   red 4.5:1, blue 5.2:1), and the verdict is spelled out in words as well,
   because the directive is right that colour must never carry a status alone. */
.door-card {
  border-radius: var(--radius-lg); padding: var(--space-4);
  border: 2px solid var(--line-strong); background: var(--surface);
  margin-bottom: var(--space-4); color: var(--ink);
  box-shadow: var(--shadow);
}
.door-card.ok   { background: var(--success); border-color: var(--success); color: #fff; }
.door-card.warn { background: var(--warning); border-color: var(--warning); color: #fff; }
.door-card.bad  { background: var(--error);   border-color: var(--error);   color: #fff; }
.door-card.ask  { background: var(--blue);    border-color: var(--blue);    color: #fff; }

.door-verdict { margin: 0 0 6px; font-size: 20px; font-weight: 700; color: inherit; }
.door-name    { margin: 0 0 2px; font-size: 26px; font-weight: 800; line-height: 1.15; color: inherit; }
.door-sub     { margin: 4px 0 0; font-size: 14px; color: inherit; opacity: .92; }

/* The buttons inside a filled card have to stand off it, so they invert:
   white face, the card's own colour as the label. */
.door-card .btn.primary,
.door-card .btn {
  background: #fff; color: var(--ink); border-color: #fff;
}
.door-card .btn:hover { background: var(--surface-muted); border-color: var(--surface-muted); }
.door-card a { color: #fff; text-decoration: underline; }

.door-tier, .door-role {
  display: inline-block; margin: 8px 6px 0 0; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; background: rgba(255, 255, 255, .18); color: inherit;
  font-weight: 600;
}

/* A thumb, not a cursor. */
.door-big  { font-size: 18px; padding: 18px; margin-top: var(--space-4); }
.door-next { margin-top: 10px; }

.door-scan   { margin-bottom: var(--space-5); }
#door-video  { width: 100%; border-radius: var(--radius-lg); background: var(--navy); display: block; }

.door-manual h2 { font-size: 16px; margin: 0 0 4px; }
.door-input {
  width: 100%; margin-top: 8px; padding: 15px; font-size: 17px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-2);
}

.door-hit {
  display: block; width: 100%; text-align: left; margin-top: 8px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--ink); font: inherit; cursor: pointer;
}
.door-hit b { display: block; font-size: 16px; }
.door-hit .mini { display: block; }
.door-hit:hover { background: var(--surface-muted); }
/* Dimming alone would be a status carried by appearance; the row also says
   "already in today" in words, which is what a volunteer actually reads. */
.door-hit.done { background: var(--surface-muted); color: var(--ink-muted); }

.door-foot { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------------------
   13.5 Certificate — the banner and the certificate page

   The purple is taken from the certificate artwork itself (the rule under the
   name is rgb(101,63,198)), not from the Connect palette, so the banner and the
   thing it leads to read as one object. It is the only place in the product
   that uses purple, which is exactly why it catches the eye on a dashboard
   built from navy and blue.
   --------------------------------------------------------------------------- */
.cert-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: 16px;
  background: linear-gradient(135deg, #3B1D8F 0%, #653FC6 55%, #9333EA 100%);
  color: #FFFFFF;
  margin-bottom: var(--space-4);
}

/* The big faint X from the certificate, echoed. Decorative only. */
.cert-banner::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.16), rgba(255,255,255,0) 70%);
  pointer-events: none;
}

.cert-banner .cert-copy { flex: 1 1 auto; min-width: 0; }
.cert-banner h2 { margin: 0 0 6px; font-size: 20px; line-height: 1.25; color: #FFFFFF; }
.cert-banner p  { margin: 0; font-size: 14px; line-height: 1.5; color: #EADDFF; }

.cert-medal {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  animation: certFloat 3.2s ease-in-out infinite;
}
.cert-medal svg { width: 30px; height: 30px; }

.cert-cta {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  border-radius: 10px;
  background: #FFFFFF;
  color: #3B1D8F;
  font-weight: 700;
  font-size: 15px;
  border: none;
  animation: certGlow 2.6s ease-in-out infinite;
}
.cert-cta:hover { background: #F6F2FF; color: #3B1D8F; text-decoration: none; }

/* Once it has been opened the banner stays, but stops asking for attention.
   An animation that never ends is an animation people stop seeing. */
/* The quiet banner is also the one that sits lower on the dashboard, below the
   metric row, so it carries the top margin the loud one does not need. */
.cert-banner.quiet { background: linear-gradient(135deg, #2B1766 0%, #4A2F94 100%); margin-top: var(--space-4); }
.cert-banner.quiet .cert-medal,
.cert-banner.quiet .cert-cta { animation: none; }
.cert-banner.quiet .cert-cta { background: rgba(255,255,255,.15); color: #FFFFFF; }
.cert-banner.quiet .cert-cta:hover { background: rgba(255,255,255,.24); color: #FFFFFF; }

@keyframes certGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); }
  50%      { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
}
@keyframes certFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* Belt and braces over the global rule in section 14. */
@media (prefers-reduced-motion: reduce) {
  .cert-medal, .cert-cta { animation: none !important; }
}

/* On a phone the banner stacks and the button goes full width, because a
   thumb-sized target matters more here than a tidy row. */
@media (max-width: 680px) {
  .cert-banner { flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); }
  .cert-banner h2 { font-size: 18px; }
  .cert-cta { width: 100%; justify-content: center; }
  .cert-medal { width: 44px; height: 44px; }
  .cert-medal svg { width: 24px; height: 24px; }
}

/* The certificate page itself. */
.cert-preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}
.cert-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }
.cert-actions .btn { flex: 1 1 200px; justify-content: center; }
@media (max-width: 680px) {
  .cert-actions .btn { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------------------
   14. Print & reduced motion
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .toast, .actions, .nav { display: none !important; }
  .card, .hero { border: 1px solid #ccc; box-shadow: none; background: #fff; color: #000; }
}
