/* Freegsm Mini App — look follows the "Finora" UI kit: deep-green hero cards, mint tiles, white rounded cards,
   soft mint-to-sky background, pill tabs and a five-slot bottom bar. All assets are local (no CDN):
   the app is served from an Iranian host. */

@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Bold.ttf") format("truetype"); font-weight: 600 800; font-display: swap; }

:root {
  --g900: #07422f; --g800: #0a5a40; --g700: #0e6d4c; --g600: #12805a; --g500: #1a9a6e;
  --mint50: #f2faf6; --mint100: #e3f5ec; --mint200: #c9ebdc;
  --bg1: #d9f1e8; --bg2: #e6f2fb; --bg3: #e9f6ee;
  --card: #ffffff; --ink: #11261d; --muted: #7b8c85; --line: #e8efeb;
  --red: #e5484d; --red-bg: #fdecec; --amber: #f2a20f; --amber-bg: #fff4dc;
  --blue: #3b82f6; --blue-bg: #e6f0ff; --purple: #7c5cff; --purple-bg: #efeaff;
  --orange: #f97316; --orange-bg: #ffeddc; --pink: #ec4899; --pink-bg: #fde8f2;
  --radius: 22px; --radius-sm: 14px;
  --shadow: 0 6px 24px rgba(16, 90, 64, .08);
  --shadow-lg: 0 14px 40px rgba(7, 66, 47, .22);
  --nav-h: 72px;
  --accent: #0e6d4c; --accent-2: #12805a; --amber-ink: #b97800; --warn-ink: #8a5a00;
  --hero-a: #0e6d4c; --hero-b: #07422f; --btn-a: #12805a; --btn-b: #0a5a40;
  --seg-bg: rgba(255, 255, 255, .7); --nav-bg: rgba(255, 255, 255, .94); --nav-ink: #98a8a1; --nav-solid: #fff;
  --sticky-a: rgba(230, 242, 251, .97); --sticky-b: rgba(230, 242, 251, 0);
  --gray-bg: #eef2f0; --gray-ink: #7d8c86; --switch-off: #cfd9d4; --sk-a: #ffffff80; --sk-b: #ffffffd0;
  --track: #e3f5ec; --grid: #e8efeb; --tip: #07422f; --thumb-a: #e8efeb; --thumb-b: #f2f6f4;
  --bar-hi-a: #12805a; --bar-hi-b: #07422f; --bar: #1a9a6e;
  color-scheme: light;
}

/* ---- deep dark ---- (near-black green; the hero cards stay rich green so they still anchor the screen) */
:root[data-theme="dark"] {
  --bg1: #04110c; --bg2: #061510; --bg3: #040e0b;
  --card: #0d1c16; --ink: #e7f3ed; --muted: #84a095; --line: #1a2e25;
  --mint50: #102319; --mint100: rgba(63, 220, 159, .12); --mint200: rgba(63, 220, 159, .24);
  --red: #ff6b70; --red-bg: rgba(255, 107, 112, .15); --amber: #f7b733; --amber-bg: rgba(247, 183, 51, .15);
  --blue: #6aa5ff; --blue-bg: rgba(106, 165, 255, .17); --purple: #a38dff; --purple-bg: rgba(163, 141, 255, .18);
  --orange: #ff9a52; --orange-bg: rgba(255, 154, 82, .17); --pink: #f472b6; --pink-bg: rgba(244, 114, 182, .17);
  --shadow: 0 6px 22px rgba(0, 0, 0, .5); --shadow-lg: 0 14px 40px rgba(0, 0, 0, .65);
  --accent: #3fdc9f; --accent-2: #35d398; --amber-ink: #f7b733; --warn-ink: #f2c46a;
  --hero-a: #0d5a40; --hero-b: #04261a; --btn-a: #1a9a6e; --btn-b: #0d6a4a;
  --seg-bg: rgba(255, 255, 255, .06); --nav-bg: rgba(9, 21, 16, .93); --nav-ink: #6b877a; --nav-solid: #0d1c16;
  --sticky-a: rgba(4, 14, 11, .97); --sticky-b: rgba(4, 14, 11, 0);
  --gray-bg: #16261e; --gray-ink: #86a095; --switch-off: #2a4035; --sk-a: #ffffff0d; --sk-b: #ffffff1f;
  --track: #17291f; --grid: #1a2e25; --tip: #1f4a39; --thumb-a: #14261d; --thumb-b: #19302a;
  --bar-hi-a: #46e3a8; --bar-hi-b: #139266; --bar: #2aae80;
  color-scheme: dark;
}
:root[data-theme="dark"] .hero { box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(63, 220, 159, .14); }
:root[data-theme="dark"] .scrim { background: rgba(0, 0, 0, .62); }
:root[data-theme="dark"] .input::placeholder, :root[data-theme="dark"] .search input::placeholder { color: #5d7a6d; }
:root[data-theme="dark"] .nav { box-shadow: 0 -8px 30px rgba(0, 0, 0, .5); border-top: 1px solid var(--line); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .stat, :root[data-theme="dark"] .pill, :root[data-theme="dark"] .search, :root[data-theme="dark"] .icon-btn { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), var(--shadow); }
html { background: var(--bg2); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Vazirmatn", system-ui, sans-serif; color: var(--ink); font-size: 14px; line-height: 1.6;
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 52%, var(--bg3) 100%) fixed;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
.num { font-feature-settings: "tnum"; }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: left; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 18px; height: 18px; } svg.i.xs { width: 15px; height: 15px; } svg.i.l { width: 26px; height: 26px; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }
.screen { padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px calc(var(--nav-h) + 34px + env(safe-area-inset-bottom, 0px)); animation: in .22s ease both; }
.screen.nonav { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
.screen.cta { padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom, 0px)); }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- header ---- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--accent); position: relative; }
.icon-btn .dot { position: absolute; top: 8px; inset-inline-start: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--card); }
.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hello .who { flex: 1; min-width: 0; }
.hello small { color: var(--accent-2); font-weight: 600; display: block; }
.hello b { font-size: 19px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(140deg, var(--g500), var(--g800)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; box-shadow: var(--shadow); flex: none; }
.avatar.lg { width: 74px; height: 74px; font-size: 30px; }

/* ---- hero card ---- */
.hero { position: relative; overflow: hidden; color: #fff; border-radius: var(--radius); padding: 18px 20px; background: linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 100%); box-shadow: var(--shadow-lg); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none; }
.hero::before { width: 220px; height: 220px; inset-inline-start: -70px; top: -90px; }
.hero::after { width: 150px; height: 150px; inset-inline-start: 30px; bottom: -80px; background: rgba(255, 255, 255, .05); }
.hero .row { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; gap: 10px; }
.hero .label { opacity: .85; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.hero .big { font-size: 34px; font-weight: 800; letter-spacing: -.5px; line-height: 1.25; margin: 6px 0 2px; position: relative; z-index: 1; }
.hero .big small { font-size: 15px; font-weight: 600; opacity: .85; margin-inline-start: 6px; }
.hero .sub { font-size: 12.5px; opacity: .82; position: relative; z-index: 1; }
.hero .chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .14); border-radius: 99px; padding: 3px 11px; font-size: 12px; }
.hero .eye { color: #fff; opacity: .9; display: grid; place-items: center; }
.hero .cta { background: #fff; color: var(--g800); border-radius: 12px; padding: 7px 14px; font-weight: 700; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.hero .mini { display: flex; gap: 22px; margin-top: 14px; position: relative; z-index: 1; }
.hero .mini div { font-size: 12px; opacity: .88; } .hero .mini b { display: block; font-size: 17px; opacity: 1; }

/* ---- generic cards ---- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card, .section + .card { margin-top: 12px; }
.section { margin-top: 20px; }
.section-h { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; }
.section-h h2 { margin: 0; font-size: 15.5px; font-weight: 700; }
.link { color: var(--accent-2); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.muted { color: var(--muted); } .small { font-size: 12px; }

/* quick actions */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink); }
.act .tile { width: 58px; height: 58px; border-radius: 18px; background: var(--mint100); color: var(--accent); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(14, 109, 76, .06); transition: transform .12s; }
.act:active .tile { transform: scale(.94); }

/* rows & tiles */
.tile-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--mint100); color: var(--accent); }
.tile-ic.red { background: var(--red-bg); color: var(--red); } .tile-ic.amber { background: var(--amber-bg); color: var(--amber); }
.tile-ic.blue { background: var(--blue-bg); color: var(--blue); } .tile-ic.purple { background: var(--purple-bg); color: var(--purple); }
.tile-ic.orange { background: var(--orange-bg); color: var(--orange); } .tile-ic.pink { background: var(--pink-bg); color: var(--pink); }
.list { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; text-align: start; width: 100%; }
.row-item + .row-item { border-top: 1px solid var(--line); }
.row-item .mid { flex: 1; min-width: 0; }
.row-item .t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .s { font-size: 11.5px; color: var(--muted); }
.row-item .end { text-align: end; flex: none; }
.pos { color: var(--accent-2); font-weight: 700; } .neg { color: var(--red); font-weight: 700; }
.chev { color: var(--muted); opacity: .6; }

/* tabs (pills) */
.seg { display: flex; gap: 6px; background: var(--seg-bg); border-radius: 16px; padding: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; white-space: nowrap; padding: 8px 14px; border-radius: 12px; font-weight: 600; font-size: 13px; color: var(--muted); transition: .15s; }
.seg button.on { background: var(--g700); color: #fff; box-shadow: 0 4px 12px rgba(14, 109, 76, .3); }
.seg button .b { background: var(--red); color: #fff; border-radius: 99px; font-size: 10.5px; padding: 0 6px; margin-inline-start: 4px; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin-bottom: 12px; }
.pills::-webkit-scrollbar { display: none; }
.pill { padding: 7px 15px; border-radius: 99px; background: var(--card); font-weight: 600; font-size: 13px; color: var(--muted); box-shadow: var(--shadow); white-space: nowrap; }
.pill.on { background: var(--g700); color: #fff; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--mint100); color: var(--accent); }
.badge.red { background: var(--red-bg); color: var(--red); } .badge.amber { background: var(--amber-bg); color: var(--amber-ink); }
.badge.gray { background: var(--gray-bg); color: var(--gray-ink); } .badge.blue { background: var(--blue-bg); color: var(--blue); }
.dot-s { width: 8px; height: 8px; border-radius: 50%; background: var(--g500); display: inline-block; }
.dot-s.red { background: var(--red); } .dot-s.gray { background: var(--gray-ink); }
.tile-ic.gray { background: var(--gray-bg); color: var(--gray-ink); } .amber-t { color: var(--amber-ink); font-weight: 600; }
.chart .grid { stroke: var(--grid); } .chart .tipbg { fill: var(--tip); } .track { stroke: var(--track); }
.theme-seg { margin: 0; } .dot-s.amber { background: var(--amber); }

/* progress */
.bar { height: 8px; border-radius: 99px; background: var(--mint100); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--g500), var(--g700)); }
.bar.amber > i { background: linear-gradient(90deg, #f7c04a, var(--amber)); } .bar.red > i { background: linear-gradient(90deg, #f27b7f, var(--red)); }
.bar.blue > i { background: linear-gradient(90deg, #6ea8ff, var(--blue)); }

/* account card in list */
.acc { display: block; width: 100%; text-align: start; }
.acc + .acc { margin-top: 10px; }
.acc .top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.acc .name { font-weight: 700; font-size: 15px; direction: ltr; unicode-bidi: isolate; text-align: start; }
.acc .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.acc .meta b { color: var(--ink); }

/* search */
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 0 14px; height: 48px; box-shadow: var(--shadow); margin-bottom: 12px; color: var(--muted); }
.search input { border: 0; outline: 0; background: none; flex: 1; height: 100%; min-width: 0; }

/* forms */
.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 7px; }
.input { width: 100%; height: 50px; border-radius: 15px; border: 1.5px solid var(--line); background: var(--card); padding: 0 14px; outline: 0; transition: .15s; }
.input:focus { border-color: var(--g500); box-shadow: 0 0 0 4px rgba(26, 154, 110, .12); }
.input.bad { border-color: var(--red); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; } .hint.err { color: var(--red); }
.stepper { display: flex; align-items: center; justify-content: space-between; background: var(--mint50); border-radius: 18px; padding: 8px; }
.stepper button { width: 46px; height: 46px; border-radius: 14px; background: var(--card); color: var(--accent); box-shadow: var(--shadow); display: grid; place-items: center; }
.stepper .val { font-size: 30px; font-weight: 800; text-align: center; line-height: 1.2; }
.stepper .val small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
input[type=range] { width: 100%; accent-color: var(--accent-2); margin-top: 12px; }
.opt { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); margin-bottom: 8px; font-weight: 600; text-align: start; transition: .15s; }
.opt.on { border-color: var(--g600); background: var(--mint50); box-shadow: 0 0 0 3px rgba(26, 154, 110, .1); }
.opt small { color: var(--muted); font-weight: 500; }
.summary { background: var(--mint50); border-radius: 18px; padding: 14px 16px; }
.summary .r { display: flex; justify-content: space-between; padding: 4px 0; }
.summary .r.total { border-top: 1px dashed var(--mint200); margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 15px; }

/* buttons */
.btn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, var(--btn-a), var(--btn-b)); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 8px 20px rgba(14, 109, 76, .3); transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.98); } .btn[disabled] { opacity: .45; box-shadow: none; pointer-events: none; }
.btn.light { background: var(--mint100); color: var(--accent); box-shadow: none; }
.btn.danger { background: var(--red-bg); color: var(--red); box-shadow: none; }
.btn.sm { height: 42px; font-size: 13.5px; border-radius: 13px; }
.btn-row { display: flex; gap: 10px; } .btn-row > * { flex: 1; }
.sticky-cta { position: fixed; bottom: 0; inset-inline: 0; max-width: 480px; margin: 0 auto; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--sticky-a) 60%, var(--sticky-b)); z-index: 5; }
.sticky-cta.up { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); background: none; padding-bottom: 10px; }
.switch { width: 48px; height: 28px; border-radius: 99px; background: var(--switch-off); position: relative; transition: .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); transition: .2s; }
.switch.on { background: var(--g600); } .switch.on::after { inset-inline-start: 23px; }

/* stat grid */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); }
.stat .tile-ic { width: 38px; height: 38px; border-radius: 12px; margin-bottom: 8px; }
.stat b { font-size: 21px; display: block; line-height: 1.3; } .stat span { color: var(--muted); font-size: 12px; }

/* charts */
.chart { width: 100%; height: 170px; display: block; }
.chart text { font-family: "Vazirmatn"; font-size: 10px; fill: var(--muted); }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.legend { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.legend div { display: flex; align-items: center; gap: 8px; } .legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend b { margin-inline-start: auto; }

/* detail */
.qr { background: #fff; border-radius: 20px; padding: 14px; width: 188px; height: 188px; margin: 0 auto; box-shadow: var(--shadow); }
.qr svg { width: 100%; height: 100%; display: block; }
.ring { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .c b { font-size: 24px; line-height: 1.2; } .ring .c span { font-size: 11.5px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; padding: 9px 0; } .kv + .kv { border-top: 1px solid var(--line); }
.kv span:first-child { color: var(--muted); }
.copybox { display: flex; align-items: center; gap: 8px; background: var(--mint50); border-radius: 14px; padding: 8px 8px 8px 12px; margin-top: 8px; }
.copybox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; direction: ltr; unicode-bidi: isolate; text-align: left; }
.copybox button { background: var(--g700); color: #fff; border-radius: 10px; height: 34px; padding: 0 12px; font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.warn { display: flex; gap: 10px; background: var(--amber-bg); color: var(--warn-ink); border-radius: 16px; padding: 12px 14px; font-size: 12.5px; }
.tip { display: flex; gap: 12px; align-items: center; background: var(--mint100); border-radius: 18px; padding: 13px 14px; }
.tip b { display: block; } .tip span { font-size: 12px; color: var(--muted); }
.receipt-thumb { width: 54px; height: 54px; border-radius: 12px; background: repeating-linear-gradient(45deg, var(--thumb-a), var(--thumb-a) 6px, var(--thumb-b) 6px, var(--thumb-b) 12px); display: grid; place-items: center; color: var(--muted); flex: none; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 4px; text-align: start; }
.menu-item + .menu-item { border-top: 1px solid var(--line); }
.menu-item .mid { flex: 1; font-weight: 600; }

/* bottom nav */
.nav { position: fixed; bottom: 0; inset-inline: 0; max-width: 480px; margin: 0 auto; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--nav-bg); backdrop-filter: blur(14px); border-radius: 26px 26px 0 0; box-shadow: 0 -8px 30px rgba(7, 66, 47, .09); display: flex; z-index: 10; }
.nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--nav-ink); font-size: 11px; font-weight: 600; position: relative; }
.nav button.on { color: var(--accent); }
.nav button.on svg { fill: rgba(26, 154, 110, .16); }
.nav button.on::before { content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--g600); }
.nav .fab { transform: translateY(-20px); flex: none; width: 62px; margin: 0 6px; }
.nav .fab span.c { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--g500), var(--g800)); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 22px rgba(14, 109, 76, .45); border: 4px solid var(--nav-solid); }
.nav .fab { color: var(--accent); } .nav .fab.on::before { display: none; }
.nav .fab svg { fill: none !important; }
.nav .nb { position: absolute; top: 8px; inset-inline-start: calc(50% + 4px); background: var(--red); color: #fff; border-radius: 99px; font-size: 10px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; }

/* sheet & toast */
.scrim { position: fixed; inset: 0; background: rgba(7, 40, 28, .45); z-index: 40; animation: fade .2s both; }
.sheet { position: fixed; bottom: 0; inset-inline: 0; max-width: 480px; margin: 0 auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 41; animation: up .25s cubic-bezier(.2, .8, .2, 1) both; max-height: 88vh; overflow: auto; }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 17px; } .sheet p { margin: 0 0 14px; color: var(--muted); }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(100%); } }
.toast { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 50%; transform: translateX(-50%); background: var(--g900); color: #fff; padding: 11px 18px; border-radius: 99px; z-index: 60; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: center; animation: in .2s both; max-width: 90%; }
.toast.err { background: #8f2327; }
.empty { text-align: center; padding: 38px 20px; color: var(--muted); } .empty svg { width: 46px; height: 46px; color: var(--mint200); margin-bottom: 8px; }
.skeleton { height: 90px; border-radius: 20px; background: linear-gradient(90deg, var(--sk-a) 25%, var(--sk-b) 50%, var(--sk-a) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; margin-bottom: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* demo bar (only in ?demo mode) */
.demobar { position: fixed; top: 0; inset-inline: 0; z-index: 70; display: flex; justify-content: center; gap: 6px; padding: 5px; background: #07422f; }
.demobar button { color: #cdeedd; font-size: 11.5px; padding: 2px 12px; border-radius: 99px; } .demobar button.on { background: #fff; color: var(--g900); font-weight: 700; }
body.has-demo #app { padding-top: 30px; }

/* additions for the live API */
.bar.wait > i { background: var(--mint200); opacity: .6; animation: sk 1.4s infinite; background-size: 200% 100%; }
.more-btn { margin: 4px 0 12px; }
.rc-img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 16px; background: var(--mint50); }
button.receipt-thumb { border: 0; cursor: pointer; color: var(--muted); }

.stepper .val { flex: 1; min-width: 0; }
.stepper .gbin { width: 100%; border: 0; background: none; outline: 0; text-align: center; font-size: 30px; font-weight: 800; color: var(--ink); padding: 0; font-family: inherit; }
.stepper .gbin:focus { box-shadow: none; }
.hint.err { color: var(--red); }

/* light theme: secondary buttons were too pale against the pale page; give them a clear fill, text and edge */
:root:not([data-theme="dark"]) .btn.light { background: #cdeadb; color: #07422f; box-shadow: inset 0 0 0 1.5px rgba(14, 109, 76, .38); }
:root:not([data-theme="dark"]) .btn.light:active { background: #b9e0cb; }
:root:not([data-theme="dark"]) .btn.danger { background: #fbdcdc; color: #b4232a; box-shadow: inset 0 0 0 1.5px rgba(229, 72, 77, .4); }
:root:not([data-theme="dark"]) .icon-btn, :root:not([data-theme="dark"]) .pill { box-shadow: inset 0 0 0 1px rgba(14, 109, 76, .22); }
/* QR: fill the white frame, crisp edges, centred (the svg carries a viewBox now, so it scales) */
.qr { display: grid; place-items: center; }
.qr svg { width: 100%; height: 100%; display: block; shape-rendering: crispEdges; }
.cfg { text-align: start; }
.cfg .copybox { margin-top: 6px; }
.cfg .cfg-t { font-size: 12px; color: var(--muted); margin-top: 10px; }
.cfg .cfg-n { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
