/* Halfsies. System fonts, warm paper light theme, true-black dark theme, one orange accent. */
:root {
  --bg: #F6F3EE; --bg2: #EFEBE4; --card: #FFFFFF; --paper: #FFFDF8; --ink: #17140F; --ink2: #4A453E; --muted: #8A847A;
  --line: #E6E0D6; --line2: #F0EBE3; --accent: #FF5A1F; --accent-ink: #fff; --accent-soft: #FFE9DF; --accent-text: #E1460D;
  --ok: #1E9E62; --ok-soft: #E2F5EA; --warn: #B76E00; --warn-soft: #FFF2D9; --bad: #D63B3B; --bad-soft: #FDE7E7;
  --shadow: 0 1px 2px rgba(23, 20, 15, .05), 0 4px 16px rgba(23, 20, 15, .06);
  --shadow-lg: 0 12px 40px rgba(23, 20, 15, .18);
  --r: 18px; --r-sm: 12px;
  --top: env(safe-area-inset-top, 0px); --bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0E10; --bg2: #18181B; --card: #1C1C1F; --paper: #232326; --ink: #F5F2EC; --ink2: #CFCAC2; --muted: #8F8A82;
    --line: #2E2E33; --line2: #26262A; --accent: #FF6A33; --accent-soft: #3A2016; --accent-text: #FF8A5C;
    --ok: #3CC583; --ok-soft: #12301F; --warn: #F0B04A; --warn-soft: #33270F; --bad: #FF6464; --bad-soft: #3A1717;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 16px/1.4 var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -.02em; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); }
.center { text-align: center; justify-content: center; }
.ok-txt { color: var(--ok); }
.danger-txt { color: var(--bad) !important; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; opacity: 0; transition: opacity .2s; }
#app.ready { opacity: 1; }
#tabview { flex: 1; padding: calc(var(--top) + 6px) 16px 0; }
.tab-pad { height: calc(96px + var(--bottom)); }
.foot-pad { height: 24px; }

/* ---------- tab bar ---------- */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; padding: 6px 8px calc(4px + var(--bottom));
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px); border-top: .5px solid var(--line); z-index: 5; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
.tabbar svg { width: 25px; height: 25px; }
.tabbar button.on { color: var(--accent); }

/* ---------- header ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px 14px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 32px; font-weight: 800; }
.logo { width: 36px; height: 36px; border-radius: 9px; }
.pro-chip { display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 14px; }
.pro-chip .ic { width: 16px; height: 16px; }
.pro-badge { font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 5px 9px; border-radius: 8px; background: var(--ink); color: var(--bg); }

/* ---------- hero ---------- */
.hero { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.scan-btn { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 22px; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent); position: relative; overflow: hidden; transition: transform .12s; }
.scan-btn::after { content: ""; position: absolute; right: -40px; top: -50px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.scan-btn:active { transform: scale(.98); }
.scan-ic { width: 54px; height: 54px; border-radius: 16px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; flex: none; }
.scan-ic .ic { width: 30px; height: 30px; }
.scan-txt { flex: 1; display: flex; flex-direction: column; }
.scan-txt b { font-size: 20px; font-family: var(--display); letter-spacing: -.01em; }
.scan-txt small { opacity: .9; font-size: 14px; }
.hero-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); font-size: 13.5px; font-weight: 600; color: var(--ink2); transition: transform .12s; }
.tile .ic { color: var(--accent); width: 24px; height: 24px; }
.tile:active { transform: scale(.97); }
.hint { font-size: 13.5px; color: var(--muted); padding: 2px 4px; }
.link { color: var(--accent-text); font-weight: 600; }

.section { font-size: 20px; font-weight: 800; margin: 22px 2px 10px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.bill-card { display: flex; gap: 12px; padding: 14px 16px; width: 100%; align-items: center; transition: transform .12s; }
.bill-card:active { transform: scale(.985); }
.bc-main { flex: 1; min-width: 0; }
.bc-title { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-sub { color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.faces { display: flex; margin-top: 8px; }
.faces .av { margin-right: -3px; box-shadow: 0 0 0 2px var(--card); }
.bc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.bc-total { font-weight: 800; font-size: 18px; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: var(--bg2); color: var(--ink2); white-space: nowrap; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }

.av { --c: var(--accent); width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; letter-spacing: -.02em; }
.av-sm { width: 26px; height: 26px; font-size: 10.5px; }
.av-xs { width: 22px; height: 22px; font-size: 9px; }
.av.more { background: var(--bg2); color: var(--ink2); }
.all-av { background: var(--ink); color: var(--bg); }
.all-av .ic { width: 15px; height: 15px; }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 26px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h3 { font-size: 21px; }
.empty p { color: var(--ink2); max-width: 330px; }
.empty .btn { margin-top: 6px; }
.art { width: 220px; height: 150px; }
.big-ic .ic { width: 56px; height: 56px; color: var(--accent); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 700; font-size: 16px; transition: transform .1s, background .15s; white-space: nowrap; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn .ic { width: 19px; height: 19px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.soft { background: var(--accent-soft); color: var(--accent-text); }
.btn.ghost { background: var(--bg2); color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ok { background: var(--ok-soft); color: var(--ok); }
.btn.small { min-height: 38px; padding: 0 13px; font-size: 14.5px; border-radius: 12px; }
.btn.tiny { min-height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: 10px; background: var(--card); color: var(--warn); }
.btn.wide { width: 100%; }
.btn.big { min-height: 54px; font-size: 17px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--ink2); }
.icon-btn.accent { background: var(--accent); color: #fff; }
.icon-btn.subtle { color: var(--muted); width: 34px; height: 34px; }
.icon-btn.subtle .ic { width: 18px; height: 18px; }

/* ---------- promo ---------- */
.promo { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.promo-art { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.promo-art .ic { width: 30px; height: 30px; }
.promo h3 { font-size: 22px; }
.promo p { color: var(--ink2); }
.ticks { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-direction: column; gap: 8px; }
.ticks li { display: flex; gap: 8px; align-items: flex-start; }
.ticks .ic { color: var(--ok); width: 20px; height: 20px; margin-top: 1px; }

/* ---------- settings ---------- */
.group-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 6px 8px; }
.group { overflow: hidden; }
.row-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; min-height: 52px; border-bottom: .5px solid var(--line2); }
.row-field:last-child { border-bottom: 0; }
.row-field > span { font-weight: 600; display: flex; flex-direction: column; gap: 1px; }
.row-field > span small { font-weight: 400; font-size: 13px; }
.row-field input:not([type=checkbox]), .row-field select { border: 0; background: transparent; text-align: right; outline: none; min-width: 0; flex: 1; color: var(--ink2); padding: 6px 0; }
.row-field select { flex: none; appearance: none; -webkit-appearance: none; color: var(--accent-text); font-weight: 600; }
.row-field.col { flex-direction: column; align-items: stretch; }
.pre-wrap { display: flex; align-items: center; width: 58%; flex: none; color: var(--muted); }
.pre-wrap i { font-style: normal; }
.row-field .pre-wrap input { text-align: left; padding-left: 2px; }
.switch { cursor: pointer; }
.switch input, .mini-switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i, .mini-switch i { width: 51px; height: 31px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch i::after, .mini-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + i, .mini-switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after, .mini-switch input:checked + i::after { transform: translateX(20px); }
.mini-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink2); margin-top: 10px; cursor: pointer; }
.mini-switch i { width: 38px; height: 23px; }
.mini-switch i::after { width: 19px; height: 19px; }
.mini-switch input:checked + i::after { transform: translateX(15px); }
.row-link { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 16px; min-height: 52px; border-bottom: .5px solid var(--line2); color: var(--ink); text-decoration: none; font-weight: 600; }
.row-link:last-child { border-bottom: 0; }
.row-link span { display: flex; align-items: center; gap: 10px; }
.row-link .ic { width: 19px; height: 19px; color: var(--muted); }
.row-link span .ic { color: var(--accent); }
.row-link.danger, .row-link.danger span .ic { color: var(--bad); }
.foot-note { font-size: 13px; color: var(--muted); margin: 8px 6px 0; }
.lead { font-size: 17px; font-weight: 700; margin: 6px 4px 12px; }

.seg { display: flex; background: var(--bg2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { flex: 1; padding: 7px 8px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink2); text-align: center; white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.small button { padding: 6px 7px; font-size: 13px; }
.seg.tiny { flex: none; }
.seg.tiny button { padding: 5px 10px; font-size: 13px; }
.seg.tips { margin-top: 8px; }

/* ---------- pages ---------- */
#stack .page { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; z-index: 10; transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s; box-shadow: -10px 0 30px rgba(0, 0, 0, .08); }
#stack .page.entering { transform: translateX(100%); }
#stack .page.leaving { transform: translateX(100%); transition-duration: .22s; }
.nav { display: flex; align-items: center; gap: 4px; padding: calc(var(--top) + 6px) 8px 6px; min-height: calc(var(--top) + 56px); }
.nav-back { display: flex; align-items: center; color: var(--accent-text); font-weight: 600; padding: 8px 4px; max-width: 34%; flex: none; }
.nav-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-back .ic { width: 26px; height: 26px; }
.nav-title { flex: 1; text-align: center; font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 8px 4px; font-family: var(--display); }
.page-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 16px 0; }
.page-foot { padding: 10px 16px calc(10px + var(--bottom)); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-top: .5px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.page-foot.two { flex-direction: row; }
.page-foot.two .btn { flex: 1; }

.steps { display: flex; gap: 4px; padding: 0 12px 10px; }
.steps button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 2px; font-size: 13.5px; font-weight: 700; color: var(--muted); border-radius: 12px; position: relative; }
.steps button i { font-style: normal; width: 21px; height: 21px; border-radius: 50%; background: var(--bg2); display: grid; place-items: center; font-size: 11.5px; }
.steps button i .ic { width: 13px; height: 13px; }
.steps button.done i { background: var(--ok-soft); color: var(--ok); }
.steps button.on { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.steps button.on i { background: var(--accent); color: #fff; }
.steps em { position: absolute; top: 1px; right: 4px; font-style: normal; min-width: 17px; height: 17px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 10.5px; display: grid; place-items: center; padding: 0 4px; }

/* ---------- items ---------- */
.receipt-strip { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; margin-bottom: 12px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.receipt-strip img { width: 44px; height: 56px; object-fit: cover; object-position: top; border-radius: 8px; background: var(--bg2); }
.receipt-strip span { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent-text); font-size: 14.5px; margin-left: 4px; }
.receipt-strip .ic { width: 18px; height: 18px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; font-size: 14.5px; width: 100%; flex-wrap: wrap; }
.banner > span { flex: 1; min-width: 190px; }
.banner .ic { width: 20px; height: 20px; flex: none; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.tip-banner { background: var(--accent-soft); color: var(--accent-text); text-align: left; flex-wrap: nowrap; margin-top: 14px; }
.banner.tip-banner span { color: var(--ink2); }
.banner.tip-banner b { color: var(--accent-text); }
.list-card { overflow: hidden; }
.list-empty { padding: 18px 16px; color: var(--muted); text-align: center; font-size: 14.5px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.list-empty .ic { width: 18px; height: 18px; }
.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; min-height: 54px; border-bottom: .5px solid var(--line2); position: relative; transition: background .15s; }
.item:last-child { border-bottom: 0; }
.item:active { background: var(--bg2); }
.qty { font-weight: 800; color: var(--accent-text); font-size: 14px; flex: none; min-width: 26px; }
.iname { flex: 1; min-width: 0; font-weight: 600; display: flex; flex-direction: column; overflow: hidden; }
.iname small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.iprice { font-weight: 700; flex: none; }
.iprice.neg { color: var(--ok); }
.item.static:active { background: none; }
.add-item, .add-person { display: flex; gap: 8px; padding: 8px; margin-top: 10px; align-items: center; }
.add-person.inline { padding: 0; margin: 0; }
.field { width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 13px; outline: none; font-size: 16px; min-width: 0; transition: border-color .15s; }
.field:focus { border-color: var(--accent); }
.add-item .field, .add-person .field { border-color: transparent; background: var(--bg2); }
.add-item .field:focus, .add-person .field:focus { border-color: var(--accent); background: var(--card); }
.field.price { width: 104px; flex: none; text-align: right; }
.sum-row { display: flex; justify-content: space-between; padding: 16px 6px 4px; font-size: 17px; }
.sum-row b { font-weight: 800; }

/* ---------- people ---------- */
.person-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-bottom: .5px solid var(--line2); }
.person-row:last-child { border-bottom: 0; }
.pname { flex: 1; font-weight: 600; font-size: 16.5px; padding: 6px 0; }
.pname small { color: var(--muted); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { --c: var(--accent); display: inline-flex; align-items: center; gap: 5px; padding: 8px 13px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); font-weight: 600; font-size: 14.5px; color: var(--ink2); }
.chip .ic { width: 16px; height: 16px; }
.chip.add .ic { color: var(--accent); }
.chip.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.chip.on { background: var(--c); color: #fff; box-shadow: none; }
.chip.static { background: color-mix(in srgb, var(--c) 16%, var(--card)); color: var(--ink); box-shadow: none; }
.chip-x { display: inline-grid; place-items: center; margin-left: 2px; color: var(--muted); }
.chip-x .ic { width: 14px; height: 14px; }

/* ---------- split ---------- */
.paint-bar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; position: sticky; top: -6px; z-index: 2; background: linear-gradient(var(--bg) 82%, transparent); }
.paint-bar::-webkit-scrollbar { display: none; }
.pchip { --c: var(--accent); display: flex; align-items: center; gap: 8px; padding: 7px 13px 7px 7px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); flex: none; transition: transform .12s; border: 2px solid transparent; }
.pchip span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.pchip b { font-size: 14.5px; }
.pchip small { font-size: 12px; color: var(--muted); }
.pchip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--card)); transform: translateY(-1px); }
.pchip:active { transform: scale(.96); }
.split-item { padding-left: 18px; }
.split-item::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); transform: scaleY(0); transition: transform .15s; }
.split-item.mine { background: color-mix(in srgb, var(--c) 9%, var(--card)); }
.split-item.mine::before { transform: scaleY(1); }
.split-item .faces { margin: 0 6px 0 0; }
.split-item .faces .av { margin-right: -5px; }
.unassigned { width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--warn); color: var(--warn); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.split-item.open .iname { color: var(--ink); }
.foot-split { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.foot-split .btn { min-height: 38px; font-size: 14.5px; padding: 0 12px; }
.ok-line { color: var(--ok); justify-content: center; font-weight: 700; gap: 6px; }

/* ---------- pay ---------- */
.extras .row-field:not(.switch) > span { flex-direction: row; align-items: baseline; gap: 8px; }
.extras .switch > span { flex: 1; }
.money-in { display: flex; align-items: center; gap: 8px; }
.money-in .field { width: 110px; text-align: right; padding: 9px 12px; }
.row-field.col .money-in { margin-top: 10px; justify-content: flex-end; }
.add-extras { gap: 8px; justify-content: flex-start; }
.add-extras .chip { margin: 0; }
.totals { padding: 14px 16px; margin-top: 14px; }
.tl { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink2); }
.tl.grand { color: var(--ink); font-weight: 800; font-size: 20px; padding-top: 10px; margin-top: 6px; border-top: 1.5px dashed var(--line); font-family: var(--display); }
.check { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13.5px; font-weight: 600; padding: 8px 10px; border-radius: 10px; flex-wrap: wrap; }
.check .ic { width: 17px; height: 17px; }
.check.ok { background: var(--ok-soft); color: var(--ok); }
.check.warn { background: var(--warn-soft); color: var(--warn); }
.payer-chips { margin-top: 0; }
.payer-chips .chip.on .ic { width: 15px; height: 15px; }
.pcards { display: flex; flex-direction: column; gap: 10px; }
.pcard { --c: var(--accent); background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; border-left: 5px solid var(--c); }
.pcard.paid { opacity: .72; }
.pc-top { display: flex; align-items: center; gap: 12px; }
.pc-name { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pc-name b { font-size: 17px; }
.pc-name small { color: var(--muted); font-size: 13px; }
.pcard.paid .pc-name small { color: var(--ok); font-weight: 600; }
.pc-amt { font-size: 24px; font-weight: 800; font-family: var(--display); letter-spacing: -.02em; }
.pc-what { margin-top: 8px; font-size: 13.5px; color: var(--ink2); line-height: 1.45; }
.pc-actions { display: flex; gap: 8px; margin-top: 12px; }
.pc-actions .btn:first-child { flex: 1; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.share-row .btn { padding: 0 10px; font-size: 14.5px; }

/* ---------- trips ---------- */
.trip-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trip-hero > div { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; }
.trip-hero > div:first-child { background: var(--accent); color: #fff; }
.trip-hero small { font-size: 13px; opacity: .85; font-weight: 600; }
.trip-hero b { font-size: 24px; font-family: var(--display); letter-spacing: -.02em; }
.bal-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: .5px solid var(--line2); }
.bal-row:last-child { border-bottom: 0; }
.bname { flex: 1; font-weight: 600; }
.bname small { color: var(--muted); font-weight: 500; }
.pos { color: var(--ok); font-weight: 700; }
.neg { color: var(--bad); font-weight: 700; }
.settle-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 13px 16px; border-bottom: .5px solid var(--line2); align-items: center; }
.settle-row:last-child { border-bottom: 0; }
.sr-who { display: flex; align-items: center; gap: 10px; }
.sr-amt { font-weight: 800; font-size: 18px; }
.sr-act { grid-column: 1 / -1; display: flex; gap: 8px; }
.sr-act .btn:first-child { flex: 1; }
.settle-row + .btn, .list-card + .btn { margin-top: 10px; }
.item.exp .iname small { margin-top: 1px; }

/* ---------- sheets ---------- */
#sheets { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.sheet-wrap { position: fixed; inset: 0; pointer-events: auto; }
.sheet-back { position: absolute; inset: 0; background: rgba(10, 8, 5, .38); opacity: 0; transition: opacity .25s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--top) - 24px); display: flex; flex-direction: column; background: var(--bg); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .9, .25, 1); padding-bottom: var(--bottom); max-width: 640px; margin: 0 auto; }
.sheet.tall { height: calc(100% - var(--top) - 24px); }
.sheet-wrap.open .sheet-back { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 6px 20px; gap: 8px; }
.sheet-head h2 { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { overflow-y: auto; padding: 6px 20px 14px; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 10px; padding: 10px 20px 14px; flex-wrap: wrap; }
.sheet-foot .btn { flex: 1; }
.sheet-body > p.muted { margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stepper { display: flex; align-items: center; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.stepper button { width: 42px; height: 44px; display: grid; place-items: center; color: var(--accent-text); flex: none; }
.stepper button .ic { width: 18px; height: 18px; }
.stepper .field { border: 0; text-align: center; padding: 10px 0; border-radius: 0; }
.stepper b { min-width: 34px; text-align: center; font-size: 17px; color: var(--ink); }
.stepper.small button { width: 36px; height: 36px; }
.stepper.small b { min-width: 22px; font-size: 15px; }
.row-field .stepper { border: 0; background: var(--bg2); }
.share-line { --c: var(--accent); display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; border-bottom: .5px solid var(--line2); }
.share-line:last-child { border-bottom: 0; }
.share-line.on { background: color-mix(in srgb, var(--c) 10%, var(--card)); }
.sl-who { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 600; padding: 4px 0; min-width: 0; }
.sl-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-line:not(.on) .av { filter: grayscale(1); opacity: .45; }
.sl-amt { color: var(--ink2); font-size: 14px; font-weight: 600; }
.menu { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r); overflow: hidden; }
.menu button { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: .5px solid var(--line2); font-weight: 600; }
.menu button:last-child { border-bottom: 0; }
.menu .ic { width: 20px; height: 20px; color: var(--accent); }
.menu .danger-txt .ic { color: var(--bad); }
.cur-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cur-grid .chip { justify-content: center; }
.viewer .sheet-body { padding: 0 0 10px; display: flex; flex-direction: column; }
.zoom { flex: 1; overflow: auto; touch-action: pan-x pan-y pinch-zoom; background: var(--bg2); }
.zoom img { width: 100%; display: block; }
.raw summary { cursor: pointer; color: var(--accent-text); font-weight: 600; margin: 8px 0; }
.raw pre { font: 12px/1.4 var(--mono); white-space: pre-wrap; background: var(--bg2); padding: 10px; border-radius: 10px; max-height: 240px; overflow: auto; }

/* ---------- quick split ---------- */
.quick { display: flex; flex-direction: column; gap: 4px; }
.quick .row-field { background: var(--card); border-radius: 14px; margin-top: 10px; border: 0; }
.big-money { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 18px; padding: 6px 18px; box-shadow: var(--shadow); }
.big-money i { font-style: normal; font-size: 30px; font-weight: 700; color: var(--muted); }
.big-money .field { border: 0; font-size: 38px; font-weight: 800; padding: 8px 0; background: transparent; font-family: var(--display); letter-spacing: -.02em; }
.quick-out { text-align: center; padding: 18px 8px 4px; }
.qo-each small { display: block; color: var(--muted); font-weight: 600; }
.qo-each b { font-size: 46px; font-family: var(--display); font-weight: 800; letter-spacing: -.03em; color: var(--accent-text); }
.qo-meta { color: var(--ink2); font-size: 14px; }

/* ---------- paywall ---------- */
.paywall .sheet-body { padding-top: 0; }
.pw-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 14px; }
.pw-logo .logo { width: 72px; height: 72px; border-radius: 17px; box-shadow: var(--shadow); }
.pw-head h2 { font-size: 24px; font-weight: 800; }
.pw-head p { color: var(--ink2); }
.pw-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.pw-list li { display: flex; gap: 12px; align-items: flex-start; }
.pw-list .ic { width: 26px; height: 26px; color: var(--accent); flex: none; margin-top: 1px; }
.pw-list div { display: flex; flex-direction: column; }
.pw-list small { color: var(--muted); font-size: 13.5px; }
.pw-price { text-align: center; margin-top: 16px; font-size: 15px; }
.pw-price b { font-size: 26px; font-family: var(--display); }
.pw-links { width: 100%; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- busy, toast, confetti ---------- */
#busy { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(10, 8, 5, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
#busy.show { opacity: 1; pointer-events: auto; }
.busy-card { background: var(--bg); border-radius: 22px; padding: 22px 26px; width: min(300px, 80vw); text-align: center; box-shadow: var(--shadow-lg); }
.scanline { width: 70px; height: 86px; margin: 0 auto 14px; border-radius: 8px; background: var(--paper); border: 2px solid var(--line); position: relative; overflow: hidden; }
.scanline::before { content: ""; position: absolute; left: 12px; right: 12px; top: 14px; height: 50px; background: repeating-linear-gradient(var(--line) 0 5px, transparent 5px 12px); }
.scanline i { position: absolute; left: 0; right: 0; height: 3px; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: scan 1.4s ease-in-out infinite alternate; }
@keyframes scan { from { top: 6px; } to { top: 78px; } }
#busy-msg { font-weight: 700; }
.busy-track { height: 4px; border-radius: 2px; background: var(--bg2); margin-top: 12px; overflow: hidden; }
#busy-bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: 14.5px; opacity: 0; transition: opacity .2s, transform .2s; z-index: 50; pointer-events: none; max-width: calc(100% - 40px); text-align: center; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
#confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; opacity: 0; }
#confetti.go i { animation: fall 2.2s cubic-bezier(.3, .6, .5, 1) forwards; }
@keyframes fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(105vh) rotate(720deg); } }

@media (min-width: 700px) {
  #tabview, .page-body { padding-left: max(16px, calc(50% - 320px)); padding-right: max(16px, calc(50% - 320px)); }
  .page-foot { padding-left: max(16px, calc(50% - 320px)); padding-right: max(16px, calc(50% - 320px)); }
  .steps { max-width: 660px; margin: 0 auto; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
