:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1c1d1a;
  --muted: #6b6d66;
  --line: rgb(28 29 26 / 0.12);
  --accent: #c8521f;       /* shuttle orange: the one accent */
  --accent-text: #ffffff;
  --ok: #3f7a52;
  --r: 14px;
  --tab-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141513;
    --surface: #1d1e1b;
    --text: #efede6;
    --muted: #9b9d95;
    --line: rgb(239 237 230 / 0.14);
    --accent: #e0693a;
    --accent-text: #141513;
    --ok: #6fb487;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px);
}
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
h1 { font-size: 20px; margin: 0; font-weight: 650; }
h2 { font-size: 18px; margin: 0 0 12px; }
.chip { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 3px 9px; border-radius: 99px; }
main { padding: 12px 16px; max-width: 560px; margin: 0 auto; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sub { font-size: 14px; color: var(--muted); }

/* summary */
.summary { margin: 4px 0 14px; }
.summary .big { font-size: 34px; font-weight: 650; letter-spacing: 0; }
.summary .sub { margin-top: 2px; }

/* list rows */
.list { background: var(--surface); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; }
.item + .item { border-top: 1px solid var(--line); }
.item .grow { flex: 1; min-width: 0; }
.item .name { font-weight: 550; }
.item .amt { font-weight: 650; }
.item.tap { cursor: pointer; width: 100%; background: none; border: 0; text-align: left; color: inherit; font: inherit; }
.item.tap:active { background: var(--line); }

.box { width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--line); flex: none;
  display: grid; place-items: center; transition: background-color 120ms ease-out, box-shadow 120ms ease-out; }
.on-row .box { background: var(--accent); box-shadow: none; }
.box svg { width: 16px; height: 16px; stroke: var(--accent-text); stroke-width: 3; fill: none; opacity: 0; transition: opacity 120ms ease-out; }
.on-row .box svg { opacity: 1; }

/* buttons */
button { font: inherit; }
.primary, .ghost, .small {
  min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0; cursor: pointer; font-weight: 600;
}
.primary { background: var(--accent); color: var(--accent-text); }
.primary:active { transform: translateY(1px); }
.primary[disabled] { opacity: 0.4; cursor: not-allowed; }
.ghost { background: none; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.small { min-height: 40px; padding: 0 14px; font-size: 15px; }
.actions { display: flex; gap: 8px; flex: none; }

/* sticky save bar on register */
.savebar { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding: 10px 16px; background: var(--bg); border-top: 1px solid var(--line); }
.savebar .primary { width: 100%; max-width: 528px; display: block; margin: 0 auto; min-height: 50px; }
body.has-savebar { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 84px); }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); z-index: 6; }
.tabs button { background: none; border: 0; color: var(--muted); font-weight: 600; font-size: 15px; position: relative; cursor: pointer; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.badge { margin-left: 6px; background: var(--accent); color: var(--accent-text); font-size: 12px; padding: 1px 7px; border-radius: 99px; }

/* section labels */
.label { font-size: 13px; color: var(--muted); margin: 18px 4px 8px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }

/* dialogs */
dialog { border: 0; border-radius: 18px; padding: 20px; width: min(92vw, 420px); background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), 0 20px 50px rgb(0 0 0 / 0.3); }
dialog::backdrop { background: rgb(0 0 0 / 0.4); }
label { display: block; font-size: 14px; margin: 14px 0 6px; color: var(--muted); }
label.check { display: flex; gap: 10px; align-items: center; color: var(--text); min-height: 44px; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
input, select { width: 100%; min-height: 46px; padding: 0 12px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.fee { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.fee input { width: 100px; text-align: right; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 90px); transform: translate(-50%, 8px);
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 15px; max-width: 90vw;
  opacity: 0; pointer-events: none; transition: opacity 180ms ease-out, transform 180ms ease-out; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.reset { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; margin: 22px auto 0; display: block; min-height: 44px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.rowmain { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 56px; padding: 0; background: none; border: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.method { flex: none; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; }
.method.cash { background: var(--accent); color: var(--accent-text); border-color: transparent; }
