/* Self-hosted fonts (kept within CSP 'self'; replaces blocked Google Fonts @import). */
@font-face {
    font-family: 'Bebas Neue';
    font-style: normal;
    /* Bebas Neue ships a single weight. Declaring the full range maps every
       requested weight (headings use --font-weight-bold, dashboard counters
       --font-weight-extrabold) onto this one face, so engines never synthesize
       a distorted faux-bold. Runtime heading-font overrides with real bold
       faces are unaffected. */
    font-weight: 100 900;
    font-display: swap;
    /* woff2 first: same font, re-containered losslessly (identical 497 glyphs),
       56KB -> 20KB. The .ttf stays as the fallback for anything that cannot
       take woff2; every current browser takes the first entry. Regenerate with
       fontTools: f = TTFont(src); f.flavor = 'woff2'; f.save(dst). */
    src: url('/fonts/bebas-neue/BebasNeue-Regular.woff2') format('woff2'),
         url('/fonts/bebas-neue/BebasNeue-Regular.ttf') format('truetype');
}

/* Anton: an open-licence (OFL) face drawn as an Impact match. Impact is what
   the landing headline was designed in, but it ships only with Windows and
   macOS and cannot be licensed for serving, so phones fell through to Bebas
   Neue and the headline looked different on every phone than on the web.
   Self-hosting Anton gives every device the same face. Latin subset, 12KB. */
@font-face {
    font-family: 'Anton';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/anton/Anton-Regular-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    /* 108KB -> 44KB, identical 414 glyphs and the same 300-700 axis. */
    src: url('/fonts/outfit/Outfit-VariableFont_wght.woff2') format('woff2-variations'),
         url('/fonts/outfit/Outfit-VariableFont_wght.ttf') format('truetype-variations');
}

/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS - Centralized Theme System
   All design tokens (colors, typography, spacing, radii, shadows) are defined
   here as CSS custom properties. These are injected by the server with values
   from the database DesignTokens configuration.
   
   Token Naming Convention:
   - --token-{category}-{semantic}-{variant}
   - --space-{scale}
   - --font-{size|weight|family}
   - --radius-{size}
   - --shadow-{size}
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ──────────────────────────────────────
     COLORS - Semantic
     ────────────────────────────────────── */
  
  /* Primary */
  --color-primary: #c0181e;
  --color-primary-dark: #a81018;
  --color-primary-light: #d63135;
  
  /* Secondary */
  --color-secondary: #6c757d;
  --color-secondary-dark: #5a6268;
  --color-secondary-light: #adb5bd;
  
  /* Accent (same as primary by default) */
  --color-accent: #c0181e;
  
  /* Neutral - Background & Surfaces */
  --color-bg: #f4f1eb;
  --color-surface: #ffffff;
  --color-surface-light: color-mix(in srgb, #ffffff 78%, transparent);
  --color-surface-strong: color-mix(in srgb, #ffffff 92%, transparent);
  --color-component: #ffffff;
  --color-component-light: color-mix(in srgb, #ffffff 62%, transparent);
  --color-component-strong: color-mix(in srgb, #ffffff 84%, transparent);

  /* Translucent "glass" fill shared by inputs, record rows, and feed-style
     surfaces so the whole app reads as one frosted layer. ~72% keeps text
     legible while letting the panel tint show through. */
  --field-fill: color-mix(in srgb, var(--color-component) 72%, transparent);
  --field-fill-hover: color-mix(in srgb, var(--color-component) 84%, transparent);

  /* Text */
  --color-text-primary: #16181d;
  --color-text-secondary: #4d5563;
  --color-text-tertiary: #6b7280;
  --color-text-inverse: #ffffff;

  /* Shared panel and table-column header band */
  --color-panel-header: #30343d;
  --color-panel-header-text: #ffffff;
  
  /* Semantic - Success */
  --color-success: #1a6e38;
  --color-success-bg: #dff0e8;
  
  /* Semantic - Warning */
  --color-warning: #8a5000;
  --color-warning-bg: #f5e8cc;
  
  /* Semantic - Error */
  --color-error: #dc2626;
  --color-error-bg: #fce8ea;
  
  /* Semantic - Info */
  --color-info: #1a4e8a;
  --color-info-bg: #dde8f5;
  
  /* Borders & Dividers */
  /* Two-tier border system: keep the tiers visually distinct (G-V17). One border for fields and
     cards alike; #c3cad4 is the owner's pick (2026-11-25), a solid cool grey that suits the navy
     theme. A separate darker field border was tried the same day and dropped as boxy. */
  --color-border: #c3cad4;
  --color-border-light: rgba(18, 24, 32, 0.10);

  /* ──────────────────────────────────────
     TYPOGRAPHY
     ────────────────────────────────────── */
  
  /* Font Families */
  --font-family-heading: 'Bebas Neue', sans-serif;
  --font-family-body: 'Outfit', sans-serif;
  --font-family-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-heading: var(--font-family-heading);
  --font-body: var(--font-family-body);
  /* Panel and section titles (owner, 2026-11-26): the body font in semibold. The heading font is a display face
     typed into Admin → Website Settings → Theme, and one the site does not host (Inter, on dev) fell back to each
     device's default, so panel titles showed in Helvetica, Arial or Roboto. They are interface labels: they stay
     on the body font, which is always loaded. Page titles and big numbers keep the heading font. */
  --font-panel-title: var(--font-family-body);
  --font-weight-panel-title: var(--font-weight-semibold);

  /* Font Sizes (px) */
  --font-size-2xs: 8px;
  --font-size-xs: 10px;
  --font-size-sm: 12px;
  --font-size-base: 15px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-2xl: 30px;
  --font-size-3xl: 32px;
  
  /* Font Weights */
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  /* Line Heights */
  --line-height-tight: 1.15;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;
  
  /* ──────────────────────────────────────
     SPACING (Base unit = 8px)
     ────────────────────────────────────── */
  
  --space-2xs: 2px;     /* 0.25x */
  --space-xs: 4px;      /* 0.5x */
  --space-sm: 8px;      /* 1x */
  --space-md: 12px;     /* 1.5x */
  --space-lg: 16px;     /* 2x */
  --space-xl: 24px;     /* 3x */
  --space-2xl: 32px;    /* 4x */
  --space-3xl: 40px;    /* 5x */
  --space-4xl: 48px;    /* 6x */
  --space-6xl: 64px;    /* 8x */
  
  /* ──────────────────────────────────────
     BORDER RADII
     ────────────────────────────────────── */
  
  /* Same scale as the iPhone app. sm: badges, chips, photos. md: buttons, inputs, inner
     panels. lg: cards and panels. xl: sidebar, top bar, sheets. A shape inside another
     shape takes the next step down. */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  /* Every button reads these, never a radius of its own. Website Settings → Theme →
     Button shape swaps them to --radius-full for capsule buttons. */
  --radius-button: var(--radius-md);
  --radius-button-sm: var(--radius-sm);

  /* Button lift: a tight dark edge under the button plus a short glow, so it reads as
     raised. Taken from the sidebar's Book Inspection; every main button uses these. */
  --btn-raise:
    0 1px 2px color-mix(in srgb, color-mix(in srgb, var(--color-text-primary) 78%, var(--color-primary) 22%) 18%, transparent),
    0 8px 18px -10px color-mix(in srgb, var(--color-primary) 55%, transparent);
  --btn-raise-hover:
    0 2px 4px color-mix(in srgb, color-mix(in srgb, var(--color-text-primary) 78%, var(--color-primary) 22%) 22%, transparent),
    0 12px 22px -10px color-mix(in srgb, var(--color-primary) 60%, transparent);
  /* Same lift for white/outlined buttons, in the text colour instead of the brand colour. */
  --btn-raise-neutral:
    0 1px 2px color-mix(in srgb, var(--color-text-primary) 12%, transparent),
    0 8px 18px -12px color-mix(in srgb, var(--color-text-primary) 32%, transparent);

  /* Standard action-button height — change here to resize every app/form button
     at once (landing/marketing buttons and the small/segmented/topbar tiers are
     intentionally excluded). */
  --btn-height: 44px;

  /* Segmented toggle — ONE global setting for every segmented control
     (notification/period/status/settings tabs). Change these to restyle all. */
  /* Track */
  /* A veil, not a fill. Mixed against --color-surface this was an opaque
     #EEEFEF — fine on the white panel the token was tuned on, but darker than
     --color-bg itself (0.861 against 0.881), so on any washed or tinted ground
     the track read as a grey slab laid over the page rather than a channel cut
     into it. Against transparent it tints whatever is actually behind it, so
     one value now works on white panels, on the warm page ground and on the
     report hero's brand wash alike. The @supports fallback further down still
     substitutes an opaque colour where color-mix is unavailable. */
  --seg-track-bg: color-mix(in srgb, var(--color-text-primary) 5%, transparent);
  --seg-track-border: var(--color-border-light, #eaecf0);
  --seg-radius: var(--radius-lg);
  --seg-gap: 3px;
  --seg-pad: 4px;
  /* Buttons */
  --seg-item-radius: var(--radius-md);
  --seg-item-pad: 7px 14px;
  /* item + 8 track padding (--seg-pad × 2) + 2px border = --btn-height, so a
     segmented toggle never grows a header taller than an adjacent button.
     Derived from --btn-height rather than a matching literal so the two can't
     drift apart if either changes. */
  --seg-item-min-h: calc(var(--btn-height) - (var(--seg-pad) * 2) - 2px);
  --seg-item-weight: var(--font-weight-semibold);
  --seg-rest-text: var(--color-text-secondary);
  --seg-active-bg: var(--color-primary);
  --seg-active-text: var(--color-text-inverse);

  /* ──────────────────────────────────────
     SHADOWS
     ────────────────────────────────────── */
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 16px 34px rgba(16, 24, 40, 0.06);
  --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.15);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.42);

  /* ──────────────────────────────────────
     Z-INDEX LAYERS
     One global stacking scale — express layer relationships here, never with
     ad-hoc literals (an ad-hoc 460 once left the mobile filter sheet trapped
     under the 1030 topbar). Component-local stacking (z-index: 1/2 inside a
     card, the self-contained auction map) stays literal by design.
     ────────────────────────────────────── */

  --z-shell-nav: 300;          /* sticky admin nav band (sits under the floating topbar) */
  --z-popover: 320;            /* in-page menus/popovers (sort menu) — above content, under topbar */
  --z-mobile-nav-overlay: 420; /* mobile more-drawer dimmer */
  --z-mobile-menu: 430;        /* mobile top dropdown menu */
  --z-mobile-nav: 450;         /* mobile bottom nav, more-drawer, landscape rail */
  --z-topbar: 1030;            /* floating glass topbar */
  --z-sheet-backdrop: 1040;    /* bottom-sheet dimmer (must cover the topbar) */
  --z-sheet: 1050;             /* mobile filter bottom sheet */
  --z-toast: 1080;             /* transient toasts — above sheets, below modals */
  --z-modal: 1200;             /* full-screen blocking modals (payment, cancel-request) */
  --z-picker-backdrop: 1250;   /* phone picker sheet dimmer (a picker can open from a sheet or modal) */
  --z-picker: 1260;            /* phone picker sheet or menu (picker.js) */
  --z-dialog: 1300;           /* confirm dialogs — top interactive layer */
  --z-skip-link: 9999;         /* skip-to-main link when focused */

  /* ──────────────────────────────────────
     TOP BAR
     ────────────────────────────────────── */

  --topbar-bg: #ffffff;
  --topbar-bg-soft: #ffffff;
  --topbar-border: #ffffff;
  --topbar-text: #16181d;
  --topbar-text-muted: #4d5563;
  --topbar-chip-bg: #ffffff;
  /* Negative spread keeps both layers close to the floating bar. The shadow
     ends before the first page panel instead of washing across its top edge. */
  --topbar-shadow: 0 2px 4px -2px rgba(8, 18, 34, 0.06), 0 6px 12px -8px rgba(8, 18, 34, 0.10);
  --topbar-blur: 26px;
  --topbar-saturation: 165%;
  --topbar-brand-width: clamp(148px, 12.5vw, 188px);

  /* Signed-out topbar: ONE definition for the home page's bar (landing-v7.css,
     .topbar) and every other public page's bar (app.css, .app-public-topbar).
     The two are separate markup, so they must both read these rather than
     restate values — that is how they drifted apart before. Mobile values are
     in the max-width: 740px block below. */
  --public-topbar-height: 60px;
  --public-topbar-pad-block: 6px;
  --public-topbar-offset: 10px;             /* gap above the floating bar; 8px wide/landscape, below */
  --public-topbar-pad-inline: 20px;
  --public-topbar-radius: var(--radius-xl);
  --public-topbar-edge: color-mix(in srgb, var(--topbar-border) 58%, transparent);
  --public-topbar-link-size: 15px;
  --public-topbar-link-weight: 600;
  --public-topbar-link-color: var(--topbar-text);
  --public-topbar-link-tracking: 0.01em;
  --public-topbar-action-size: 13px;
  --public-topbar-action-weight: 700;
  --public-topbar-action-pad-inline: 16px;
  /* Near-solid white with a brand edge: holds on the hero photograph and on
     plain page backgrounds alike (the old translucent glass vanished on both). */
  --public-topbar-action-bg: color-mix(in srgb, #fff 92%, transparent);
  --public-topbar-action-bg-hover: color-mix(in srgb, var(--color-primary) 6%, #fff);
  --public-topbar-action-border: var(--color-primary);
  --public-topbar-action-text: var(--color-primary);

  /* Focus on every text field, select and custom dropdown site-wide: a solid
     brand border (the edge carries the contrast, ~11:1 on white) plus a soft
     32% halo. Read by each field family's :focus rule — never restate these.
     Buttons and checkboxes keep their own focus styles. */
  --field-focus-border: var(--color-primary);
  --field-focus-ring: 0 0 0 3px color-mix(in srgb, var(--color-primary) 32%, transparent);

  /* Space between the top bar's row and a public page's first content, so
     every page's title or first card starts on the same line. 16px at 640px
     and below. Read by How It Works and by body.public-page rules in app.css. */
  --public-page-top: var(--space-xl);

  /* The glass panel behind every signed-in page's content (main.admin-shell-content
     in _Layout), client and admin alike. Set --shell-panel-bg: transparent here to
     drop it site-wide, or on one page's body class to drop it there only. */
  --shell-panel-bg: linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 88%, transparent) 0%, color-mix(in srgb, var(--color-component) 82%, transparent) 100%);
  --shell-panel-border: 1px solid var(--color-border-light);
  --shell-panel-shadow: var(--shadow-lg), var(--shadow-inner);

  /* ──────────────────────────────────────
     REPORT UI
     ────────────────────────────────────── */

  --color-report-card-bg:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-surface) 82%, transparent) 0%,
      color-mix(in srgb, var(--color-component) 62%, transparent) 100%
    );
  --color-report-card-bg-strong:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-surface) 90%, transparent) 0%,
      color-mix(in srgb, var(--color-component) 72%, transparent) 100%
    );
  --color-report-overlay: color-mix(in srgb, var(--color-text-primary) 34%, transparent);
  --color-report-overlay-strong: color-mix(in srgb, var(--color-text-primary) 82%, transparent);
  --color-report-icon: color-mix(in srgb, var(--color-text-primary) 68%, var(--color-info) 32%);
  --color-report-low: var(--color-warning);
  --color-report-low-bg: color-mix(in srgb, var(--color-warning-bg) 82%, white 18%);
  --color-report-medium: color-mix(in srgb, var(--color-warning) 58%, var(--color-error) 42%);
  --color-report-medium-bg: color-mix(in srgb, var(--color-warning-bg) 42%, var(--color-error-bg) 58%);
  --color-report-high: var(--color-error);
  --color-report-high-bg: var(--color-error-bg);
  --color-report-hero-ink: var(--color-text-primary);
  --color-report-hero-ink-soft: color-mix(in srgb, var(--color-text-primary) 86%, var(--color-primary) 14%);
  --color-report-hero-muted: var(--color-text-secondary);
  --color-report-hero-muted-subtle: var(--color-text-tertiary);
  --color-report-hero-line: var(--color-border-light);
  --color-report-hero-surface: var(--color-surface);
  --color-report-hero-soft: color-mix(in srgb, var(--color-component) 78%, var(--color-bg) 22%);
  --color-report-hero-tabs-bg: color-mix(in srgb, var(--color-component) 86%, var(--color-bg) 14%);
  --color-report-hero-accent: var(--color-accent);
  --color-report-hero-on-accent: var(--color-text-inverse);
  --color-report-hero-success: var(--color-success);
  --color-report-hero-minor: var(--color-warning);
  --color-report-hero-major: var(--color-error);
  --color-report-hero-on-media: var(--color-text-inverse);
  --shadow-report-card: 0 10px 26px color-mix(in srgb, var(--color-text-primary) 8%, transparent);
  --shadow-report-hero: var(--shadow-sm), 0 22px 60px -28px color-mix(in srgb, var(--color-text-primary) 28%, transparent);
  --shadow-report-hero-stat: 0 28px 56px rgba(10, 18, 32, 0.14);
  --radius-report-hero: var(--radius-xl);
  --radius-report-hero-stat: var(--space-2xs);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & DEFAULTS
   ═══════════════════════════════════════════════════════════════════════════ */

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

@media (orientation: landscape), (min-width: 1081px) {
  :root { --public-topbar-offset: 8px; }
}

@media (max-width: 740px) {
  :root {
    --public-topbar-pad-inline: 12px;
    --public-topbar-radius: var(--radius-xl);
    --public-topbar-action-pad-inline: 14px;
  }
}

@media (max-width: 640px) {
  :root { --public-page-top: var(--space-lg); }
}

/* Short screens: the bar compresses so the page below gets the room. */
@media (max-width: 1080px) and (orientation: portrait) and (max-height: 700px) {
  :root { --public-topbar-height: 44px; --public-topbar-offset: 6px; }
}

@media (max-width: 360px) and (orientation: portrait) {
  :root { --public-topbar-height: 44px; --public-topbar-pad-block: 0px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  :root { --public-topbar-height: 44px; --public-topbar-offset: 4px; --public-topbar-pad-block: 0px; }
}

/* One desktop logo scale for the public landing pages and shared app header. */
@media (min-width: 1081px) {
  :root { --topbar-brand-width: clamp(148px, 11vw, 165px); }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html {
  font-size: 14px;
}

/* Temporary verification mode:
   Add class="debug-fonts" to the <html> element in a layout to confirm
   heading/body token application visually across the app, then remove it. */
html.debug-fonts {
  --font-family-heading: Impact, fantasy;
  --font-family-body: "Courier New", monospace;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--color-primary) 7%, transparent), transparent 28%),
    linear-gradient(180deg, color-mix(in srgb, var(--color-bg) 24%, white 76%) 0%, var(--color-bg) 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  position: relative;
  min-height: 100%;
}

/* No margin-bottom here. It paired with `html { position: relative }` above as
   the old sticky-footer hack, where the footer was position: absolute and the
   body reserved its height — but .app-footer has only ever had margin-top and
   sits in normal flow, so the 60px reserved space for something that no longer
   exists. It was unconditional, so every page carried it, and on the pages that
   do need room at the bottom it stacked on top of the real clearance:
   `.admin-shell ~ .app-footer` already pads itself by 64px + 12px +
   env(safe-area-inset-bottom) to clear the fixed mobile nav. The auth pages had
   already overridden it back to 0 rather than inherit the dead space. */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

button,
input,
select,
textarea,
label,
th,
td,
.btn,
.badge,
.breadcrumb,
.breadcrumb-item {
  font-family: var(--font-family-body);
}

/* Bootstrap's own corners (4px buttons and fields) would otherwise show on any .btn or
   field that no page stylesheet rounds, such as the checkout Pay button. Loaded after
   bootstrap.min.css at equal specificity, so these win; page rules still win over them. */
.btn {
  border-radius: var(--radius-button);
}

.btn-sm {
  border-radius: var(--radius-button-sm);
}

.form-control,
.form-select {
  border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOCUS STATES
   ═══════════════════════════════════════════════════════════════════════════ */

.btn:focus-visible,
.btn:active:focus-visible,
.btn-link.nav-link:focus-visible,
.form-check-input:focus-visible {
  box-shadow: 0 0 0 0.1rem var(--color-surface), 0 0 0 0.25rem color-mix(in srgb, var(--color-primary) 32%, transparent);
}

/* Bootstrap's own field focus (light blue, 25%) would otherwise show on any
   .form-control/.form-select that no page stylesheet covers. Loaded after
   bootstrap.min.css at equal specificity, so this wins. */
.form-control:focus,
.form-control:focus-visible,
.form-select:focus {
  border-color: var(--field-focus-border);
  box-shadow: var(--field-focus-ring);
}

/* ═══════════════════════════════════════════════════════════════════════════
   GLASS MORPHISM UTILITY (used by topbars and cards)
   ═══════════════════════════════════════════════════════════════════════════ */

.glass {
  /* White-alpha alone ≈1.2:1 against the page — mix in a little ink so panels
     keep a perceivable edge (G-V23). */
  --glass-border: color-mix(in srgb, #ffffff 70%, var(--color-text-primary) 12%);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-surface) 54%, transparent) 0%,
    color-mix(in srgb, var(--color-component) 28%, transparent) 100%
  );
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  box-shadow: 0 18px 38px rgba(8, 18, 34, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.glass-sm {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--color-surface) 82%, transparent) 0%,
    color-mix(in srgb, var(--color-component) 62%, transparent) 100%
  );
  border: 1px solid var(--color-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 16px 34px rgba(16, 24, 40, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

/* ── Global iOS no-zoom floor for form fields ──────────────────────────────
   Mobile Safari zooms the page whenever a focused field has font-size < 16px.
   Floor every text-entry control at 16px on mobile (scaling up if the theme's
   --font-size-base is larger) so no field zooms regardless of the admin-set base
   size. One global rule instead of per-component patches. The negation list keeps
   the selector's specificity above single-class field rules and excludes controls
   that have no zoomable text. (ID-targeted fields, e.g. #house-search-input, are
   handled at their own rule because an ID out-specifies this.)

   --field-font-size is that same size as a token, for text that belongs with a field but is not
   an <input>: dropdown and picker list options, and search boxes inside lists. Fields, their
   search boxes and their options then read at one size: the theme base on desktop, 16px+ on
   phones (owner, 2026-11-25). */
:root { --field-font-size: var(--font-size-base); }
@media (max-width: 767.98px) {
  :root { --field-font-size: max(16px, var(--font-size-base)); }
  /* :is() gives select and textarea the input arm's specificity; listed bare, a single-class rule
     such as Contact's ".public-form-field textarea" out-ranked them and the box zoomed. */
  :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not(.otp-box),
      select,
      textarea) {
    font-size: var(--field-font-size);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   color-mix() FALLBACK (Safari <16.2, Chrome/Edge <111, older Android WebView)
   Browsers without color-mix() treat any value using it as invalid at use time,
   so the glass fills, page gradient and focus ring silently resolve to
   transparent/none — text ends up floating with no surface behind it. Collapse
   the glass layer to opaque theme surfaces there. Layout, spacing and text
   colors are unaffected; supporting browsers skip this block entirely.
   ═══════════════════════════════════════════════════════════════════════════ */
@supports not (background: color-mix(in srgb, red, blue)) {
  :root {
    --field-focus-ring: 0 0 0 2px var(--color-primary);
    --color-surface-light: var(--color-surface);
    --color-surface-strong: var(--color-surface);
    --color-component-light: var(--color-component);
    --color-component-strong: var(--color-component);
    --field-fill: var(--color-component);
    --field-fill-hover: var(--color-component);
    --seg-track-bg: var(--color-bg);
    --color-report-card-bg: var(--color-surface);
    --color-report-card-bg-strong: var(--color-surface);
    --color-report-overlay: rgba(22, 24, 29, 0.34);
    --color-report-overlay-strong: rgba(22, 24, 29, 0.82);
    --color-report-icon: var(--color-info);
    --color-report-low-bg: var(--color-warning-bg);
    --color-report-medium: var(--color-warning);
    --color-report-medium-bg: var(--color-error-bg);
    --color-report-hero-ink-soft: var(--color-text-primary);
    --color-report-hero-soft: var(--color-component);
    --color-report-hero-tabs-bg: var(--color-component);
  }

  body {
    background: var(--color-bg);
  }

  .btn:focus-visible,
  .btn:active:focus-visible,
  .btn-link.nav-link:focus-visible,
  .form-control:focus-visible,
  .form-check-input:focus-visible {
    box-shadow: 0 0 0 0.1rem var(--color-surface), 0 0 0 0.25rem var(--color-primary);
  }

  .glass,
  .glass-sm {
    background: var(--color-surface);
    border-color: var(--color-border);
  }

  /* NOTE: .app-glass-topbar / .admin-shell fallbacks live at the end of app.css —
     their color-mix declarations are in app.css, which loads after this file, so a
     fallback here would lose the cascade. */
}

/* ═══════════════════════════════════════════════════════════════════════════
   PUBLIC PAGES' PHONE MENU (Pages/Shared/_PublicMenu.cshtml; owner, 2026-11-19)
   A button beside Login / Signup and a frosted-glass list of the main pages, shown only where the
   header's own links are hidden (the home bar below 901px, the shared bar below 900px, and sideways
   phones where the shared bar drops its links). Lives here because the home page loads its own
   stylesheets but always this one.
   ═══════════════════════════════════════════════════════════════════════════ */
.public-menu {
  display: none;
}

@media (max-width: 900px) {
  .topbar .public-menu { display: flex; }
}

@media (max-width: 899.98px) {
  .app-public-topbar .public-menu { display: flex; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 1100px) and (pointer: coarse) {
  .app-public-topbar .public-menu { display: flex; }
}

.public-menu__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-button);
  border: 1px solid color-mix(in srgb, var(--public-topbar-action-border) 38%, transparent);
  background: var(--public-topbar-action-bg);
  color: var(--public-topbar-action-text);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.public-menu__btn:hover,
.public-menu__btn[aria-expanded="true"] {
  background: var(--public-topbar-action-bg-hover);
  border-color: var(--public-topbar-action-border);
}

.public-menu__btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.public-menu__icon-close,
.public-menu__btn[aria-expanded="true"] .public-menu__icon-open { display: none; }
.public-menu__btn[aria-expanded="true"] .public-menu__icon-close { display: block; }

/* A light dim behind the panel: the page shows through, blurred by the glass. */
.public-menu__veil {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet-backdrop);
  background: color-mix(in srgb, var(--color-text-primary) 22%, transparent);
}

/* Frosted glass: the .glass recipe above, a little more opaque so the links stay readable over the hero photo. */
.public-menu__panel {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  z-index: var(--z-sheet);
  display: grid;
  padding: 6px;
  border-radius: var(--radius-xl);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-surface) 72%, transparent) 0%,
    color-mix(in srgb, var(--color-component) 52%, transparent) 100%
  );
  border: 1px solid color-mix(in srgb, #ffffff 70%, var(--color-text-primary) 12%);
  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  box-shadow: 0 18px 38px rgba(8, 18, 34, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.public-menu__panel[hidden],
.public-menu__veil[hidden] { display: none; }

.public-menu__panel a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.public-menu__panel a + a {
  border-top: 1px solid color-mix(in srgb, var(--color-text-primary) 8%, transparent);
}

.public-menu__panel a:hover,
.public-menu__panel a:focus-visible,
.public-menu__panel a[aria-current="page"] {
  background: color-mix(in srgb, var(--color-primary) 9%, transparent);
  color: var(--color-primary);
  outline: none;
}

/* ── Public top bar buttons drawn at 36px (owner, 2026-11-23) ─────────────────
   On short screens the bar is 44px and the menu circle and Login were 44px too,
   filling it edge to edge; elsewhere the circle was 44px beside a 36px Login.
   Both are now drawn at 36px everywhere, with an invisible 44px tap area so
   they stay as easy to hit. Home page Login: landing-v7-hero.css.
   To revert, delete this block (and its partner there). */
.public-menu__btn {
  position: relative;
  width: 36px;
  height: 36px;
}
.public-menu__btn::after {
  content: "";
  position: absolute;
  inset: -5px; /* from inside the 1px border: 34 + 10 = 44px */
}
.app-public-topbar .app-auth-button {
  position: relative;
  min-height: 36px;
}
.app-public-topbar .app-auth-button::after {
  content: "";
  position: absolute;
  inset: -5px 0;
}
