/* JobFlow demo app - product UI
   Shape system: cards 18px, buttons pill, inputs 12px.
   Accent: deep green. Status colors are semantic (paid/sent/overdue). */

@font-face {
  font-family: "Outfit";
  src: url("../../assets/fonts/outfit-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../../assets/fonts/jbmono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface-2: #eef2ee;
  --ink: #17231d;
  --muted: #5e6c64;
  --faint: #93a098;
  --line: #e3e8e3;
  --brand: #17734b;
  --brand-deep: #0e5637;
  --brand-soft: #e2f0e8;
  --brand-ink: #0b4a30;
  --warn: #b4551d;
  --warn-soft: #f7e8de;
  --info: #40566b;
  --info-soft: #e8edf2;
  --shadow: 0 8px 28px rgba(23, 55, 40, 0.10);
  --r-card: 18px;
  --r-input: 12px;
  --sans: "Outfit", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:active { transform: scale(0.98); }
input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.app {
  position: relative;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

/* ---------- status bar ---------- */
.statusbar {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 22px 6px;
  font-size: 14px;
  font-weight: 600;
}
.sb-right { display: flex; align-items: center; gap: 7px; }
.sb-signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.sb-signal i { width: 3px; background: var(--ink); border-radius: 1px; }
.sb-signal i:nth-child(1) { height: 4px; }
.sb-signal i:nth-child(2) { height: 6px; }
.sb-signal i:nth-child(3) { height: 8px; }
.sb-signal i:nth-child(4) { height: 11px; }
.sb-batt {
  width: 23px; height: 11px;
  border: 1.5px solid var(--ink); border-radius: 3.5px;
  padding: 1.5px; position: relative;
}
.sb-batt::after {
  content: ""; position: absolute; right: -4px; top: 2.5px;
  width: 2px; height: 4px; background: var(--ink); border-radius: 0 1px 1px 0;
}
.sb-batt b { display: block; height: 100%; width: 78%; background: var(--ink); border-radius: 1.5px; }

/* dark chrome variant (sign-in and worker screens) */
.app.chrome-dark { background: #10231a; }
.app.chrome-dark .statusbar { color: #f2f6f3; }
.app.chrome-dark .sb-signal i, .app.chrome-dark .sb-batt b { background: #f2f6f3; }
.app.chrome-dark .sb-batt { border-color: #f2f6f3; }
.app.chrome-dark .sb-batt::after { background: #f2f6f3; }

/* ---------- screens ---------- */
.screen-holder { flex: 1; position: relative; overflow: hidden; }
.screen {
  position: absolute; inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 20px calc(96px + env(safe-area-inset-bottom, 0px));
  animation: screen-in 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.screen.no-tabs { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.screen.slide-back { animation-name: screen-back; }
@keyframes screen-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes screen-back { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- type ---------- */
.h-greet { font-size: 15px; color: var(--muted); margin-top: 10px; }
.h-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.h-page { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 18px; }
.h-page .h-title { font-size: 26px; }
.money { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; fill: currentColor; }

/* ---------- hero card (dashboard) ---------- */
.hero-card {
  margin-top: 16px;
  background: linear-gradient(145deg, #124e34, #17734b 62%, #1d8a5b);
  color: #f2f8f4;
  border-radius: var(--r-card);
  padding: 22px 20px 18px;
  box-shadow: var(--shadow);
}
.hero-card .label { font-size: 13px; font-weight: 500; color: #b9d9c8; }
.hero-card .big { font-size: 38px; font-weight: 700; margin-top: 2px; }
.hero-split { display: flex; gap: 0; margin-top: 18px; border-top: 1px solid rgba(255,255,255,0.16); padding-top: 14px; }
.hero-split > div { flex: 1; }
.hero-split > div + div { border-left: 1px solid rgba(255,255,255,0.16); padding-left: 16px; }
.hero-split .label { font-size: 12px; }
.hero-split .val { font-size: 17px; font-weight: 600; margin-top: 2px; }

/* ---------- stat row ---------- */
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 14px 16px;
  border: 1px solid var(--line);
}
.stat-card .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-card .label .icon { font-size: 15px; color: var(--brand); }
.stat-card .val { font-size: 20px; font-weight: 700; margin-top: 4px; }
.stat-card .sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.stat-card.warn .label .icon { color: var(--warn); }
.stat-card.warn .val { color: var(--warn); }

/* ---------- quick actions ---------- */
.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.quick {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 13px 8px 11px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.quick .icon { font-size: 21px; color: var(--brand); }
.quick:active { transform: scale(0.96); }

/* ---------- sections & lists ---------- */
.sec-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 24px 0 10px;
}
.sec-head h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.sec-head button, .sec-head a { font-size: 13.5px; font-weight: 600; color: var(--brand); text-decoration: none; }

.list { display: flex; flex-direction: column; gap: 10px; }
.row-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 13px;
  text-align: left;
  transition: transform 0.15s ease;
}
.row-card:active { transform: scale(0.985); }
.row-ico {
  flex: none; width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink);
  font-size: 19px;
}
.row-ico.warn { background: var(--warn-soft); color: var(--warn); }
.row-ico.info { background: var(--info-soft); color: var(--info); }
.row-main { flex: 1; min-width: 0; }
.row-main .t { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main .s { font-size: 12.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { text-align: right; flex: none; }
.row-end .amt { font-size: 15px; font-weight: 700; }
.row-end .when { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.row-card > .icon.chev { color: var(--faint); font-size: 15px; flex: none; }

/* receipt thumb */
.row-thumb {
  flex: none; width: 40px; height: 40px; border-radius: 13px;
  object-fit: cover; background: var(--surface-2);
}

/* ---------- chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em;
  padding: 3px 9px; border-radius: 999px;
}
.chip.paid { background: var(--brand-soft); color: var(--brand-ink); }
.chip.sent { background: var(--info-soft); color: var(--info); }
.chip.overdue { background: var(--warn-soft); color: var(--warn); }
.chip.draft { background: var(--surface-2); color: var(--muted); }
.chip.active { background: var(--brand-soft); color: var(--brand-ink); }
.chip.done { background: var(--surface-2); color: var(--muted); }

/* ---------- segmented control ---------- */
.seg {
  display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px;
  margin: 4px 0 16px;
}
.seg button {
  flex: 1; padding: 8px 4px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(23,55,40,0.12); }

/* ---------- progress bars ---------- */
.budget-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.budget-bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width 0.5s cubic-bezier(0.16,1,0.3,1); }
.budget-bar i.hot { background: var(--warn); }
.budget-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 20px;
  border-radius: 999px;
  font-size: 15.5px; font-weight: 700;
  background: var(--brand); color: #f4faf6;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); background: var(--brand-deep); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.subtle { background: var(--brand-soft); color: var(--brand-ink); }
.btn.sm { width: auto; padding: 9px 16px; font-size: 13.5px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- tab bar ---------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 20;
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; color: var(--faint);
  padding: 4px 0;
  position: relative;
}
.tabbar button .icon { font-size: 23px; }
.tabbar button.on { color: var(--brand-deep); }
.tabbar .badge {
  position: absolute; top: 0; right: calc(50% - 20px);
  min-width: 16px; height: 16px; border-radius: 999px;
  background: var(--warn); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  padding: 0 4px;
}

/* ---------- sign-in ---------- */
.signin {
  height: 100%;
  display: flex; flex-direction: column;
  padding: 8px 26px calc(28px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(52, 168, 108, 0.35), transparent 60%),
    linear-gradient(180deg, #0d1f17, #10231a 55%, #12281e);
  color: #eef5f0;
}
.signin .brand-mark {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--brand);
  display: grid; place-items: center;
  font-weight: 800; font-size: 21px; color: #fff; letter-spacing: -0.02em;
  margin-top: 8vh;
  box-shadow: 0 12px 32px rgba(23, 115, 75, 0.45);
}
.signin h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; margin-top: 26px; }
.signin p { font-size: 15.5px; color: #a7bcae; margin-top: 12px; line-height: 1.5; max-width: 30ch; }
.signin .spacer { flex: 1; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px; border-radius: 999px;
  background: #f4f7f4; color: #1a241e; font-size: 15.5px; font-weight: 700;
}
.btn-google .gmark { width: 19px; height: 19px; flex: none; }
.btn-worker {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 15px; margin-top: 11px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22); color: #dcE8e0; font-size: 15.5px; font-weight: 600;
}
.signin .tour-link {
  margin-top: 20px; text-align: center; width: 100%;
  font-size: 13.5px; font-weight: 600; color: #8fceac;
}
.signin .fine { font-size: 11.5px; color: #6d8577; text-align: center; margin-top: 16px; }

/* ---------- PIN screen ---------- */
.pin-screen {
  height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 30px calc(24px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #0d1f17, #12281e);
  color: #eef5f0;
  text-align: center;
}
.pin-back { align-self: flex-start; font-size: 20px; color: #a7bcae; padding: 10px 6px; }
.pin-screen h1 { font-size: 24px; font-weight: 700; margin-top: 3vh; }
.pin-screen p { font-size: 14px; color: #a7bcae; margin-top: 8px; }
.pin-dots { display: flex; gap: 16px; margin: 4vh 0; }
.pin-dots i {
  width: 14px; height: 14px; border-radius: 999px;
  border: 1.5px solid #5f7a6b; transition: background 0.12s ease, border-color 0.12s ease;
}
.pin-dots i.fill { background: #34a86c; border-color: #34a86c; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; margin-top: auto; }
.pin-pad button {
  width: 76px; height: 76px; border-radius: 999px;
  background: rgba(255,255,255,0.07);
  font-size: 26px; font-weight: 600; color: #eef5f0;
  transition: background 0.12s ease;
}
.pin-pad button:active { background: rgba(255,255,255,0.18); }
.pin-pad button.blank { background: none; pointer-events: none; }
.pin-pad button .icon { font-size: 24px; }

/* ---------- worker mode ---------- */
.worker-hero {
  background: linear-gradient(150deg, #143826, #17513a);
  color: #eef5f0;
  border-radius: var(--r-card);
  padding: 20px;
  margin-top: 14px;
}
.worker-hero .label { font-size: 12.5px; color: #9cc4ad; font-weight: 600; }
.worker-hero h2 { font-size: 21px; font-weight: 700; margin-top: 4px; letter-spacing: -0.01em; }
.worker-hero .addr { font-size: 13.5px; color: #b9d3c4; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.worker-hero .actions { display: flex; gap: 10px; margin-top: 16px; }
.worker-hero .actions .btn { padding: 11px 14px; font-size: 13.5px; }
.worker-hero .actions .btn.ghost { background: rgba(255,255,255,0.1); border: 0; color: #eef5f0; }

.clock-strip {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 13px 16px; margin-top: 12px;
}
.clock-strip .t { font-size: 14px; font-weight: 600; }
.clock-strip .s { font-size: 12px; color: var(--muted); margin-top: 1px; }
.clock-strip .btn { width: auto; padding: 10px 18px; font-size: 13.5px; }
.clock-strip.on { border-color: var(--brand); background: var(--brand-soft); }

.task-row {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 15px 16px;
  text-align: left;
}
.task-row .box {
  flex: none; width: 26px; height: 26px; border-radius: 9px;
  border: 2px solid #c3cec7;
  display: grid; place-items: center;
  color: transparent; font-size: 15px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.task-row.done .box { background: var(--brand); border-color: var(--brand); color: #fff; }
.task-row .t { font-size: 15px; font-weight: 600; flex: 1; }
.task-row.done .t { color: var(--faint); text-decoration: line-through; }
.task-row .eta { font-size: 12px; color: var(--faint); }

.progress-ring-wrap { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.progress-ring-wrap .txt .t { font-size: 15px; font-weight: 700; }
.progress-ring-wrap .txt .s { font-size: 12.5px; color: var(--muted); }
.ring { transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-2); }
.ring .fillc { stroke: var(--brand); transition: stroke-dashoffset 0.6s cubic-bezier(0.16,1,0.3,1); }
.ring-label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; font-family: var(--mono);
}

/* ---------- morning digest (lock-screen style) ---------- */
.digest {
  height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: 5vh 22px calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(110% 80% at 80% -10%, rgba(52, 168, 108, 0.28), transparent 60%),
    linear-gradient(180deg, #0d1f17, #12281e);
  color: #eef5f0;
  text-align: center;
  overflow-y: auto;
}
.dg-time { font-size: 58px; font-weight: 300; letter-spacing: -0.02em; line-height: 1; }
.dg-date { font-size: 14px; color: #a7bcae; margin-top: 6px; }
.dg-card {
  width: 100%;
  margin-top: 4vh;
  background: rgba(255, 255, 255, 0.09);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 15px 17px;
  text-align: left;
}
.dg-app {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: #9cc4ad;
}
.dg-app .icon { font-size: 14px; }
.dg-app em { margin-left: auto; font-style: normal; font-weight: 500; color: #7d9788; text-transform: none; letter-spacing: 0; }
.dg-line { font-size: 14px; line-height: 1.5; margin-top: 11px; color: #dce8e0; }
.dg-line b { color: #fff; }
.dg-line.dg-hint { color: #9cc4ad; font-size: 13px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 11px; }
.dg-actions { width: 100%; margin-top: auto; padding-top: 4vh; display: grid; gap: 10px; }
.dg-note { font-size: 11.5px; color: #6d8577; margin-top: 14px; }

/* ---------- detail pages ---------- */
.subnav { display: flex; align-items: center; gap: 6px; margin: 10px 0 4px; }
.subnav button { font-size: 21px; color: var(--ink); padding: 8px 10px 8px 0; display: flex; }
.subnav .crumb { font-size: 13px; color: var(--muted); font-weight: 600; }

.detail-head { margin: 6px 0 16px; }
.detail-head h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; }
.detail-head .who { font-size: 14px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; }

.kv-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
.kv-card + .kv-card { margin-top: 12px; }
.kv-line { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; }
.kv-line .k { color: var(--muted); }
.kv-line .v { font-weight: 600; }
.kv-line.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 13px; }
.kv-line.total .v { font-size: 16px; font-weight: 700; }

/* ---------- sheets ---------- */
.sheet-layer { position: absolute; inset: 0; z-index: 40; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(13, 26, 20, 0.45);
  animation: fade-in 0.25s ease;
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 10px 22px calc(26px + env(safe-area-inset-bottom, 0px));
  max-height: 88%;
  overflow-y: auto;
  animation: sheet-up 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}
.sheet::before {
  content: ""; display: block;
  width: 38px; height: 4.5px; border-radius: 999px;
  background: var(--line); margin: 2px auto 14px;
}
@keyframes sheet-up { from { transform: translateY(60%); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 4px; }
.sheet .sheet-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .help { font-size: 12px; color: var(--faint); margin-top: 5px; }
.field input, .field select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--r-input);
  background: var(--bg);
  padding: 13px 14px;
  font-size: 15.5px;
  outline: none;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus, .field select:focus { border-color: var(--brand); }
.field .err { display: none; font-size: 12.5px; color: var(--warn); margin-top: 5px; font-weight: 600; }
.field.invalid input { border-color: var(--warn); }
.field.invalid .err { display: block; }

.amount-input { position: relative; }
.amount-input span {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 15.5px; color: var(--muted); font-weight: 600;
}
.amount-input input { padding-left: 30px; font-family: var(--mono); font-weight: 600; }

.dep-preview {
  background: var(--brand-soft); border-radius: var(--r-input);
  padding: 12px 14px; margin: 4px 0 16px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px; color: var(--brand-ink); font-weight: 600;
}
.dep-preview .money { font-size: 17px; font-weight: 700; }

.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 4px; }
.cat-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 11px 2px 9px;
  border-radius: var(--r-input);
  border: 1.5px solid var(--line);
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.cat-grid button .icon { font-size: 19px; }
.cat-grid button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }

.receipt-drop {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px dashed var(--line); border-radius: var(--r-input);
  padding: 12px 14px; margin-bottom: 16px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  width: 100%;
}
.receipt-drop .icon { font-size: 21px; color: var(--brand); }
.receipt-drop img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; }
.receipt-drop.has { border-style: solid; color: var(--ink); }

/* ---------- toast ---------- */
.toast-layer {
  position: absolute; left: 0; right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 46px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 60; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  background: #14251c; color: #ecf4ee;
  font-size: 13.5px; font-weight: 600;
  padding: 11px 18px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(10, 25, 18, 0.35);
  animation: toast-in 0.3s cubic-bezier(0.16,1,0.3,1);
}
.toast .icon { color: #4cc98a; font-size: 17px; }
.toast.leaving { opacity: 0; transform: translateY(-8px); transition: 0.25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(0.95); } to { opacity: 1; transform: none; } }

/* ---------- tour ---------- */
.tour-layer {
  position: absolute; inset: 0; z-index: 80;
  pointer-events: none;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 14px);
}
.tour-layer[hidden], .sheet-layer[hidden], .tabbar[hidden] { display: none; }
.tour-card {
  pointer-events: auto;
  width: 100%;
  background: #14251c; color: #ecf4ee;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 14px 40px rgba(10, 25, 18, 0.5);
  animation: sheet-up 0.3s cubic-bezier(0.16,1,0.3,1);
}
.tour-card .step { font-size: 11px; font-weight: 700; color: #7dbf9c; letter-spacing: 0.08em; text-transform: uppercase; }
.tour-card p { font-size: 14.5px; line-height: 1.45; margin-top: 6px; }
.tour-card .tour-actions { display: flex; gap: 10px; margin-top: 13px; }
.tour-card .tour-actions button {
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
}
.tour-card .tour-next { background: #34a86c; color: #06130c; }
.tour-card .tour-skip { color: #9cc4ad; }

/* ---------- empty states ---------- */
.empty {
  text-align: center; padding: 46px 30px;
  color: var(--muted);
}
.empty .icon { font-size: 38px; color: var(--faint); }
.empty .t { font-size: 15.5px; font-weight: 700; color: var(--ink); margin-top: 12px; }
.empty .s { font-size: 13.5px; margin-top: 5px; line-height: 1.5; }
.empty .btn { margin-top: 18px; width: auto; display: inline-flex; padding: 11px 20px; font-size: 14px; }

/* ---------- standalone (not embedded) ---------- */
@media (min-width: 520px) {
  body:not(.embedded) {
    background: #101512;
    display: grid; place-items: center;
    min-height: 100dvh;
  }
  body:not(.embedded) .app {
    height: min(860px, 94dvh);
    width: 400px;
    border-radius: 44px;
    border: 10px solid #1c231f;
    box-shadow: 0 40px 120px rgba(0,0,0,0.55);
  }
}
