/* Frosties: big buttons for busy hands. One column on a phone.
   One theme on purpose: black, with the ice blue and neon pink of the logo. */
:root {
  color-scheme: dark;
  --bg: #000000; --surface: #11151b; --sheet: #080a0d; --ink: #f3f7fb; --muted: #9eabb8; --line: #252c36;
  --bar: #000000; --bar-ink: #f3f7fb; --lead: #131a24; --ice: #9fdcff;
  --accent: #ff62a8; --accent-ink: #1b0410; --accent-soft: #3a1228;
  --good: #63d391; --good-soft: #10301d; --warn: #f3c661; --warn-soft: #33280b; --bad: #ff8080; --bad-soft: #3f1518;
  --t1: #40142b; --t2: #0d3441; --t3: #2c2052; --t4: #13294f; --t5: #0f3a34; --t6: #3b1743;
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 14px;
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.4 var(--body); -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

#app { height: 100%; }
.shell { height: 100%; display: flex; flex-direction: column; }
.top { background: var(--bar); color: var(--bar-ink); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 56px; flex: none; }
.top h1 { font: 700 22px/1.1 var(--display); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.top .icon-btn { background: transparent; border: 0; color: inherit; min-width: 44px; height: 44px; border-radius: 12px; font-size: 26px; line-height: 1; padding: 0 8px; }
.top .who { background: rgba(255, 255, 255, .14); border: 0; color: inherit; border-radius: 999px; padding: 8px 14px; font-weight: 700; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .top-act { background: rgba(255, 255, 255, .14); border: 0; color: inherit; border-radius: 12px; padding: 8px 12px; font-weight: 700; white-space: nowrap; }
.main { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.wrap.wide { max-width: 1100px; }
.dock { flex: none; background: var(--sheet); border-top: 1px solid var(--line); }
.dock-in { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 10px; align-items: stretch; }
.nav { max-width: 760px; margin: 0 auto; display: flex; }
.nav button { flex: 1; background: transparent; border: 0; padding: 12px 4px 14px; font-weight: 700; color: var(--muted); border-top: 3px solid transparent; }
.nav button[aria-current="page"] { color: var(--accent); border-top-color: var(--accent); }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px 16px; font-weight: 700; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big { min-height: 64px; font: 700 22px/1.1 var(--display); width: 100%; }
.btn.block { width: 100%; }
.btn.grow { flex: 1; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); text-decoration: underline; min-height: 40px; padding: 6px 8px; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
body.busy .btn.primary { opacity: .6; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card.pad { padding: 14px; }
.section-title { font: 700 18px/1.2 var(--display); color: var(--muted); }
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; background: transparent; border: 0; text-align: left; min-height: 56px; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 700; overflow-wrap: anywhere; }
.row .sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.row .amt { font: 700 18px/1 var(--display); }
.row.off .title { color: var(--muted); text-decoration: line-through; }
.row .chev { color: var(--muted); font-size: 22px; }
.empty { color: var(--muted); padding: 18px 14px; text-align: center; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; background: var(--line); color: var(--ink); white-space: nowrap; }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.banner { border-radius: var(--r); padding: 12px 14px; font-weight: 700; background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
.banner.note { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); font-weight: 600; }
.hint { color: var(--muted); font-size: 14px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 10px 16px; font-weight: 700; min-height: 44px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile { position: relative; overflow: hidden; border: 0; border-radius: var(--r); min-height: 104px; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left; background: var(--t6); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.tile:active { transform: translateY(2px); filter: brightness(1.35); }
.tile .name { font: 700 20px/1.1 var(--display); overflow-wrap: anywhere; }
.tile .price { font-weight: 700; font-size: 14px; color: var(--ice); }
.tile.c1 { background: var(--t1); } .tile.c2 { background: var(--t2); } .tile.c3 { background: var(--t3); }
.tile.c4 { background: var(--t4); } .tile.c5 { background: var(--t5); } .tile.c6 { background: var(--t6); }
.tile.other { background: var(--surface); border: 2px dashed var(--muted); box-shadow: none; }
.tile.other .price { color: var(--muted); }
.tile.has-pic { min-height: 148px; justify-content: flex-end; gap: 2px; }
.tile .pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile.has-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .9) 90%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); border-radius: inherit; }
.tile.has-pic .name, .tile.has-pic .price { position: relative; z-index: 1; text-shadow: 0 1px 4px #000; }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface); }
.thumb.none { border: 1px dashed var(--line); }
.photo { width: 100%; max-width: 320px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); display: block; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-weight: 700; }
.input { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; min-height: 48px; width: 100%; font-size: 17px; }
.input.money-in { font: 700 24px/1 var(--display); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { flex: 1 1 0; min-width: 96px; border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 8px; font-weight: 700; min-height: 52px; }
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg.tall button { min-height: 72px; font: 700 20px/1.1 var(--display); }
.seg.tabs { flex-wrap: nowrap; gap: 6px; }
.seg.tabs button { min-width: 0; padding: 10px 2px; font-size: 15px; }
.pair { display: flex; gap: 10px; align-items: flex-end; }
.pair > * { flex: 1; min-width: 0; }
.pair > .fixed { flex: none; }
.check { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; font-weight: 700; color: transparent; }
.row[aria-pressed="true"] .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); font-size: 26px; font-weight: 700; line-height: 1; }
.stepper .n { font: 700 28px/1 var(--display); min-width: 36px; text-align: center; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat .k { color: var(--muted); font-size: 14px; font-weight: 700; }
.stat .v { font: 700 26px/1.1 var(--display); }
.stat.lead { grid-column: 1 / -1; background: var(--lead); color: var(--bar-ink); border-color: var(--ice); }
.stat.lead .k { color: inherit; opacity: .75; }
.stat.lead .v { font-size: 36px; color: var(--ice); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; align-items: baseline; }
.kv .k { overflow-wrap: anywhere; }
.kv .v { font-weight: 700; }
.kv.total { font: 700 20px/1.2 var(--display); border-top: 2px solid var(--ink) !important; }
.kv.sub .k { padding-left: 14px; color: var(--muted); }
.kv.neg .v { color: var(--bad); }
.kv.head { font-weight: 700; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; padding-bottom: 4px; }

.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { background: var(--sheet); border: 1px solid var(--line); border-bottom: 0; width: 100%; max-width: 760px; max-height: 92%; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 18px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { font: 700 24px/1.1 var(--display); }
#toast { position: fixed; left: 0; right: 0; top: 6px; display: flex; justify-content: center; pointer-events: none; z-index: 30; padding: 0 16px; }
.toast { background: var(--ink); color: var(--bg); border-radius: 12px; padding: 12px 16px; font-weight: 700; max-width: 520px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.toast.bad { background: var(--bad); color: #14060a; }
.toast.good { background: var(--good); color: #04140b; }

.splash, .login { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 28px 16px; gap: 18px; }
.splash { justify-content: center; color: var(--muted); }
.brand { font: 700 52px/1 var(--display); color: var(--accent); letter-spacing: -.01em; }
.logo { width: min(62vw, 250px); height: auto; aspect-ratio: 1; border-radius: 50%; display: block; }
.bill-face .logo { width: 132px; margin: 0 auto 6px; }
.brand-sub { color: var(--muted); font-weight: 700; margin-top: -8px; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; }
.login .panel { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.names { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.names button { min-height: 68px; font: 700 20px/1.1 var(--display); }
.dots { display: flex; gap: 14px; justify-content: center; padding: 6px 0; }
.dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); }
.dots span.on { background: var(--ink); border-color: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { min-height: 64px; font: 700 26px/1 var(--display); border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.keypad .blank { visibility: hidden; }

.bill-face { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 16px; }
.bill-face .shop { font: 700 34px/1 var(--display); color: var(--accent); text-align: center; }
.bill-face .for { text-align: center; color: var(--muted); margin: 4px 0 14px; font-weight: 700; }
.bill-face .kv { padding: 8px 0; font-size: 18px; }
.bill-face .kv + .kv { border-top: 1px dashed var(--line); }
.bill-face .due { font: 700 30px/1.1 var(--display); border-top: 2px solid var(--ink) !important; padding-top: 12px; }
.paid-mark { font: 700 44px/1 var(--display); color: var(--good); text-align: center; }
.bar-total { display: flex; flex-direction: column; justify-content: center; flex: 1; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 6px 14px; min-height: 56px; }
.bar-total .n { font-size: 13px; color: var(--muted); font-weight: 700; }
.bar-total .t { font: 700 22px/1.1 var(--display); }
.dock .btn.primary { min-width: 38%; font: 700 20px/1 var(--display); }
details > summary { cursor: pointer; font: 700 18px/1.2 var(--display); color: var(--muted); padding: 4px 0; }
