
:root { --bg:#e8ecf1; --surface:#f3f5f8; --sunk:#dfe4ea; --line:#d5dae1; --text:#1f252d; --sub:#566070; --accent:#1877c9; --on:#fff;
  --ok:#12804a; --warn:#9a6a00; --bad:#c8253a;
  --up: 5px 5px 12px rgba(160,170,185,.6), -5px -5px 12px #fff; --down: inset 3px 3px 7px rgba(160,170,185,.6), inset -3px -3px 7px #fff; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }
h1 { font-size: 30px; line-height: 1.15; margin: 4px 0 6px; font-weight: 800; overflow-wrap: anywhere; }
h2 { font-size: 21px; margin: 0 0 10px; font-weight: 800; }
p { margin: 8px 0; }
.sub { color: var(--sub); }
.block { display: block; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.card { background: var(--surface); border-radius: 22px; padding: 18px; margin: 18px 0; box-shadow: var(--up); }
.line { display: flex; align-items: center; gap: 10px; }
.line + .line { margin-top: 10px; }
.wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; box-shadow: var(--up); transition: box-shadow .12s; }
.btn:active { box-shadow: var(--down); }
.btn.primary { background: var(--accent); color: var(--on); box-shadow: 4px 6px 14px rgba(24,119,201,.35), -5px -5px 12px #fff; }
.btn.primary:active { box-shadow: inset 3px 3px 8px rgba(0,0,0,.25); }
.btn.wide { display: flex; width: 100%; }
.btn.small { min-height: 46px; padding: 0 16px; font-size: 17px; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn { flex: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--surface); color: var(--sub); cursor: pointer; box-shadow: var(--up);
  display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:active { box-shadow: var(--down); }
.icon-btn[disabled] { opacity: .4; }
.ic { display: inline-flex; flex: none; }
input, textarea { width: 100%; min-height: 54px; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--sunk); color: var(--text); font: inherit; box-shadow: var(--down); }
textarea { resize: vertical; }
input[type=checkbox] { flex: none; width: 30px; height: 30px; min-height: 0; padding: 0; box-shadow: none; accent-color: var(--accent); }
input[type=file] { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; overflow: hidden; }
:focus-visible, label.btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.field { display: block; flex: 1; min-width: 0; margin-top: 12px; }
.field > span { display: block; margin-bottom: 4px; color: var(--sub); font-size: 16px; font-weight: 600; }
.tabs, .seg { display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--sunk); box-shadow: var(--down); margin: 14px 0 4px; }
.tabs button, .seg button { flex: 1; min-height: 48px; border: 0; border-radius: 999px; background: none; color: var(--sub); font: inherit; font-weight: 700; cursor: pointer; }
.tabs button.on, .seg button.on { background: var(--surface); color: var(--accent); box-shadow: 2px 3px 8px rgba(160,170,185,.6); }
.dish, .person, .rowbtn { padding: 14px 0; border-top: 2px solid var(--line); }
h2 + .dish, h2 + .person, h2 + .rowbtn, p + .dish { border-top: 0; padding-top: 4px; }
label.dish { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.dish.on strong:first-child { color: var(--accent); }
.rowbtn { display: flex; align-items: center; gap: 10px; width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper strong { min-width: 28px; text-align: center; font-size: 22px; }
.sumrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.sumrow.total { margin-top: 8px; padding-top: 14px; border-top: 2px solid var(--line); font-size: 24px; font-weight: 800; }
.stats { display: flex; gap: 8px; margin: 14px 0 0; }
.stats div { flex: 1; min-width: 0; }
.stats span { display: block; color: var(--sub); font-size: 15px; font-weight: 600; }
.stats strong { font-size: 22px; overflow-wrap: anywhere; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 16px; font-weight: 700; background: var(--sunk); color: var(--sub); }
.chip.owe { background: #f6e9c8; color: #6f4c00; }
.chip.say { background: #d6e8f8; color: #0f5796; }
.chip.ok { background: #d3eddf; color: #0c6238; }
.paid { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; font-weight: 700; cursor: pointer; }
.warn { color: var(--warn); font-weight: 600; }
.good { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; }
.banner { padding: 14px 18px; border-radius: 16px; background: var(--sunk); font-weight: 700; }
.qr { display: block; width: 232px; height: 232px; margin: 16px auto 4px; border-radius: 12px; background: #fff; }
.link { font-size: 16px; }
.bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; margin: 0 -16px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 2px solid var(--line); font-size: 22px; font-weight: 800; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 24px; z-index: 9; max-width: 528px; margin: 0 auto; padding: 14px 18px; border-radius: 16px; background: var(--text); color: #fff; font-weight: 600; text-align: center; }
details summary { min-height: 46px; padding: 10px 0; color: var(--accent); font-weight: 700; cursor: pointer; }
