/* =====================================================================
   10XAXS design system — axs.css
   ---------------------------------------------------------------------
   Loaded by views/partials/app-head.ejs at the top of <head> on every
   customer-* and auth-* page (not customer-report-print / visitor-keypad),
   BEFORE each page's own <style>, so a page's rules keep winning until
   that page is migrated.

   Rules for this file:
   - Tokens are custom properties named --ax-*; components are classes
     named .ax-*. Pages already use .card/.modal/.chip/.btn/--ink for
     their own things, so nothing here may claim an unprefixed name
     (a plain modifier only ever appears joined to an .ax-* class, e.g.
     .ax-hdr-status.on, .ax-ic-tile.blue).
   - The base layer below is the ONLY place that touches bare elements,
     and it is limited to what the UI plan (T1.1) lists: text-size-adjust,
     one focus ring, select max-width, the 16px touch-input floor and
     reduced motion. No margin/button/input resets.
   - The one legacy hook styled here is ".topbar a.back" (the 44x44 back
     link every sub-page header already has, plan T1.13).
   - z-index scale: sticky 10 · door-open banner 35 · FAB 50 · bottom
     nav 60 · sheet/modal 80 · toast 90 · idle warning 200.
   ===================================================================== */

:root {
  /* ---- brand ---- */
  --ax-brand: #1c6fb5;
  --ax-brand-dark: #14568f;
  --ax-brand-light: #2e8bd6;
  --ax-brand-soft: #eff6ff;
  --ax-brand-line: #bfdbfe;
  --ax-gradient: linear-gradient(135deg, #2e8bd6 0%, #1c6fb5 52%, #14568f 100%);

  /* ---- text + surfaces ---- */
  --ax-ink: #0f172a;
  --ax-ink-2: #334155;
  --ax-muted: #64748b;
  --ax-faint: #94a3b8;
  --ax-line: #e9edf3;
  --ax-line-soft: #eef2f7;
  --ax-line-strong: #cbd5e1;
  --ax-bg: #f4f6fb;
  --ax-card: #ffffff;
  --ax-surface-2: #f8fafc;
  --ax-sheet-bg: #f2f4f8;

  /* ---- status: one meaning per colour, everywhere ----
     green = locked / OK · amber = unlocked · red = a door physically
     open (and destructive actions) · grey = unknown                  */
  --ax-green: #10b981;
  --ax-green-ink: #047857;
  --ax-green-soft: #ecfdf5;
  --ax-green-line: #bbf7d0;
  --ax-amber: #f59e0b;
  --ax-amber-ink: #92400e;
  --ax-amber-soft: #fffbeb;
  --ax-amber-line: #fcd34d;
  --ax-red: #dc2626;
  --ax-red-dark: #b91c1c;
  --ax-red-ink: #991b1b;
  --ax-red-soft: #fef2f2;
  --ax-red-line: #fecaca;
  --ax-grey: #cbd5e1;
  --ax-grey-ink: #475569;
  --ax-grey-soft: #f1f5f9;

  /* ---- type ---- */
  --ax-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ax-fs-xs: 12px;
  --ax-fs-sm: 13px;
  --ax-fs: 15px;
  --ax-fs-md: 16px;
  --ax-fs-lg: 18px;
  --ax-fs-xl: 21px;

  /* ---- shape ---- */
  --ax-r-xs: 8px;
  --ax-r-sm: 11px;
  --ax-r: 14px;
  --ax-r-lg: 16px;
  --ax-r-xl: 22px;
  --ax-r-pill: 999px;
  --ax-shadow-1: 0 1px 2px rgba(15, 23, 42, .05);
  --ax-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .06);
  --ax-shadow-2: 0 14px 40px rgba(15, 23, 42, .24);
  --ax-shadow-up: 0 -4px 18px rgba(15, 23, 42, .07);
  --ax-shadow-brand: 0 6px 16px rgba(28, 111, 181, .3);

  /* ---- spacing scale ---- */
  --ax-sp-1: 4px;
  --ax-sp-2: 8px;
  --ax-sp-3: 12px;
  --ax-sp-4: 16px;
  --ax-sp-5: 20px;
  --ax-sp-6: 24px;
  --ax-sp-8: 32px;

  /* ---- sizes ---- */
  --ax-tap: 44px;
  --ax-topbar-h: 49px;   /* door-open-banner.js + Events .date-header assume 49px */
  --ax-maxw: 640px;
  --ax-nav-space: calc(76px + env(safe-area-inset-bottom, 0px));

  /* ---- z-index scale ---- */
  --ax-z-sticky: 10;
  --ax-z-banner: 35;
  --ax-z-fab: 50;
  --ax-z-nav: 60;
  --ax-z-sheet: 80;
  --ax-z-modal: 80;
  --ax-z-toast: 90;
  --ax-z-idle: 200;

  --ax-ease: cubic-bezier(.2, .8, .2, 1);
}

/* =====================================================================
   BASE LAYER (plan T1.1) — deliberately tiny
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* One keyboard focus ring. Zero specificity: a page's own focus style wins. */
:where(:focus-visible) { outline: 2px solid var(--ax-brand); outline-offset: 2px; }

:where(select) { max-width: 100%; }

/* Phones: a text field under 16px makes iOS zoom the page in when it gets focus
   (it used to be held back by maximum-scale=1, which also blocked pinch-zoom).
   !important so it also reaches id-styled and inline-styled fields; it only ever
   RAISES small text. A deliberately big field (PIN pad, 2FA code) opts out with
   class="ax-text-lg" so it keeps its own size. */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"]):not(.ax-text-lg),
  select:not(.ax-text-lg),
  textarea:not(.ax-text-lg) {
    font-size: max(16px, 1em) !important;
  }
}

/* Reduced motion: transitions and decorative animations end at once.
   Loading spinners (any class containing "spin") keep turning slowly —
   they are progress, not decoration. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  *:not([class*="spin"]), *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
  }
  [class*="spin"] { animation-duration: 1.6s !important; }
}

/* Page scroll lock while a sheet is open (set by the More sheet script). */
/* Root only: overflow:hidden on <body> as well would make body its own scroller, and every
   sticky header (topbar, door header, Events day headers) would jump while the sheet is open. */
html.ax-sheet-open { overflow: hidden; }

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

/* =====================================================================
   ICONS — <svg class="ax-icon"><use href="#i-door"/></svg>
   (sprite: views/partials/icons.ejs, loaded by the bottom-nav partial)
   ===================================================================== */
.ax-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ax-icon {
  display: inline-block; flex: none; width: 1.25em; height: 1.25em; vertical-align: -.25em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}
.ax-icon-xs { width: 14px; height: 14px; }
.ax-icon-sm { width: 16px; height: 16px; }
.ax-icon-md { width: 20px; height: 20px; }
.ax-icon-lg { width: 24px; height: 24px; }
.ax-icon-xl { width: 28px; height: 28px; }
.ax-icon-fill { fill: currentColor; }

/* =====================================================================
   APP HEADER — 49px sticky bar: back link · title (+ subtitle) · right slot
   <header class="ax-topbar">
     <a class="ax-back" href="/c/<id>/home" aria-label="Back to Home"><svg class="ax-icon"><use href="#i-chevron-left"/></svg></a>
     <div class="ax-topbar-title"><h1>Title</h1><small>Site name</small></div>
     <div class="ax-topbar-right">…</div>
   </header>
   Pages migrating an existing ".topbar" keep that class too (class="topbar
   ax-topbar"): door-open-banner.js pins ".topbar" under the red banner.
   ===================================================================== */
.ax-topbar {
  position: sticky; top: var(--dob-h, 0px); z-index: var(--ax-z-sticky);
  display: flex; align-items: center; gap: 6px; box-sizing: border-box;
  height: var(--ax-topbar-h); margin: 0;
  padding: 0 12px 0 max(4px, env(safe-area-inset-left, 0px));
  background: #fff; border-bottom: 1px solid var(--ax-line); color: var(--ax-ink);
  font-family: var(--ax-font);
}
.ax-topbar-title { flex: 1; min-width: 0; }
.ax-topbar-title h1 {
  margin: 0; font-size: 17px; font-weight: 750; line-height: 1.2; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ax-topbar-title small {
  display: block; margin-top: 1px; font-size: 12px; color: var(--ax-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ax-topbar-right { flex: none; display: flex; align-items: center; gap: 6px; }

.ax-back, .ax-iconbtn {
  flex: none; display: inline-grid; place-items: center; width: var(--ax-tap); height: var(--ax-tap);
  padding: 0; border: 0; border-radius: 12px; background: none; color: var(--ax-brand);
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ax-iconbtn { color: var(--ax-ink-2); }
.ax-back .ax-icon, .ax-iconbtn .ax-icon { width: 24px; height: 24px; }
.ax-back:active, .ax-iconbtn:active { background: var(--ax-grey-soft); }

/* Legacy sub-page headers (<div class="topbar"><a class="back">‹</a>…): a 44x44
   brand-blue tap target. The negative vertical margins keep the bar's height
   (49px on most pages — door-open-banner.js and Events' .date-header rely on it). */
.topbar a.back {
  display: inline-grid; place-items: center; min-width: var(--ax-tap); min-height: var(--ax-tap);
  margin: -10px 0 -10px -10px; border-radius: 12px; color: var(--ax-brand); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.topbar a.back:active { background: var(--ax-grey-soft); }

/* Connection pill in a sub-page header: a dot + the word, never colour alone.
   <span class="ax-hdr-status hdr-status on"><i aria-hidden="true"></i>Online</span>
   ("on" = online; pages keep their old "hdr-status" class and ids #bdot / #dot as hooks) */
.ax-hdr-status {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px 0 9px;
  border-radius: var(--ax-r-pill); background: var(--ax-grey-soft); color: var(--ax-grey-ink);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.ax-hdr-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ax-faint); }
.ax-hdr-status.on { background: var(--ax-green-soft); color: var(--ax-green-ink); }
.ax-hdr-status.on i { background: var(--ax-green); }

/* =====================================================================
   CARDS, SECTIONS, LIST ROWS
   ===================================================================== */
.ax-page { max-width: var(--ax-maxw); margin: 0 auto; padding: 0 16px; }
/* The usual sub-page body: <main class="ax-wrap"> (centred column, 16px gutters, room above/below). */
.ax-wrap { box-sizing: border-box; max-width: var(--ax-maxw); margin: 0 auto; padding: 14px 16px 24px; }
/* A notice at the top of a page body (e.g. "the site is offline"): .ax-error / .ax-notice + .ax-page-note */
.ax-page-note { margin-bottom: 12px; }
.ax-section-label {
  display: flex; align-items: center; gap: 6px; margin: 18px 6px 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ax-muted);
}
.ax-card {
  background: var(--ax-card); border-radius: var(--ax-r-lg); box-shadow: var(--ax-shadow); color: var(--ax-ink);
}
.ax-card-pad { padding: 16px; }
.ax-card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; }
.ax-card-head h2, .ax-card-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 16px; font-weight: 700; }
.ax-card-body { padding: 12px 16px 16px; }
.ax-card-foot { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--ax-line-soft); }

/* A group of rows (the More sheet uses these). */
.ax-list {
  margin: 0 0 10px; padding: 0; list-style: none; overflow: hidden;
  background: var(--ax-card); border-radius: var(--ax-r); box-shadow: var(--ax-shadow-1);
}
.ax-row {
  position: relative; box-sizing: border-box; display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 48px; margin: 0; padding: 6px 10px 6px 12px;
  border: 0; background: none; color: var(--ax-ink); font: inherit; text-align: left; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ax-row + .ax-row::before {
  content: ""; position: absolute; top: 0; left: 54px; right: 0; height: 1px; background: var(--ax-line-soft);
}
.ax-row:active { background: var(--ax-grey-soft); }
.ax-row:focus-visible { outline-offset: -2px; }
.ax-row-ic {
  flex: none; width: 30px; height: 30px; border-radius: var(--ax-r-xs); display: grid; place-items: center;
  background: var(--ax-grey-soft); color: var(--ax-grey-ink);
}
.ax-row-ic .ax-icon { width: 17px; height: 17px; }
.ax-row-main { flex: 1; min-width: 0; }
.ax-row-title { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.ax-row-sub { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ax-muted); line-height: 1.35; }
.ax-row-end { flex: none; font-size: 13px; color: var(--ax-muted); }
.ax-row-chev { flex: none; width: 18px; height: 18px; color: #c3cbd8; }
.ax-row-danger, .ax-row-danger .ax-row-title { color: var(--ax-red); }

/* Icon tile tints (the Home tiles / More sheet colours). */
.ax-tint-blue   { background: #e6f0fa; color: #1769b4; }
.ax-tint-sky    { background: #e8f4fc; color: #2585cf; }
.ax-tint-steel  { background: #eaeff7; color: #3f6896; }
.ax-tint-slate  { background: #edf1f5; color: #5b7689; }
.ax-tint-teal   { background: #ecfdf5; color: #0d9488; }
.ax-tint-green  { background: #ecfdf5; color: #059669; }
.ax-tint-amber  { background: #fef6e7; color: #b45309; }
.ax-tint-orange { background: #fff7ed; color: #ea580c; }
.ax-tint-indigo { background: #eef0fb; color: #4f46e5; }
.ax-tint-rose   { background: #fdeeee; color: #dc2626; }
.ax-tint-red    { background: #fee2e2; color: #dc2626; }
.ax-tint-grey   { background: #eef1f4; color: #5a6b7b; }

/* 38px rounded icon tile at the start of a card head: <span class="ax-ic-tile blue">…icon…</span>
   (tints: slate · blue · teal · green · amber · orange · rose · red) */
.ax-ic-tile { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.ax-ic-tile .ax-icon { width: 20px; height: 20px; }
.ax-ic-tile.slate  { background: var(--ax-grey-soft); color: var(--ax-grey-ink); }
.ax-ic-tile.blue   { background: var(--ax-brand-soft); color: var(--ax-brand); }
.ax-ic-tile.teal   { background: #ecfdf5; color: #0d9488; }
.ax-ic-tile.green  { background: var(--ax-green-soft); color: #15803d; }
.ax-ic-tile.amber  { background: var(--ax-amber-soft); color: #b45309; }
.ax-ic-tile.orange { background: #fff7ed; color: #ea580c; }
.ax-ic-tile.rose   { background: #fdeeee; color: #dc2626; }
.ax-ic-tile.red    { background: var(--ax-red-soft); color: var(--ax-red-dark); }

/* =====================================================================
   BUTTONS
   .ax-btn + one of: -primary · -secondary · -ghost · -quiet · -danger
   (outline) · -danger-solid (final destructive confirm only); sizes -sm,
   -block, -pill. Door controls (owner decision 2026-10-21, "Door buttons
   B"): -unlock-briefly (main blue) · -keep-unlocked (amber = unlocked) ·
   -lock (green = locked) · -quiet for "Back to normal schedule".
   ===================================================================== */
.ax-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box;
  min-height: var(--ax-tap); margin: 0; padding: 0 16px;
  border: 1px solid transparent; border-radius: 12px;
  background: var(--ax-grey-soft); color: var(--ax-ink);
  font: 600 15px/1.2 var(--ax-font); text-align: center; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.ax-btn .ax-icon { width: 20px; height: 20px; }
.ax-btn:active:not(:disabled):not([aria-disabled="true"]) { transform: scale(.98); }
.ax-btn:disabled, .ax-btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.ax-btn-primary {
  background: var(--ax-gradient); border-color: var(--ax-brand); color: #fff;
  box-shadow: 0 4px 12px rgba(28, 111, 181, .25);
}
.ax-btn-secondary { background: #fff; border-color: var(--ax-line-strong); color: var(--ax-brand); }
.ax-btn-ghost { background: transparent; color: var(--ax-ink-2); }
.ax-btn-ghost:active { background: var(--ax-grey-soft); }
.ax-btn-quiet { background: var(--ax-surface-2); border-color: #e2e8f0; color: var(--ax-ink-2); }
.ax-btn-danger { background: #fff; border-color: var(--ax-red-line); color: var(--ax-red-dark); }
.ax-btn-danger-solid { background: var(--ax-red); border-color: var(--ax-red); color: #fff; }
.ax-btn-sm { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; }
.ax-btn-sm .ax-icon { width: 17px; height: 17px; }
.ax-btn-pill { border-radius: var(--ax-r-pill); }
.ax-btn-block { display: flex; width: 100%; }

/* Door card controls (Doors option B) */
.ax-btn-unlock-briefly {
  display: flex; width: 100%; min-height: 66px; justify-content: flex-start; gap: 12px; padding: 10px 14px;
  border: 0; border-radius: 15px; color: #fff; text-align: left; white-space: normal;
  background: linear-gradient(135deg, #2e8bd6 0%, #1c6fb5 55%, #14568f 100%);
  box-shadow: var(--ax-shadow-brand);
}
.ax-btn-bub {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .18);
}
.ax-btn-unlock-briefly .ax-btn-bub .ax-icon { width: 22px; height: 22px; }
.ax-btn-text { min-width: 0; }
.ax-btn-label { display: block; font-size: 16.5px; font-weight: 700; }
.ax-btn-sub { display: block; margin-top: 1px; font-size: 13px; font-weight: 500; opacity: .9; }
.ax-btn-keep-unlocked, .ax-btn-lock { min-height: 52px; border-radius: 14px; }
.ax-btn-keep-unlocked { background: var(--ax-amber-soft); border-color: var(--ax-amber-line); color: var(--ax-amber-ink); }
.ax-btn-lock { background: var(--ax-green-soft); border-color: var(--ax-green-line); color: var(--ax-green-ink); }
.ax-btn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* =====================================================================
   CHIPS · PILLS · STATUS DOTS
   ===================================================================== */
.ax-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ax-chips-fill > .ax-chip { flex: 1 1 0; }
.ax-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box;
  min-height: 42px; margin: 0; padding: 0 14px; border: 1px solid #e2e8f0; border-radius: var(--ax-r-sm);
  background: #fff; color: #1e293b; font: 600 14px/1.2 var(--ax-font); white-space: nowrap;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ax-chip .ax-icon { width: 16px; height: 16px; }
.ax-chip-pill { min-height: 38px; border-radius: var(--ax-r-pill); font-size: 13px; }
.ax-chip[aria-pressed="true"], .ax-chip.is-on {
  background: var(--ax-brand-soft); border-color: var(--ax-brand-line); color: var(--ax-brand);
}
.ax-chip:disabled { opacity: .5; cursor: default; }

.ax-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--ax-r-pill);
  background: var(--ax-grey-soft); color: var(--ax-grey-ink);
  font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap;
}
.ax-pill-green { background: var(--ax-green-soft); color: var(--ax-green-ink); }
.ax-pill-amber { background: var(--ax-amber-soft); color: var(--ax-amber-ink); }
.ax-pill-red   { background: var(--ax-red-soft); color: var(--ax-red-dark); }
.ax-pill-blue  { background: var(--ax-brand-soft); color: var(--ax-brand); }
.ax-pill-grey  { background: var(--ax-grey-soft); color: var(--ax-grey-ink); }
.ax-pill-solid-red { background: var(--ax-red); color: #fff; }

/* Door state dots: green = locked · amber = unlocked · red = physically open · grey = unknown */
.ax-dot {
  display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ax-grey);
}
.ax-dot-locked, .ax-dot-green { background: var(--ax-green); box-shadow: 0 0 0 3px rgba(16, 185, 129, .16); }
.ax-dot-unlocked, .ax-dot-amber { background: var(--ax-amber); box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.ax-dot-open, .ax-dot-red { background: var(--ax-red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); }
.ax-dot-unknown, .ax-dot-grey { background: var(--ax-grey); box-shadow: none; }
.ax-dot-sm { width: 7px; height: 7px; box-shadow: none; }
/* dot + a word, so state never relies on colour alone ("Online", "Reconnecting…") */
.ax-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ax-muted); }
.ax-status-locked { color: var(--ax-green-ink); }
.ax-status-unlocked { color: #b45309; }
.ax-status-open { color: var(--ax-red-dark); font-weight: 700; }

/* =====================================================================
   SEGMENTED CONTROL — mark the chosen item with aria-pressed / aria-selected
   / aria-current="page" / .is-on
   ===================================================================== */
.ax-seg { display: flex; padding: 3px; border-radius: var(--ax-r-sm); background: var(--ax-grey-soft); }
.ax-seg > button, .ax-seg > a, .ax-seg-item {
  flex: 1 1 0; min-width: 0; min-height: 38px; margin: 0; padding: 0 8px; display: grid; place-items: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--ax-grey-ink);
  font: 600 13.5px/1.2 var(--ax-font); text-decoration: none; white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ax-seg > [aria-pressed="true"], .ax-seg > [aria-selected="true"], .ax-seg > [aria-current="page"], .ax-seg > .is-on {
  background: #fff; color: var(--ax-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .14);
}
/* The bar's 3px padding is part of each item's tap area: a 38px item is a 44px target. */
.ax-seg > button, .ax-seg > a, .ax-seg-item { position: relative; }
.ax-seg > button::after, .ax-seg > a::after, .ax-seg-item::after {
  content: ""; position: absolute; left: 0; right: 0; top: -3px; bottom: -3px;
}

/* =====================================================================
   BOTTOM NAV (partials/customer-bottomnav.ejs — owner decision "Bottom bar A")
   ===================================================================== */
.ax-nav-spacer { height: var(--ax-nav-space); }
.ax-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--ax-z-nav);
  display: flex; box-sizing: border-box;
  padding: 7px max(4px, env(safe-area-inset-right, 0px)) calc(7px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
  background: #fff; border-top: 1px solid var(--ax-line); box-shadow: var(--ax-shadow-up);
  font-family: var(--ax-font);
}
.ax-nav-item {
  position: relative; flex: 1 1 0; min-width: 0; min-height: var(--ax-tap); box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  margin: 0; padding: 2px; border: 0; border-radius: 10px; background: none;
  color: var(--ax-muted); font: 600 11px/1.2 var(--ax-font); text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ax-nav-item .ax-icon { width: 22px; height: 22px; vertical-align: 0; }
.ax-nav-item > span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-nav-item:active { opacity: .6; }
.ax-nav-item[aria-current="page"], .ax-nav-item[aria-expanded="true"] { color: var(--ax-brand); }
.ax-nav-item[aria-current="page"] > span { font-weight: 700; }
.ax-nav-item[aria-current="page"]::before {
  content: ""; position: absolute; top: -8px; left: 50%; width: 26px; height: 3px; margin-left: -13px;
  border-radius: 0 0 3px 3px; background: var(--ax-brand);
}
.ax-nav [hidden], .ax-sheet [hidden] { display: none !important; }

/* =====================================================================
   BOTTOM SHEET — .ax-sheet-bg + .ax-sheet (role=dialog). Toggle the
   hidden attribute, then .is-open for the slide; z 80 (above the nav).
   ===================================================================== */
.ax-sheet-bg {
  position: fixed; inset: 0; z-index: var(--ax-z-sheet);
  background: rgba(15, 23, 42, .46); opacity: 0; transition: opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.ax-sheet-bg.is-open { opacity: 1; }
.ax-sheet-bg:not(.is-open) { pointer-events: none; }
.ax-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--ax-z-sheet); box-sizing: border-box;
  max-width: var(--ax-maxw); max-height: calc(100% - 38px); margin: 0 auto;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0 max(14px, env(safe-area-inset-right, 0px)) calc(26px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  background: var(--ax-sheet-bg); border-radius: var(--ax-r-xl) var(--ax-r-xl) 0 0;
  box-shadow: 0 -10px 40px rgba(15, 23, 42, .25); color: var(--ax-ink); font-family: var(--ax-font);
  transform: translateY(100%); transition: transform .24s var(--ax-ease);
}
.ax-sheet.is-open { transform: none; }
.ax-sheet:not(.is-open) { pointer-events: none; }
.ax-sheet-bg[hidden], .ax-sheet[hidden] { display: none; }
.ax-sheet-grab { width: 38px; height: 5px; margin: 8px auto 4px; border-radius: 3px; background: var(--ax-grey); }
.ax-sheet-head { display: flex; align-items: center; gap: 10px; padding: 6px 2px 12px; }
.ax-sheet-title { flex: 1; min-width: 0; }
.ax-sheet-title h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.ax-sheet-title small {
  display: block; font-size: 12.5px; color: var(--ax-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ax-sheet-x {
  flex: none; width: var(--ax-tap); height: var(--ax-tap); margin: -5px -5px -5px 0; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ax-grey-ink);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ax-sheet-x > span { width: 34px; height: 34px; border-radius: 50%; background: #e3e8ef; display: grid; place-items: center; }
.ax-sheet-x .ax-icon { width: 18px; height: 18px; }
.ax-sheet-signout {
  display: flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box;
  min-height: 48px; margin-top: 4px; border-radius: var(--ax-r); background: #fff; box-shadow: var(--ax-shadow-1);
  color: var(--ax-red); font-size: 15.5px; font-weight: 700; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.ax-sheet-signout .ax-icon { width: 19px; height: 19px; }
.ax-sheet-signout:active { background: var(--ax-red-soft); }

/* =====================================================================
   INSTALL HELP — "Add 10XAXS to your Home Screen" on iPhone / iPad
   (partials/install-help.ejs + /js/install-help.js). A .ax-sheet on Home
   and Doors (.ax-sheet.ax-ih), inline on /get (.ax-ih.ax-ih-inline).
   Every line of text 16px+, every control 44px+.
   ===================================================================== */
.ax-ih [hidden] { display: none !important; }
.ax-ih-body { font-size: 16px; line-height: 1.45; color: var(--ax-ink); }
.ax-ih-steps { list-style: none; margin: 0 0 12px; padding: 0; counter-reset: ax-ih; }
.ax-ih-steps > li {
  display: flex; align-items: center; gap: 12px; margin: 0 0 8px; padding: 12px;
  border-radius: var(--ax-r); background: #fff; box-shadow: var(--ax-shadow-1); counter-increment: ax-ih;
}
.ax-ih-steps > li::before {
  content: counter(ax-ih); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ax-brand); color: #fff; font-size: 15px; font-weight: 800;
}
.ax-ih-pic {
  flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--ax-brand-soft); color: var(--ax-brand);
}
.ax-ih-pic .ax-icon { width: 26px; height: 26px; }
.ax-ih-pic-add { background: #f2f2f7; color: #007aff; font-size: 17px; font-weight: 700; }   /* iOS's own blue "Add" */
.ax-ih-txt { flex: 1; min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
.ax-ih-txt small { display: block; margin-top: 3px; font-size: 16px; color: var(--ax-muted); }
.ax-ih-then { display: flex; align-items: center; gap: 8px; margin: 0 2px 14px; font-size: 16px; color: var(--ax-green-ink); }
.ax-ih-then .ax-icon { width: 22px; height: 22px; }
.ax-ih-why {
  display: flex; align-items: flex-start; gap: 12px; margin: 0 0 12px; padding: 14px;
  border-radius: var(--ax-r); background: var(--ax-brand-soft); border: 1px solid var(--ax-brand-line); color: #1e3a5f;
}
.ax-ih-why strong { display: block; font-size: 17px; }
.ax-ih-why p { margin: 3px 0 0; font-size: 16px; }
.ax-ih-why-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--ax-brand); }
.ax-ih-why-ic .ax-icon { width: 24px; height: 24px; }
.ax-ih-fallback {
  margin: 0 0 12px; padding: 14px; border-radius: var(--ax-r);
  background: var(--ax-amber-soft); border: 1.5px solid var(--ax-amber-line); color: var(--ax-ink);
}
.ax-ih-fallback h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; color: var(--ax-amber-ink); }
.ax-ih-fallback p { margin: 0; font-size: 16px; }
.ax-ih-copywrap { margin-top: 12px; }
.ax-ih .ax-ih-copy { min-height: 52px; font-size: 16.5px; font-weight: 700; gap: 8px; }
.ax-ih .ax-ih-copy.is-copied { background: var(--ax-green-ink); border-color: var(--ax-green-ink); color: #fff; }
.ax-ih-manual p { margin: 10px 0 6px; font-size: 16px; }
.ax-ih-url {
  display: block; box-sizing: border-box; width: 100%; min-height: 48px; margin: 0; padding: 10px 12px;
  border: 1.5px solid var(--ax-line-strong); border-radius: 12px; background: #fff; color: var(--ax-ink);
  font: inherit; font-size: 16px; -webkit-user-select: text; user-select: text;
}
.ax-ih-note { margin: 10px 2px 12px; font-size: 16px; color: var(--ax-muted); }
.ax-ih-fallback .ax-ih-note { margin: 10px 0 0; color: #475569; }
.ax-ih-done { min-height: 48px; font-size: 16px; }
.ax-ih-inline .ax-ih-steps > li { background: var(--ax-surface-2); box-shadow: none; border: 1px solid var(--ax-line); }

/* =====================================================================
   MODAL — centred dialog, z 80 (above the nav, under toasts)
   ===================================================================== */
.ax-modal-bg {
  position: fixed; inset: 0; z-index: var(--ax-z-modal); display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(15, 23, 42, .5);
}
.ax-modal-bg[hidden] { display: none; }
.ax-modal {
  box-sizing: border-box; width: 100%; max-width: 440px; max-height: calc(100% - 32px); overflow-y: auto;
  padding: 20px; border-radius: 18px; background: #fff; box-shadow: var(--ax-shadow-2);
  color: var(--ax-ink); font-family: var(--ax-font);
}
.ax-modal h2 { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.ax-modal p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; color: var(--ax-ink-2); }
.ax-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* =====================================================================
   TOAST — one at a time, above the bottom nav (z 90)
   ===================================================================== */
.ax-toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); z-index: var(--ax-z-toast);
  box-sizing: border-box; max-width: min(92vw, 520px); display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px; background: var(--ax-ink); color: #fff;
  font: 600 14px/1.4 var(--ax-font); box-shadow: var(--ax-shadow-2); overflow-wrap: anywhere;
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity .2s ease, transform .2s var(--ax-ease);
}
.ax-toast.is-show { opacity: 1; transform: translate(-50%, 0); }   /* stays pointer-events:none — never swallows a tap on what's under it */
.ax-toast .ax-icon { width: 18px; height: 18px; }
.ax-toast-success { background: #065f46; }
.ax-toast-error { background: var(--ax-red-ink); }
.ax-toast-warn { background: #78350f; }

/* =====================================================================
   EMPTY · LOADING · ERROR · NOTICE
   ===================================================================== */
.ax-empty { padding: 36px 20px; text-align: center; color: var(--ax-muted); }
.ax-empty-ic {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ax-line-soft); color: var(--ax-faint);
}
.ax-empty-ic .ax-icon { width: 26px; height: 26px; }
.ax-empty-title { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--ax-ink); }
.ax-empty-text { max-width: 320px; margin: 0 auto; font-size: 14px; line-height: 1.45; }
.ax-empty .ax-btn { margin-top: 14px; }

.ax-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px 16px; color: var(--ax-muted); font-size: 14px; }
.ax-spinner {
  flex: none; width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%;
  border: 2.5px solid rgba(28, 111, 181, .2); border-top-color: var(--ax-brand);
  animation: ax-spin .8s linear infinite;
}
@keyframes ax-spin { to { transform: rotate(360deg); } }

.ax-error, .ax-notice {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.45;
}
.ax-error { background: var(--ax-red-soft); border: 1px solid var(--ax-red-line); color: var(--ax-red-ink); }
.ax-notice { background: var(--ax-brand-soft); border: 1px solid var(--ax-brand-line); color: #1e3a5f; }
.ax-error .ax-icon, .ax-notice .ax-icon { width: 18px; height: 18px; margin-top: 1px; }
.ax-error .ax-btn { margin-left: auto; }

/* =====================================================================
   GRADIENT HEADER + LOGO BADGE (Home, "Get the app", sign-in screens)
   <header class="ax-hero …">   blue gradient, soft corner glow, rounded
     <div class="ax-logo-badge"><img …> or <span class="ax-wordmark">10<i>X</i>AXS</span></div>
   </header>
   The page adds its own padding; children sit above the glow.
   ===================================================================== */
.ax-hero {
  position: relative; overflow: hidden; color: #fff; background: var(--ax-gradient);
  border-radius: 0 0 26px 26px;
}
.ax-hero::after {
  content: ""; position: absolute; right: -50px; top: -60px; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%); pointer-events: none;
}
.ax-hero > * { position: relative; z-index: 1; }

.ax-logo-badge {
  display: inline-flex; align-items: center; gap: 9px; flex: none; box-sizing: border-box; max-width: 100%;
  height: 44px; padding: 0 14px; border-radius: 12px; background: #fff; color: var(--ax-ink);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .16);
}
.ax-logo-badge img { display: block; height: 30px; width: auto; max-width: 190px; object-fit: contain; }
.ax-logo-badge img[hidden], .ax-wordmark[hidden] { display: none; }
.ax-wordmark { font-size: 23px; font-weight: 900; letter-spacing: -.03em; line-height: 1; color: var(--ax-brand); }
.ax-wordmark i { font-style: normal; color: var(--ax-faint); }

/* =====================================================================
   SIGN-IN SCREENS (plan T2.11) — auth-login / -mfa / -forgot /
   -set-password and the kiosk PIN page. Kept after .ax-btn / .ax-notice
   on purpose: .ax-auth-submit and .ax-auth-ok adjust those.
   <main class="ax-auth">
     <header class="ax-hero ax-auth-hero"> logo badge + <div class="ax-auth-title"><h1/><p/></div></header>
     <div class="ax-auth-card"> .ax-auth-msg · .ax-auth-field > label + .ax-auth-input
       (.ax-auth-pw wraps a password field + its .ax-auth-eye toggle) · .ax-btn.ax-auth-submit
       · .ax-auth-links > .ax-auth-link </div>
     <p class="ax-auth-foot">…</p>
   </main>
   ===================================================================== */
.ax-auth { box-sizing: border-box; max-width: 440px; margin: 0 auto; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.ax-auth-hero { padding: 20px max(20px, env(safe-area-inset-right, 0px)) 48px max(20px, env(safe-area-inset-left, 0px)); }
.ax-auth-title { margin-top: 18px; }
.ax-auth-title h1 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -.01em; line-height: 1.25; }
.ax-auth-title p { margin: 4px 0 0; font-size: 14.5px; opacity: .92; overflow-wrap: anywhere; }
.ax-auth-card {
  position: relative; z-index: 2; box-sizing: border-box; margin: -26px 16px 0; padding: 20px 18px 16px; border-radius: 18px;
  background: var(--ax-card); box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 26px rgba(15, 23, 42, .10);
}
.ax-auth-msg { margin: 0 0 16px; overflow-wrap: anywhere; }
.ax-auth-ok { background: var(--ax-green-soft); border-color: var(--ax-green-line); color: var(--ax-green-ink); }
.ax-auth-field { margin: 0 0 16px; }
.ax-auth-field > label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 650; color: var(--ax-ink-2); }
.ax-auth-input {
  display: block; box-sizing: border-box; width: 100%; min-height: 50px; margin: 0; padding: 12px 14px;
  border: 1.5px solid #d7dfea; border-radius: 12px; background: #fff; color: var(--ax-ink);
  font: inherit; font-size: 16px; -webkit-appearance: none; appearance: none;
}
.ax-auth-input::placeholder { color: var(--ax-faint); }
.ax-auth-input:focus { outline: none; border-color: var(--ax-brand); box-shadow: 0 0 0 3px rgba(28, 111, 181, .15); }
.ax-auth-hint { margin: 6px 0 0; font-size: 13px; color: var(--ax-muted); }
.ax-auth-pw { position: relative; }
.ax-auth-pw .ax-auth-input { padding-right: 52px; }
.ax-auth-eye {
  position: absolute; top: 3px; right: 3px; width: 44px; height: 44px; display: grid; place-items: center;
  margin: 0; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--ax-muted); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ax-auth-eye:active { background: var(--ax-grey-soft); }
.ax-auth-eye .ax-icon { width: 21px; height: 21px; }
.ax-auth-submit { min-height: 52px; margin-top: 4px; border-radius: 13px; font-size: 16px; font-weight: 700; }
.ax-auth-links { display: flex; flex-direction: column; align-items: center; margin-top: 10px; }
.ax-auth-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 0 10px;
  border-radius: 10px; color: var(--ax-brand); font-size: 14.5px; font-weight: 650; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.ax-auth-link:active { background: var(--ax-brand-soft); }
.ax-auth-link .ax-icon { width: 18px; height: 18px; }
.ax-auth-link-muted { color: var(--ax-muted); }
.ax-auth-foot { margin: 22px 16px 0; text-align: center; font-size: 12px; color: var(--ax-muted); }
.ax-auth-foot b { color: var(--ax-brand); font-weight: 700; }
@media (min-width: 600px) {
  .ax-auth { padding-top: 6vh; }
  .ax-auth-hero { border-radius: 22px; }
}
