/* TipNet components. Conventions: plain class names, BEM-lite (.card, .card-title). */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  /* a field reached with Tab scrolls clear of the bottom tab bar instead of stopping behind it */
  scroll-padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--s-3));
}
@media (min-width: 900px) {
  html {
    scroll-padding-bottom: 0;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
}
h1 {
  font-size: 28px;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 18px;
}
p {
  margin: 0 0 var(--s-2);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ---------- layout ---------- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: var(--s-3) var(--s-3) var(--s-2);
}
.brand {
  font: 800 26px/1 var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand span {
  color: var(--accent);
}
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.save-error {
  width: calc(100% - 2 * var(--s-3));
  max-width: calc(560px - 2 * var(--s-3));
  margin: var(--s-2) auto 0;
}
#app,
.column {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--s-2) var(--s-3) var(--s-5);
  flex: 1;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}
.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-2);
}
/* an amount like "$285 take-home" stays on one line; the label next to it wraps instead */
.spread > b.num {
  white-space: nowrap;
}
.app-footer {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--s-3) var(--s-3) calc(var(--tabbar-h) + var(--s-3) + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ---------- tabs: bottom bar on mobile, top on wide ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.tabbar button {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  background: none;
  border: 0;
  border-top: 3px solid transparent;
  color: var(--muted);
  font: 600 14px var(--font-body);
  cursor: pointer;
  padding: var(--s-1);
}
.tabbar button[aria-selected='true'],
.tabbar button[aria-current='page'] {
  color: var(--text);
  border-top-color: var(--accent);
}
.tabbar button:hover {
  color: var(--text);
}
/* Tab labels stay on one line. On narrow phones "Pay periods" shows as "Periods" (screen readers still hear the full name). */
.tabbar button {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab-short {
  display: none;
}
@media (max-width: 360px) {
  .tabbar button {
    font-size: 13px;
  }
  .tab-full {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .tab-short {
    display: inline;
  }
}
@media (min-width: 900px) {
  .app-shell {
    --tabbar-h: 0px;
  }
  .tabbar {
    position: sticky;
    top: 0;
    bottom: auto;
    order: -1;
    height: auto;
    justify-content: center;
    gap: var(--s-2);
    padding: 0;
    border-top: 0;
    border-bottom: 1px solid var(--border);
  }
  .tabbar button {
    flex: 0 0 160px;
    min-height: 48px;
    border-top: 0;
    border-bottom: 3px solid transparent;
  }
  .tabbar button[aria-selected='true'],
  .tabbar button[aria-current='page'] {
    border-bottom-color: var(--accent);
  }
  .app-footer {
    padding-bottom: var(--s-4);
  }
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-3);
}
.card-title {
  font: 500 12px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s-2);
}
.label {
  font: 500 12px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hint {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
/* Tonight: the take-home right under the tips box, so it shows on a phone without scrolling past Save */
.quick-net {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.note {
  font-size: 14px;
  padding: var(--s-2) var(--s-3);
  border-left: 3px solid var(--accent);
  background: var(--sunk);
  border-radius: var(--r-sm);
}
.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-3) 0;
}

/* ---------- fields ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > label,
.field-label {
  font-weight: 600;
  font-size: 15px;
}
.input,
.field input:not([type='checkbox']):not([type='radio']),
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--tap);
  padding: 10px 12px;
  background: var(--sunk);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
}
.input:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--focus);
}
.field[data-invalid] input,
.field[data-invalid] select,
.input[aria-invalid='true'] {
  border-color: var(--bad);
}
.field-error {
  font-size: 14px;
  color: var(--bad);
  margin: 0;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 55%,
    calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
/* big money entry: <div class="money"><span>$</span><input inputmode="decimal"></div> */
.money {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: var(--s-1) var(--s-3);
  background: var(--sunk);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
}
.money > span {
  font: 800 40px var(--font-display);
  color: var(--muted);
}
.money input,
.field .money input:not([type='checkbox']):not([type='radio']) {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: none;
  font: 800 52px var(--font-display);
  letter-spacing: 0.01em;
  padding: var(--s-1) var(--s-2);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.money input:focus-visible,
.field .money input:focus-visible {
  outline: none;
}
.money:focus-within {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* checkbox row */
.check {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: var(--tap);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
}
.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
}
.check small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap);
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 16px var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease);
}
.btn:hover {
  background: var(--accent-hover);
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-block {
  width: 100%;
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
  font-weight: 600;
}
.btn-secondary:hover {
  background: var(--sunk);
}
.btn-small {
  padding: 6px 14px;
  font-size: 14px;
}
.btn-link {
  background: none;
  border: 0;
  color: var(--accent);
  text-decoration: underline;
  min-height: var(--tap);
  padding: 0 var(--s-1);
  cursor: pointer;
  font-weight: 600;
}
.btn-danger {
  background: transparent;
  color: var(--bad);
  border-color: var(--bad);
  font-weight: 600;
}
.btn-danger:hover {
  background: var(--bad-bg);
}
/* two-tap: UI sets data-armed="true" and changes the label to "Tap again to confirm" */
.btn-danger[data-armed='true'] {
  background: var(--bad-solid);
  color: var(--bad-solid-ink);
  border-color: var(--bad-solid);
}

/* ---------- pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font: 500 12px var(--font-mono);
  letter-spacing: 0.04em;
  background: var(--sunk);
  color: var(--muted);
  border: 1px solid var(--border);
}
.pill-good {
  background: var(--good-bg);
  color: var(--good);
  border-color: transparent;
}
.pill-bad {
  background: var(--bad-bg);
  color: var(--bad);
  border-color: transparent;
}

/* ---------- banner, toast, update bar ---------- */
.banner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  align-items: center;
  justify-content: space-between;
  padding: var(--s-2) var(--s-3);
  border: 1px dashed var(--accent);
  border-radius: var(--r-md);
  font-size: 15px;
}
.banner p {
  margin: 0;
  flex: 1 1 220px;
}
.banner-warn {
  border-style: solid;
  border-color: var(--bad);
  background: var(--bad-bg);
}
.update-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 15px;
  /* at the bottom of the page, just above the "TipNet Budget" card (owner request) */
  margin-top: var(--s-5);
  border-radius: var(--r-md);
}
/* the Budget card right under it doesn't need its own big gap */
.update-bar + .upsell {
  margin-top: var(--s-3);
}
.update-bar button {
  min-height: var(--tap);
  padding: 6px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--accent-ink);
  background: transparent;
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}
#toast {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 40;
  bottom: calc(var(--tabbar-h) + var(--s-3) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: 0 var(--s-3);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  max-width: 520px;
  width: 100%;
  padding: var(--s-2) var(--s-3);
  min-height: var(--tap);
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r-md);
  font-size: 15px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.25);
  animation: toast-in var(--t-fast) var(--ease);
}
.toast span {
  flex: 1;
}
.toast button {
  min-height: var(--tap);
  min-width: var(--tap);
  background: none;
  border: 0;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- progress steps (setup flow) ---------- */
.steps {
  display: flex;
  gap: var(--s-2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.steps li {
  flex: 1;
  min-width: 0;
  padding-top: var(--s-2);
  border-top: 3px solid var(--border);
  font: 500 12px var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.steps li[aria-current='step'] {
  border-top-color: var(--accent);
  color: var(--text);
}
.steps li.done {
  border-top-color: var(--accent);
}

/* ---------- result card ---------- */
.result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  animation: result-in 200ms var(--ease);
}
@keyframes result-in {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}
.hero {
  font: 800 64px/1 var(--font-display);
  letter-spacing: 0.01em;
  color: var(--hero);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.hero-label {
  font: 500 12px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin: 0;
}
.breakdown > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: 15px;
}
.breakdown dt {
  color: var(--muted);
}
.breakdown dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.breakdown .total {
  padding-top: var(--s-2);
  border-top: 1px solid var(--border);
  font-weight: 700;
}

/* stat strip: 3 small figures */
.strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.strip > div {
  background: var(--surface);
  padding: var(--s-2) var(--s-3);
  min-width: 0;
}
.strip b {
  display: block;
  font: 800 24px var(--font-display);
  font-variant-numeric: tabular-nums;
}

/* ---------- lists / rows / tables ---------- */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 56px;
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--border);
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row .main {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.list-row .amount {
  font: 800 22px var(--font-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.table th {
  font: 500 12px var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--border);
}
.table tr:last-child td {
  border-bottom: 0;
}
.table .r {
  text-align: right;
}

/* repeatable setup rows (pay types, deductions) */
.repeat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-2);
  align-items: end;
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

details.card > summary {
  cursor: pointer;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  font-weight: 600;
}

/* ---------- screen additions ---------- */
.strip-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.list-row.wrap {
  flex-wrap: wrap;
}
.row-actions {
  flex-basis: 100%;
  display: flex;
  gap: var(--s-2);
  justify-content: flex-end;
}
.tabbar button {
  -webkit-tap-highlight-color: transparent;
}
h1 {
  margin-bottom: 0;
}
.btn-secondary[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--hero);
  background: var(--sunk);
}
/* the put-aside slider: a plain track with a big thumb, no box around it */
.field input[type='range'] {
  min-height: var(--tap);
  padding: 0;
  background: transparent;
  border: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.field input[type='range']:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.field input[type='date'] {
  min-width: 0;
  padding-left: 8px;
  padding-right: 6px;
  font-size: 15px;
}
@media (max-width: 400px) {
  .grid-2 {
    gap: var(--s-2);
  }
}
@media (max-width: 380px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- budget ---------- */
.bar {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--sunk);
  border: 1px solid var(--border);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-pill);
}
.sample {
  filter: blur(3.5px);
  opacity: 0.65;
  pointer-events: none;
  user-select: none;
}
.breakdown dt {
  white-space: pre-wrap;
  min-width: 0;
}
details > summary.btn-link {
  display: flex;
  align-items: center;
  text-decoration: underline;
}
.noscript {
  padding: 16px;
}

/* ---------- privacy and terms pages ---------- */
.doc {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--s-2) var(--s-3) var(--s-4);
  overflow-wrap: anywhere;
}
.doc h1 {
  margin-bottom: var(--s-1);
}
.doc h2 {
  font-size: 18px;
  margin: var(--s-4) 0 var(--s-1);
}
.doc p {
  margin: 0 0 var(--s-2);
  line-height: 1.55;
}
.app-footer a {
  color: var(--accent);
  font-weight: 600;
}
/* Links inside the Privacy and Terms pages (including the contact email) use the accent, like the footer. */
.doc a {
  color: var(--accent);
  text-underline-offset: 2px;
}
.doc a:hover {
  color: var(--accent-hover);
}
.doc-page a.brand {
  text-decoration: none;
  color: inherit;
}

/* ---------- fieldsets (Setup, Tonight) and the example view (Tonight, before setup) ---------- */
fieldset.field {
  border: 0;
  padding: 0;
  margin: 0;
}
fieldset.field > legend {
  font-weight: 600;
  font-size: 15px;
  padding: 0;
  margin-bottom: 6px;
}
.banner-example {
  flex-direction: column;
  align-items: flex-start;
  border-style: solid;
}
.banner-example h2 {
  margin: 0;
  font-size: 18px;
}
.banner-example p {
  flex: none;
}

/* ---------- jobs worked tonight (Tonight and the night editor) ---------- */
.job-row {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.job-row .spread {
  flex-wrap: wrap;
}
.job-row .job-rate {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 380px) {
  /* keep the job and its hours side by side on small phones: the hours box is short */
  .job-row .grid-2 {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
}

/* ---------- "Last backup" reminder (Tonight and Setup) ---------- */
.backup-nudge {
  margin-bottom: var(--s-3);
}
/* restaurant switcher (Tonight, Setup, Pay periods): one button per restaurant, the picked one filled. Long names end in "…". */
.wp-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: var(--s-2);
}
.wp-switch button {
  min-height: var(--tap);
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text);
  font: 600 15px var(--font-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.wp-switch button:hover {
  background: var(--sunk);
}
.wp-switch button[aria-checked='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

/* ---------- "TipNet Budget" card at the bottom of Tonight, Pay periods and Setup ---------- */
.upsell {
  margin-top: var(--s-5);
}
.upsell h2 {
  margin: 0;
}

/* ---------- Setup: one row per restaurant and per shared section, opened in place ---------- */
h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.fold {
  padding: 0;
}
.fold-h {
  margin: 0;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}
.fold-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  min-height: 56px;
  padding: var(--s-3);
  background: none;
  border: 0;
  border-radius: var(--r-lg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.fold-head:hover {
  background: var(--sunk);
}
.fold-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.fold-title {
  font: 800 18px/1.15 var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.fold-sum {
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.chev {
  flex: none;
  width: 10px;
  height: 10px;
  margin: 0 6px 4px 0;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform var(--t-fast) var(--ease);
}
.fold-head[aria-expanded='true'] .chev {
  margin-bottom: -4px;
  transform: rotate(-135deg);
}
.fold-body {
  padding: 0 var(--s-3) var(--s-3);
}
.fold-saved {
  padding: 0 var(--s-3) var(--s-3);
}
/* cards inside an open row are sections of it, not cards of their own */
.fold-body .card {
  padding: var(--s-3) 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
}
.fold-group {
  margin: var(--s-3) 0 0;
}
/* Save / Cancel stay at the bottom of the screen while a restaurant is open */
.save-bar {
  position: sticky;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--s-2));
  z-index: 5;
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: 0 -4px 16px rgb(0 0 0 / 0.18);
}
.save-bar p {
  margin: 0;
}

/* Small screens: the Save bar is one compact row (buttons beside the status line), 44px targets kept */
@media (max-width: 480px) {
  .save-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-1) var(--s-2);
    padding: var(--s-2);
  }
  .save-bar .cluster {
    flex-wrap: nowrap;
    gap: var(--s-1);
    order: 1;
  }
  .save-bar .btn {
    padding: 10px 10px;
    font-size: 15px;
    white-space: nowrap;
  }
  .save-bar #draft-state {
    order: 2;
    flex: 1 1 5.5rem;
    min-width: 0;
    font-size: 0.75rem;
    line-height: 1.25;
  }
  .save-bar #draft-ask-q {
    flex: 1 1 100%;
    order: 0;
  }
  .save-bar #draft-reasons {
    order: 3;
    flex: 1 1 100%;
    font-size: 0.75rem;
    line-height: 1.25;
  }
}
/* Read by screen readers, not shown. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* Budget: the big number with its Example badge (only while the example's made-up balance is used). */
.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
}
.pill-example {
  font-size: 14px;
  color: var(--text);
  background: var(--sunk);
  border-color: var(--border-strong);
}

/* ---------- "Tipped out tonight:" (Tonight and the night editor): compact boxes, two per row on a phone ---------- */
.tipout-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s-2);
}
.check.check-compact {
  gap: 8px;
  padding: 8px 10px;
}
.check.check-compact small {
  font-size: 13px;
}

/* Tonight: the only job there is to pick, as plain text (no one-choice dropdown) */
.job-fixed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
  min-height: var(--tap);
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.job-fixed .hint {
  font-weight: 400;
}
