/* ============================== FONTS ============================== */
/* VicRoads brand fonts, extracted from the apk. Declared here as font-family
   "VicRoads" with three weights so any rule can opt-in by setting
   font-family: "VicRoads", <existing fallback stack>; */
@font-face {
  font-family: "VicRoads";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/vic_regular.otf") format("opentype");
}
@font-face {
  font-family: "VicRoads";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/vic_medium.otf") format("opentype");
}
@font-face {
  font-family: "VicRoads";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/vic_semibold.otf") format("opentype");
}
/* Museo 500 - used on the demerit-points balance banner for a slightly
   warmer, editorial display feel that contrasts the rest of the VicRoads UI. */
@font-face {
  font-family: "Museo";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/Museo-500.otf") format("opentype");
}

/* ============================== RESET / BASE ============================== */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
/* Root background is WHITE (matches ServiceNSW pattern). Individual
   screens paint their own colours over the top - #home-screen sets
   var(--bg-home) grey, #license-screen keeps white. This means any
   pixel gap the iOS standalone-PWA layout exposes below fixed elements
   always shows white matching whatever the nearest content already is,
   never a grey stripe. */
html { background: #FFFFFF; }
/* Pin the body to the viewport so iOS Safari / standalone-PWA can't rubber-band
   the document. All scrolling lives inside child containers
   (.lv-body, .tab-scroll, .sub-body) - each of which sets its own touch-action: pan-y. */
body {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  font-family: "VicRoads", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  color: #1F2C3D;
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.35;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* Global safety net: any freakishly long string (long user name, long
     licence type, translated copy) can break onto the next line rather
     than pushing beyond the viewport edge. Individual headings still get
     their own fluid clamp() font-sizes below. */
  overflow-wrap: break-word;
  word-wrap: break-word;
  /* CSS-level rubber-band lock: the page itself never responds to a touch
     gesture. Children that *should* scroll opt back in with touch-action: pan-y.
     Replaces the old document-level touchmove preventDefault handler, which
     was killing scroll on .tab-scroll panels (home / vehicles / payments). */
  touch-action: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
input, select { font-family: inherit; font-size: 16px; }
.hidden { display: none !important; }

/* Belt-and-suspenders ghost-click guard: enterApp() adds this class to
   #home-screen for ~500 ms after a PIN unlock. iOS sometimes fires a
   touch-synthesised click 100-400 ms after touchend, and if the PIN
   screen hid itself synchronously during the final digit tap that
   phantom click can land on a now-visible home-screen element (opening
   the fake browser as a blank-looking white page). Blocking pointer
   events on the whole home screen during that window drops the
   phantom click on the floor. The class is also removed on the first
   real touchstart / pointerdown, so a user who actually taps during
   those 500 ms is NOT ignored - only clicks that arrive without a
   corresponding user gesture on the new screen get swallowed. */
#home-screen.post-unlock-swallow { pointer-events: none; }

:root {
  --ink: #1F2C3D;
  --ink-soft: #4A5A6B;
  --label: #6C7A87;
  --bg-home: #EEF1F3;
  --bg-section: #EEF1F3;
  --white: #FFFFFF;
  --green: #22B14C;
  --green-dark: #1E9A40;
  --red: #D8462F;
  --red-soft: #E8634C;
  --mint: #C5E5C0;
  --mint-dark: #A8D2A3;
  --divider: #DDE2E7;
  --shadow-card: 0 1px 2px rgba(20, 35, 50, 0.04), 0 4px 14px rgba(20, 35, 50, 0.05);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

.screen {
  height: 100%;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bot);
}

/* ============================== SPLASH SCREEN ============================== */
#splash-screen {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(var(--safe-top) + 22vh);
  padding-bottom: var(--safe-bot);
  transition: opacity 0.45s ease;
}
#splash-screen.fading { opacity: 0; pointer-events: none; }
#splash-screen.hidden { display: none; }
.splash-logo-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 24px;
}
.splash-logo {
  display: block;
  width: 240px;
  max-width: 72%;
  height: auto;
}
.splash-spinner-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 20vh;
}
.splash-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid transparent;
  border-top-color: #22B14C;
  border-right-color: #22B14C;
  border-bottom-color: #22B14C;
  border-radius: 50%;
  animation: splash-spin 0.9s linear infinite;
}
@keyframes splash-spin { to { transform: rotate(360deg); } }

/* ============================== PIN SCREEN ============================== */
#pin-screen {
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Bottom padding sized so the keypad clears the safe-area edge but doesn't
     float too high in the screen. */
  padding: calc(var(--safe-top) + 60px) 24px calc(var(--safe-bot) + 40px);
}
.pin-wrap {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Fill the available vertical space inside #pin-screen so that
     margin-top: auto on .keypad has room to push the keypad to the bottom. */
  flex: 1;
}
.pin-lock {
  margin-top: 30px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-lock-img {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
}
.pin-title {
  font-family: "VicRoads", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Fluid font-size so "Please enter your existing PIN code" fits on one
     line across all phone widths (~340px → ~430px) without clipping the
     right edge on narrow Android viewports. */
  font-size: clamp(17px, 5vw, 22px);
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin: 0 0 36px;
  text-align: center;
  width: 100%;
  line-height: 1.2;
  padding: 0 16px;
  box-sizing: border-box;
  /* nowrap removed - on the narrowest viewports the title now wraps to
     two lines instead of getting clipped by the viewport edge. */
}
.pin-dots {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 340px;
  margin-bottom: 40px;
}
.pin-dots .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  transition: background 0.12s ease;
}
.pin-dots .dot.filled { background: var(--ink); }
.pin-error {
  min-height: 22px;
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  max-width: 380px;
  row-gap: 32px;
  column-gap: 48px;
  /* Pushes the keypad to the bottom of the available space inside pin-wrap,
     so it sits just above the screen's bottom padding regardless of how much
     content sits above it. Without this, the keypad stays packed against
     the elements above it and reducing pin-screen's padding-bottom does
     nothing (the empty space just moves to the bottom of the viewport). */
  margin-top: auto;
}
.key {
  font-family: "VicRoads", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: background 0.1s ease, transform 0.05s ease;
}
.key:active { background: #F0F2F5; transform: scale(0.96); }
.key-forgot { font-size: 14px; font-weight: 600; }
.key-back { font-size: 18px; }

/* ============================== HOME SCREEN ============================== */
#home-screen {
  background: var(--bg-home);
  padding-top: var(--safe-top);
  display: flex;
  flex-direction: column;
}
/* ============ Tab panels inside #home-screen (Home / Vehicles / Licence / Payments / Profile) ============ */
.tab-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Explicit bg so transformed children inside .tab-scroll can never expose a
     transparent gap during a rubber-band drag. */
  background: var(--bg-home);
  /* Clip the transformed .tab-scroll child. Without this, when the user
     rubber-band-drags the cards upward, the transform: translate3d moves
     content above .tab-scroll's box and it visually escapes into the
     .hi-greeting / .tab-title area sitting above. Native WKWebView is more
     lenient about honoring z-index on transformed content than desktop
     Safari, so it needs an explicit clip. */
  overflow: hidden;
}
.tab-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  /* Bottom padding clears the fixed .bottom-nav (~64px including safe area) so
     the last menu row never lives behind it. The bouncer JS adds the rubber-band
     overscroll on top of native scroll - no more giant filler is needed. */
  padding: 18px 20px calc(110px + var(--safe-bot));
}
/* Home tab has the fixed .my-licence-card overlaying the lower portion of the
   viewport - needs extra bottom padding so the home cards never sit behind it. */
.home-scroll {
  padding-bottom: calc(230px + var(--safe-bot));
}

.tab-title {
  /* Fluid: ~28px on narrow phones (~340px), ~36px on standard (~430px+). */
  font-size: clamp(28px, 9vw, 36px);
  font-weight: 600;
  letter-spacing: -0.8px;
  color: var(--ink);
  /* Sits OUTSIDE its tab's .tab-scroll as a sibling above it inside the
     #panel-* - stays nailed to the top while the scroller drags/scrolls below.
     Solid background + raised stacking context ensure dragged content slides
     cleanly under the title rather than bleeding through. */
  background: var(--bg-home);
  margin: 0;
  padding: 26px 20px 14px;
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
}

/* ============ Menu cards (reused across Vehicles / Licence / Payments / Profile) ============ */
.menu-card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
  overflow: hidden;
}
.menu-section-title {
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  padding: 22px 22px 8px;
  letter-spacing: -0.3px;
}
.menu-row {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  background: transparent;
  transition: background 0.12s ease;
  border-top: 1px solid #E6EAEE;
}
.menu-card > .menu-row:first-child,
.menu-section-title + .menu-row {
  border-top: none;
}
.menu-row:active {
  background: #F5F7F9;
}
.menu-row-content {
  flex: 1;
  min-width: 0;
}
.menu-row-title {
  font-size: 17px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.2px;
  line-height: 1.25;
}
.menu-row-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.4;
  font-weight: 400;
}
.menu-row-chevron {
  color: var(--ink);
  margin-left: 16px;
  flex-shrink: 0;
}
.menu-row-icon {
  margin-right: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-row-verify .menu-row-title,
.logout-row .menu-row-title { font-weight: 600; }
.app-version {
  text-align: center;
  color: var(--ink-soft);
  font-size: 16px;
  padding: 6px 0 24px;
}

/* ============ Licence tab inline card ============ */
.licence-card-inline {
  background: linear-gradient(180deg, #3D5468 0%, #2B3D4F 60%, #1F2C3D 100%);
  color: #FFFFFF;
  border-radius: 14px;
  padding: 24px 24px 26px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  margin-bottom: 18px;
  min-height: 250px;
  box-shadow: 0 4px 14px rgba(20, 35, 50, 0.10);
}
.licence-card-inline .my-licence-title { font-size: 20px; font-weight: 500; letter-spacing: -0.3px; }
.licence-card-inline .my-licence-sub { font-size: 16px; opacity: 0.92; margin-top: 4px; font-weight: 400; }
.licence-card-inline .expand-icon { flex-shrink: 0; opacity: 0.95; }

/* ============ Sub-screens (Demerit points, My vehicles) ============ */
.sub-screen {
  background: var(--bg-home);
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: var(--safe-top);
}
.sub-screen-white { background: #FFFFFF; }
.sub-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: inherit;
  border-bottom: 1px solid #E6EAEE;
  position: sticky;
  top: var(--safe-top);
  z-index: 4;
  touch-action: none;
}
.sub-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sub-title {
  flex: 1;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  margin-right: 32px;
  letter-spacing: -0.2px;
}
/* Regular Segoe UI weight for the "settings-style" sub-screens - keeps
   Passkey settings, My vehicles, and Demerit points sub-screens at the
   default bold (800) weight. */
#help-info-screen .sub-title,
#biometrics-screen .sub-title {
  font-weight: 400;
}
.sub-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 22px 20px calc(28px + var(--safe-bot));
}

/* ============ Demerit points content ============ */
.demerit-balance-card {
  background: #4FB955;
  border-radius: 14px;
  padding: 22px 22px 26px;
  color: #FFFFFF;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(34, 177, 76, 0.12);
}
.demerit-balance-label { font-size: 18px; font-weight: 500; margin-bottom: 14px; }
.demerit-balance-row { display: flex; align-items: baseline; }
.demerit-balance-number { font-size: 68px; font-weight: 600; line-height: 1; }
.demerit-balance-max { font-size: 28px; font-weight: 400; opacity: 0.9; margin-left: 4px; }
.demerit-balance-unit { font-size: 16px; margin-top: 12px; opacity: 0.95; }
.demerit-info-box {
  background: #EAEDF1;
  border-radius: 14px;
  padding: 20px 20px 22px;
  margin-bottom: 18px;
}
.demerit-info-title { font-size: 22px; font-weight: 600; margin-bottom: 12px; color: var(--ink); letter-spacing: -0.2px; }
.demerit-info-text { font-size: 17px; line-height: 1.45; color: var(--ink); }
.demerit-record-card {
  background: #FFFFFF;
  border: 1px solid #DDE2E7;
  border-radius: 14px;
  padding: 20px 20px 22px;
}
.demerit-record-title { font-size: 22px; font-weight: 600; margin-bottom: 10px; color: var(--ink); letter-spacing: -0.2px; }
.demerit-record-text { font-size: 17px; color: var(--ink); line-height: 1.42; }

/* ============ Empty states (e.g. My vehicles) ============ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 100px 28px 40px;
}
.empty-state-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #E3F2E0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.empty-state-title {
  /* Fluid: ~20px narrow → 24px std. */
  font-size: clamp(20px, 6vw, 24px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.3px;
  margin-bottom: 12px;
}
.empty-state-text {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 320px;
}
/* Wrapper handles the LAYOUT - full-width bg + padding - so the h1
   itself (which carries the click handler) only occupies the width of
   its text, not the whole top row. Prevents accidental taps on empty
   whitespace to the right of the name from opening the edit modal. */
.hi-greeting-wrap {
  background: var(--bg-home);
  margin: 0;
  padding: 26px 20px 14px;
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
}
.hi-greeting {
  /* Fluid: ~26px on narrow phones, ~34px on standard. */
  font-size: clamp(26px, 8.6vw, 34px);
  font-weight: 600;
  letter-spacing: -0.6px;
  color: var(--ink);
  cursor: pointer;
  /* Body sets touch-action: none as a rubber-band lock. iOS Safari still
     synthesizes click from tap on cursor:pointer children regardless, but
     Chrome/Android strictly honors the ancestor touch-action and refuses to
     fire click - breaking the openAdmin tap target. */
  touch-action: manipulation;
  /* inline-block so the clickable box is only the text width, not the
     full row. Tap area extends by the small internal padding for
     comfortable tapping without opening the modal from empty space. */
  display: inline-block;
  margin: 0;
  padding: 4px 6px;
}
.card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.home-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 110px;
  justify-content: center;
}
.home-card .card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.demerit-icon, .vehicles-icon { display: flex; align-items: center; }
.demerit-icon img, .vehicles-icon img { display: block; }
.vicroads-v { display: block; }
.nav-icon-img { display: block; object-fit: contain; }

.my-licence-card {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;                       /* extends all the way down - the .bottom-nav (z 10) overlays the bottom portion */
  margin: 0 16px;
  background: linear-gradient(180deg, #3D5468 0%, #2B3D4F 60%, #1F2C3D 100%);
  color: #FFFFFF;
  border-radius: 14px 14px 0 0;
  /* Bottom padding controls how far the visible "My licence / Tap to view licence"
     text sits above the bottom-nav. Lower number = text drops lower on screen and
     the visible card is shorter. The gradient still extends to bottom: 0 so the
     nav sits on top of it with no grey gap. */
  padding: 18px 22px calc(135px + var(--safe-bot));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  box-shadow: 0 -4px 14px rgba(20, 35, 50, 0.10);
  cursor: pointer;
  z-index: 5;
}
.my-licence-title { font-size: 18px; font-weight: 500; letter-spacing: -0.3px; }
.my-licence-sub { font-size: 15px; opacity: 0.92; margin-top: 4px; font-weight: 400; }
.expand-icon { opacity: 0.95; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFFFFF;
  border-top: 1px solid #E6EAEE;
  display: flex;
  justify-content: space-around;
  /* Tight flat padding (copied from the ServiceNSW app's proven layout).
     No safe-area math - that was adding a big empty strip below the tab
     labels on iPhones with a home indicator. */
  padding: 4px 8px 4px;
  z-index: 10;
}
.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 4px;
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  min-width: 0;
  flex: 1;
}
.nav-tab.active { color: var(--green); font-weight: 600; }
.nav-icon-wrap {
  border-radius: 16px;
  padding: 4px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fixed height (taller than the largest current icon) so all five nav tabs
     produce identical wrap heights - keeps the labels beneath them aligned
     on the same baseline even when one tab's icon (Vehicles) is larger. */
  height: 40px;
  transition: background 0.18s ease;
}
.nav-tab.active .nav-icon-wrap {
  background: rgba(34, 177, 76, 0.12);
}
.nav-tab:not(.active) .nav-icon-wrap {
  background: transparent;
}

/* Home tab - swap green V (active) vs dark V (inactive) */
.nav-tab.active .home-v-inactive { display: none; }
.nav-tab:not(.active) .home-v-active { display: none; }

/* All nav SVGs inherit colour from the parent button (green when .active, ink otherwise) */
.nav-svg { display: block; }
.nav-tab.active .icon-outline { display: none; }
.nav-tab:not(.active) .icon-filled { display: none; }

/* Vehicles icon - both apk-extracted SVGs used as CSS masks tinted by
   currentColor (ink when inactive, green when active - inherits from
   .nav-tab). Both SVGs have ~32×32 viewBoxes that are tight to content,
   so a single shared size with mask-size: contain renders both at the
   same on-screen footprint. */
.nav-vehicle-img,
.nav-vehicle-img.icon-outline,
.nav-vehicle-img.icon-filled {
  display: block;
  width: 26px;
  height: 26px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
          mask-repeat: no-repeat;
          mask-position: center;
          mask-size: contain;
}
.nav-vehicle-img.icon-outline {
  -webkit-mask-image: url(logos/vehicle-icon.svg);
          mask-image: url(logos/vehicle-icon.svg);
}
.nav-vehicle-img.icon-filled {
  -webkit-mask-image: url(logos/vehicle-icon-filled-trim.svg);
          mask-image: url(logos/vehicle-icon-filled-trim.svg);
}
.empty-state-vehicle-img {
  display: block;
  width: 64px;
  height: 64px;
  background-color: var(--green);
  -webkit-mask-image: url(logos/vehicle-icon-filled-trim.svg);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
          mask-image: url(logos/vehicle-icon-filled-trim.svg);
          mask-repeat: no-repeat;
          mask-position: center;
          mask-size: contain;
}

/* Licence / Payments / Profile nav icons - same masked-PNG pattern as the
   vehicles icon. Real extracted apk SVGs used as binary silhouettes, tinted
   via currentColor (ink when inactive, --green when active). */
.nav-licence-img,
.nav-payments-img,
.nav-profile-img {
  display: block;
  width: 26px;
  height: 26px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
          mask-repeat: no-repeat;
          mask-position: center;
          mask-size: contain;
}
.nav-licence-img.icon-outline {
  -webkit-mask-image: url(logos/ic_licence_outline.svg);
          mask-image: url(logos/ic_licence_outline.svg);
}
.nav-licence-img.icon-filled {
  -webkit-mask-image: url(logos/ic_licence_filled.svg);
          mask-image: url(logos/ic_licence_filled.svg);
}
.nav-payments-img.icon-outline {
  -webkit-mask-image: url(logos/ic_payments_outline.svg);
          mask-image: url(logos/ic_payments_outline.svg);
}
.nav-payments-img.icon-filled {
  -webkit-mask-image: url(logos/ic_payments_filled.svg);
          mask-image: url(logos/ic_payments_filled.svg);
}
.nav-profile-img.icon-outline {
  -webkit-mask-image: url(logos/ic_profile_outline.svg);
          mask-image: url(logos/ic_profile_outline.svg);
}
.nav-profile-img.icon-filled {
  -webkit-mask-image: url(logos/ic_profile_filled.svg);
          mask-image: url(logos/ic_profile_filled.svg);
}
/* Active/inactive toggle matches the .nav-svg pattern above */
.nav-tab.active .nav-licence-img.icon-outline,
.nav-tab.active .nav-payments-img.icon-outline,
.nav-tab.active .nav-profile-img.icon-outline { display: none; }
.nav-tab:not(.active) .nav-licence-img.icon-filled,
.nav-tab:not(.active) .nav-payments-img.icon-filled,
.nav-tab:not(.active) .nav-profile-img.icon-filled { display: none; }

/* ============================== LICENCE VIEW ============================== */
#license-screen {
  background: #FFFFFF;
  padding-top: var(--safe-top);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.lv-header {
  display: flex;
  align-items: center;
  padding: 6px 16px 4px;
  background: #FFFFFF;
  position: sticky;
  top: var(--safe-top);
  z-index: 4;
  /* iOS Chrome / Safari: this element is NEVER allowed to scroll the document */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.lv-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lv-title {
  flex: 1;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  margin-right: 32px;
  letter-spacing: -0.2px;
}
.lv-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* iOS: vertical pan only, no document-level pinch/drag */
  touch-action: pan-y;
  padding-bottom: var(--safe-bot);
}
.last-refreshed {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  /* Reduced top padding so the pull-refresh ring (which anchors to the bottom
     of the spinner area, i.e. right at the top of .lv-body / this element)
     sits visually close to the text rather than floating in empty padding. */
  padding: 4px 16px 18px;
  font-weight: 600;
}

/* Pull-to-refresh spinner - flex sibling between .lv-header and .lv-body,
   so growing its height pushes the body content down while the sticky header
   stays anchored. Collapsed (height: 0) by default. During an active drag
   the JS sets inline height for real-time rubber-band feel; on release the
   .active class holds it open at 52px while the ring spins. */
.pull-refresh-spinner {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;        /* anchor the ring to the bottom so it sits
                                   right above the "Last refreshed" line */
  justify-content: center;
  height: 0;
  overflow: hidden;
  background: transparent;
  /* Slower, smoother snap-back on release - matched to the bounce-back
     scroll snap (SNAP_MS in app.js attachBounceBack). Cubic-bezier is an
     ease-out-expo curve - gentle deceleration into place. */
  transition: height 0.78s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  z-index: 3;
  touch-action: none;
  padding-bottom: 6px;
}
.pull-refresh-spinner.dragging {
  transition: none;
}
/* Post-release "refreshing" hold - spinner area sits at a fixed height
   while the ring keeps spinning. CSS transition (inherited from the base
   rule) animates from finger height down to 52px on release. */
.pull-refresh-spinner.holding {
  height: 52px;
}
.pull-refresh-ring {
  width: 30px;
  height: 30px;
  display: block;
  opacity: 0;
  transition: opacity 0.18s ease;
  /* Origin centred so the SVG spins around its own middle. */
  transform-origin: 50% 50%;
}
.pull-refresh-spinner.spinning .pull-refresh-ring {
  opacity: 1;
  animation: pull-spin 0.95s linear infinite;
}
@keyframes pull-spin {
  to { transform: rotate(360deg); }
}
.last-refreshed span { color: var(--ink); font-weight: 400; }

.lv-red-banner {
  background: #DD3422;
  color: #FFFFFF;
  padding: 14px clamp(12px, 4vw, 18px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(6px, 2vw, 12px);
  /* Guard against sub-pixel overflow of the logo on very narrow viewports
     (Galaxy S9 ~360px, older phones ~340px) - the wordmark used to clip
     off the right edge because banner-left refused to shrink. */
  overflow: hidden;
}
.banner-left {
  /* Flex children default to min-width: auto which is the intrinsic content
     size - with nowrap text below this would push the logo off-screen. Set
     to 0 so this column can shrink and the logo stays visible. */
  min-width: 0;
  flex: 1 1 auto;
}
.banner-title {
  /* Fluid font-size: 13px on the narrowest phones, 15px on standard ones,
     keeps title on one line without clipping the logo. */
  font-size: clamp(13px, 3.9vw, 15px);
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.banner-sub {
  font-size: clamp(13px, 3.9vw, 15px);
  font-weight: 500;
  margin-top: 4px;
}
.vicroads-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.vicroads-banner-logo {
  display: block;
  /* Fluid: ~72px on narrow phones, ~86px on standard. Keeps the wordmark
     legible without ever overflowing the banner. */
  width: clamp(72px, 22vw, 86px);
  height: auto;
  transition: filter 0.15s ease;
}

/* Banner colour variants by licence type */
.lv-red-banner.banner-p1,
.lv-red-banner.banner-p2 {
  background: #DD3422;
  color: #FFFFFF;
}
.lv-red-banner.banner-p1 .vicroads-banner-logo,
.lv-red-banner.banner-p2 .vicroads-banner-logo {
  filter: none;
}
.lv-red-banner.banner-learner {
  background: #F4C518;
  color: #1F2C3D;
}
.lv-red-banner.banner-learner .banner-title,
.lv-red-banner.banner-learner .banner-sub {
  color: #1F2C3D;
}
.lv-red-banner.banner-learner .vicroads-banner-logo {
  filter: invert(1) brightness(0.05);
}
.lv-red-banner.banner-full {
  background: #4A5A6B;
  color: #FFFFFF;
}

/* ---- Panel locked to photo-row-backdrop-800.png (1172x784 - floral
   ---- composite) so the absolute-positioned photo + qr frames sit at
   ---- their tuned coordinates over the backdrop. */
.lv-green-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 1172 / 784;
  background-color: #C5E5C0;
  background-image: url('logos/photo-row-backdrop-800.png');
  background-repeat: no-repeat;
  /* Backdrop is anchored to the TOP and rendered 1% taller than the panel
     so the bottom of the PNG (which has 3 rows of semi-transparent black
     pixels baked into the source - composites as a dark horizontal line
     over the light-green background-color) gets clipped by overflow: hidden. */
  background-position: top center;
  background-size: 100% 101%;
  padding: 0;
  overflow: hidden;
}
.photo-row {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Single CSS var driven by the gyro module - opacity ramps with the
     ABSOLUTE LEFT-RIGHT (gamma) tilt only. Declared on .photo-row so it
     cascades to BOTH .photo-frame descendants (.coa-watermark on the
     licence photo) AND .qr-frame descendants (.qr-coa-bg behind the
     consent card), keeping all watermarks in sync. */
  --coa-opacity: 0.28;
}
/* Frame coords retained from the previous (dark-card) backdrop. The new
   floral backdrop has no card insets, so the photo / qr now float over
   the floral pattern at the same percentage positions - visually they
   read as cards-on-floral, mirroring the verify-site layout. */
.photo-frame {
  position: absolute;
  left: 3.6%;
  top: 5.6%;
  width: 45.2%;
  height: 88.4%;
  background: transparent;
  border-radius: 14px;
  overflow: hidden;
}
.photo-frame > img#user-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hologram coat-of-arms watermark - the source PNG is a composite that
   already contains the 3 coats arranged in the layout (top-left, mid-right,
   bottom-left), so we render ONE img covering the full photo-frame and let
   the composite's internal positioning do the work. Only opacity changes
   with tilt. */
.coa-watermark {
  /* Centered both axes inside the photo-frame, with a 110% width so each
     of the 3 composite-baked coats reads close to the original 38%
     individual sizing. Photo-frame's overflow: hidden clips the 5% bleed
     on each side, which is acceptable since the composite leaves clear
     margins around its coat positions. Tune width if needed. */
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110%;
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: var(--coa-opacity);
  transition: opacity 120ms linear;
  will-change: opacity;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
.qr-frame {
  position: absolute;
  left: 51.4%;
  top: 5.6%;
  width: 44.4%;
  height: 88.4%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
}
/* Single coat-of-arms halo behind the QR consent card. Sized to ~38% of
   the qr-frame width so it reads at the same on-screen scale as one of
   the three coats in the .coa-watermark composite (which renders at 110%
   of photo-frame width × ~33% each → ~36% of photo-frame width per coat,
   and photo-frame ≈ qr-frame width, so 38% here ≈ same visual size).
   Anchored to the RIGHT half of the qr-frame, vertically centered, with
   a 12% bleed past the right edge so it pokes out past the right side
   of the white consent card. Tied to --coa-opacity so the gyro module
   animates this halo in sync with the photo-side composite. */
.qr-coa-bg {
  position: absolute;
  top: 50%;
  right: -6%;
  width: 38%;
  height: auto;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: var(--coa-opacity);
  transition: opacity 120ms linear;
  will-change: opacity;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 0;
}
.qr-consent-card {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  border-radius: 4cqi;
  padding: 5cqi 5cqi;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Container-scoped sizing so all text/padding inside scales with the
     card's own width. Fixes overflow on narrower phones (iPhone 12,
     iPhone 13 mini) where fixed px sizes were too large for the
     percentage-scaled card. */
  container-type: inline-size;
}
.qr-consent-text {
  font-size: 11cqi;
  color: var(--ink);
  margin: 0 0 5cqi;
  line-height: 1.25;
}
.qr-consent-prompt {
  font-size: 11cqi;
  color: var(--ink);
  margin: 0 0 6cqi;
  font-weight: 600;
  line-height: 1.2;
}
.qr-reveal-btn {
  background: var(--ink);
  color: #FFFFFF;
  padding: 5cqi 10cqi;
  border-radius: 18cqi;
  font-size: 10.5cqi;
  font-weight: 600;
}
.qr-reveal-btn:active { background: #14202E; }

.tabs-pill {
  position: relative;
  display: flex;
  margin: 22px 16px 16px;
  background: #FFFFFF;
  border-radius: 30px;
  padding: 4px;
  box-shadow: inset 0 0 0 1px #D7DCE1;
  /* CSS vars driven by JS to position the sliding indicator pill */
  --ind-x: 0px;
  --ind-w: 0px;
}
.tab-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  width: var(--ind-w);
  transform: translateX(var(--ind-x));
  background: var(--ink);
  border-radius: 26px;
  transition:
    transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
    width 320ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}
.tab-indicator.no-anim {
  /* used on first paint so the indicator snaps to position without sliding from 0 */
  transition: none;
}
.tab-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 9px 8px;
  border-radius: 26px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  transition: color 220ms ease;
}
.tab-btn.active {
  color: #FFFFFF;
}

.tab-content {
  padding: 14px 18px 24px;
  opacity: 1;
  transition: opacity 140ms ease;
}
.tab-content.fading {
  opacity: 0;
}

.full-name {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 12px 0 18px;
  color: var(--ink);
}
.divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 12px 0;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 16px;
  margin: 14px 0;
}
.info-cell.full { margin: 14px 0; }
.info-label {
  font-size: 14px;
  color: var(--label);
  margin-bottom: 6px;
  font-weight: 400;
}
.info-value {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.1px;
}
/* Multi-line stacked info values (e.g. street line + suburb/state/postcode line)
   render top-down rather than side-by-side. */
.info-value.info-value-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.signature-box {
  margin-top: 4px;
  min-height: 90px;
  display: flex;
  align-items: flex-start;
}
.signature-box .signature-img {
  display: none;
  max-width: 260px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.signature-box.has-sig .signature-img { display: block; }
.signature-box.has-sig .signature-placeholder { display: none; }
.signature-placeholder {
  font-size: 14px;
  color: #9AA3AD;
  font-style: italic;
  padding: 18px 0;
}

.signature-preview {
  margin-top: 8px;
  width: 200px;
  height: 80px;
  border-radius: 6px;
  background: #FFFFFF center / contain no-repeat;
  border: 1px dashed #CFD5DB;
}

.age-status-block { padding: 22px 0; }

.section-header {
  background: var(--bg-section);
  margin: 18px -18px 0;
  padding: 9px 18px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.detail-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--divider);
}
.detail-block:last-child { border-bottom: none; }
.detail-block.barcode-block { border-bottom: none; }
.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.check-circle {
  width: 28px;
  height: 28px;
  background: var(--green-dark);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.p-badge {
  background: #DD3422;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 14px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}
.p-badge.big {
  width: 28px;
  height: 28px;
  font-size: 17px;
  border-radius: 5px;
}

.condition-row {
  display: flex;
  align-items: center;
  gap: 32px;
}
.condition-letter {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  min-width: 16px;
}
.condition-text {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

.card-num-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-num-mask {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--ink);
}
.eye-toggle { padding: 6px; }
.eye-toggle.is-revealed .eye-slash { display: none; }

.barcode-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}
.vp-barcode {
  width: 100%;
  flex: 1;
  height: 80px;
}
.barcode-expand { padding: 6px; flex-shrink: 0; }

.lv-bottom-spacer { height: 40px; }

/* Age tab */
.age-display {
  text-align: center;
  padding: 30px 0;
}
.age-big {
  font-size: 96px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  margin: 8px 0;
}
.age-sub {
  font-size: 18px;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ============================== OVERLAYS ============================== */
.overlay {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}
.admin-card {
  background: #FFFFFF;
  border-radius: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  overflow-y: auto;
  /* Content padding respects the safe area (notch at top, home
     indicator at bottom) so form fields aren't clipped by iOS chrome. */
  padding: calc(20px + var(--safe-top)) 22px calc(24px + var(--safe-bot));
  position: relative;
  /* Opt back into vertical scrolling - body sets touch-action: none, which would
     otherwise propagate and prevent the form from scrolling on touch devices. */
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.admin-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}
.admin-close {
  font-size: 32px;
  color: var(--ink-soft);
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.admin-close:active { background: #F0F2F5; }
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.admin-form input[type="text"],
.admin-form select {
  padding: 10px 12px;
  border: 1px solid #CFD5DB;
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
}
.admin-form input:focus, .admin-form select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 177, 76, 0.15);
}
.photo-preview {
  margin-top: 8px;
  width: 90px;
  height: 120px;
  border-radius: 6px;
  background: #EEF1F3 center / cover no-repeat;
}
/* QR mode segmented control - sits just above the Save/Reset buttons in
   the edit-licence overlay. Two radio inputs are visually hidden and the
   <label> siblings act as pill segments. Active segment is styled via
   the `:checked + label` sibling selector so no JS is needed. */
.qr-mode-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.qr-mode-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.qr-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #EEF1F3;
  border-radius: 10px;
  padding: 4px;
  position: relative;
}
.qr-mode-toggle input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.qr-mode-toggle label {
  text-align: center;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
  user-select: none;
  white-space: nowrap;
}
.qr-mode-toggle input[type="radio"]:checked + label {
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
}
.qr-mode-toggle input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.qr-mode-hint {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 500;
  opacity: 0.85;
  line-height: 1.4;
}

/* ---------- Live Link paste panel (admin form) ----------
   Only visible when the Live Link radio is selected. Houses the pasted
   URL, a live countdown of the 2-minute window, and the paste / scan /
   clear action row. Collapses with .hidden so toggling it doesn't shift
   the Save button's layout when the panel reappears. */
.live-link-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  background: #F6F8FA;
  border: 1px solid #E1E5EA;
  border-radius: 10px;
}
.live-link-panel.hidden { display: none; }
.live-link-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.live-link-status.is-active  { color: #1E9A40; }        /* green  - fresh */
.live-link-status.is-warning { color: #B57900; }        /* amber  - <10s */
.live-link-status.is-expired { color: #B02222; }        /* red    - expired */
.live-link-url-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.live-link-url {
  padding: 10px 12px;
  border: 1px solid #D5DBE2;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: #FFFFFF;
  text-transform: none;
  letter-spacing: 0;
  /* URLs are long. Monospace so the user can tell at a glance whether
     the pasted thing looks like a real URL. */
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.live-link-url:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
  border-color: var(--green);
}
.live-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.live-link-actions button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
}
.live-link-clear {
  flex: 0 0 auto !important;
}
.live-link-hint {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 500;
  opacity: 0.85;
  line-height: 1.4;
}

/* Amber warning state for the main QR countdown badge when a Live Link
   is within its last 10 seconds. Reuses the same amber palette as the
   install gate banner so the design language is consistent. */
#qr-modal.is-livelink-warning .qr-expires-row {
  background: #FFF4D6;
  border-radius: 10px;
  padding: 6px 12px;
}
#qr-modal.is-livelink-warning .qr-expires-time,
#qr-modal.is-livelink-warning .qr-expires-label {
  color: #6E4A00 !important;
}

.admin-buttons {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.btn-primary {
  flex: 1;
  background: var(--green);
  color: #FFFFFF;
  padding: 13px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 16px;
}
.btn-primary:active { background: var(--green-dark); }
.btn-secondary {
  flex: 1;
  background: #EEF1F3;
  color: var(--ink);
  padding: 13px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
}

.qr-modal-title {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--ink);
}

/* === QR fullscreen takeover (matches the real "Verify Licence" screen) === */
.qr-fullscreen {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 110;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bot);
}
.qr-fullscreen.hidden { display: none; }
.qr-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  border-bottom: 1px solid #EDEFF2;
  flex-shrink: 0;
}
.qr-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.2px;
}
.qr-close-btn {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 4px;
}
.qr-close-btn:active { opacity: 0.6; }
.qr-body {
  flex: 1;
  overflow-y: auto;
  /* Lock horizontal overflow - if the generated QR canvas is larger than
     the viewport (qrcode.min.js hard-codes 320px, iPhone 16e / SE / mini
     etc. can be narrower once padding is subtracted), we'd otherwise get
     a horizontal scrollbar + clipped disclaimer text. */
  overflow-x: hidden;
  padding: 24px 24px 36px;
  -webkit-overflow-scrolling: touch;
  /* Body sets touch-action: none for rubber-band lock - opt this scroller back in. */
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.qr-image-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 22px;
  position: relative;
  /* Cap the QR at a sensible reading size on tablets/desktops, and let
     it shrink to the viewport on narrow phones. min() picks whichever is
     smaller: the 100% of available width, or 360px. */
  width: 100%;
  max-width: min(100%, 360px);
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 1 / 1;
}
.qr-img {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  image-rendering: pixelated;
  transition: opacity 0.25s ease, filter 0.25s ease;
}
/* When the QR is the dynamically generated one (a <div> containing a canvas
   + fallback <img> from qrcode.min.js), the canvas defaults to its own
   width/height (240x240) and sits flush-left inside a 100%-width div.
   Centre the canvas/img children and let the wrapper size to its content
   so it lands in the middle of the modal like the static placeholder did. */
.qr-img-dynamic {
  /* Fill the (now capped + aspect-locked) .qr-image-wrap so the raw
     320x320 canvas from qrcode.min.js scales down on narrow phones. */
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.qr-img-dynamic canvas,
.qr-img-dynamic img {
  display: block;
  margin: 0 auto;
  /* Critical: force the intrinsically-320px canvas to scale to the
     wrapper. Without this the canvas renders at its native pixel width
     regardless of container size - which is exactly why customers on
     iPhone 16e / SE / mini were seeing an oversized, edge-clipping QR. */
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* Keep QR pixels crisp instead of blurring on downscale. */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ----- QR state overlays: loading spinner + expired refresh ----- */
.qr-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 180px;
  transform: translate(-50%, -50%);
  /* Darker forest green (Material Green 800-ish). The bright --green
     (#22B14C) used elsewhere for the status chip looked too lime against
     the white QR background - this reads as more authoritative and
     matches the reference design. */
  background: #2E7D32;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
.qr-overlay-spinner,
.qr-overlay-refresh {
  width: 56%;
  height: 56%;
  display: none;
}
@keyframes qr-spin { to { transform: rotate(360deg); } }
.qr-overlay-spinner {
  animation: qr-spin 1.1s linear infinite;
  transform-origin: 50% 50%;
}
.qr-refresh-label {
  display: none;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin: 8px 0 30px;
}

/* Loading + expired share the faded-QR look */
.qr-fullscreen.is-loading .qr-img,
.qr-fullscreen.is-expired .qr-img {
  opacity: 0.16;
  filter: grayscale(1);
}
.qr-fullscreen.is-loading .qr-overlay,
.qr-fullscreen.is-expired .qr-overlay { display: flex; }
.qr-fullscreen.is-loading .qr-overlay-spinner { display: block; }
.qr-fullscreen.is-expired .qr-overlay-refresh { display: block; }

/* Timer row only shows when revealed */
.qr-fullscreen.is-loading .qr-expires-row,
.qr-fullscreen.is-expired .qr-expires-row { display: none; }

/* "Tap to refresh" label only shows when expired */
.qr-fullscreen.is-expired .qr-refresh-label { display: block; }
.qr-fullscreen.is-expired #qr-image-wrap { cursor: pointer; }
.qr-expires-row {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 30px;
}
.qr-expires-label {
  font-size: 19px;
  color: var(--ink-soft);
  font-weight: 500;
}
.qr-expires-time {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.qr-disclaimer {
  font-size: 16px;
  color: var(--ink);
  line-height: 1.5;
  margin: 0 0 28px;
}
.qr-disclaimer strong { font-weight: 800; }
.sharing-heading {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 14px;
}
.sharing-list {
  margin: 0;
  padding-left: 22px;
  list-style: disc;
}
.sharing-list li {
  font-size: 16px;
  color: var(--ink);
  line-height: 1.8;
  padding-left: 6px;
}

/* === Barcode fullscreen takeover (matches the real "Verify Barcode" screen) === */
.barcode-fullscreen {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 110;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bot);
}
.barcode-fullscreen.hidden { display: none; }
.barcode-fs-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  flex-shrink: 0;
}
.barcode-fs-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.1px;
}
.barcode-fs-close {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 4px;
}
.barcode-fs-close:active { opacity: 0.6; }
.barcode-fs-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 36px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  text-align: center;
}
.barcode-fs-heading {
  /* Fluid: ~22px narrow → 28px std. */
  font-size: clamp(22px, 7vw, 28px);
  font-weight: 600;
  color: var(--ink);
  margin: 8px 0 32px;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.barcode-fs-image-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 36px;
  padding: 0 8px;
}
.barcode-fs-image-wrap svg {
  width: 100%;
  max-width: 520px;
  height: 140px;
  display: block;
}
.barcode-fs-disclaimer {
  font-size: 17px;
  color: var(--ink);
  line-height: 1.5;
  margin: 0;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.barcode-privacy-link {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-height: 700px) {
  #pin-screen { padding-bottom: calc(var(--safe-bot) + 24px); }
  /* Short-screen override no longer bumps font-size - clamp() on the base
     rule handles fluid sizing across widths; short screens only need the
     tighter margin. */
  .pin-title { margin-bottom: 36px; }
  .pin-dots { margin-bottom: 36px; }
  .pin-lock { margin-top: 8px; margin-bottom: 18px; }
  .keypad { row-gap: 22px; column-gap: 36px; }
}

/* ============================== LICENCE LOADING SCREEN ============================== */
#license-loading-screen {
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100%;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bot);
}
.license-loading-spinner {
  width: 56px;
  height: 56px;
  border: 5px solid rgba(34, 177, 76, 0.18);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: splash-spin 0.9s linear infinite;
}

/* ============================== PROFILE SUB-SCREENS (Help / Biometrics / Passkey) ============================== */
.sub-screen-grey {
  background: var(--bg-home);
}
.sub-card {
  background: #FFFFFF;
  border-radius: 16px;
  margin: 12px 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.sub-row {
  padding: 22px 22px;
  display: flex;
  align-items: center;
  border-top: 1px solid #E6EAEE;
  background: transparent;
  width: 100%;
  text-align: left;
}
.sub-card > .sub-row:first-child,
.sub-card > .sub-block:first-child + .sub-row { border-top: none; }
.sub-row:active { background: #F5F7F9; }
.sub-row-title {
  flex: 1;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.sub-row-chevron {
  color: var(--ink);
  flex-shrink: 0;
  margin-left: 12px;
}

/* Toggle switch - used on biometrics screen */
.toggle-switch {
  position: relative;
  width: 56px;
  height: 32px;
  border-radius: 30px;
  background: #E2E4E7;
  flex-shrink: 0;
  transition: background 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}
.toggle-switch.on {
  background: var(--green);
}
.toggle-switch.on::after {
  transform: translateX(24px);
}

/* Passkey screen */
.passkey-info-block {
  padding: 22px 22px 6px;
}
.passkey-info-text {
  font-size: 17px;
  color: var(--ink);
  line-height: 1.5;
  margin: 0 0 18px;
}
.passkey-learn-link {
  display: inline-block;
  font-size: 17px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
  padding: 4px 0 22px;
}
.passkey-divider {
  border: none;
  border-top: 1px solid #E6EAEE;
  margin: 0;
}
.passkey-add-wrap {
  padding: 22px 22px 14px;
}
.passkey-add-btn {
  width: 100%;
  background: var(--ink);
  color: #FFFFFF;
  padding: 16px;
  border-radius: 36px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.1px;
}
.passkey-add-btn:active { background: #14202E; }
.passkey-empty-text {
  font-size: 16px;
  color: var(--ink);
  padding: 0 22px 22px;
  margin: 0;
  line-height: 1.45;
}

/* ============================== LICENSE GATE ============================== */
#license-gate {
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  touch-action: pan-y;
}
.lg-wrap {
  width: 100%;
  max-width: 420px;
  padding: 56px 28px 40px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.lg-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.lg-logo {
  width: 190px;
  height: auto;
  display: block;
}
.lg-title {
  /* Fluid: ~21px narrow → 26px std. */
  font-size: clamp(21px, 6.5vw, 26px);
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin: 0 0 10px;
  letter-spacing: -0.2px;
}
.lg-sub {
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
  margin: 0 0 32px;
  line-height: 1.45;
}
.lg-step {
  display: flex;
  flex-direction: column;
}
.lg-google-btn-wrap {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin-bottom: 14px;
}
/* Native iOS shell only - replaces the GSI-rendered button because Google
   refuses to render its own widget inside a WKWebView. Styled to match
   the "Sign in with Google" visual guidelines: white surface, black
   text, coloured G logo, 40pt tall. */
.lg-native-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  background: #FFFFFF;
  color: #1F1F1F;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
  border: 1px solid #DADCE0;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.lg-native-google-btn:active {
  background: #F5F7F9;
  box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.10);
}
.lg-native-google-btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}
.lg-native-google-btn svg { flex-shrink: 0; }
.lg-helper {
  font-size: 13px;
  color: var(--label);
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

/* Step 2: key entry */
.lg-account-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F3F5F7;
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 8px 8px 8px 14px;
  margin-bottom: 22px;
}
.lg-account-icon { flex-shrink: 0; }
.lg-account-email {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: text;
  -webkit-user-select: text;
}
.lg-account-change {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  background: var(--white);
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 6px 12px;
}
.lg-account-change:active { background: #EEF1F3; }

.lg-key-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.lg-key-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--divider);
  border-radius: 10px;
  outline: none;
  text-align: center;
  text-transform: uppercase;
  user-select: text;
  -webkit-user-select: text;
  margin-bottom: 18px;
}
.lg-key-input:focus { border-color: var(--red); }
.lg-key-input::placeholder {
  color: #B6BEC7;
  font-weight: 500;
  letter-spacing: 1px;
}

.lg-activate-btn {
  width: 100%;
  padding: 15px 16px;
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  background: var(--red);
  border-radius: 10px;
  letter-spacing: 0.2px;
}
.lg-activate-btn:active { background: #B83A26; }
.lg-activate-btn:disabled {
  background: #E5A89D;
  cursor: default;
}

.lg-status {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  min-height: 20px;
  color: var(--ink-soft);
}
.lg-status.lg-status-error { color: var(--red); font-weight: 600; }
.lg-status.lg-status-ok    { color: var(--green-dark); font-weight: 600; }
.lg-status.lg-status-busy  { color: var(--ink-soft); }

/* ============================== FAKE IN-APP BROWSER ==============================
   Mimics iOS's in-app web view (SFSafariViewController-style chrome): Close link
   at top, thin blue loading slither under it, white content body, four-button
   chrome at bottom (back / forward / share / refresh). Loading slither is fake -
   it stays as a small fixed segment for FB_LOAD_MS, then fades out and the page
   content swaps in. Pages are registered in app.js (fbPages map) and triggered
   by any element with data-fake-page="<page-id>".                              */
.fake-browser {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 150;
  display: flex;
  flex-direction: column;
  padding-top: 0;
  padding-bottom: 0;
}
.fake-browser.hidden { display: none; }

.fb-top {
  flex-shrink: 0;
  padding-top: var(--safe-top);
  background: #FFFFFF;
}
.fb-top-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 18px 12px;
}
.fb-close {
  font-size: 19px;
  font-weight: 400;
  color: #1F2C3D;
  background: transparent;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.2px;
}

.fb-progress {
  height: 3px;
  width: 100%;
  background: #E5E7E9;
  position: relative;
  overflow: hidden;
  transition: opacity 0.25s ease;
}
.fb-progress-bar {
  display: block;
  height: 100%;
  width: 7%;
  background: #0A84FF;
}
.fake-browser.fb-loaded .fb-progress { opacity: 0; }

.fb-viewport {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: #FFFFFF;
}

.fb-bottom {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 12px calc(8px + var(--safe-bot));
  border-top: 1px solid #E5E7E9;
  background: #FFFFFF;
}
.fb-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------- Page: Manage registration renewal (rego-renewal) ---------- */
.fb-page { min-height: 100%; }
.fb-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #EEF1F3;
  border-bottom: 1px solid #DDE2E7;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 700;
  color: var(--green);
}
.fb-breadcrumb svg { flex-shrink: 0; }
.fb-content {
  padding: 26px 20px 36px;
}
.fb-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 8px 0 30px;
}
.fb-step {
  background: var(--green);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}
.fb-step-active {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 700;
}
.fb-step-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}
.fb-step-line {
  flex: 1;
  height: 4px;
  background: var(--green);
}
.fb-h2 {
  color: var(--green);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 18px;
  line-height: 1.3;
}
.fb-callout {
  background: #F8F2C9;
  border: 1px solid #E6DA7B;
  border-radius: 4px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.55;
  color: #1F2C3D;
  margin-bottom: 22px;
}
.fb-money {
  color: var(--green);
  font-weight: 700;
}
.fb-p {
  font-size: 15px;
  line-height: 1.55;
  color: #1F2C3D;
  margin: 0 0 16px;
}
.fb-link {
  color: var(--green);
  text-decoration: none;
}
.fb-link:active { text-decoration: underline; }
.fb-continue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #B0B6BC;
  color: #FFFFFF;
  border: none;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 3px;
  margin-top: 18px;
  cursor: not-allowed;
  font-family: inherit;
}

/* ---------- Page: Change your garage address (garage-address) ---------- */
.fb-content-tight {
  padding: 28px 22px 36px;
}
.fb-advanced {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ECEEF0;
  border: 1px solid #D7DBDF;
  border-radius: 2px;
  padding: 22px 22px;
  margin-bottom: 24px;
}
.fb-advanced-label {
  font-size: 18px;
  font-weight: 400;
  color: #1F2C3D;
}
.fb-advanced-plus {
  font-size: 28px;
  font-weight: 300;
  color: #9098A0;
  line-height: 1;
}
.fb-p-muted {
  color: #4A5765;
}
.fb-required-note {
  font-size: 15px;
  line-height: 1.5;
  color: #4A5765;
  margin: 0 0 10px;
}
.fb-divider {
  border: none;
  border-top: 1px solid #D7DBDF;
  margin: 22px 0 22px;
}
.fb-section-h {
  font-size: 22px;
  font-weight: 700;
  color: #1F2C3D;
  margin: 0 0 22px;
}
.fb-check-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.fb-check-box {
  width: 22px;
  height: 22px;
  border: 1.5px solid #B0B6BC;
  border-radius: 2px;
  background: #FFFFFF;
  flex-shrink: 0;
  display: inline-block;
}
.fb-check-label {
  font-size: 15px;
  color: #1F2C3D;
}
.fb-residential {
  font-size: 15px;
  line-height: 1.5;
  color: #4A5765;
  font-style: italic;
  margin: 6px 0 28px 36px;
}
.fb-field {
  margin-top: 14px;
}
.fb-field-label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #1F2C3D;
  margin-bottom: 10px;
}
.fb-required-star {
  color: #4A5765;
  font-weight: 400;
  margin-left: 2px;
}
.fb-text-input {
  width: 100%;
  height: 54px;
  border: 1px solid #C4C9CE;
  border-radius: 2px;
  padding: 8px 12px;
  font-size: 16px;
  font-family: inherit;
  background: #FFFFFF;
  color: #1F2C3D;
  box-sizing: border-box;
}
.fb-text-input:focus {
  outline: none;
  border-color: #6C7A87;
}
.fb-helper {
  font-size: 15px;
  line-height: 1.5;
  color: #4A5765;
  margin: 12px 0 0;
}

/* ---------- Page: Apprentice registration discount (apprentice-discount) ---------- */
.fb-h1 {
  /* Fake in-app browser page headers - many long titles across dozens of
     sub-pages (Transaction history / Apprentice registration discount /
     Unregistered vehicle permit / etc). Fluid: ~24px narrow → 32px std. */
  font-size: clamp(24px, 8vw, 32px);
  font-weight: 700;
  color: #1F2C3D;
  margin: 0 0 28px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.fb-stepper-2 .fb-step-end {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
}
.fb-divider-tight {
  margin: 8px 0 26px;
}
.fb-divider-short {
  margin: 24px 0 18px;
  border-top-color: #DDE2E7;
}
.fb-field-label-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 17px;
}
.fb-help-btn {
  background: #1F2C3D;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.2px;
  cursor: pointer;
  flex-shrink: 0;
}
.fb-help-btn:active { background: #2C3B4F; }

.fb-radio-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  cursor: pointer;
}
.fb-radio {
  width: 22px;
  height: 22px;
  border: 1.5px solid #B0B6BC;
  border-radius: 50%;
  background: #FFFFFF;
  flex-shrink: 0;
  margin-top: 1px;
  display: inline-block;
}
.fb-radio-label {
  font-size: 15px;
  line-height: 1.5;
  color: #1F2C3D;
}

.fb-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 16px;
  border: 1px solid #C4C9CE;
  border-radius: 2px;
  background: #FFFFFF;
}
.fb-select-text {
  font-size: 16px;
  color: #1F2C3D;
}
.fb-select-caret {
  font-size: 14px;
  color: #1F2C3D;
  margin-left: 12px;
}

.fb-text-input-tall {
  height: 90px;
}

.fb-next {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--green);
  color: #FFFFFF;
  border: none;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 4px;
  margin-top: 4px;
  cursor: pointer;
  font-family: inherit;
}
.fb-next:active { background: var(--green-dark); }

/* ---------- Page: Unregistered vehicle permits (uvp) ---------- */
.fb-bullets {
  list-style: none;
  padding: 0;
  margin: 4px 0 18px 4px;
}
.fb-bullets li {
  position: relative;
  padding-left: 24px;
  font-size: 16px;
  line-height: 1.55;
  color: #1F2C3D;
  margin-bottom: 16px;
}
.fb-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.fb-numbered {
  list-style: none;
  counter-reset: fbstep;
  padding: 0;
  margin: 10px 0 18px;
}
.fb-numbered li {
  position: relative;
  padding-left: 44px;
  font-size: 16px;
  line-height: 1.55;
  color: #1F2C3D;
  margin-bottom: 18px;
  min-height: 28px;
}
.fb-numbered li::before {
  counter-increment: fbstep;
  content: counter(fbstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-extlink {
  color: #1F2C3D;
  text-decoration: underline;
  font-weight: 700;
  display: inline;
}
.fb-extlink-icon {
  display: inline-block;
  vertical-align: -2px;
  margin: 0 4px 0 4px;
  color: #1F2C3D;
}
.fb-extlink-plain {
  color: #1F2C3D;
  text-decoration: underline;
  font-weight: 700;
}

.fb-pill-btn {
  display: inline-flex;
  align-items: center;
  background: #2E7D32;
  color: #FFFFFF;
  border: none;
  padding: 14px 30px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 999px;
  font-family: inherit;
  cursor: pointer;
  margin: 8px 0 28px;
}
.fb-pill-btn:active { background: #246628; }

/* ---------- Page: Manage licence renewal (licence-renewal) ---------- */
.fb-lic-card {
  border: 1px solid #DDE2E7;
  border-radius: 2px;
  background: #FFFFFF;
  overflow: hidden;
  margin-top: 12px;
}
.fb-lic-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1F2C3D;
  padding: 18px 22px;
  color: #FFFFFF;
}
.fb-lic-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fb-lic-header-title {
  font-size: 19px;
  font-weight: 700;
}
.fb-lic-section {
  padding: 18px 22px 20px;
  border-bottom: 1px solid #E6EAEE;
}
.fb-lic-section:last-child { border-bottom: none; }
.fb-lic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fb-lic-row-top {
  margin-bottom: 14px;
}
.fb-lic-row-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 800;
  color: #1F2C3D;
}
.fb-lic-row-icon {
  flex-shrink: 0;
}

.fb-lic-card-mask {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #1F2C3D;
}
.fb-lic-card-mask-revealed {
  letter-spacing: 1px;
}
.fb-lic-show-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #76BC2E;
  color: #FFFFFF;
  border: none;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 4px;
  font-family: inherit;
  cursor: pointer;
  min-width: 118px;
  justify-content: space-between;
}
.fb-lic-show-btn:active { background: #66A626; }
.fb-lic-show-btn.is-revealed .fb-lic-show-slash { display: none; }

.fb-lic-section-detail {
  padding-top: 20px;
}
.fb-lic-type {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
  color: #1F2C3D;
  margin-bottom: 22px;
}
.fb-lic-dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  row-gap: 14px;
  column-gap: 16px;
  margin: 0;
}
.fb-lic-dl dt {
  font-size: 16px;
  font-weight: 800;
  color: #1F2C3D;
}
.fb-lic-dl dd {
  font-size: 16px;
  color: #1F2C3D;
  margin: 0;
}
.fb-lic-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1E7D32;
  font-weight: 600;
}

/* ---------- Page: Personal information (personal-info) ---------- */
.fb-content-pi {
  padding-top: 36px;
}
.fb-pi-list {
  border-top: 1px solid #DDE2E7;
}
.fb-pi-acc {
  border-bottom: 1px solid #DDE2E7;
}
.fb-pi-acc-head {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.fb-pi-acc-left {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}
.fb-pi-acc-label {
  font-size: 24px;
  font-weight: 700;
  color: #1F2C3D;
}
.fb-pi-acc-chev {
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.fb-pi-acc-head.is-open .fb-pi-acc-chev {
  transform: rotate(180deg);
}
.fb-pi-acc-body {
  padding-bottom: 8px;
}
.fb-pi-row {
  padding: 18px 0;
  border-top: 1px solid #DDE2E7;
}
.fb-pi-row:first-child {
  border-top: none;
}
.fb-pi-row-label {
  font-size: 16px;
  font-weight: 400;
  color: #6C7A87;
  margin-bottom: 6px;
}
.fb-pi-row-value {
  font-size: 17px;
  color: #1F2C3D;
}

/* Security Settings expanded body - each row has a label + right-aligned Edit
   link on the top line, then the value (italic + muted for the password
   placeholder, normal weight for the 2FA method) below. */
.fb-sec-row {
  padding: 18px 0;
  border-top: 1px solid #DDE2E7;
}
.fb-sec-row:first-child { border-top: none; }
.fb-sec-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.fb-sec-row-label {
  font-size: 16px;
  font-weight: 400;
  color: #1F2C3D;
}
.fb-sec-row-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  text-decoration: underline;
  font-size: 17px;
  font-weight: 400;
}
.fb-sec-row-edit svg {
  color: var(--green);
}
.fb-sec-row-value {
  font-size: 17px;
  color: #1F2C3D;
}
.fb-sec-row-value-italic {
  font-style: italic;
  color: #6C7A87;
}

/* ---------- Page: Demerit points (demerit) ---------- */
.fb-dm-outer {
  margin-top: 28px;
}
/* Scoped override for the demerit page header - medium weight (not the bolder
   700 the manage-renewal "Driver licence" header uses), set in Museo 500
   to give the "Demerit points & driver history" title the editorial feel
   LO asked for. */
.fb-dm-outer .fb-lic-header-title-light {
  font-family: "Museo", "VicRoads", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.1px;
}
/* Real traffic-light asset replacing the previous hand-drawn inline SVG. */
.fb-dm-traffic-icon {
  display: block;
  width: 22px;
  height: auto;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-drag: none;
}
.fb-dm-body {
  padding: 22px 22px 26px;
}
.fb-dm-card {
  border: 1px solid #DDE2E7;
  border-radius: 2px;
  padding: 22px 22px 18px;
  margin-top: 18px;
}
.fb-dm-status {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.fb-dm-status-title {
  font-size: 18px;
  font-weight: 700;
  color: #1E7D32;
  line-height: 1.3;
}
.fb-dm-bullets {
  list-style: disc;
  padding-left: 22px;
  margin: 10px 0 18px;
}
.fb-dm-bullets li {
  font-size: 16px;
  line-height: 1.5;
  color: #1F2C3D;
  margin-bottom: 10px;
}
.fb-dm-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 22px 0 14px;
}
.fb-dm-active-label {
  font-size: 24px;
  font-weight: 700;
  color: #1F2C3D;
  line-height: 1.15;
}
.fb-dm-active-num {
  font-size: 64px;
  font-weight: 600;
  color: #1E7D32;
  line-height: 1;
}
.fb-dm-active-num-red {
  color: #C82B2B;
}
/* Segmented bar: 12 equal-width flex segments separated by 3px white gaps.
   Each segment has a small inner radius (3px), but the very first segment
   has a full pill cap on its left edge and the very last segment has a
   full pill cap on its right edge - so the whole bar looks like a pill
   that's been "sliced" into 12 pieces, matching IMG_46. Segments with
   .fb-dm-seg-filled go red; the rest stay gray. */
.fb-dm-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 14px;
  margin: 20px 0 16px;
}
.fb-dm-seg {
  flex: 1;
  height: 100%;
  background: #D7DBDF;
  border-radius: 3px;
  transition: background 0.15s ease;
}
.fb-dm-seg:first-child {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}
.fb-dm-seg:last-child {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}
.fb-dm-seg-filled {
  background: #C82B2B;
}
.fb-dm-bar-labels {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}
.fb-dm-bar-num {
  font-size: 18px;
  font-weight: 700;
  color: #1F2C3D;
}
.fb-dm-bar-num-current {
  color: #1E7D32;
}
.fb-dm-bar-num-red {
  color: #C82B2B;
}
.fb-dm-bar-sub {
  font-size: 14px;
  color: #6C7A87;
  margin-top: 2px;
}
.fb-dm-bar-right { text-align: right; }
.fb-dm-learn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 6px 0;
  font-size: 17px;
  font-weight: 400;
  color: #1F2C3D;
  font-family: inherit;
  cursor: pointer;
}
.fb-dm-footnote {
  margin-top: 22px;
  font-size: 14px;
  line-height: 1.55;
  color: #4A5765;
}

/* ---------- Page: Manage Payment Methods (payment-methods) ---------- */
.fb-tabs {
  display: flex;
  margin-top: 18px;
}
.fb-tab {
  flex: 1;
  padding: 22px 16px;
  font-size: 19px;
  font-weight: 600;
  color: #1F2C3D;
  background: #ECEEF0;
  border: none;
  border-bottom: 1px solid #DDE2E7;
  border-right: 1px solid #DDE2E7;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
}
.fb-tab:last-child { border-right: none; }
.fb-tab-active {
  background: #FFFFFF;
  border-top: 4px solid var(--green);
  border-bottom: none;
  padding-top: 18px;
  border-right: 1px solid #DDE2E7;
}
.fb-tab-active:last-child {
  border-right: none;
  border-left: 1px solid #DDE2E7;
}
.fb-tab:first-child.fb-tab-active {
  border-right: 1px solid #DDE2E7;
}
.fb-tab-panel {
  padding-top: 24px;
}
.fb-info-blue {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #E7F4FB;
  padding: 18px 18px;
  border-radius: 2px;
  margin-bottom: 22px;
}
.fb-info-blue-icon { flex-shrink: 0; display: inline-flex; }
.fb-info-blue-text {
  font-size: 16px;
  line-height: 1.5;
  color: #1F2C3D;
}
.fb-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--green);
  color: #FFFFFF;
  border: none;
  padding: 14px 22px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.fb-add-btn-plus {
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}
.fb-add-btn:active { background: var(--green-dark); }
.fb-divider-pm {
  margin: 36px 0 0;
}

/* ---------- Page: Direct debit payments (direct-debit) ---------- */
.fb-radio-input {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid #B0B6BC;
  border-radius: 50%;
  background: #FFFFFF;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin: 1px 0 0;
  outline: none;
}
.fb-radio-input:checked {
  border-color: #2196F3;
  background: #2196F3;
}
.fb-radio-input:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #FFFFFF;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.fb-add-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 14px 0 24px;
}
/* The stacked Add credit card / Add bank account buttons on the direct-debit
   opt-in state use a darker olive-y green (different from the brighter
   var(--green) used elsewhere). Both share the same left edge - the second
   button just sits directly below the first with a small vertical overlap. */
.fb-add-stack .fb-add-btn {
  background: #85B43D;
}
.fb-add-stack .fb-add-btn:active { background: #729932; }
.fb-add-stack .fb-add-btn + .fb-add-btn {
  margin-top: -10px;
}

/* ---------- Page: Transaction history (transaction-history) ---------- */
.fb-select-narrow {
  max-width: 320px;
}
.fb-select-placeholder {
  color: #6C7A87;
}
.fb-segmented {
  display: inline-flex;
  border: 1px solid #C4C9CE;
}
.fb-segment {
  background: #FFFFFF;
  color: #1F2C3D;
  border: none;
  border-right: 1px solid #C4C9CE;
  padding: 14px 28px;
  font-size: 17px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
}
.fb-segment:last-child { border-right: none; }
.fb-segment-active {
  background: #ECEEF0;
  font-weight: 700;
}
.fb-more-filters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 18px 0 22px;
  font-size: 18px;
  font-weight: 700;
  color: #1F2C3D;
  text-decoration: underline;
  font-family: inherit;
  cursor: pointer;
}
.fb-apply-btn {
  display: block;
  width: 100%;
  background: #1F2C3D;
  color: #FFFFFF;
  border: none;
  padding: 18px 22px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 2px;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 24px;
}
.fb-apply-btn:active { background: #2C3B4F; }
.fb-th-results {
  margin-top: 18px;
}
.fb-th-empty-h {
  /* "No recent licence or registration payments found" - long empty-state
     heading. Fluid: ~22px narrow → 28px std. */
  font-size: clamp(22px, 7vw, 28px);
  margin-bottom: 18px;
}

/* ---------- Page: Replace licence (replace-licence) ---------- */
.fb-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  /* Fluid: ~20px narrow → 24px std. Section headers pair with an icon
     inside a flex row - narrower text keeps the icon+heading combo
     inside the viewport on Galaxy S9-class screens. */
  font-size: clamp(20px, 6vw, 24px);
  font-weight: 700;
  color: #1F2C3D;
  margin: 28px 0 22px;
  /* Text child needs min-width: 0 so it can shrink instead of pushing
     past the flex row's right edge. */
  min-width: 0;
}
.fb-section-icon {
  flex-shrink: 0;
}
.fb-info-row {
  margin-bottom: 22px;
}
.fb-info-row-label {
  font-size: 15px;
  font-weight: 800;
  color: #1F2C3D;
  margin-bottom: 6px;
}
.fb-info-row-value {
  font-size: 16px;
  color: #4A5765;
}
.fb-info-row-italic {
  font-size: 15px;
  line-height: 1.5;
  color: #4A5765;
  font-style: italic;
  margin: 12px 0 0;
}
.fb-callout-warn {
  background: #F4F6F8;
  border-left: 5px solid #E8A93B;
  padding: 18px 18px 18px 22px;
  font-size: 15px;
  line-height: 1.55;
  color: #1F2C3D;
  margin: 8px 0 12px;
  border-radius: 2px;
}
.fb-callout-info {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #F0F2F4;
  padding: 18px 18px;
  margin: 22px 0 24px;
  border-radius: 2px;
}
.fb-callout-info-icon {
  flex-shrink: 0;
  display: inline-flex;
}
.fb-callout-info-text {
  font-size: 14px;
  line-height: 1.5;
  color: #1F2C3D;
}

/* ---------- Page: Order driver history report (driver-history) ---------- */
.fb-next-full {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  font-size: 17px;
  border-radius: 4px;
  margin-top: 0;
  margin-bottom: 14px;
  position: relative;
}
.fb-next-full > span:last-child {
  position: absolute;
  right: 22px;
}
.fb-cancel {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  color: #1F2C3D;
  border: 1.5px solid #1F2C3D;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 4px;
  font-family: inherit;
  cursor: pointer;
}
.fb-cancel-full {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 16px 22px;
  font-size: 17px;
  position: relative;
}
.fb-cancel-full > span:first-child {
  position: absolute;
  left: 22px;
}
.fb-cancel:active { background: #F4F6F8; }

/* ---------- Page: Update address on licence (update-address) ---------- */
.fb-content-update-addr {
  padding-top: 38px;
}
.fb-divider-flat {
  margin: 0 0 30px;
  border-top-color: #DDE2E7;
}
.fb-accordion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #DDE2E7;
  cursor: pointer;
}
.fb-accordion-left {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
.fb-accordion-label {
  font-size: 22px;
  font-weight: 700;
  color: #1F2C3D;
}
.fb-accordion-chev {
  flex-shrink: 0;
}

/* ---------- Page: Access myLearners (mylearners) ---------- */
.fb-decimal {
  list-style: none;
  counter-reset: fbdec;
  padding: 0;
  margin: 10px 0 18px;
}
.fb-decimal li {
  position: relative;
  padding-left: 38px;
  font-size: 16px;
  line-height: 1.55;
  color: #4A5765;
  margin-bottom: 16px;
}
.fb-decimal li::before {
  counter-increment: fbdec;
  content: counter(fbdec) ".";
  position: absolute;
  left: 8px;
  top: 0;
  font-size: 16px;
  font-weight: 400;
  color: #4A5765;
}
.fb-extlink-icon-green {
  color: var(--green);
}
.fb-link-plain {
  text-decoration: none;
}
.fb-spacer-lg {
  height: 36px;
}

/* ---------- Page: My vehicle reports (vehicle-reports) ---------- */
/* Bold underlined green inline link variant - used inside <strong> blocks
   where the link itself should also pick up the bold weight. */
.fb-link-bold {
  font-weight: 700;
  text-decoration: underline;
}

/* UVP page uses several H1 sections - give them comfortable top margin so
   they read as separate sections, but no top margin on the very first one. */
.fb-content-tight .fb-h1 + .fb-h1,
.fb-content-tight .fb-p + .fb-h1,
.fb-content-tight .fb-bullets + .fb-h1,
.fb-content-tight .fb-numbered + .fb-h1,
.fb-content-tight .fb-pill-btn + .fb-h1 {
  margin-top: 28px;
}

/* ============================================================================
   INSTALL GATE - "Add to Home Screen" onboarding
   ----------------------------------------------------------------------------
   Only shown when the app is loaded in Safari (not launched as a PWA). We
   sit above the license gate in z-order and lock scroll so it reads like a
   proper full-screen onboarding rather than a page section.
   ============================================================================ */
#install-gate {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--safe-top) + 12px) 24px calc(var(--safe-bot) + 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prominent "unofficial demo" banner. Amber palette (matches iOS/Android
   system warning conventions) so a Google Safe Browsing reviewer scanning
   the page can't miss it. Only rendered inside #install-gate, which itself
   is only shown in browser mode - installed PWA users never see this. */
.ig-demo-banner {
  width: 100%;
  max-width: 500px;
  margin: 0 auto 22px;
  padding: 10px 14px;
  background: #FFF4D6;
  border: 1px solid #F0C765;
  color: #6E4A00;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(160, 100, 0, 0.08);
}
.ig-demo-banner-icon { flex: 0 0 auto; margin-top: 1px; color: #B57900; }
.ig-demo-banner-text strong { font-weight: 700; color: #4A3200; }

/* Small "read the full disclaimer" link near the bottom of the install
   gate. Understated by design - the banner up top does the loud disclosure;
   this is the "click through for details" affordance a human reviewer or
   curious user will use to reach /disclaimer.html. */
.ig-disclaimer-link-wrap {
  margin-top: 32px;
  padding: 0 4px;
  display: flex;
  justify-content: center;
}
.ig-disclaimer-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #6E7783;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.ig-disclaimer-link:hover,
.ig-disclaimer-link:active {
  color: #1E9A40;
  background: #F0F7EA;
}
#install-gate.hidden { display: none; }

.ig-wrap {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.ig-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6vh;
  text-align: center;
}

/* Plain ribbon icon - no card, no background, no shadow. Just the mark. */
.ig-logo {
  width: 72px;
  height: 72px;
  display: block;
  margin-bottom: 22px;
}

.ig-title {
  font-size: 30px;
  font-weight: 700;
  color: #1F2C3D;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.ig-sub {
  font-size: 16px;
  color: #5A6472;
  margin: 0;
  max-width: 320px;
  line-height: 1.4;
}

.ig-steps {
  list-style: none;
  margin: 42px 0 0;
  padding: 22px 20px;
  width: 100%;
  background: #F7F9FA;
  border: 1px solid #E5EAEE;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ig-step {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ig-step-num {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(140deg, #34C05A 0%, #1E9A40 100%);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(30, 154, 64, 0.30);
}
.ig-step-text {
  font-size: 16px;
  color: #1F2C3D;
  line-height: 1.4;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.ig-step-text strong { font-weight: 600; }

/* Inline share-icon chip - mirrors the iOS toolbar share affordance so users
   recognise it instantly. Subtle rounded border, white fill, blue stroke. */
.ig-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #FFFFFF;
  border: 1px solid #D8DEE4;
  border-radius: 8px;
  vertical-align: middle;
  margin: 0 2px;
}

/* Bouncy down-arrow - absolutely positioned in the bottom-right corner so it
   lines up with Safari's real share button (bottom-right of the toolbar on
   iOS). Sits above the safe-area inset so it's never clipped by the home
   indicator, and hugs the right edge with a small gutter. */
.ig-arrow {
  position: absolute;
  right: 22px;
  bottom: calc(var(--safe-bot) + 14px);
  animation: ig-bounce 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ig-bounce {
  0%, 100% { transform: translateY(0);   opacity: 0.55; }
  50%      { transform: translateY(8px); opacity: 1;    }
}

/* ============================================================================
   LICENCE GATE - DEVICE RESET PANEL
   ----------------------------------------------------------------------------
   Sits under the "Activate" button inside #lg-step-key. Only revealed when
   /api/lookup-key returns a key already bound to the signed-in Google
   account. Two visible states share the same container: ready-to-reset and
   cooldown countdown.
   ============================================================================ */
.lg-reset {
  margin-top: 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lg-reset.hidden { display: none; }

.lg-reset-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #E5EAEE 20%, #E5EAEE 80%, transparent);
  margin-bottom: 4px;
}

.lg-reset-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1E9A40;
  font-weight: 600;
  font-size: 14px;
}
.lg-reset-icon { flex: 0 0 auto; }

.lg-reset-title { line-height: 1.3; }

.lg-reset-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #5A6472;
}
.lg-reset-text strong { color: #1F2C3D; font-weight: 600; }

.lg-reset-btn {
  margin-top: 4px;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(140deg, #34C05A 0%, #1E9A40 100%);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(30, 154, 64, 0.25);
  transition: transform 0.08s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.lg-reset-btn:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(30, 154, 64, 0.30);
}
.lg-reset-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Cooldown card - warmer amber palette so users read "wait" without alarm. */
.lg-reset-cooldown {
  padding: 12px 14px;
  border-radius: 12px;
  background: #FFF7E8;
  border: 1px solid #F5D492;
  color: #6E4C0F;
}
.lg-reset-cooldown.hidden { display: none; }
.lg-reset-cooldown-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: #8A5A00;
  margin-bottom: 4px;
}
.lg-reset-cooldown-text {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.45;
}
.lg-reset-cooldown-text strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;   /* stops HH:MM:SS jitter as digits change */
  color: #4A340B;
}
.lg-reset-help {
  margin: 0;
  font-size: 12px;
  color: #7B591F;
}

.lg-reset-footnote {
  margin: 0;
  font-size: 11px;
  color: #9AA3AD;
  text-align: center;
}

/* ============================================================================
   EDIT-DETAILS DATA-SCOPE NOTICE
   ----------------------------------------------------------------------------
   Sits at the top of the "Edit licence details" modal. Quietly clarifies to
   users (and any classifier / human reviewer who ends up inside the app)
   that data typed into the form never leaves the device. Muted blue palette
   so it reads as a helpful info tip rather than a warning.
   ============================================================================ */
.admin-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin: 4px 0 18px;
  background: #EEF6FB;
  border: 1px solid #C7DEEC;
  border-radius: 12px;
  color: #2B4A63;
  font-size: 13px;
  line-height: 1.45;
}
.admin-notice-icon { flex: 0 0 auto; color: #4A7BA0; margin-top: 1px; }
.admin-notice-text { flex: 1; }


