/* Bookepa app. Written for a 360px phone first; wider screens just centre it.
 *
 * One font, stored with the app so it works offline: Inter, cut down to the
 * letters Bookepa's five languages and the cedi sign need (about 32 KB, one
 * download, then kept on the phone). Colours come from the same family as
 * bookepa.com: deep forest green, gold, warm paper. The phone's dark mode is
 * followed automatically.
 */

@font-face {
  font-family: 'Inter Bookepa';
  src: url('fonts/inter-bookepa.woff2?v=1') format('woff2');
  font-weight: 450 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces. A cool near-white page, pure white cards, and no borders on
     the cards at all: depth comes from soft wide shadow instead. */
  --bg: #F4F6F5;
  --surface: #FFFFFF;
  --surface-2: #F9FAF9;
  --line: #ECEFED;
  --edge: #ECEFED;
  --edge-2: #DCE2DE;

  /* Text */
  --ink: #0F1A15;
  --ink-2: #39453F;
  --muted: #636F69;
  --sub-on-tint: #566259;

  /* The dark statement card at the top of the home screen */
  --forest: #10362A;
  --forest-2: #174837;
  --on-forest: #F1F5F2;
  --on-forest-muted: #A6BAAF;

  /* One confident green, used sparingly */
  --accent: #0C8049;
  --accent-soft: #E6F4EC;
  --accent-ink: #0A5E37;

  --gold: #C79A43;
  --gold-soft: #FAF3E4;
  --gold-ink: #7A5A1C;
  --brand: #C24A36;

  --in: #0C8049;
  --in-soft: #E6F4EC;
  --in-ink: #0A5E37;
  --out: #C6453A;
  --out-soft: #FCEDEB;
  --out-ink: #9A3129;
  --amber: #99621A;
  --amber-soft: #FBF3E6;
  --focus: #1F5FBF;

  --radius-lg: 26px;
  --radius: 20px;
  --radius-sm: 16px;
  --tabs-h: 70px;

  --shadow-xs: 0 1px 2px rgba(15,26,21,.04);
  --shadow: 0 2px 4px rgba(15,26,21,.03), 0 12px 24px -12px rgba(15,26,21,.10);
  --shadow-md: 0 4px 8px rgba(15,26,21,.04), 0 20px 40px -20px rgba(15,26,21,.16);
  --shadow-lg: 0 8px 16px rgba(15,26,21,.05), 0 32px 64px -24px rgba(15,26,21,.24);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 450 16px/1.55 'Inter Bookepa', system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; position: relative; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: var(--accent-ink); font-weight: 600; text-underline-offset: 3px; }
/* A link on its own line still needs a finger-sized target. */
.card p a { display: inline-block; padding: 11px 2px; margin: -11px 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  background: var(--forest); color: var(--on-forest);
  box-shadow: 0 1px 0 rgba(0,0,0,.12);
}
.top .who { min-width: 0; display: flex; flex-direction: column; }
.shop { font-weight: 700; font-size: 17px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person { border: 0; background: none; text-align: left; font-size: 13px; font-weight: 600;
  color: var(--gold); min-height: 44px; padding: 10px 0; margin: -10px 0; }
.person:not(:empty)::after { content: " \25BE"; font-size: 11px; }
.pill {
  flex: none; max-width: 48%; overflow: hidden; white-space: nowrap;
  border: 1px solid rgba(243,238,226,.22); background: rgba(243,238,226,.08); color: var(--on-forest);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px;
}
.pill::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #5BCB7E; box-shadow: 0 0 0 3px rgba(91,203,126,.18); }
.pill.wait::before { background: var(--gold); box-shadow: 0 0 0 3px rgba(201,154,62,.2); }
.pill.off::before { background: #8C958F; box-shadow: none; }
.pill.bad::before { background: #F07A6E; box-shadow: 0 0 0 3px rgba(240,122,110,.2); }

.banner {
  margin: 14px 16px 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--gold-soft); color: var(--gold-ink); font-size: 14.5px; font-weight: 500;
  border: 1px solid rgba(201,154,62,.35);
}
.banner a { color: inherit; font-weight: 700; }

/* ---------------------------------------------------------------- layout */
main { padding: 24px 18px calc(var(--tabs-h) + 48px + env(safe-area-inset-bottom)); outline: none; }
.loading { color: var(--muted); text-align: center; margin-top: 30vh; }
h1 { font-size: 23px; font-weight: 700; letter-spacing: -.022em; line-height: 1.2; margin: 4px 0 18px; }
h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; color: var(--muted); margin: 32px 2px 12px; }
p.hint { color: var(--muted); font-size: 14.5px; margin: 6px 0 0; }

.back {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none;
  padding: 8px 4px; margin: -4px 0 6px -4px; font-weight: 600; color: var(--muted); min-height: 44px;
}
.back svg { width: 20px; height: 20px; fill: none; }

/* ---------------------------------------------------------- greeting */
.greet { margin: 2px 2px 16px; }
.greet .g-hi { font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.greet .g-day { font-size: 14px; font-weight: 450; color: var(--muted); margin-top: 4px; }

/* ------------------------------------------------------------ home hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 26px 24px 22px;
  color: var(--on-forest);
  background:
    radial-gradient(560px 340px at 108% -14%, rgba(199,154,67,.20), transparent 60%),
    radial-gradient(460px 360px at -12% 114%, rgba(14,142,82,.26), transparent 58%),
    var(--forest);
  box-shadow: var(--shadow-lg);
}
/* nothing drawn on the card. The shape and the shadow do the work. */
.hero .h-k { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--on-forest-muted); }
.hero .h-v { font-size: clamp(33px, 9.2vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.hero .h-v.neg { color: #F4A79D; }
.hero .h-sub { font-size: 13.5px; color: var(--on-forest-muted); }
.hero .h-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.hero .h-stat { background: rgba(241,245,242,.07); border: 0; border-radius: var(--radius-sm); padding: 13px 15px; min-width: 0; }
.hero .h-stat span { display: block; font-size: 12px; color: var(--on-forest-muted); font-weight: 500; margin-bottom: 3px; }
.hero .h-stat strong { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero .h-stat.in strong { color: #86D29B; }
.hero .h-stat.out strong { color: #E9A196; }
.hero .h-link {
  display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 16px;
  border: 0; background: none; color: var(--gold); font-weight: 600; font-size: 14.5px; min-height: 44px; padding: 11px 0 9px; margin-bottom: -7px; text-align: left;
}

/* ------------------------------------------------------------ big actions */
/* Tinted rather than filled. The colour still says in or out, but two
   saturated blocks side by side was the loudest thing on the screen. */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.act {
  border: 0; border-radius: var(--radius); padding: 18px; min-height: 112px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px;
  font-weight: 650; font-size: 16.5px; text-align: left; color: var(--ink); letter-spacing: -.008em;
  background: var(--surface); box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.act .ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.act svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.act small { display: block; font-weight: 450; font-size: 13px; color: var(--sub-on-tint); margin-top: 3px; }
.act.in { background: var(--in-soft); }
.act.in .ic { background: var(--in); }
.act.in > span:not(.ic) { color: var(--in-ink); }
.act.out { background: var(--out-soft); }
.act.out .ic { background: var(--out); }
.act.out > span:not(.ic) { color: var(--out-ink); }
.act:active { transform: scale(.98); }
.act:disabled { opacity: .45; }

/* ------------------------------------------------------------------ tiles */
.tiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.tile {
  background: var(--surface); border: 0; border-radius: var(--radius);
  padding: 17px 18px; text-align: left; min-height: 88px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
}
button.tile { width: 100%; }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; gap: 6px; }
button.tile .k::after { content: "\203A"; font-size: 18px; line-height: 1; color: var(--edge-2); }
.tile .v { overflow-wrap: anywhere; font-size: clamp(16px, 4.4vw, 19px); font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tile.wide { grid-column: 1 / -1; }
.tile.in .v { color: var(--in-ink); }
.tile.out .v { color: var(--out-ink); }
.tile.amber .v { color: var(--amber); }
.stale { font-size: 12.5px; color: var(--muted); margin: 12px 2px 0; }

/* one-line shortcuts, like "Count the cash" */
.homebtns { display: grid; gap: 12px; margin-top: 12px; }
.shortcut {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 0; border-radius: var(--radius); padding: 16px 18px;
  min-height: 70px; font-weight: 600; font-size: 15.5px; box-shadow: var(--shadow);
}
.shortcut .ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.shortcut .ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shortcut .txt { flex: 1; min-width: 0; }
.shortcut small { display: block; font-weight: 450; font-size: 13px; color: var(--muted); margin-top: 2px; }
.shortcut::after { content: "\203A"; font-size: 22px; color: var(--edge-2); }
.shortcut:disabled { opacity: .5; }

/* ----------------------------------------------------------------- alerts */
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.alerts li {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 0; border-radius: var(--radius-sm);
  padding: 16px 18px; font-size: 15px; font-weight: 500; box-shadow: var(--shadow);
}
.alerts li::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.alerts li.ok::before { background: var(--in); box-shadow: 0 0 0 4px var(--in-soft); }
.alerts li.bad::before { background: var(--out); box-shadow: 0 0 0 4px var(--out-soft); }
.alerts li.tap { padding: 0; }
.alerts li.tap::before { margin: 19px 0 0 14px; }
.alerts li.tap button { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex: 1;
  border: 0; background: none; padding: 14px 16px 14px 0; min-height: 48px; text-align: left; font-size: 15px; font-weight: 500; }
.alerts .go { font-weight: 600; color: var(--gold-ink); white-space: nowrap; font-size: 14px; }

/* ------------------------------------------------------------------ lists */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list > li + li { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; min-height: 66px; background: none; border: 0; text-align: left;
}
button.row:active { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.row .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .amt.in { color: var(--in-ink); }
.row .amt.out { color: var(--out-ink); }
.band { width: 5px; align-self: stretch; border-radius: 3px; background: var(--in); flex: none; }
.band.amber { background: #E0A030; }
.band.red { background: var(--out); }
.tag { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); white-space: nowrap; }
.tag.red { background: var(--out-soft); color: var(--out-ink); }
.tag.green { background: var(--in-soft); color: var(--in-ink); }
.empty { color: var(--muted); text-align: center; padding: 34px 20px; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow-xs); }

.total-card {
  background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.total-card .k { color: var(--muted); font-weight: 500; font-size: 14.5px; }
.total-card .v { white-space: nowrap; font-size: 23px; font-weight: 700; letter-spacing: -.022em; font-variant-numeric: tabular-nums; }

.key { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin: 10px 2px 0; flex-wrap: wrap; }
.key span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--in); }
.key .a::before { background: #E0A030; }
.key .r::before { background: var(--out); }

/* segmented switch: Owe me | I owe */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; margin: 0 0 18px;
  background: #EBEFEC; border: 0; border-radius: 18px; }
.seg button { border: 0; border-radius: 12px; background: none; min-height: 46px; font-weight: 650; font-size: 15.5px; color: var(--muted); }
.seg button[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs), 0 4px 10px -6px rgba(15,26,21,.25); }

/* ------------------------------------------------------------------ forms */
form { display: grid; gap: 20px; }
label.f { display: grid; gap: 8px; font-weight: 600; font-size: 15px; }
label.f > span.opt, .opt { font-weight: 450; color: var(--muted); font-size: 13.5px; }
input[type=text], input[type=tel], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: 56px; padding: 12px 15px;
  border: 1.5px solid var(--edge-2); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-xs);
  font-size: 17.5px; font-weight: 500;
}
input::placeholder { color: var(--muted); opacity: .6; font-weight: 500; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
input.big { font-size: 25px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stepper { display: grid; grid-template-columns: 58px 1fr 58px; gap: 8px; }
.stepper button { border: 1.5px solid var(--edge-2); background: var(--surface); border-radius: var(--radius-sm); font-size: 25px; font-weight: 600; min-height: 56px; }
.stepper input { text-align: center; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choices.three { grid-template-columns: 1fr 1fr 1fr; }
.choice {
  border: 1.5px solid var(--edge-2); background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs);
  min-height: 54px; padding: 8px 10px; font-weight: 600; font-size: 15.5px;
}
.choice[aria-pressed=true] { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px rgba(12,128,73,.6); }
.choice.credit[aria-pressed=true] { border-color: var(--amber); background: var(--amber); color: #fff; box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .choice { min-height: 46px; font-size: 15px; padding: 8px 14px; border-radius: 999px; }

.totalline {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 20px; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow);
}
.totalline .v { font-size: 27px; font-weight: 700; letter-spacing: -.022em; font-variant-numeric: tabular-nums; }
.note { font-size: 14.5px; color: var(--muted); margin-top: -8px; }
.err { color: var(--out-ink); font-weight: 600; font-size: 14.5px; min-height: 1em; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 12px 22px; border-radius: 16px; border: 1.5px solid var(--edge-2);
  background: var(--surface); font-weight: 650; font-size: 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-xs);
  transition: transform .12s ease;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 20px -10px rgba(12,128,73,.7); }
.btn.go { background: var(--in); border-color: var(--in); color: #fff; }
.btn.stop { background: var(--out); border-color: var(--out); color: #fff; }
.btn.wa { background: #1F8A4C; border-color: #1F8A4C; color: #fff; }
.btn.block { width: 100%; }
.btn.small { min-height: 44px; font-size: 15px; padding: 8px 14px; border-radius: 12px; }
.btn:disabled, .btn.off { opacity: .5; }
.btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }
.btnrow .btn { flex: 1; }
.btnrow .btn.block { width: auto; }
.add-link { display: flex; justify-content: flex-end; margin: -6px 0 12px; }

/* ---------------------------------------------------------------- sign in */
.signin { padding-top: 7vh; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 27px; letter-spacing: -.028em; }
.logo .mark { width: 46px; height: 46px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 26px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 24px 0; font-size: 14.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--edge); }
#gbtn { min-height: 44px; display: flex; justify-content: center; }
.langtop { display: flex; justify-content: center; margin: -3vh 0 20px; }
.choices.langs { grid-template-columns: 1fr 1fr; max-width: 260px; }
.langtop .choices.langs .choice { min-height: 44px; font-size: 15px; }
.chips.langs .choice { min-height: 44px; font-size: 15px; }
.langtop .chips.langs { justify-content: center; gap: 6px; }
.langtop .chips.langs .choice { min-height: 44px; font-size: 13.5px; padding: 6px 13px; }

/* ------------------------------------------------------------------- tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: start;
  background: var(--surface); border-top: 0;
  padding: 0 4px env(safe-area-inset-bottom);
  box-shadow: 0 -1px 0 var(--line), 0 -12px 32px -18px rgba(15,26,21,.22);
}
.tabs button {
  position: relative; padding: 11px 2px 8px; border: 0; background: none; min-height: var(--tabs-h);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
}
.tabs span { line-height: 1.15; text-align: center; }
html:not([lang=en]) .tabs span { font-size: 11px; }
.tabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs svg circle[r="1.6"] { fill: currentColor; }
.tabs button[aria-current=page] { color: var(--ink); }
.tabs button[aria-current=page]::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 22px; height: 3px; margin-left: -11px;
  border-radius: 0 0 3px 3px; background: var(--accent);
}
.tabs button[aria-current=page] svg { color: var(--accent); }
/* the raised "write something down" button in the middle */
.tabs .plus { padding-top: 0; }
.tabs .plus .disc {
  width: 60px; height: 60px; margin-top: -20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); box-shadow: 0 10px 24px -8px rgba(12,128,73,.55);
  border: 3px solid var(--surface); transition: transform .12s ease;
}
.tabs .plus .disc svg { width: 28px; height: 28px; stroke-width: 2.6; color: #fff; }
.tabs .plus:active .disc { transform: scale(.94); }
.tabs .plus span { color: var(--ink); }
.tabs .plus:disabled { opacity: .5; }

/* ------------------------------------------------------------ sheet/toast */
.scrim { position: fixed; inset: 0; background: rgba(8,16,12,.5); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  max-width: 520px; margin: 0 auto; max-height: 90vh; overflow-y: auto;
  background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
}
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--edge-2); margin: 0 auto 14px; }
.sheet h1 { margin-bottom: 4px; }
.sheet .sub { color: var(--muted); margin: 0 0 16px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 22px + env(safe-area-inset-bottom)); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--forest); color: var(--on-forest); padding: 13px 20px; border-radius: 14px; font-weight: 700;
  max-width: calc(100% - 32px); transition: opacity .2s, transform .2s; text-align: center;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(201,154,62,.35);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* the menu the middle button opens */
.quick { display: grid; gap: 10px; }
.quick .q {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; min-height: 74px;
  border: 1px solid var(--edge); background: var(--surface); border-radius: var(--radius); padding: 12px 16px;
  font-weight: 650; font-size: 17px; box-shadow: var(--shadow);
}
.quick .q .ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; flex: none; color: #fff; }
.quick .q .ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.quick .q small { display: block; font-weight: 450; font-size: 13px; color: var(--muted); }
.quick .q.in .ic { background: var(--in); }
.quick .q.out .ic { background: var(--out); }
.quick .q.gold .ic { background: #C99A3E; color: #1B1406; }
.quick .q.plain .ic { background: var(--surface-2); color: var(--ink); border: 1px solid var(--edge); }
.quick .q:disabled { opacity: .5; }

.card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card p { margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 700; text-align: right; }
dl.facts dd.num { white-space: nowrap; }
dl.facts:has(dd.num) { grid-template-columns: 1fr auto; }
dl.facts .strong { color: var(--ink); font-weight: 800; border-top: 1px solid var(--edge); padding-top: 9px; margin-top: 2px; }
dl.facts dd.strong { font-size: 19px; font-weight: 700; }

/* ------------------------------------------------------------ More menu */
.menu .row .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); border: 0; color: var(--accent-ink); }
.menu .row .ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu .row::after { content: "\203A"; font-size: 21px; color: var(--edge-2); }

/* ----------------------------------------------------------------- my book */
.choices.four { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.choices.four .choice { min-height: 46px; font-size: 15px; padding: 6px 4px; }
.periodnav { display: grid; grid-template-columns: 54px 1fr 54px; align-items: center; gap: 8px; margin: 14px 0; }
.navbtn { min-height: 50px; border: 1.5px solid var(--edge-2); background: var(--surface); border-radius: var(--radius-sm); font-size: 17px; }
.navbtn:disabled { opacity: .35; }
.ptitle { text-align: center; font-weight: 650; font-size: 18px; letter-spacing: -.01em; }
.cmp { margin: 5px 0 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cmp.up { color: var(--in-ink); }
.cmp.down { color: var(--out-ink); }
.cmp .arrow { font-size: 10px; margin-right: 4px; vertical-align: 1px; }
.chartcard { padding: 14px 10px; }
.legend { display: flex; gap: 16px; font-size: 13.5px; color: var(--muted); margin: 0 4px 6px; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.in { background: #1E7B3A; }
.sw.out { background: #E07A5F; }
.chart { width: 100%; height: auto; display: block; touch-action: manipulation; }
.chart .grid { stroke: var(--edge); stroke-width: 1; }
.chart .base { stroke: var(--edge-2); stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart .tick.later { opacity: .4; }
.chart .hilite { fill: var(--surface-2); }
.chart .hit { cursor: pointer; outline: none; }
.chart .hit:focus-visible { stroke: var(--focus); stroke-width: 2; }
.pick { min-height: 64px; padding: 8px 6px 2px; display: grid; gap: 4px; justify-items: start; }
.pick-t { font-weight: 800; }
.pick-v { font-size: 15px; font-variant-numeric: tabular-nums; white-space: pre-wrap; }
.astable { margin-top: 8px; }
.astable summary { cursor: pointer; font-weight: 800; padding: 8px 6px; min-height: 44px; display: flex; align-items: center; }
.astable .list { margin-top: 4px; box-shadow: none; }
.rank { width: 30px; height: 30px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); display: grid; place-items: center; font-weight: 700; font-size: 13.5px; flex: none; }
.meter { height: 6px; background: var(--surface-2); border-radius: 3px; margin-top: 7px; overflow: hidden; }
.meter span { display: block; height: 100%; background: #E07A5F; border-radius: 3px; }
.sumcard { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sumrow { padding: 16px 20px; }
.sumrow + .sumrow { border-top: 1px solid var(--line); }
.sumtop { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sumrow .k { font-weight: 600; color: var(--muted); white-space: nowrap; }
.sumrow .v { font-size: clamp(17px, 5.2vw, 21px); font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sumrow.in .v { color: var(--in-ink); }
.sumrow.out .v { color: var(--out-ink); }
.sumrow.total { background: var(--surface-2); }
.sumrow.total .k { color: var(--ink); }

/* ------------------------------------------------------ iPhone install card */
.steps { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 12px; }
.steps .ico { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--edge);
  display: grid; place-items: center; color: #1F6FEB; font-weight: 800; }
.steps .ico svg { width: 22px; height: 22px; }
.steps .ico.num { color: var(--ink); }
.choices.plans .choice { white-space: pre-line; line-height: 1.35; min-height: 66px; font-size: 14.5px; padding: 8px 4px; }

/* --------------------------------------------- receipts, buy list, cash */
.lastsale { margin-top: 14px; border-color: rgba(30,123,58,.35); background: var(--in-soft); box-shadow: none; }
.lastsale .ls-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.lastsale .ls-k { font-weight: 650; color: var(--in-ink); }
.lastsale .ls-v { font-size: 14.5px; overflow-wrap: anywhere; }
.lastsale .x { border: 0; background: none; font-size: 26px; line-height: 1; min-width: 44px; min-height: 44px; margin: -10px -10px 0 0; color: var(--muted); }

.buycard { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  margin-bottom: 14px; padding: 15px 17px; text-align: left; border-radius: var(--radius);
  border: 1px solid rgba(201,154,62,.45); background: var(--gold-soft); color: var(--gold-ink); }
.buycard strong { display: block; font-size: 17px; font-weight: 650; }
.buycard small { display: block; font-size: 14px; font-weight: 600; }
.buycard .go { font-size: 28px; font-weight: 800; }
.qtywrap { display: flex; align-items: center; gap: 6px; flex: none; }
.qtywrap .qtybox { width: 84px; min-height: 48px; padding: 8px 10px; text-align: center; font-weight: 800; font-size: 19px; }
.qtywrap .unit { font-size: 13px; color: var(--muted); max-width: 54px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cashresult:empty { display: none; }
.cashresult { padding: 13px 15px; border-radius: var(--radius-sm); font-weight: 800; font-size: 18px; background: var(--surface-2); }
.cashresult.ok { background: var(--in-soft); color: var(--in-ink); }
.cashresult.short { background: var(--out-soft); color: var(--out-ink); }
.cashresult.over { background: var(--amber-soft); color: var(--amber); }

/* ------------------------------------------------------------------ wider */
@media (min-width: 560px) {
  #app { box-shadow: 0 0 0 1px var(--edge); }
}
/* Tablets: same app, more room. Sheets stay phone-width so forms never
   stretch across a 10-inch screen. */
@media (min-width: 720px) {
  #app { max-width: 760px; }
  .tabs { max-width: 760px; }
  main { padding-left: 28px; padding-right: 28px; }
  .top { padding-left: 28px; padding-right: 28px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile.wide { grid-column: auto; }
  .act { min-height: 120px; font-size: 22px; }
  .homebtns { grid-template-columns: 1fr 1fr; }
  .sheet { max-width: 560px; }
  .chart .tick { font-size: 9px; }
}
@media (min-width: 720px) and (orientation: landscape) {
  .sheet { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: 24px; max-height: 86vh; }
  .sheet::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.paynow { margin: 14px 0 2px; }
.paynow .hint { margin: 8px 0 0; }
