/* ==========================================================================
   EYIF 2026 Wi-Fi Portal — shared styling
   Style direction: vibrant, block-based (youth event), mobile-first.

   IMPORTANT: no external assets (fonts, CDNs) are referenced anywhere in
   this file. A captive portal renders BEFORE the attendee has internet
   access, so any remote request would hang and the page would render
   unstyled. Everything here is self-contained: system font stack only.
   ========================================================================== */

:root {
  /* Brand ---------------------------------------------------------------
     --brand-color is injected per-page from the admin "Brand Color"
     setting and drives primary actions. Default is the EYIF wordmark blue,
     darkened to #1B7BB8 so white button text clears WCAG AA (4.6:1); the
     logo blue #2088C8 only reaches 3.9:1.
     --color-accent is the EYIF orange, used for emphasis and the code
     display rather than for text-bearing surfaces (orange cannot reach
     4.5:1 against white while staying vibrant). */
  --brand-color: #1B7BB8;
  --color-accent: #F86800;
  --color-accent-soft: #FFF1E6;
  /* The vivid brand orange only reaches 3.0:1 on white, so text uses a
     darkened variant (5.2:1). --color-accent stays for borders and fills,
     where the 3:1 non-text threshold applies. */
  --color-accent-text: #C2410C;

  /* Surfaces & text */
  --color-bg: #F4F6F8;
  --color-surface: #FFFFFF;
  --color-text: #16202A;
  --color-text-muted: #5A6B7A;
  /* Dividers stay light; input outlines need 3:1 against the surface to
     satisfy WCAG 1.4.11 (non-text contrast), so they use a darker token. */
  --color-border: #DDE3E9;
  --color-border-strong: #86939F;

  /* Feedback */
  --color-warning: #92500E;
  --color-warning-bg: #FFF6E6;
  --color-danger: #B3261E;
  --color-danger-bg: #FDECEA;
  --color-success: #10633C;

  /* Spacing scale (4/8 rhythm) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-card: 0 1px 2px rgba(16, 32, 45, .06), 0 12px 32px rgba(16, 32, 45, .08);
  --shadow-focus: 0 0 0 3px rgba(27, 123, 184, .35);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --transition: 180ms cubic-bezier(.2, .8, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0E1620;
    --color-surface: #17222E;
    --color-text: #EAF0F6;
    --color-text-muted: #9DB0C0;
    --color-border: #2A3947;
    --color-border-strong: #5A6E82;
    --color-accent-soft: #2A1D12;
    /* On dark surfaces the vivid orange already clears AA (5.3:1), so the
       darkened light-mode variant would be needlessly dim here. */
    --color-accent-text: #F86800;
    --color-warning: #F0C075;
    --color-warning-bg: #2C2113;
    --color-danger: #F2B8B4;
    --color-danger-bg: #2E1614;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .45);
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  /* Keep content clear of notches / gesture bars on phones. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* --------------------------------------------------------------------------
   Ambient background — brand-color glow + film grain

   Fixed behind everything (z-index -1), so it only shows through the empty
   space around the card/banner/button — every foreground surface already
   paints its own opaque background. The grain canvas itself is drawn and
   animated from a small inline script at the bottom of index.php; see the
   comments there for why it's deliberately cheap.
   -------------------------------------------------------------------------- */

.portal-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--color-bg);
}

.portal-bg::before,
.portal-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
}

.portal-bg::before {
  width: 62vmax;
  height: 62vmax;
  top: -24vmax;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent);
  opacity: .16;
}

.portal-bg::after {
  width: 52vmax;
  height: 52vmax;
  bottom: -24vmax;
  right: -14vmax;
  background: var(--brand-color);
  opacity: .14;
}

.grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  opacity: .5;
  mix-blend-mode: overlay;
}

@media (prefers-color-scheme: dark) {
  .portal-bg::before { opacity: .26; }
  .portal-bg::after { opacity: .2; }
  .grain { opacity: .35; mix-blend-mode: soft-light; }
}

/* --------------------------------------------------------------------------
   Attendee portal card
   -------------------------------------------------------------------------- */

/* The portal must fit one screen without scrolling — attendees are standing
   in a venue queue, and a Connect button below the fold reads as "broken".
   Vertical rhythm here is deliberately tighter than the admin screens.
   `margin: auto` on the child (rather than justify-content: center) keeps
   the card centred while still letting it scroll if a very small screen or
   very large Dynamic Type setting genuinely overflows, instead of clipping
   the top. */
.portal {
  max-width: 460px;
  margin: 0 auto;
  padding: var(--space-4);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.portal-card {
  margin: auto 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5) var(--space-4);
  /* The block-based accent bar ties the card to the event branding. */
  border-top: 5px solid var(--color-accent);
}

.logo {
  max-width: 264px;
  width: 100%;
  height: auto;
  margin: 0 auto var(--space-3);
  display: block;
}

.portal h1 {
  margin: 0 0 var(--space-2);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* When the logo already carries the event name, the <h1> would repeat it.
   Keep it in the DOM for screen readers and document structure, but take it
   out of the visual flow so the logo can be larger. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.tagline {
  margin: 0 0 var(--space-1);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent-text);
}

.details {
  margin: 0 0 var(--space-4);
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Hero banner — EYIF 2.0 masthead image + "Connect to Win" entry point

   The masthead (EYIF logo, partner/sponsor logos, "Ideas, Capital & Impact",
   "EYIF 2.0") is one designed image rather than markup, so this is just its
   frame. The sign-up form no longer sits on the page by default; it opens
   in a modal (see "Sign-up modal" below) so the banner + button are the
   first and only thing attendees see.
   -------------------------------------------------------------------------- */

.hero-banner {
  display: block;
  width: 100%;
  height: auto;
  margin: var(--space-2) 0 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* --------------------------------------------------------------------------
   Hero copy — the welcome/sponsor/prize story between the banner and the
   button, and the prize call-out after it. Sized to fit inside one 100dvh
   screen on a typical phone without scrolling (checked against real
   viewport heights, not assumed) — spacing here is deliberately tighter
   than the vertical rhythm used elsewhere, so don't "fix" it to match.
   -------------------------------------------------------------------------- */

.hero-rule {
  width: 100%;
  height: 1px;
  margin: var(--space-3) 0;
  border: none;
  background: var(--color-border);
}

.hero-welcome {
  margin: 0 0 var(--space-2);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.hero-welcome-accent { color: var(--brand-color); }
.hero-welcome-accent2 { color: var(--color-accent-text); }

.hero-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.hero-divider .divider-line {
  flex: 1 1 auto;
  height: 1px;
  background: var(--color-border);
}

.hero-divider .divider-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--color-accent);
}

.hero-divider .divider-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

.hero-copy {
  margin: 0 0 var(--space-2);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.hero-shout {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--brand-color);
}

.hero-shout-sm {
  margin: var(--space-2) 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-color);
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-2) 0;
}

.btn-connect-win {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--color-accent), #ffb457 130%);
  font-size: 19px;
  box-shadow: 0 10px 28px -6px rgba(248, 104, 0, .5);
  animation: connect-win-pulse 2.6s ease-in-out infinite;
}

.btn-connect-win:hover { filter: brightness(1.06); }

@keyframes connect-win-pulse {
  0%, 100% { box-shadow: 0 10px 28px -6px rgba(248, 104, 0, .5); }
  50% { box-shadow: 0 10px 36px -4px rgba(248, 104, 0, .75); }
}

/* "Magnetize" particles — small dots scattered around the button that snap
   inward on hover/touch and spring back out on release. Vanilla version of
   the particle-attraction pattern: plain dots positioned/animated with CSS
   custom properties + a transition, no framer-motion. Generated and toggled
   by the script at the bottom of index.php. */
.magnet-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #fff;
  opacity: .5;
  pointer-events: none;
  transform: translate(var(--px, 0), var(--py, 0));
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), opacity .35s ease;
}

.btn-connect-win.is-attracting .magnet-particle {
  transform: translate(0, 0);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Sign-up modal — the details form, opened by "Connect to Win"

   No external dialog/animation library: this is a captive portal, rendered
   before the attendee has internet access, so it has to work with plain
   CSS + inline JS only (see the script at the bottom of index.php).
   -------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(10, 18, 26, .55);
  z-index: 100;
}

.modal-overlay[hidden] { display: none; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border-top: 5px solid var(--color-accent);
  box-shadow: var(--shadow-card);
  padding: var(--space-6) var(--space-4) var(--space-5);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 36px;
  height: 36px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  color: var(--color-text-muted);
  background: var(--color-bg);
}

.modal-close:hover { filter: none; background: var(--color-border); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.field {
  text-align: left;
  margin-bottom: var(--space-3);
}

.field label {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="color"] {
  width: 100%;
  /* 46px keeps the tap target above the 44px minimum. */
  min-height: 46px;
  padding: 10px var(--space-3);
  font-family: inherit;
  font-size: 16px; /* 16px avoids iOS auto-zoom on focus. */
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input[type="color"] { padding: var(--space-1); height: 46px; cursor: pointer; }

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand-color);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

input:focus { border-color: var(--brand-color); }

input[type="file"] {
  width: 100%;
  font-size: 14px;
  color: var(--color-text-muted);
  padding: var(--space-2) 0;
}

button {
  width: 100%;
  min-height: 50px;
  margin-top: var(--space-1);
  padding: var(--space-3) var(--space-4);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-color);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter var(--transition), transform var(--transition);
}

button:hover { filter: brightness(1.08); }
/* Scale feedback stays within the button's own box so nothing reflows. */
button:active { transform: scale(.985); }

button[disabled],
button[aria-busy="true"] {
  opacity: .6;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.hint {
  margin: var(--space-3) 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Success page — the code is the hero element
   -------------------------------------------------------------------------- */

.code-label {
  margin: 0 0 var(--space-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.code {
  display: block;
  margin: 0 0 var(--space-4);
  padding: var(--space-4) var(--space-3);
  background: var(--color-accent-soft);
  border: 2px dashed var(--color-accent);
  border-radius: var(--radius-md);
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 800;
  line-height: 1.1;
  /* Tabular figures keep the digits evenly spaced and easy to read aloud. */
  font-variant-numeric: tabular-nums;
  letter-spacing: .12em;
  color: var(--color-text);
  /* Let attendees long-press to copy. */
  user-select: all;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-3);
  display: block;
  color: var(--color-success);
}

.warning,
.error {
  margin: var(--space-3) 0 0;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-align: left;
}

.warning { color: var(--color-warning); background: var(--color-warning-bg); }
.error { color: var(--color-danger); background: var(--color-danger-bg); }

/* --------------------------------------------------------------------------
   Powered-by credit
   -------------------------------------------------------------------------- */

.powered-by {
  margin: var(--space-4) 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.powered-by img { height: 32px; width: auto; }

/* --------------------------------------------------------------------------
   Admin shell — sidebar + main content

   The admin runs a fixed dark palette rather than following the system
   theme: it mirrors the existing MangoNet operator dashboards, and the
   deliberate contrast with the light attendee portal makes it obvious at a
   glance whether a screen is staff-facing or attendee-facing.
   -------------------------------------------------------------------------- */

.admin-body {
  --admin-bg: #0B1524;
  --admin-surface: #122033;
  --admin-surface-2: #17293F;
  --admin-text: #E8EEF6;
  --admin-text-muted: #93A7BE;
  --admin-border: #24384F;
  --admin-active: #1D4E77;
  background: var(--admin-bg);
  color: var(--admin-text);
}

.admin-shell {
  display: flex;
  min-height: 100dvh;
}

.sidebar {
  flex: 0 0 232px;
  background: var(--admin-surface);
  border-right: 1px solid var(--admin-border);
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar-brand { padding: var(--space-2) var(--space-3); }

.sidebar-brand-name {
  display: block;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-accent);
}

.sidebar-brand-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--admin-text-muted);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  /* 44px keeps every nav row a comfortable tap target on tablets. */
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--admin-text-muted);
  transition: background var(--transition), color var(--transition);
}

.nav-item:hover { background: var(--admin-surface-2); color: var(--admin-text); }

.nav-item.is-active {
  background: var(--admin-active);
  color: #fff;
  font-weight: 600;
}

.nav-icon { width: 18px; height: 18px; flex: 0 0 18px; }

.nav-divider {
  height: 1px;
  margin: var(--space-3) var(--space-3);
  background: var(--admin-border);
}

.nav-item-signout:hover { color: #FFB4AB; }

.admin-main {
  flex: 1 1 auto;
  min-width: 0; /* lets wide tables scroll instead of stretching the layout */
  padding: var(--space-5);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.admin-main h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--admin-text);
}

.page-sub {
  margin: var(--space-1) 0 0;
  font-size: 13px;
  color: var(--admin-text-muted);
}

.page-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.stat {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.stat-label {
  display: block;
  font-size: 13px;
  color: var(--admin-text-muted);
}

.stat-value {
  display: block;
  margin-top: var(--space-1);
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.panel {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.panel h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--color-accent);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--brand-color);
  transition: filter var(--transition);
}

.btn-link:hover { filter: brightness(1.08); }

.btn-link.secondary {
  color: var(--admin-text);
  background: transparent;
  border: 1px solid var(--admin-border);
}

/* Table scrolls inside its own container so the page never scrolls sideways. */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--admin-text-muted);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--admin-surface-2); }

/* The raffle code is the column staff read aloud — make it unmistakable. */
td.code-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--color-accent);
}

.empty {
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--admin-text-muted);
}

/* Admin form controls sit on dark surfaces. */
.admin-body .field label { color: var(--admin-text); }
.admin-body input[type="text"],
.admin-body input[type="email"],
.admin-body input[type="tel"],
.admin-body input[type="color"] {
  background: var(--admin-bg);
  color: var(--admin-text);
  border-color: var(--admin-border);
}
.admin-body input[type="file"] { color: var(--admin-text-muted); }
.admin-body .field-hint { color: var(--admin-text-muted); }
.admin-body .settings-form { max-width: 560px; }

/* Admin login reuses the centred portal shell. */
.login-card { max-width: 380px; margin: 0 auto; }

.settings-form .field { margin-bottom: var(--space-5); }
.admin-main .field { margin-bottom: var(--space-4); }
.settings-form .field-hint {
  margin: var(--space-1) 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Preview of the current upload, shown above its file input so staff can
   see what's live before deciding whether to replace it. */
.settings-preview {
  display: block;
  max-width: 100%;
  width: 320px;
  height: auto;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border);
}

/* Sidebar collapses to a horizontal strip on narrow screens so staff can
   still use the admin from a phone at the venue. */
@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .sidebar {
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid var(--admin-border);
    gap: var(--space-3);
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-1);
  }
  .nav-item { flex: 0 0 auto; }
  .nav-divider { display: none; }
  .admin-main { padding: var(--space-4); }
}

/* Short viewports (small/older phones, or landscape) trade some of the
   logo's size back for fit, so the Connect button stays above the fold.
   Keyed on height rather than width: it's vertical space that runs out.
   Threshold checked against a real iPhone SE-class viewport (375x667) —
   the hero copy below overflowed there at the base sizing, so 640px alone
   wasn't a low enough bar. */
@media (max-height: 700px) {
  .portal { padding: var(--space-2) var(--space-4); }
  .portal-card { padding: var(--space-4); }
  .logo { max-width: 208px; margin-bottom: var(--space-2); }
  .details { margin-bottom: var(--space-3); }
  .powered-by { margin-top: var(--space-2); }
  .powered-by img { height: 26px; }
  .hero-banner { margin-bottom: var(--space-2); }
  .hero-rule { margin: var(--space-2) 0; }
  .hero-welcome { font-size: 20px; margin-bottom: var(--space-1); }
  .hero-divider { margin: var(--space-2) 0; }
  .hero-copy { font-size: 14px; line-height: 1.4; margin-bottom: var(--space-1); }
  .hero-shout { font-size: 15px; }
  .hero-shout-sm { font-size: 14px; margin-top: var(--space-1); }
  .hero-cta { margin: var(--space-1) 0; }
}

@media (min-width: 640px) {
  .portal h1 { font-size: 30px; }
  .admin h1 { font-size: 28px; }
}

/* Respect users who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  button:active { transform: none; }
}

/* Diagnostic banner: the "all good" counterpart to .error. */
.diag-ok {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #B7F7D4;
  background: #10321F;
}

.log-view {
  max-height: 460px;
  overflow: auto;
  margin: 0;
  padding: var(--space-3);
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--admin-text-muted);
}

/* Buttons that sit inline in a header row, rather than filling a form. */
.btn-inline {
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 0 var(--space-4);
  font-size: 14px;
  font-weight: 600;
}

.btn-inline.secondary {
  color: var(--admin-text);
  background: transparent;
  border: 1px solid var(--admin-border);
}

/* Status pills and the revoke control on the entries table. */
.pill {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
}

.pill-active {
  color: #B7F7D4;
  background: #10321F;
  border-color: #1B5334;
}

.pill-note {
  margin-left: var(--space-2);
  font-size: 12px;
  color: var(--admin-text-muted);
}

.btn-danger {
  color: #FFD9D5;
  background: #5B1A15;
  border: 1px solid #7A241D;
}

.btn-danger:hover { filter: brightness(1.15); }

.table-note {
  margin: var(--space-3) 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--admin-text-muted);
}

/* Checkbox rows read as one control, not a stray box above a label. */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--brand-color);
  cursor: pointer;
}

/* Byte counts line up column-wise when the digits are tabular. */
.num-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
