/* ==========================================================================
   FlyPG design system
   Olive and cream base; terracotta, sage, amber and green are supporting.
   No shadows — separation is by border and ground colour.
   ========================================================================== */

:root {
  /* olive */
  --olive-deep: #232A16;
  --olive: #313A1E;
  --olive-mid: #3F4A28;
  --olive-line: #47512F;
  --olive-ink: #4A5136;
  --olive-field: #333B21;
  --olive-btn-line: #556136;
  /* cream */
  --cream: #F7F3E7;
  --card: #FDFBF4;
  --warm: #F4EFE0;
  --line: #E2DCC9;
  --line-2: #DED7C2;
  --line-3: #EFE9D8;
  --app-ground: #EFE9D8;
  /* sage */
  --sage-tile: #E8EBDF;
  --sage-panel: #E4EDDB;
  --sage-line: #D6DCC6;
  --sage-btn-line: #CFD3BC;
  --sage-light: #A9C48A;
  --sage-1: #93A47A;
  --sage-2: #ADB39A;
  --sage-3: #CFD6BC;
  --sage-4: #A0A68C;
  /* terracotta */
  --terra: #B4562F;
  --terra-ink: #8E4526;
  --terra-wash: #F8EBE2;
  --terra-line: #EACBBA;
  --terra-wash-2: #FCF1EA;
  --terra-line-2: #EED3C3;
  --terra-tile: #F6E4DA;
  --terra-deep: #4A3226;
  --terra-soft: #E8A98E;
  /* amber / green */
  --amber: #A97A1F;
  --amber-ink: #7A5A12;
  --amber-wash: #F6EED7;
  --amber-line: #E8DDB6;
  --amber-mid: #DCB45E;
  --green: #456B37;
  --green-soft: #5A6E42;
  /* ink */
  --ink: #232A16;
  --ink-body: #3B402C;
  --ink-2: #6B6F5C;
  --ink-3: #8E8977;
  --ink-4: #9A9C86;

  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--cream); font-size: 14px; line-height: 1.4; }
a { color: var(--olive); text-decoration: none; }
a:hover { color: var(--terra); }
img { max-width: 100%; display: block; }
p, .prose { text-wrap: pretty; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }

/* ---------- text ---------- */
.muted, .ink2 { color: var(--ink-2); }
.ink3 { color: var(--ink-3); }
.terra { color: var(--terra); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.b { font-weight: 700; }
.sb { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-2); }
.eyebrow-sm { font-size: 9.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-2); }
.note { font-size: 10.5px; color: var(--ink-2); line-height: 1.5; margin-top: 8px; }
.note-c { font-size: 10.5px; color: var(--ink-2); line-height: 1.5; margin-top: 9px; text-align: center; }

/* ---------- spacing helpers (kept deliberately small) ---------- */
.mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; }
.mt12 { margin-top: 12px; } .mt14 { margin-top: 14px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.flex { display: flex; align-items: center; } .flex-top { display: flex; align-items: flex-start; }
.between { justify-content: space-between; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .shrink0 { flex-shrink: 0; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap9 { gap: 9px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.g5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 700; line-height: 1.2;
  border-radius: 11px; padding: 12px 16px; border: 1px solid transparent; cursor: pointer; text-align: center; background: none; color: inherit; white-space: nowrap; }
.btn:hover { color: inherit; }
.btn-block { display: flex; width: 100%; }
.btn-olive { background: var(--olive); color: var(--card); }
.btn-olive:hover { background: var(--olive-deep); color: var(--card); }
.btn-deep { background: var(--olive-deep); color: var(--card); }
.btn-cream { background: var(--card); color: var(--olive-deep); }
.btn-cream:hover { background: #F0EBD9; color: var(--olive-deep); }
.btn-outline { border-color: var(--sage-btn-line); color: var(--olive); background: transparent; }
.btn-outline:hover { border-color: var(--olive); color: var(--olive); }
.btn-outline-cream { border-color: var(--line-2); color: var(--olive); background: var(--card); }
.btn-on-olive { border-color: var(--olive-btn-line); color: var(--card); background: transparent; }
.btn-on-olive:hover { border-color: var(--sage-2); color: var(--card); }
.btn-terra { background: var(--terra); color: var(--card); }
.btn-terra:hover { background: var(--terra-ink); color: var(--card); }
.btn-sage { background: var(--sage-panel); border-color: var(--sage-btn-line); color: var(--olive); }
.btn-warn { background: var(--terra-wash-2); border-color: var(--terra-line-2); color: var(--terra); }
.btn-done { background: var(--sage-panel); border-color: var(--sage-btn-line); color: var(--olive-ink); }
.btn-green { background: var(--green); color: var(--card); }
.btn-muted, .btn[disabled], .btn.is-disabled { background: var(--line-3); color: var(--ink-4); border-color: transparent; cursor: not-allowed; }
.btn-xs { font-size: 10.5px; padding: 6px 10px; border-radius: 8px; }
.btn-sm { font-size: 11.5px; padding: 9px 12px; border-radius: 9px; }
.btn-md { font-size: 12px; padding: 11px 14px; border-radius: 10px; }
.btn-lg { font-size: 14.5px; padding: 15px 18px; border-radius: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; min-width: 104px; }
/* Text-style buttons keep their inline look but get a finger-sized hit area (negative margin keeps the layout unchanged). */
.link-btn { background: none; border: 0; padding: 8px 6px; margin: -8px -6px; font: inherit; font-weight: 700; color: var(--olive); cursor: pointer; }
.link-btn:hover { color: var(--terra); }
form.inline { display: inline; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.card-pad { padding: 15px; }
.card-pad-sm { padding: 13px 14px; }
.card-flush { overflow: hidden; }
.card-olive { background: var(--olive); color: var(--card); border-radius: 16px; }
.card-deep { background: var(--olive-deep); color: var(--card); border-radius: 16px; }
.card-warn { background: var(--terra-wash); border: 1px solid var(--terra-line); border-radius: 14px; }
.card-warn-2 { background: var(--terra-wash-2); border: 1px solid var(--terra-line-2); border-radius: 13px; }
.card-sage { background: var(--sage-tile); border: 1px solid var(--sage-line); border-radius: 14px; }
.card-sage-2 { background: #F1F5EA; border: 1px solid var(--sage-btn-line); border-radius: 14px; }
.card-amber { background: var(--amber-wash); border: 1px solid var(--amber-line); border-radius: 11px; color: var(--amber-ink); }
.card-warm { background: var(--warm); border: 1px solid var(--line-3); border-radius: 11px; }
.card-cream { background: var(--cream); border: 1px solid var(--line); border-radius: 14px; }
.tile-on-olive { background: var(--olive-mid); border-radius: 10px; padding: 9px 11px; }
.tile-glass { background: rgba(255, 255, 255, .09); border-radius: 11px; padding: 11px 12px; }
.olive-rule { border-top: 1px solid var(--olive-line); }

/* callout: icon + text on a tinted ground */
.callout { display: flex; align-items: flex-start; gap: 9px; border-radius: 12px; padding: 11px 13px; font-size: 11.5px; line-height: 1.45; }
.callout svg { flex-shrink: 0; margin-top: 1px; }
.callout-sage { background: var(--sage-tile); border: 1px solid var(--sage-btn-line); color: var(--olive); }
.callout-amber { background: var(--amber-wash); border: 1px solid var(--amber-line); color: var(--amber-ink); }
.callout-terra { background: var(--terra-wash); border: 1px solid var(--terra-line); color: var(--terra-ink); }
.callout-warm { background: var(--warm); border: 1px solid var(--line-3); color: var(--ink-2); }

/* ---------- lists ---------- */
.list { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list > .row, .list > a.row, .list > form > .row { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--line-3); color: inherit; }
.list > .row:last-child, .list > a.row:last-child { border-bottom: 0; }
.list > a.row:hover { background: #FBF8EE; color: inherit; }
.row-top { align-items: flex-start !important; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 12.5px; font-weight: 600; }
.row-sub { font-size: 10.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.4; }
.row-stamp { font-size: 10px; color: var(--ink-3); margin-top: 3px; }
.row-end { text-align: right; flex-shrink: 0; }
.row-amt { font-size: 12.5px; font-weight: 700; }
.row-state { font-size: 9.5px; font-weight: 700; margin-top: 2px; }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--warm); font-size: 11px; color: var(--ink-2); }
.list-foot b, .list-foot .act { font-size: 10.5px; font-weight: 700; color: var(--olive); }
.list-foot-col { padding: 12px 14px; background: var(--warm); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-3); font-size: 12px; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--ink-2); flex-shrink: 0; }
.kv > span:last-child { font-weight: 600; text-align: right; }
.kv-total { display: flex; justify-content: space-between; padding-top: 11px; font-size: 13.5px; font-weight: 700; }
.tone-ok { color: var(--olive-ink); } .tone-amber { color: var(--amber); } .tone-terra { color: var(--terra-ink); } .tone-due { color: var(--terra); }

/* ---------- avatars & tiles ---------- */
.av { width: 36px; height: 36px; border-radius: 11px; background: var(--cream); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: var(--olive); flex-shrink: 0; overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av-sage { background: var(--sage-tile); border-color: var(--sage-line); }
.av-amber { background: var(--amber-wash); border-color: var(--amber-line); color: var(--amber-ink); }
.av-terra { background: var(--terra-wash); border-color: var(--terra-line); color: var(--terra-ink); }
.av-sm { width: 30px; height: 30px; border-radius: 15px; font-size: 10.5px; background: #F0EADC; border: 0; }
.av-34 { width: 34px; height: 34px; }
.av-lg { width: 52px; height: 52px; border-radius: 16px; background: var(--olive); color: var(--card); font-size: 17px; border: 0; }
.av-olive { background: var(--olive-mid); border-color: var(--olive-btn-line); color: var(--card); width: 40px; height: 40px; border-radius: 12px; font-size: 13px; }
.itile { width: 32px; height: 32px; border-radius: 9px; background: var(--sage-tile); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--olive); }
.itile-34 { width: 34px; height: 34px; border-radius: 10px; }
.itile-36 { width: 36px; height: 36px; border-radius: 11px; }
.itile-38 { width: 38px; height: 38px; border-radius: 11px; font-size: 10px; font-weight: 700; letter-spacing: .3px; }
.itile-terra { background: var(--terra-tile); color: var(--terra); }
.itile-amber { background: var(--amber-wash); color: var(--amber); }
.itile-green { background: var(--sage-panel); color: var(--green); }
.itile-olive { background: var(--olive); color: var(--card); }
.itile-cream { background: var(--cream); border: 1px solid var(--line); color: var(--ink-2); }
.itile-glass { background: rgba(255, 255, 255, .14); color: var(--card); }

/* ---------- pills ---------- */
.pill { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .3px; border-radius: 20px; padding: 3px 8px; white-space: nowrap; line-height: 1.35; flex-shrink: 0; }
.pill-lg { font-size: 10px; padding: 4px 9px; }
.pill-green { color: var(--green); background: var(--sage-panel); }
.pill-amber { color: var(--amber-ink); background: var(--amber-wash); }
.pill-terra { color: var(--terra-ink); background: var(--terra-wash); }
.pill-solid { color: var(--card); background: var(--terra); }
.pill-olive { color: var(--card); background: var(--olive); }
.pill-sage { color: var(--olive); background: var(--sage-tile); }
.pill-muted { color: var(--ink-2); background: var(--line-3); }
.pill-white { color: var(--olive-deep); background: var(--card); }
.pill-livegreen { color: var(--card); background: var(--green-soft); }
.badge-dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 4px; background: var(--terra); border: 1.5px solid var(--card); }
.count-badge { position: absolute; top: 6px; right: 8px; min-width: 15px; height: 15px; border-radius: 8px; background: var(--terra); color: var(--card); font-size: 9.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* ---------- stats ---------- */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; }
.stat-sm { border-radius: 13px; padding: 12px 13px; }
.stat-label { font-size: 10px; font-weight: 500; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-2); }
.stat-sm .stat-label { font-size: 9.5px; letter-spacing: .5px; }
.stat-value { font-size: 21px; font-weight: 700; letter-spacing: -.7px; margin-top: 5px; line-height: 1.15; }
.stat-sm .stat-value { font-size: 19px; letter-spacing: -.6px; margin-top: 4px; }
.stat-value small { font-size: 12.5px; color: var(--ink-2); font-weight: 500; letter-spacing: 0; }
.stat-sub { font-size: 11px; font-weight: 600; margin-top: 2px; color: var(--ink-2); }
.stat-warn { background: var(--terra-wash); border-color: var(--terra-line); }
.stat-warn .stat-label, .stat-warn .stat-sub { color: var(--terra-ink); }
.stat-warn .stat-value { color: var(--terra); }
.stat-soft-warn { background: var(--terra-wash-2); border-color: var(--terra-line-2); }
.stat-soft-warn .stat-value { color: var(--terra); }

/* ---------- bars ---------- */
.bar { height: 6px; border-radius: 3px; background: var(--cream); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 3px; background: var(--olive); }
.bar-5 { height: 5px; } .bar-7 { height: 7px; border-radius: 4px; } .bar-8 { height: 8px; border-radius: 4px; }
.bar-line { background: var(--line-3); }
.bar-glass { background: rgba(255, 255, 255, .18); }
.fill-green > span, .bar > span.green { background: var(--green); }
.bar > span.terra { background: var(--terra); }
.bar > span.amber { background: var(--amber); }
.bar > span.sage { background: var(--sage-light); }

/* ---------- toggles & checkboxes ---------- */
.toggle { width: 42px; height: 24px; border-radius: 13px; background: var(--line-2); display: inline-flex; align-items: center; padding: 0 3px; border: 0; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.toggle::after { content: ''; width: 18px; height: 18px; border-radius: 10px; background: var(--card); transition: transform .15s; }
.toggle.on { background: var(--olive); }
.toggle.on::after { transform: translateX(18px); }
.toggle-sm { width: 32px; height: 18px; border-radius: 9px; padding: 2px; }
.toggle-sm::after { width: 14px; height: 14px; border-radius: 7px; }
.toggle-sm.on::after { transform: translateX(14px); }
.toggle-sm.on.terra { background: var(--terra); }
.cbox { width: 17px; height: 17px; border-radius: 5px; border: 1px solid #D9D0BE; background: var(--card); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; color: transparent; }
.cbox.on { background: var(--olive); border-color: var(--olive); color: var(--card); }
.cbox.round { border-radius: 9px; }
.cbox.round.on { background: var(--olive-ink); border-color: var(--olive-ink); }
.cbox-lg { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--sage-line); }
.cbox-lg.on { background: var(--green); border-color: var(--green); color: var(--card); }
button.plain { background: none; border: 0; padding: 0; margin: 0; text-align: inherit; color: inherit; font: inherit; cursor: pointer; width: 100%; }

/* ---------- chips ---------- */
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.chip { font-size: 11.5px; font-weight: 600; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 7px 13px; white-space: nowrap; cursor: pointer; }
.chip:hover { color: var(--ink); border-color: var(--olive); }
.chip.on { background: var(--olive-deep); border-color: var(--olive-deep); color: var(--card); font-weight: 700; }
.chip-sq { border-radius: 9px; font-size: 12.5px; font-weight: 700; padding: 9px 13px; background: var(--cream); }
.chip-sq.on { background: var(--olive); border-color: var(--olive); }
.chip-add { font-size: 11px; font-weight: 600; color: var(--olive); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; cursor: pointer; }
.chip-add:hover { border-color: var(--olive); }
.chip-mode { font-size: 11.5px; font-weight: 700; border-radius: 9px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); color: var(--olive-ink); cursor: pointer; }
.chip-mode.on { background: var(--olive); border-color: var(--olive); color: var(--card); }

/* ---------- form fields ---------- */
.field { display: block; }
.field + .field { margin-top: 11px; }
.field-label { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.field-label-sm { display: block; font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.input { width: 100%; font-size: 13px; color: var(--ink); background: var(--cream); border: 1px solid var(--line-3); border-radius: 10px; padding: 11px 12px; outline: none; }
.input:focus { border-color: var(--olive); background: var(--card); }
.input::placeholder { color: var(--ink-2); opacity: 1; }
textarea.input { min-height: 72px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6F5C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.input.missing { color: var(--terra); background: var(--terra-wash); border-color: var(--terra-line); }
.input-dark { background: var(--olive-field); border: 1px solid var(--olive-line); color: var(--card); }
.input-dark::placeholder { color: var(--sage-4); }
.input-dark:focus { border-color: #7B8A5C; background: var(--olive-field); }
.field-error { font-size: 11px; color: var(--terra); margin-top: 5px; font-weight: 600; }
.form-errors { background: var(--terra-wash); border: 1px solid var(--terra-line); color: var(--terra-ink); border-radius: 11px; padding: 10px 12px; font-size: 12px; margin-bottom: 12px; }
.upload-tile { position: relative; display: block; border-radius: 11px; padding: 11px 12px; background: var(--cream); border: 1px solid var(--line-3); cursor: pointer; }
.upload-tile.missing { background: var(--terra-wash); border: 1px dashed var(--terra-line); }
.upload-tile input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload-tile .t { font-size: 11.5px; font-weight: 600; }
.upload-tile .s { font-size: 10.5px; font-weight: 700; margin-top: 3px; color: var(--green); }
.upload-tile.missing .s { color: var(--terra); }
.stepper { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  color: var(--olive); background: #F0EADC; border: 0; cursor: pointer; flex-shrink: 0; }
.stepper[disabled] { color: #C9C3B2; background: var(--cream); cursor: default; }

/* ---------- keypad & PIN (dark sign-in screens) ---------- */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.key { height: 52px; border-radius: 12px; background: var(--olive-field); border: 1px solid var(--olive-line); color: var(--card); font-size: 19px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; }
.key:active { background: var(--olive-mid); }
.key.blank { background: none; border: 0; cursor: default; }
.pin-dots { display: flex; gap: 11px; }
.pin-dot { flex: 1; height: 44px; border-radius: 11px; background: var(--olive-field); border: 1px solid var(--olive-line); display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--card); }
.pin-dot.filled { background: radial-gradient(circle, var(--sage-tile) 5px, var(--olive) 6px); border-color: var(--olive); }
.pin-dot.otp.filled { background: var(--olive); border-color: var(--olive-line); }
.pin-dot.cursor { border-color: #7B8A5C; }

/* ---------- photo placeholders ---------- */
.photo-slot { width: 100%; height: 100%; min-height: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: #E9E3D2; color: #7C7A66; font-size: 12.5px; text-align: center; padding: 10px; border: 1px dashed #CBC3AE; }
.photo-fill { width: 100%; height: 100%; object-fit: cover; }

/* ---------- empty states & flash ---------- */
.empty { background: var(--cream); border: 1px solid var(--line); border-radius: 14px; padding: 13px; font-size: 11.5px; color: var(--ink-2); line-height: 1.5; }
.flash { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 100; max-width: min(92vw, 420px); background: var(--olive-deep); color: var(--card);
  font-size: 12.5px; font-weight: 600; border-radius: 11px; padding: 11px 16px; animation: flash-out 5s forwards; pointer-events: none; }
.flash-error { background: var(--terra); }
@keyframes flash-out { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.demo-note { background: var(--amber-wash); border: 1px dashed var(--amber-mid); color: var(--amber-ink); border-radius: 10px; padding: 9px 12px; font-size: 11.5px; line-height: 1.45; }

/* ---------- dialogs (bottom sheet on phones) ---------- */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 430px; border-radius: 18px 18px 0 0; background: var(--card); color: var(--ink); max-height: 88dvh; }
dialog.sheet::backdrop { background: rgba(35, 42, 22, .45); }
dialog.sheet .sheet-body { padding: 18px 16px 20px; overflow-y: auto; max-height: 88dvh; }
dialog.sheet .sheet-title { font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
dialog.sheet .sheet-close { float: right; background: none; border: 0; font-size: 20px; line-height: 1; color: var(--ink-2); cursor: pointer; }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: 18px; } }

/* ==========================================================================
   Mobile app shell (tenant, staff, PG owner) — designed at 390px
   ========================================================================== */
body.app { background: var(--app-ground); }
.phone { max-width: 430px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--cream); display: flex; flex-direction: column; position: relative; }
@media (min-width: 480px) { .phone { border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); } }
.m-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 13px 16px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.m-logo { width: 32px; height: 32px; border-radius: 9px; background: var(--olive); color: var(--card); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.m-title { font-size: 14.5px; font-weight: 600; letter-spacing: -.2px; display: flex; align-items: center; gap: 5px; }
.m-sub { font-size: 10.5px; color: var(--ink-2); margin-top: 1px; }
.m-bell { position: relative; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink); flex-shrink: 0; }
.m-body { flex: 1; }
.screen { padding: 14px 16px 22px; }
.screen-title { font-size: 17px; font-weight: 700; letter-spacing: -.4px; }
.screen-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.5; }
.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 20px 0 9px; }
.sec-head.tight { margin: 18px 0 8px; }
.sec-title { font-size: 13px; font-weight: 700; letter-spacing: -.2px; }
.sec-link { font-size: 11px; font-weight: 600; color: var(--olive); }
.m-nav { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 9px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-2); font-size: 10px; font-weight: 500; }
.nav-item:hover { color: var(--olive); }
.nav-item.on { color: var(--olive); font-weight: 700; }
/* build credit under the tab bar, on every app screen */
.m-credit { padding: 9px 16px calc(9px + env(safe-area-inset-bottom)); text-align: center; font-size: 10px; color: var(--ink-2); background: var(--card); border-top: 1px solid var(--line); }
/* sign-in screens run on the dark ground, so the strip follows them */
body.theme-dark .phone { background: var(--olive-deep); }
body.theme-dark .m-credit { background: var(--olive-deep); color: var(--sage-2); border-top-color: var(--olive-line); }
.imp-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--terra); color: var(--card); font-size: 11.5px; font-weight: 600; padding: 8px 14px; }
.imp-banner a, .imp-banner button { color: var(--card); font-weight: 700; text-decoration: underline; background: none; border: 0; cursor: pointer; font: inherit; }

/* action tiles on home screens */
.qa { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 11px 5px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  color: var(--ink); position: relative; font-size: 10px; font-weight: 600; text-align: center; line-height: 1.25; }
.qa:hover { border-color: var(--olive); color: var(--ink); }
.tap-card { display: block; color: inherit; }
.tap-card:hover { border-color: var(--olive); color: inherit; }

/* dark sign-in screens */
.signin { flex: 1; background: var(--olive-deep); padding: 38px 24px 26px; display: flex; flex-direction: column; color: var(--card); }
.signin-logo { width: 52px; height: 52px; border-radius: 15px; background: var(--olive); color: var(--card); display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; letter-spacing: -.6px; }
.signin h1 { font-size: 25px; letter-spacing: -.8px; margin-top: 22px; line-height: 1.2; }
.signin .lede { font-size: 13px; color: var(--sage-4); margin-top: 8px; line-height: 1.5; }
.signin .label { font-size: 11px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; color: var(--sage-2); }
.phone-field { display: flex; align-items: center; gap: 9px; margin-top: 8px; background: var(--olive-field); border: 1px solid var(--olive-line); border-radius: 11px; padding: 13px 14px; }
.phone-field .cc { font-size: 15px; font-weight: 600; color: var(--sage-4); }
.phone-field .sep { width: 1px; height: 17px; background: var(--olive-line); }
.phone-field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--card); font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.phone-field input::placeholder { color: #7A7F68; }
.signin-foot { margin-top: auto; padding-top: 20px; font-size: 11px; color: #7A7F68; text-align: center; line-height: 1.5; }

/* ---------- utilities for wide screens ---------- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 520px) { .container { padding: 0 16px; } }
