/* iOS WKWebView inflates small text unless locked — buttons couldn't
   hold their labels and floated over each other on iPhone TestFlight
   (Dalton, Oct 23 2026: 'buttons are floating on the words'). Lock it. */
html{text-size-adjust:100%;-webkit-text-size-adjust:100%}

/* ArmorFiCore dark mode — shared override sheet.
   Injected by server middleware on every HTML page; the theme class
   (html.af-dark / html.af-light) is set by the bootstrap script before
   first paint. nav.js drawer toggle stores af-theme in localStorage
   (auto|light|dark; auto follows prefers-color-scheme).

   Strategy: the 30+ page templates hardcode the house light palette, so
   this sheet remaps those exact values under html.af-dark. !important is
   deliberate — it also beats per-element inline styles and nav.js's
   runtime-injected <style> blocks. Scoped to @media screen so paper
   forms (run sheets, SL1, manifests, receipts) always print light. */

@media screen {

/* ---------- base surfaces ---------- */
html.af-dark { color-scheme: dark; }   /* native pickers/scrollbars go dark */
html.af-dark body { background:#0e1620 !important; color:#d8e2ec !important; }
html.af-dark main { color:#d8e2ec; }

/* cards / panels / forms */
html.af-dark .card,
html.af-dark .bar,
html.af-dark .add,
html.af-dark .stop,
html.af-dark .picker,
html.af-dark form.add,
html.af-dark table { background:#16222e !important; border-color:#2c3f52 !important; }
html.af-dark .card h2 { background:#0d2b4e !important; color:#fff !important; }
html.af-dark .due h2 { background:#1b5fad !important; }
html.af-dark .assign,
html.af-dark .picker { background:#1a2836 !important; border-color:#2c3f52 !important; }
html.af-dark .stop > h2 { background:#1c2a39 !important; color:#9ec9ff !important; }

/* tables */
html.af-dark th { background:#24557f !important; color:#fff !important; }
html.af-dark td { border-top-color:#2c3f52 !important; }
html.af-dark tr:nth-child(odd) td { background:#1b2938 !important; }
html.af-dark tr:nth-child(even) td { background:#16222e !important; }
html.af-dark .miss td { background:#3b2020 !important; }
html.af-dark .tot td { background:#16324a !important; color:#d8e2ec !important; }

/* form controls */
html.af-dark input, html.af-dark select, html.af-dark textarea {
  background:#16222e !important; color:#d8e2ec !important;
  border-color:#3a5068 !important; }
html.af-dark .bar select, html.af-dark .bar input, html.af-dark .bar a {
  background:#16222e !important; color:#9ec9ff !important; border-color:#2e6da4 !important; }
html.af-dark input::placeholder, html.af-dark textarea::placeholder { color:#7d8fa3; }
html.af-dark input[type=file]::file-selector-button { background:#2a3540;
  color:#d8e2ec; border:1px solid #3a5068; border-radius:6px; padding:6px 10px; }
html.af-dark button:disabled { background:#3f5670 !important; color:#8fa5bd !important; }
html.af-dark .slider { background:#3a5068 !important; }
html.af-dark .slider:before, html.af-dark .track::after { background:#fff !important; }
html.af-dark .track { background:#46586c !important; }

/* code chips */
html.af-dark code { background:#1c2a39 !important; color:#6fb0f5 !important; }
html.af-dark .code { color:#6fb0f5 !important; border-bottom-color:#6fb0f5 !important; }

/* ---------- text tones ---------- */
html.af-dark .sub, html.af-dark .empty, html.af-dark .note,
html.af-dark .print-note { color:#b9cde3 !important; }
/* .freq sits on navy/blue card headers — keep it light, never muted-gray */
html.af-dark .freq { color:#cfe2f7 !important; }
html.af-dark .bar label { color:#c3cfdb !important; }
html.af-dark form.add label { color:#9ec9ff !important; }
html.af-dark .acc summary { color:#6fb0f5 !important; }

/* status chips: light bg + dark text pairs -> dark bg + light text */
html.af-dark .MEETS, html.af-dark .ach, html.af-dark .approved,
html.af-dark .routed, html.af-dark .msg-ok, html.af-dark #ok,
html.af-dark .p-verified, html.af-dark .badge {
  background:#1b3520 !important; color:#8fd69b !important; }
html.af-dark .BELOW, html.af-dark .counted, html.af-dark .blind,
html.af-dark .p-truck, html.af-dark .fleet {
  background:#362d10 !important; color:#e6c95c !important; }
html.af-dark .hold, html.af-dark .late, html.af-dark .err,
html.af-dark .msg-err, html.af-dark #err, html.af-dark .msg,
html.af-dark .p-held { background:#3b2020 !important; color:#f0a8a8 !important; }
html.af-dark .draft, html.af-dark .open, html.af-dark .p-vault {
  background:#16324a !important; color:#9ec9ff !important; }
html.af-dark .sent { background:#2a3540 !important; color:#93a5b8 !important; }
html.af-dark .unknown, html.af-dark .c-wait { background:#46586c !important;
  color:#c3cfdb !important; }
html.af-dark .note { background:#362d10 !important; border-color:#5c4d1c !important;
  color:#e6c95c !important; }
/* full sweep (Oct 18): remaining light-bg chips across all templates */
html.af-dark .decls, html.af-dark .loc, html.af-dark .pre,
html.af-dark .who, html.af-dark .pill { background:#1c2a39 !important;
  color:#9ec9ff !important; }
html.af-dark .ok { background:#1b3520 !important; color:#8fd69b !important; }
html.af-dark .resid { background:#1a2836 !important; }
html.af-dark .ro { background:#16222e !important; border-color:#2c3f52 !important; }
html.af-dark .wire { background:#362d10 !important; color:#e6c95c !important; }
/* signature pad stays a white sheet on purpose — you sign on white */

/* remaining dark-text-only selectors (sit on the page background) */
html.af-dark label { color:#c3cfdb !important; }
html.af-dark #msg, html.af-dark .brand, html.af-dark .count,
html.af-dark .f b, html.af-dark .grp, html.af-dark .meta b,
html.af-dark .rc b, html.af-dark .svc b, html.af-dark .title {
  color:#9ec9ff !important; }
html.af-dark .dep, html.af-dark .held, html.af-dark .held h2,
html.af-dark .inactive { color:#f0a8a8 !important; }
html.af-dark .liab, html.af-dark .sig div, html.af-dark .terms {
  color:#c3cfdb !important; }
html.af-dark .done > h2::after, html.af-dark .verified {
  color:#8fd69b !important; }
html.af-dark a.dl { color:#6fb0f5 !important; }

/* ---------- inline-style overrides ----------
   Only the light backgrounds actually used inline (#fff, #e8f0fa, #e8e8e8)
   and dark text colors. White text is never touched — it sits on navy/blue
   chips that stay dark. */
html.af-dark [style*="background:#fff" i] { background:#16222e !important; }
html.af-dark [style*="background:#e8f0fa" i] { background:#1c2a39 !important; }
html.af-dark [style*="background:#e8e8e8" i] { background:#2a3540 !important; }
html.af-dark [style*="background:#f2f7fd" i] { background:#1a2836 !important; }

html.af-dark [style*="color:#666" i], html.af-dark [style*="color:#555" i],
html.af-dark [style*="color:#888" i], html.af-dark [style*="color:#999" i],
html.af-dark [style*="color:#444" i] { color:#93a5b8 !important; }
html.af-dark [style*="color:#222" i], html.af-dark [style*="color:#333" i],
html.af-dark [style*="color:#000" i] { color:#d8e2ec !important; }
html.af-dark [style*="color:#0d2b4e" i] { color:#9ec9ff !important; }
html.af-dark [style*="color:#1b5fad" i] { color:#6fb0f5 !important; }
html.af-dark [style*="color:#1b5e20" i], html.af-dark [style*="color:#155724" i],
html.af-dark [style*="color:#2b5f2b" i], html.af-dark [style*="color:#2e7d32" i],
html.af-dark [style*="color:#1b8f3d" i] { color:#8fd69b !important; }
html.af-dark [style*="color:#721c24" i], html.af-dark [style*="color:#a02020" i],
html.af-dark [style*="color:#b3261e" i], html.af-dark [style*="color:#b00020" i],
html.af-dark [style*="color:#8b1a1a" i], html.af-dark [style*="color:#c62828" i]
  { color:#f0a8a8 !important; }
html.af-dark [style*="color:#7a5b00" i], html.af-dark [style*="color:#6b5300" i],
html.af-dark [style*="color:#c77700" i], html.af-dark [style*="color:#b26a00" i],
html.af-dark [style*="color:#e65100" i] { color:#e6c95c !important; }
html.af-dark [style*="color:#7b1fa2" i] { color:#c792ea !important; }

/* ---------- Ask PAIC chat (styles live in nav.js) ---------- */
html.af-dark #af-chat { background:#16222e !important; }
html.af-dark #af-msgs { background:#0e1620 !important; }
html.af-dark .bub.paic { background:#1c2a39 !important; border-color:#2c3f52 !important;
  color:#d8e2ec !important; }
html.af-dark #af-chat textarea { background:#16222e !important; color:#d8e2ec !important; }
html.af-dark #af-prev { background:#16222e !important; }

/* ---------- misc ---------- */
html.af-dark hr { border-color:#2c3f52; }
html.af-dark ::selection { background:#1b5fad; color:#fff; }
html.af-dark a { color:#6fb0f5; }
html.af-dark header a, html.af-dark .mod a { color:#9ec9ff; }  /* header links keep light blue */

/* theme toggle lives in nav.js drawer styles (#af-theme sun/moon) */

} /* @media screen */
