/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --blue:       #007AFF;
  --blue-dark:  #0055D4;
  --green:      #34C759;
  --red:        #FF3B30;
  --orange:     #FF9500;
  --yellow-bg:  rgba(255,204,0,.15);
  --yellow-bd:  rgba(200,155,0,.45);

  --bg:         #F2F2F7;
  --card:       #FFFFFF;
  --fill:       #F2F2F7;
  --fill2:      #E5E5EA;

  --t1:         #1C1C1E;
  --t2:         #636366;
  --t3:         #AEAEB2;
  --sep:        #E5E5EA;

  --r-xl:  22px;
  --r-lg:  16px;
  --r-md:  12px;
  --r-sm:   8px;

  --font: -apple-system, "SF Pro Display", BlinkMacSystemFont,
          "Helvetica Neue", Arial, sans-serif;
  --font-rounded: -apple-system, "SF Pro Rounded", BlinkMacSystemFont, sans-serif;
}

/* ── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* ── App shell ────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* ── Chrome (top nav) ─────────────────────────────────────────────────── */
#chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 8px;
  min-height: 50px;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--blue);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.12s;
}
.btn-back:active { opacity: 0.45; }

#prog-track {
  flex: 1;
  height: 3px;
  background: var(--fill2);
  border-radius: 2px;
  overflow: hidden;
}
#prog-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  width: 0%;
  transition: width 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}

#step-label {
  font-size: 13px;
  color: var(--t3);
  font-weight: 500;
  flex-shrink: 0;
}

/* ── Screen root ──────────────────────────────────────────────────────── */
#screen-root {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ── Screen ───────────────────────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  padding: 4px 18px 36px;
  will-change: transform, opacity;
}

/* ── Page transitions ─────────────────────────────────────────────────── */
.screen.t-in-right  { animation: inFromRight  0.34s cubic-bezier(0.25,0.46,0.45,0.94) both; }
.screen.t-in-left   { animation: inFromLeft   0.34s cubic-bezier(0.25,0.46,0.45,0.94) both; }
.screen.t-out-left  { animation: outToLeft    0.28s cubic-bezier(0.25,0.46,0.45,0.94) both; }
.screen.t-out-right { animation: outToRight   0.28s cubic-bezier(0.25,0.46,0.45,0.94) both; }

@keyframes inFromRight  { from{transform:translateX(52px);opacity:0} to{transform:none;opacity:1} }
@keyframes inFromLeft   { from{transform:translateX(-52px);opacity:0} to{transform:none;opacity:1} }
@keyframes outToLeft    { from{transform:none;opacity:1} to{transform:translateX(-24px);opacity:0} }
@keyframes outToRight   { from{transform:none;opacity:1} to{transform:translateX(52px);opacity:0} }

/* ── Stagger fade-up for children ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:none; }
}
.stagger > * {
  animation: fadeUp 0.38s cubic-bezier(0.34,1.1,0.64,1) both;
}
.stagger > *:nth-child(1){ animation-delay:.05s }
.stagger > *:nth-child(2){ animation-delay:.10s }
.stagger > *:nth-child(3){ animation-delay:.15s }
.stagger > *:nth-child(4){ animation-delay:.20s }
.stagger > *:nth-child(5){ animation-delay:.25s }
.stagger > *:nth-child(6){ animation-delay:.30s }
.stagger > *:nth-child(7){ animation-delay:.35s }

/* ── Screen title ─────────────────────────────────────────────────────── */
.screen-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.12;
  color: var(--t1);
  margin: 10px 0 4px;
}
.screen-sub {
  font-size: 15px;
  color: var(--t2);
  line-height: 1.45;
  margin-bottom: 24px;
}

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 16px 18px;
  margin-bottom: 10px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--t3);
  margin-bottom: 8px;
}

/* ── Inputs ───────────────────────────────────────────────────────────── */
input, select, button { font-family: var(--font); }
input, select { -webkit-appearance: none; appearance: none; }

.input-field {
  width: 100%;
  background: var(--fill);
  border: none;
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 17px;
  color: var(--t1);
  outline: none;
  transition: box-shadow .15s;
}
.input-field::placeholder { color: var(--t3); }
.input-field:focus { box-shadow: 0 0 0 3px rgba(0,122,255,.2); }

.input-select {
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23AEAEB2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* ── Large number input (staff counts) ───────────────────────────────── */
.num-input {
  width: 100%;
  background: var(--fill);
  border: none;
  border-radius: var(--r-md);
  padding: 14px 10px;
  font-size: 36px;
  font-weight: 600;
  color: var(--t1);
  text-align: center;
  outline: none;
  transition: box-shadow .15s;
  -moz-appearance: textfield;
}
.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-input::placeholder { color: var(--t3); font-weight: 300; }
.num-input:focus { box-shadow: 0 0 0 3px rgba(0,122,255,.2); }

/* ── Money input (big, POS screen) ───────────────────────────────────── */
.money-wrap {
  display: flex;
  align-items: center;
  background: var(--fill);
  border-radius: var(--r-md);
  padding: 0 16px;
  transition: box-shadow .15s;
}
.money-wrap:focus-within { box-shadow: 0 0 0 3px rgba(0,122,255,.2); }

.money-prefix {
  font-size: 32px;
  font-weight: 200;
  color: var(--t3);
  user-select: none;
  flex-shrink: 0;
  margin-right: 4px;
}
.money-input {
  flex: 1;
  background: none;
  border: none;
  font-size: 48px;
  font-weight: 300;
  color: var(--t1);
  padding: 18px 0;
  outline: none;
  min-width: 0;
  -moz-appearance: textfield;
}
.money-input::-webkit-outer-spin-button,
.money-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.money-input::placeholder { color: var(--t3); }

/* ── Small money input (cash screen) ─────────────────────────────────── */
.money-wrap-sm {
  display: flex;
  align-items: center;
  background: var(--fill);
  border-radius: var(--r-md);
  padding: 0 14px;
  transition: box-shadow .15s;
}
.money-wrap-sm:focus-within { box-shadow: 0 0 0 3px rgba(0,122,255,.2); }
.money-prefix-sm {
  font-size: 22px;
  font-weight: 300;
  color: var(--t3);
  user-select: none;
  margin-right: 4px;
}
.money-input-sm {
  flex: 1;
  background: none;
  border: none;
  font-size: 28px;
  font-weight: 300;
  color: var(--t1);
  padding: 12px 0;
  outline: none;
  min-width: 0;
  -moz-appearance: textfield;
}
.money-input-sm::-webkit-outer-spin-button,
.money-input-sm::-webkit-inner-spin-button { -webkit-appearance: none; }
.money-input-sm::placeholder { color: var(--t3); }

/* ── Register tiles ───────────────────────────────────────────────────── */
.reg-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  background: var(--card);
  border-radius: var(--r-xl);
  border: 2px solid transparent;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s, background .2s, transform .1s;
}
.reg-tile:active { transform: scale(0.98); }
.reg-tile.on {
  border-color: var(--blue);
  background: rgba(0,122,255,.04);
}

.reg-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--t3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .18s, border-color .18s;
  color: white;
}
.reg-tile.on .reg-check {
  background: var(--blue);
  border-color: var(--blue);
}

.reg-check-icon {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity .18s, transform .18s cubic-bezier(0.34,1.4,0.64,1);
}
.reg-tile.on .reg-check-icon {
  opacity: 1;
  transform: scale(1);
}

.reg-info { flex: 1; }
.reg-name {
  font-size: 17px;
  font-weight: 500;
  color: var(--t1);
}
.reg-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 4px;
}
.badge-kitchen { background: #FEF3C7; color: #92400E; }
.badge-bar     { background: #DBEAFE; color: #1E40AF; }
.badge-pos     { background: #F3F4F6; color: #374151; }

/* ── Staff grid ───────────────────────────────────────────────────────── */
.staff-row {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.staff-cell { display: flex; flex-direction: column; gap: 6px; }
.cell-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  text-align: center;
}

/* ── Validation pill ──────────────────────────────────────────────────── */
.val-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  margin-top: 10px;
  transition: background .25s, color .25s;
}
.val-pill.neutral { background: var(--fill);  color: var(--t3); }
.val-pill.valid   { background: rgba(52,199,89,.12); color: #248A3D; }
.val-pill.invalid { background: rgba(255,59,48,.1);  color: #D70015; }

/* ── Split preview card ───────────────────────────────────────────────── */
.split-preview {
  padding: 14px 18px;
}
.split-hdr {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--t3);
  margin-bottom: 10px;
}
.split-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--sep);
}
.split-row:last-child { border-bottom: none; }
.split-lbl {
  font-size: 15px;
  font-weight: 500;
  color: var(--t2);
  flex: 1;
}
.split-amt {
  font-size: 22px;
  font-weight: 700;
  color: var(--t1);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.split-each {
  font-size: 13px;
  font-weight: 400;
  color: var(--t3);
}
.split-ctx {
  font-size: 13px;
  color: var(--t3);
  flex-shrink: 0;
  text-align: right;
}
.split-leftover {
  font-size: 12px;
  color: var(--orange);
  font-weight: 500;
  padding: 2px 0 6px;
}
.split-row-dep .split-lbl { color: var(--t3); }
.split-row-dep .split-amt { color: var(--t2); font-size: 19px; }
.drawer-col { color: var(--orange); }

/* ── Denomination breakdown (bill & coin chips) ──────────────────────── */
.denom-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--sep);
}
.denom-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.denom-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--t3);
}
.denom-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--t1);
  font-variant-numeric: tabular-nums;
}
.denom-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.denom-bill {
  display: inline-flex;
  align-items: center;
  background: rgba(52,199,89,.14);
  color: #1E7A38;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.denom-coin {
  display: inline-flex;
  align-items: center;
  background: rgba(255,149,0,.14);
  color: #A85C00;
  border-radius: 50px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.denom-x {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.75;
  margin-left: 1px;
}
.denom-bar-other {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--sep);
}
.denom-bar-other .denom-lbl { color: var(--t3); }
.denom-bar-other .denom-val { font-size: 17px; color: var(--t2); }

/* ── Cash transfer note ───────────────────────────────────────────────── */
.transfer-note {
  font-size: 13px;
  color: var(--t2);
  background: rgba(0,122,255,.06);
  border-left: 3px solid var(--blue);
  padding: 8px 12px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-bottom: 8px;
  line-height: 1.45;
}

/* ── Print-only report header (hidden on screen) ─────────────────────── */
.print-hdr { display: none; }

/* ── Deduction amount (red in preview, normal in print) ──────────────── */
.deduction-amt {
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
}

/* ── Source segmented control (Cash / Card toggle) ───────────────────── */
.source-seg {
  display: flex;
  margin-top: 10px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1.5px solid var(--sep);
}
.seg-btn {
  flex: 1;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  background: var(--fill);
  color: var(--t3);
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.seg-btn + .seg-btn { border-left: 1.5px solid var(--sep); }
.seg-btn.active { background: var(--blue); color: #fff; }

/* ── Denomination breakdown (bill & coin chips) ──────────────────────── */
.denom-bar { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--sep); }
.denom-bar-other { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--sep); }
.denom-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.denom-lbl { font-size: 12px; font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: .05em; }
.denom-val { font-size: 20px; font-weight: 700; color: var(--t1); font-variant-numeric: tabular-nums; }
.denom-bar-other .denom-val { font-size: 17px; color: var(--t2); }
.denom-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.denom-x { font-weight: 400; font-size: 11px; opacity: .75; }
.denom-bill {
  background: rgba(52,199,89,.14); color: #1E7A38;
  border-radius: 6px; padding: 5px 9px; font-size: 13px; font-weight: 700;
}
.denom-coin {
  background: rgba(255,149,0,.14); color: #A85C00;
  border-radius: 50px; padding: 5px 9px; font-size: 12px; font-weight: 700;
}

/* ── Early departure rows ────────────────────────────────────────────── */
.btn-dep-init {
  display: block; width: 100%;
  background: none; border: 1.5px dashed var(--sep);
  border-radius: var(--r-md); color: var(--blue);
  font-size: 14px; font-weight: 600;
  padding: 12px; cursor: pointer; text-align: center;
  margin-top: 4px;
  -webkit-tap-highlight-color: transparent;
}
.btn-dep-init:active { background: var(--fill); }

.dep-hdr { display: flex; align-items: center; justify-content: space-between; }
.btn-dep-add {
  background: none; border: none;
  font-size: 20px; font-weight: 700;
  color: var(--blue); cursor: pointer; padding: 0 2px; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.btn-dep-add:active { opacity: .5; }

.dep-row {
  display: flex; align-items: flex-end; gap: 10px;
  padding-top: 12px; margin-top: 12px;
  border-top: 1px solid var(--sep);
}
.dep-snap-col  { flex: 1; min-width: 0; }
.dep-count-col { width: 62px; flex-shrink: 0; }
.dep-snap-only { flex: 1; min-width: 0; }
.dep-col-lbl   { font-size: 12px; color: var(--t3); font-weight: 500; margin-bottom: 4px; }

.dep-remove-btn {
  background: none; border: none; color: var(--t3);
  font-size: 22px; line-height: 1; cursor: pointer;
  padding: 2px 4px; margin-bottom: 6px; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.dep-remove-btn:active { color: var(--red); }

/* full-width per-person card (used for departure tiers) */
.pp-full { grid-column: span 2; }

/* ── Round-up toggle & note ──────────────────────────────────────────── */
.section-hdr-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.btn-round-up {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1.5px solid var(--sep);
  background: var(--fill);
  color: var(--t2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-round-up.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.round-up-note {
  font-size: 13px;
  color: #248A3D;
  background: rgba(52,199,89,.1);
  border-left: 3px solid var(--green);
  padding: 8px 12px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-bottom: 8px;
  line-height: 1.45;
}

/* ── Running total chip ───────────────────────────────────────────────── */
.running-chip {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,122,255,.1);
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 50px;
  margin: 14px 0;
}

/* ── Setup logo ───────────────────────────────────────────────────────── */
.logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 32px;
  gap: 10px;
}
.logo-icon {
  width: 76px; height: 76px;
  background: linear-gradient(145deg, var(--blue) 0%, var(--blue-dark) 100%);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(0,122,255,.35);
}
.logo-icon svg { width: 38px; height: 38px; color: white; }
.logo-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--t1);
}
.logo-sub {
  font-size: 15px;
  color: var(--t2);
}

/* ── POS reg header ───────────────────────────────────────────────────── */
.field-note {
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--t3);
  margin-left: 6px;
}

.pos-step-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--blue);
  margin-bottom: 4px;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--r-lg);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(0.97); opacity: .88; }
.btn:disabled { opacity: .3; cursor: not-allowed; transform: none; }

.btn-blue   { background: var(--blue);  color: #fff; }
.btn-green  { background: var(--green); color: #fff; }
.btn-ghost  { background: var(--fill);  color: var(--blue); }
.btn-danger { background: var(--red);   color: #fff; }

/* ── Spacer ───────────────────────────────────────────────────────────── */
.flex1 { flex: 1; min-height: 0; }
.gap { height: 16px; }

/* ── Action area ──────────────────────────────────────────────────────── */
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
}

/* ── Results ──────────────────────────────────────────────────────────── */
.res-meta {
  font-size: 15px;
  color: var(--t2);
  margin-bottom: 20px;
  line-height: 1.4;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.metric {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 16px 18px;
}
.metric.full  { grid-column: span 2; }
.metric.hero  {
  background: linear-gradient(145deg, var(--blue) 0%, var(--blue-dark) 100%);
  box-shadow: 0 8px 20px rgba(0,122,255,.3);
}

.metric-lbl {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--t3);
  margin-bottom: 6px;
}
.metric.hero .metric-lbl { color: rgba(255,255,255,.7); }

.metric-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.metric.hero .metric-val { color: #fff; font-size: 38px; }

.metric-note {
  font-size: 12px;
  color: var(--t3);
  margin-top: 3px;
}
.metric.hero .metric-note { color: rgba(255,255,255,.65); }

.section-hdr {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--t3);
  margin: 20px 0 8px 4px;
}

/* ── Tables ───────────────────────────────────────────────────────────── */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.tbl th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--t3);
  padding: 8px 4px;
  text-align: left;
  border-bottom: 1px solid var(--sep);
}
.tbl td {
  padding: 11px 4px;
  border-bottom: 1px solid var(--sep);
  color: var(--t1);
}
.tbl tr:last-child td { border-bottom: none; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .bold td { font-weight: 700; }

/* ── Per-person cards ─────────────────────────────────────────────────── */
.pp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pp-card {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 16px 18px;
}
.pp-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--t3);
  margin-bottom: 10px;
}
.pp-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--t2);
  padding: 3px 0;
  gap: 8px;
}
.pp-line span:last-child { font-variant-numeric: tabular-nums; }
.pp-total {
  display: flex;
  justify-content: space-between;
  font-size: 19px;
  font-weight: 700;
  color: var(--t1);
  border-top: 1.5px solid var(--sep);
  padding-top: 10px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* ── Tax box ──────────────────────────────────────────────────────────── */
.tax-box {
  background: var(--yellow-bg);
  border: 1.5px solid var(--yellow-bd);
  border-radius: var(--r-xl);
  padding: 16px 18px;
  font-size: 14px;
  color: #5C4200;
  line-height: 1.5;
  margin-bottom: 10px;
}
.tax-box strong { display: block; font-size: 15px; margin-bottom: 4px; color: #3D2C00; }

/* ── Toast ────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(28,28,30,.92);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 50px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s cubic-bezier(0.34,1.2,0.64,1);
  z-index: 999;
  max-width: 90vw;
  white-space: normal;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Print ────────────────────────────────────────────────────────────── */
@media print {
  /* Hide UI chrome and interactive elements */
  .no-print, #chrome, .actions, .running-chip,
  .split-preview, #toast, .source-seg,
  #dep-section, .btn-dep-init { display: none !important; }

  @page { margin: 10mm 12mm; }

  /* Reset layout so the screen flows like a document */
  html, body {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
    display: block !important;
  }

  #app, #screen-root, .screen {
    position: static !important;
    overflow: visible !important;
    height: auto !important;
    max-width: 100% !important;
    width: 100% !important;
    background: #fff !important;
    box-shadow: none !important;
    padding: 4px 14px 20px !important;
    display: block !important;
  }

  /* Kill stagger animations */
  .stagger > * { animation: none !important; opacity: 1 !important; transform: none !important; }

  /* Print-only report label */
  .print-hdr {
    display: block;
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #AEAEB2;
    margin: 6px 0 2px;
  }

  /* Cards: white + subtle border so they read on white paper */
  .card {
    background: #fff !important;
    box-shadow: none !important;
    border: 1.5px solid #E5E5EA !important;
  }

  /* Metrics: white cards, hero gets a blue border instead of gradient */
  .metric { background: #fff !important; box-shadow: none !important; }

  .metric.hero {
    background: #fff !important;
    box-shadow: none !important;
    border: 2px solid #007AFF !important;
  }

  .metric-lbl { color: #AEAEB2; }
  .metric.hero .metric-lbl  { color: rgba(0,122,255,.75) !important; }
  .metric-val                { color: #1C1C1E !important; }
  .metric.hero .metric-val   { color: #007AFF !important; }
  .metric.hero .metric-note  { color: rgba(0,122,255,.6) !important; }

  /* Tables on white */
  .tbl td, .tbl th { background: #fff !important; }

  /* Per-person cards on white */
  .pp-card { background: #fff !important; box-shadow: none !important; }

  /* Keep accent colours in print */
  .drawer-col    { color: #FF9500 !important; }
  .deduction-amt { color: #FF3B30 !important; }
  .transfer-note { background: rgba(0,122,255,.06) !important; }
}

/* ── Desktop ──────────────────────────────────────────────────────────── */
@media (min-width: 481px) {
  body {
    display: flex;
    justify-content: center;
    align-items: stretch;
    background: #D1D1D6;
  }
  #app {
    width: 390px;
    box-shadow: 0 0 80px rgba(0,0,0,.22);
    background: var(--bg);
  }
}
