:root {
  --primary: #0B2A1A; --header: #164B2F; --on-primary: #FFFFFF; --accent: #000000;
  --bg: #F3F5F3; --card: #FFFFFF; --text: #111611; --muted: #5B665E; --line: #DDE3DE;
  --good: #1F7A45; --bad: #B3261E; --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; overscroll-behavior-y: none; }
a { color: inherit; }
h1, h2 { margin: 0; }
h2 { font-size: 1.05rem; margin-bottom: 8px; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-top)) 12px 12px; background: var(--primary); color: var(--on-primary); }
.bar h1 { flex: 1; font-size: 1.15rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-side { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.6rem; text-decoration: none; color: var(--on-primary); border-radius: 50%; }
.bar-side.back { font-size: 2.2rem; line-height: 1; }
.env { background: #FFD54F; color: #000; text-align: center; font-size: .8rem; font-weight: 600; padding: 3px 8px; }
.env.inline { display: inline-block; border-radius: 999px; padding: 3px 12px; }
.content { padding: 14px 14px calc(28px + var(--safe-bottom)); max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05); }
.hello { margin: 2px 4px 0; font-weight: 600; color: var(--muted); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; padding: 16px; border-radius: var(--radius); background: var(--card); text-decoration: none; font-weight: 650; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05); }
.tile:active { transform: scale(.98); }
.tile-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: var(--primary); color: var(--on-primary); }
.tile-main { background: var(--primary); color: var(--on-primary); }
.tile-main .tile-icon { background: var(--on-primary); color: var(--primary); }
.badge { position: absolute; top: 12px; right: 12px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--bad); color: #fff; font-size: .8rem; display: grid; place-items: center; padding: 0 6px; }
.notice { display: block; padding: 12px 14px; border-radius: 14px; background: #E5F1E9; color: var(--primary); text-decoration: none; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.row.between { justify-content: space-between; }
.row.between > * { flex: 0 1 auto; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.field small { font-weight: 400; }
input, select { font: inherit; font-size: 16px; color: var(--text); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; min-height: 48px; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--header); box-shadow: 0 0 0 3px rgba(22,75,47,.18); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 0; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.btn.big { min-height: 56px; font-size: 1.05rem; width: 100%; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.ghost { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn.danger { background: #fff; color: var(--bad); border: 1.5px solid var(--bad); }
.btn:disabled { opacity: .55; }
.link { background: none; border: 0; color: var(--header); font: inherit; font-weight: 600; padding: 4px 0; text-decoration: underline; }
.hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.preview { min-height: 140px; border-radius: 14px; border: 1.5px dashed var(--line); display: grid; place-items: center; overflow: hidden; background: #FAFBFA; }
.preview img { max-width: 100%; max-height: 320px; display: block; }
.preview.tall img { max-height: 60vh; }
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; text-decoration: none; }
.list.compact .item { padding: 8px 0; }
.item .grow, .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item small { color: var(--muted); }
.end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; background: #EEF1EE; display: grid; place-items: center; flex: none; }
.chev { font-size: 1.6rem; color: var(--muted); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #EEF1EE; color: var(--muted); white-space: nowrap; }
.stage-queued, .stage-sending { background: #FFF3CD; color: #6B4E00; }
.stage-uploaded { background: #E3ECF7; color: #1C4A80; }
.stage-processed { background: #EDE7F6; color: #4A2C80; }
.stage-posted { background: #E5F1E9; color: var(--good); }
.stage-failed { background: #FCE8E6; color: var(--bad); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpis.three { grid-template-columns: 1fr 1fr 1fr; }
.kpi { background: var(--card); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.card .kpi { background: #F6F8F6; box-shadow: none; }
.kpi small { color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 1.15rem; }
.pos strong { color: var(--good); } .neg, .neg strong { color: var(--bad); }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 34px 1fr 88px; gap: 8px; align-items: center; font-size: .85rem; }
.bar-row > span:last-child { text-align: right; }
.bar-track { display: flex; flex-direction: column; gap: 2px; }
.bar-track i { display: block; height: 6px; border-radius: 3px; min-width: 2px; }
.bar-track i.in { background: var(--header); } .bar-track i.out { background: var(--accent); }
.year { width: auto; min-height: 40px; padding: 6px 12px; }
.reasons { background: #FFF8E1; border-radius: 12px; padding: 10px 12px; margin: 0; font-size: .9rem; }
.match { background: #E3ECF7; border-radius: 12px; padding: 10px 12px; margin: 0; font-size: .9rem; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .error { color: var(--bad); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(18px + var(--safe-bottom)); transform: translateX(-50%); width: min(92vw, 520px); background: #111; color: #fff; padding: 14px 16px; border-radius: 14px; z-index: 20; box-shadow: 0 6px 24px rgba(0,0,0,.25); white-space: pre-line; }
.toast.good { background: var(--primary); } .toast.bad { background: var(--bad); }
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; z-index: 30; }
.sheet { background: #fff; width: 100%; padding: 20px 16px calc(20px + var(--safe-bottom)); border-radius: 22px 22px 0 0; white-space: pre-line; }
.signin { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: var(--primary); color: var(--on-primary); }
.signin .muted { color: rgba(255,255,255,.78); }
.signin .error { color: #FFB4AB; }
.signin-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.gbtn { min-height: 48px; margin: 8px 0; }
.splash, .loading { display: grid; place-items: center; min-height: 120px; }
.splash { min-height: 100vh; background: var(--primary); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(127,127,127,.3); border-top-color: var(--header); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .tile:active { transform: none; } }
/* the business's own logo (set per business; see brand.json) */
.logo-card { display: flex; align-items: center; justify-content: center; border-radius: var(--radius); padding: 14px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05); }
.logo-img { display: block; max-width: 100%; height: auto; object-fit: contain; }
.signin-logo { width: min(86vw, 360px); padding: 20px 24px; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.signin-logo .logo-img { max-height: 200px; }
.home-logo .logo-img { max-height: 92px; }
.about-logo .logo-img { max-height: 120px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
