/* ==========================================================================
   POA&M Tracker — Mobile App Mockups
   Native-app patterns (status bar, sticky header, bottom tab bar, sheets).
   Shares the web mockups' tokens so both read as one product.

   Each screen renders inside a phone frame on desktop and goes full-bleed
   on a real handset — same file, no separate build.
   ========================================================================== */

:root {
  /* Brand — matched to the web mockups */
  --nav-bg:        #111E36;
  --nav-bg-2:      #0C1729;
  --brand-50:      #EEF4FC;
  --brand-100:     #D8E7F8;
  --brand-300:     #5598E7;
  --brand-500:     #256ABF;
  --brand-600:     #1C5CAB;
  --brand-700:     #164A8C;

  --page:          #F5F7FA;
  --surface:       #FFFFFF;
  --surface-2:     #FAFBFC;
  --surface-3:     #F1F4F8;
  --border:        #E3E8EF;
  --border-strong: #CFD7E3;
  --ink:           #101B2E;
  --ink-2:         #48566B;
  --ink-3:         #77849A;
  --ink-4:         #9AA5B6;

  /* Risk ramp — validated for colour-vision separation; always beside a label */
  --risk-critical: #A4161A;
  --risk-high:     #E2600F;
  --risk-moderate: #EDA100;
  --risk-low:      #1BAF7A;

  --ok:      #0F7D3F;
  --ok-bg:   #E8F6EE;
  --warn-bg: #FDF6E3;
  --danger:  #A4161A;
  --danger-bg: #FCEBEA;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --shadow-xs: 0 1px 2px rgba(16,27,46,.06);
  --shadow-sm: 0 1px 3px rgba(16,27,46,.08), 0 1px 2px rgba(16,27,46,.04);
  --shadow:    0 6px 18px rgba(16,27,46,.10);
  --shadow-up: 0 -4px 20px rgba(16,27,46,.10);

  --status-h: 46px;
  --header-h: 52px;
  --tabbar-h: 76px;   /* includes clearance for the home indicator */

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(160deg, #E7EDF5 0%, #DBE4EF 100%);
  display: grid;
  place-items: center;
  padding: 34px 20px;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.28; letter-spacing: -.015em; }
p { margin: 0; }
a { color: var(--brand-600); text-decoration: none; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
svg { display: block; }

/* --------------------------------------------------------------------------
   Device frame  (desktop only — collapses on a real phone)
   -------------------------------------------------------------------------- */
.device {
  position: relative;
  width: 390px;
  height: 844px;
  flex: none;
  background: var(--page);
  border: 11px solid #0E1726;
  border-radius: 52px;
  box-shadow: 0 30px 70px rgba(12, 23, 41, .34), 0 0 0 1.5px #263449;
  overflow: hidden;
}
.device-screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }

/* Status bar */
.statusbar {
  height: var(--status-h);
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 24px 0 28px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .01em;
  position: relative;
  z-index: 5;
}
.statusbar .time { flex: none; }
.statusbar .island {
  position: absolute; left: 50%; top: 9px; transform: translateX(-50%);
  width: 96px; height: 26px; border-radius: 20px; background: #0E1726;
}
.statusbar .sys { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.statusbar .sys svg { width: 17px; height: 17px; }
.statusbar.on-dark { color: #fff; }
.statusbar.on-light { color: var(--ink); }

/* App header */
.appbar {
  flex: none;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 16px 12px;
  position: relative;
  z-index: 4;
}
.appbar-main { min-width: 0; flex: 1; }
.appbar h1 { font-size: 22px; letter-spacing: -.025em; }
.appbar .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.appbar.on-dark h1 { color: #fff; }
.appbar.on-dark .sub { color: #9FB3CE; }
.appbar-actions { display: flex; align-items: center; gap: 4px; flex: none; }

.icon-btn {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-2); position: relative;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: rgba(16,27,46,.07); }
.icon-btn svg { width: 20px; height: 20px; stroke-width: 1.8; }
.icon-btn.on-dark { color: #D6E1F0; }
.icon-btn.on-dark:active { background: rgba(255,255,255,.12); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--risk-high); border: 2px solid var(--surface);
}
.icon-btn.on-dark .dot { border-color: var(--nav-bg); }

/* Scroll area */
.app-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 16px 22px;
  background: var(--page);
}
.app-scroll::-webkit-scrollbar { width: 0; }
.app-scroll.on-dark-top { background: var(--page); }

/* A navy header block that the content scrolls up beneath */
.hero {
  background: linear-gradient(158deg, var(--nav-bg-2), var(--nav-bg) 55%, #17365F);
  color: #fff;
  margin: 0 -16px 16px;
  padding: 4px 20px 22px;
  border-radius: 0 0 22px 22px;
}
.hero-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.hero-value { font-size: 40px; font-weight: 680; letter-spacing: -.035em; line-height: 1; }
.hero-label { font-size: 13px; color: #A9BCD6; margin-top: 6px; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); color: #DCE6F3;
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.hero-split { display: flex; gap: 10px; }
.hero-stat {
  flex: 1; background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r); padding: 11px 12px;
}
.hero-stat .n { font-size: 21px; font-weight: 680; letter-spacing: -.03em; }
.hero-stat .l { font-size: 11.5px; color: #A9BCD6; margin-top: 2px; line-height: 1.3; }
.hero-stat.alert .n { color: #FFB694; }

/* Bottom tab bar */
.tabbar {
  flex: none;
  min-height: var(--tabbar-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex;
  box-shadow: var(--shadow-up);
  position: relative;
  z-index: 6;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding-bottom: 14px;   /* keeps labels clear of the home indicator */
  color: var(--ink-4);
  font-size: 10.5px; font-weight: 600; letter-spacing: .005em;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.tab svg { width: 22px; height: 22px; stroke-width: 1.75; }
.tab.is-active { color: var(--brand-600); }
.tab.is-active svg { stroke-width: 2.1; }
.tab .badge-dot {
  position: absolute; top: 7px; left: 50%; margin-left: 5px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 20px; background: var(--risk-high); color: #fff;
  font-size: 9.5px; font-weight: 700; display: grid; place-items: center;
  border: 1.5px solid var(--surface);
}
.home-indicator {
  position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%);
  width: 132px; height: 5px; border-radius: 4px; background: rgba(16,27,46,.28); z-index: 7;
}

/* --------------------------------------------------------------------------
   Content components
   -------------------------------------------------------------------------- */
.section {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 2px 10px;
}
.section:first-child { margin-top: 4px; }
.section h2 { font-size: 15px; letter-spacing: -.015em; }
.section .more { margin-left: auto; font-size: 13px; color: var(--brand-600); font-weight: 600; }
.section .count { font-size: 12px; color: var(--ink-3); font-weight: 600; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 10px; }
.card-pad { padding: 14px 15px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 13px 14px; box-shadow: var(--shadow-sm);
}
.tile .t-icon {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-600); margin-bottom: 9px;
}
.tile .t-icon svg { width: 16px; height: 16px; stroke-width: 1.9; }
.tile .t-icon.danger { background: var(--danger-bg); color: var(--danger); }
.tile .t-icon.warn   { background: var(--warn-bg); color: #8A6100; }
.tile .t-icon.ok     { background: var(--ok-bg); color: var(--ok); }
.tile .t-icon.high   { background: #FDF0E6; color: #9A4208; }
.tile .n { font-size: 23px; font-weight: 680; letter-spacing: -.03em; line-height: 1.1; }
.tile .l { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.35; }

/* List rows */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none; color: inherit;
}
.row:last-child { border-bottom: 0; }
.row:active { background: var(--surface-3); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.row-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-sub .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); flex: none; }
.row-chev { color: var(--ink-4); flex: none; }
.row-chev svg { width: 18px; height: 18px; stroke-width: 2.1; }
.row.accent-danger::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--risk-critical); }
.row.accent-warn::before   { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--risk-high); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 650; white-space: nowrap; line-height: 1.4;
  background: var(--surface-3); color: var(--ink-2);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.risk-critical { background: #FCEBEA; color: #8A1114; }
.badge.risk-critical .dot { background: var(--risk-critical); }
.badge.risk-high { background: #FDF0E6; color: #9A4208; }
.badge.risk-high .dot { background: var(--risk-high); }
.badge.risk-moderate { background: #FDF6E3; color: #7A5600; }
.badge.risk-moderate .dot { background: var(--risk-moderate); }
.badge.risk-low { background: #E9F8F2; color: #0A6E4C; }
.badge.risk-low .dot { background: var(--risk-low); }
.badge.st-open { background: var(--brand-50); color: var(--brand-700); }
.badge.st-open .dot { background: var(--brand-500); }
.badge.st-progress { background: #EDF0FB; color: #3B3491; }
.badge.st-progress .dot { background: #4A3AA7; }
.badge.st-review { background: var(--warn-bg); color: #7A5600; }
.badge.st-review .dot { background: var(--risk-moderate); }
.badge.st-overdue { background: #FCEBEA; color: #8A1114; }
.badge.st-overdue .dot { background: var(--risk-critical); }
.badge.st-closed { background: var(--ok-bg); color: #0A6E4C; }
.badge.st-closed .dot { background: var(--ok); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--ink-3); }

.tag {
  font-family: var(--mono); font-size: 11px; font-weight: 550;
  color: var(--brand-600); background: var(--brand-50);
  padding: 2px 6px; border-radius: 5px; white-space: nowrap;
}
.tag.plain { color: var(--ink-3); background: var(--surface-3); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--brand-100); color: var(--brand-700);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.avatar.sm { width: 24px; height: 24px; font-size: 9.5px; }
.avatar.c2 { background: #FDF0E6; color: #9A4208; }
.avatar.c3 { background: #E9F8F2; color: #0A6E4C; }
.avatar.c4 { background: #F0EAFB; color: #4A3AA7; }
.avatar.c5 { background: #FCEBEA; color: #8A1114; }

/* Search + chips */
.searchbar { position: relative; margin-bottom: 12px; }
.searchbar svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-4); stroke-width: 1.9; }
.searchbar input {
  width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 21px;
  background: var(--surface); padding: 0 14px 0 40px;
  font: inherit; font-size: 14.5px; color: var(--ink);
}
.searchbar input::placeholder { color: var(--ink-4); }
.searchbar input:focus { outline: none; border-color: var(--brand-300); box-shadow: 0 0 0 3px var(--brand-50); }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 1px 16px 12px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  -webkit-tap-highlight-color: transparent;
}
.chip .n { font-size: 11px; font-weight: 700; color: var(--ink-4); }
.chip.is-on { background: var(--nav-bg); border-color: var(--nav-bg); color: #fff; }
.chip.is-on .n { color: #9FB3CE; }
.chip svg { width: 14px; height: 14px; stroke-width: 2.1; }

/* Segmented control */
.segment {
  display: flex; background: var(--surface-3); border-radius: 11px;
  padding: 3px; margin-bottom: 14px;
}
.segment button {
  flex: 1; height: 34px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center; gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
.segment button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.segment button .n { font-size: 11px; font-weight: 700; color: var(--ink-4); }
.segment button.is-on .n { color: var(--risk-critical); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--border-strong);
  font-size: 15px; font-weight: 600; color: var(--ink);
  box-shadow: var(--shadow-xs); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.985); }
.btn svg { width: 19px; height: 19px; stroke-width: 1.9; flex: none; }
.btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; box-shadow: 0 2px 8px rgba(28,92,171,.3); }
.btn-dark { background: var(--nav-bg); border-color: var(--nav-bg); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-quiet { background: var(--surface-3); border-color: transparent; box-shadow: none; color: var(--ink-2); }

.btn-pair { display: flex; gap: 10px; }
.btn-pair .btn { flex: 1; }

/* Floating action button */
.fab {
  position: absolute; right: 18px; bottom: calc(var(--tabbar-h) + 18px);
  width: 56px; height: 56px; border-radius: 19px;
  background: var(--brand-600); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 22px rgba(28,92,171,.42);
  z-index: 5;
}
.fab svg { width: 25px; height: 25px; stroke-width: 2.2; }
.fab:active { transform: scale(.94); }

/* Progress */
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress .bar { height: 100%; border-radius: 6px; background: var(--brand-500); }
.progress .bar.ok { background: var(--ok); }
.progress .bar.warn { background: var(--risk-moderate); }
.progress .bar.danger { background: var(--risk-critical); }

/* Checkbox */
.chk {
  appearance: none; -webkit-appearance: none;
  width: 23px; height: 23px; flex: none;
  border: 2px solid var(--border-strong); border-radius: 50%;
  display: inline-grid; place-items: center;
}
.chk:checked { background: var(--ok); border-color: var(--ok); }
.chk:checked::after {
  content: ""; width: 10px; height: 5.5px;
  border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}
.chk.sq { border-radius: 7px; }

/* Donut */
.donut-row { display: flex; align-items: center; gap: 16px; }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.dl { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dl .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dl .nm { flex: 1; color: var(--ink-2); }
.dl .n { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Mini bar list */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .nm { width: 96px; flex: none; color: var(--ink-2); }
.bar-row .track { flex: 1; height: 8px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 5px; background: var(--brand-500); }
.bar-row .n { width: 26px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* File cards */
.file-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.file-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.file-thumb { height: 76px; background: var(--surface-3); display: grid; place-items: center; position: relative; border-bottom: 1px solid var(--border); }
.file-thumb svg { width: 27px; height: 27px; stroke-width: 1.5; }
.file-thumb .ext { position: absolute; bottom: 6px; right: 6px; font-size: 9px; font-weight: 700; letter-spacing: .05em; padding: 2px 5px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-3); }
.ft-pdf { color: #A4161A; } .ft-xls { color: #0F7D3F; } .ft-img { color: #4A3AA7; }
.ft-doc { color: #1C5CAB; } .ft-log { color: #48566B; } .ft-zip { color: #9A4208; }
.file-body { padding: 9px 10px; }
.file-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; word-break: break-word; }
.file-meta { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/* Capture CTA */
.capture {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.capture .cap {
  border: 1.5px dashed var(--border-strong); background: var(--surface);
  border-radius: var(--r-lg); padding: 18px 10px; text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.capture .cap:active { background: var(--brand-50); border-color: var(--brand-300); }
.capture .cap svg { width: 26px; height: 26px; margin: 0 auto 8px; color: var(--brand-600); stroke-width: 1.6; }
.capture .cap .t { font-size: 13.5px; font-weight: 650; }
.capture .cap .s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* Banner */
.banner {
  display: flex; gap: 11px; padding: 12px 14px; border-radius: var(--r);
  font-size: 13px; line-height: 1.45; border: 1px solid;
}
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; stroke-width: 1.9; }
.banner strong { display: block; margin-bottom: 2px; }
.banner.danger { background: var(--danger-bg); border-color: #F6D2D0; color: #7C1113; }
.banner.warn { background: var(--warn-bg); border-color: #F3E3B8; color: #6B4B00; }
.banner.info { background: var(--brand-50); border-color: var(--brand-100); color: #16406F; }
.banner.ok { background: var(--ok-bg); border-color: #C9E8D6; color: #0A5C31; }

/* Bottom sheet */
.sheet-backdrop {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(16,27,46,.45);
  display: none; align-items: flex-end;
}
.sheet-backdrop.is-open { display: flex; }
.sheet {
  width: 100%; background: var(--surface);
  border-radius: 22px 22px 0 0;
  max-height: 82%; display: flex; flex-direction: column;
  box-shadow: var(--shadow-up);
  animation: sheet-up .22s ease-out;
}
@keyframes sheet-up { from { transform: translateY(14%); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet-grab { width: 38px; height: 4.5px; border-radius: 4px; background: var(--border-strong); margin: 9px auto 4px; flex: none; }
.sheet-head { padding: 8px 18px 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); flex: none; }
.sheet-head h3 { font-size: 17px; }
.sheet-body { padding: 16px 18px; overflow-y: auto; }
.sheet-foot { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); flex: none; }

.opt {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 2px; border-bottom: 1px solid var(--border);
}
.opt:last-of-type { border-bottom: 0; }
.opt-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; flex: none; }
.opt-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.opt-main { flex: 1; min-width: 0; }
.opt-title { font-size: 14.5px; font-weight: 600; }
.opt-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* --------------------------------------------------------------------------
   Authentication screens (pre sign-in — no tab bar, dark canvas)
   -------------------------------------------------------------------------- */
.auth-scroll {
  display: flex; flex-direction: column;
  padding: 8px 22px calc(24px + env(safe-area-inset-bottom));
  color: #fff;
}
/* Children are flex items here — without this they shrink instead of scrolling,
   which silently squashes fixed-height controls like buttons. */
.auth-scroll > * { flex: none; }
.home-indicator.on-dark { background: rgba(255,255,255,.34); }

.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; }
.auth-brand .mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--brand-300), var(--brand-600));
  display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(37,106,191,.5);
}
.auth-brand .mark svg { width: 19px; height: 19px; stroke: #fff; stroke-width: 1.9; }
.auth-brand .nm { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.auth-brand .nm span { color: var(--brand-300); margin-left: .3em; }

.auth-head { margin-bottom: 22px; }
.auth-head h2 { font-size: 25px; letter-spacing: -.03em; margin-bottom: 7px; }
.auth-head p { font-size: 14px; color: #A9BCD6; line-height: 1.55; }
.auth-head p b { color: #DCE6F3; font-weight: 650; }

/* Identity-provider buttons on the dark canvas */
.sso-btn {
  display: flex; align-items: center; gap: 11px;
  width: 100%; min-height: 50px; padding: 0 16px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 13px;
  background: rgba(255,255,255,.08); color: #fff;
  font-size: 14.5px; font-weight: 600; text-align: left;
  -webkit-tap-highlight-color: transparent; text-decoration: none;
}
.sso-btn:active { background: rgba(255,255,255,.15); }
.sso-btn + .sso-btn { margin-top: 10px; }
.sso-btn .sso-mark { width: 21px; height: 21px; flex: none; }
.sso-btn .sso-mark svg { width: 21px; height: 21px; }
.sso-btn .sso-meta { margin-left: auto; font-size: 11px; font-weight: 650; color: #9FB3CE; }
.sso-btn.recommended { background: rgba(85,152,231,.2); border-color: rgba(85,152,231,.5); }
.sso-btn.recommended .sso-meta { color: #8FBBF0; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #7E93B0; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.14); }

/* Fields on the dark canvas */
.auth-scroll .field label { color: #A9BCD6; }
.auth-scroll .input, .auth-scroll .select {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.16);
  color: #fff;
}
.auth-scroll .input::placeholder { color: #7E93B0; }
.auth-scroll .input:focus, .auth-scroll .select:focus {
  outline: none; border-color: var(--brand-300);
  box-shadow: 0 0 0 3px rgba(85,152,231,.22);
}
.auth-scroll .field .hint { font-size: 12px; color: #8CA0BB; margin-top: 6px; line-height: 1.45; }
.auth-scroll .btn-primary { background: var(--brand-500); border-color: var(--brand-500); }
.auth-scroll .btn-quiet { background: rgba(255,255,255,.09); border-color: transparent; color: #DCE6F3; }
/* Plain links only — anchors styled as buttons or rows keep their own colour */
.auth-scroll a:not(.btn):not(.sso-btn):not(.auth-method) { color: #8FBBF0; }

.auth-foot {
  margin-top: auto; padding-top: 26px;
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-size: 11px; color: #6C82A0;
}

/* Segmented one-time-code entry */
.code-input { display: flex; gap: 8px; }
.code-input input {
  flex: 1; min-width: 0; height: 58px;
  text-align: center; font-family: var(--font);
  font-size: 23px; font-weight: 650; color: #fff;
  font-variant-numeric: tabular-nums;
  border: 1.5px solid rgba(255,255,255,.2); border-radius: 12px;
  background: rgba(255,255,255,.07); padding: 0;
}
.code-input input:focus { outline: none; border-color: var(--brand-300); box-shadow: 0 0 0 3px rgba(85,152,231,.22); }
.code-input input.is-filled { border-color: var(--brand-300); background: rgba(85,152,231,.2); }

.code-timer { display: flex; align-items: center; gap: 9px; margin-top: 12px; font-size: 12.5px; color: #A9BCD6; }
.code-timer b { color: #fff; }
.code-timer .track { flex: none; width: 96px; height: 6px; border-radius: 4px; background: rgba(255,255,255,.16); overflow: hidden; }
.code-timer .fill { height: 100%; border-radius: 4px; background: var(--brand-300); }

/* Alternative factors */
.auth-method {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 13px 14px; text-align: left;
  border: 1px solid rgba(255,255,255,.14); border-radius: 13px;
  background: rgba(255,255,255,.055); color: #fff;
  -webkit-tap-highlight-color: transparent; text-decoration: none;
}
.auth-method + .auth-method { margin-top: 9px; }
.auth-method:active { background: rgba(255,255,255,.12); }
.auth-method.is-off { opacity: .45; pointer-events: none; }
.am-icon {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: rgba(85,152,231,.22); color: #8FBBF0;
  display: grid; place-items: center;
}
.am-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.am-main { flex: 1; min-width: 0; }
.am-title { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.am-sub { font-size: 12px; color: #9FB3CE; margin-top: 2px; line-height: 1.4; }
.am-chev { color: #7E93B0; flex: none; }
.am-chev svg { width: 17px; height: 17px; stroke-width: 2.1; }

/* Badges legible on the dark canvas */
.auth-scroll .badge.on-dark { background: rgba(255,255,255,.14); color: #DCE6F3; }
.auth-scroll .badge.on-dark-ok { background: rgba(15,125,63,.3); color: #7FE0A6; }
.auth-scroll .badge.on-dark-off { background: transparent; border: 1px solid rgba(255,255,255,.22); color: #9FB3CE; }

/* Biometric prompt */
.biometric {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 0 4px;
}
.biometric .ring {
  width: 62px; height: 62px; border-radius: 50%;
  border: 2px solid rgba(85,152,231,.45);
  background: rgba(85,152,231,.14);
  display: grid; place-items: center; color: #8FBBF0;
}
.biometric .ring svg { width: 30px; height: 30px; stroke-width: 1.6; }
.biometric .t { font-size: 13.5px; font-weight: 600; }
.biometric .s { font-size: 12px; color: #8CA0BB; }

/* Field */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.select, .input {
  width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); padding: 0 13px; font: inherit; font-size: 14.5px; color: var(--ink);
}
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2377849A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}

/* Utilities */
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.strong { font-weight: 650; color: var(--ink); }
.flex { display: flex; align-items: center; gap: 10px; }
.flex.top { align-items: flex-start; }
.spacer { flex: 1; }
.right { margin-left: auto; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.due-late { color: var(--danger); font-weight: 650; }
.due-soon { color: #9A4208; font-weight: 650; }

/* --------------------------------------------------------------------------
   Real handset — drop the frame, go full bleed
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  body { display: block; padding: 0; background: var(--page); }
  .device {
    width: 100%; height: 100vh; height: 100dvh;
    border: 0; border-radius: 0; box-shadow: none;
  }
  .statusbar { display: none; }          /* the OS draws the real one */
  .home-indicator { display: none; }
  .appbar { padding-top: max(10px, env(safe-area-inset-top)); }
  .tab { padding-bottom: 6px; }          /* the OS indicator lives in the safe area */
}
