/* Redesigned screens (docs/register-redesign/PLAN.md). Stage 2, 0.32.0: the PIN sign-in and the
   checkout (Pay, the card reader's states, Paid). Loaded last on every register page. Colors only
   from the theme's tokens; Night Rail (the first look) is designed first, Ledger and the others
   follow from the same tokens. Only how things look changes: every button and amount is the same. */

/* =========================================================================
   PIN sign-in
   ========================================================================= */
.lock-date { color: var(--muted); font-size: 15px; margin: -2px 0 10px; }
.lock-date:empty { display: none; }
.lock .pad-key { font-variant-numeric: tabular-nums; }
.lock .pin-ok { min-height: 56px; }
:root[data-theme="night-rail"] :is(.lock-clock, .lock .pad-key) { font-family: var(--mono); }

/* Tablets and wider: two halves. The time, the date and the clock-in on the left; the PIN pad on
   the right with big keys (round in Night Rail). */
@media (min-width: 900px) and (min-height: 600px) {
  .lock .lock-card {
    display: grid; max-width: 1040px; padding: 44px 56px; column-gap: 72px; row-gap: 6px; text-align: left; align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
    grid-template-areas: "clock title" "clock pad" "date pad" "note pad" "cbtn pad" "links pad" "report pad";
    grid-template-rows: auto auto auto auto auto auto 1fr;
  }
  .lock .lock-card > .lock-clock { grid-area: clock; line-height: 1; align-self: start; white-space: nowrap;
    /* Fits its half: "12:45 p.m." is the longest (10 characters of a fixed-width face). */
    font-size: clamp(48px, calc((min(100vw - 32px, 1040px) - 544px) / 6.2), 104px); }
  .lock .lock-card > .lock-date { grid-area: date; font-size: 21px; margin: 6px 0 0; }
  .lock .lock-card > h2 { grid-area: title; align-self: start; text-align: center; font-size: 20px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
  .lock .lock-card > p { grid-area: note; margin: 10px 0 0; }
  .lock .lock-card > :is(.pin, .demo-people) { grid-area: pad; width: 100%; max-width: 360px; justify-self: center; margin-top: 8px; }
  .lock .lock-card > .lock-clock-btn { grid-area: cbtn; width: auto; justify-self: start; min-height: 56px; padding: 0 22px; margin-top: 28px; }
  .lock .lock-card > .lock-links { grid-area: links; justify-content: flex-start; gap: 28px; margin-top: 18px; }
  .lock .lock-card > .lock-report { grid-area: report; justify-self: start; align-self: start; margin-top: 12px; }
  .lock .pad { grid-template-columns: repeat(3, 84px); gap: 14px; justify-content: center; }
  .lock .pad-key { min-height: 84px; font-size: 28px; }
  .lock .pin-dots { margin: 6px 0 22px; gap: 18px; }
  .lock .pin-dots span { width: 18px; height: 18px; }
  .lock .pin-ok { width: calc(3 * 84px + 2 * 14px); margin: 16px auto 0; display: flex; }
}
/* Night Rail: no card, the screen is the card; round keys. */
:root[data-theme="night-rail"] .lock .pad-key { border-radius: 999px; background: var(--panel); }
:root[data-theme="night-rail"] .lock .pad-key:active { background: var(--panel-2); }
@media (min-width: 900px) and (min-height: 600px) {
  :root[data-theme="night-rail"] .lock .lock-card { background: transparent; border-color: transparent; box-shadow: none; }
  :root[data-theme="night-rail"] .lock .lock-card > .lock-clock { font-size: clamp(48px, calc((min(100vw - 32px, 1040px) - 544px) / 6.2), 120px); font-weight: 500; letter-spacing: -.04em; }
}
@media (max-width: 899px), (max-height: 599px) {
  :root[data-theme="night-rail"] .lock .pad { justify-items: center; }
  :root[data-theme="night-rail"] .lock .pad-key { width: min(100%, 78px); min-height: 0; aspect-ratio: 1; background: var(--panel-2); }
  :root[data-theme="night-rail"] .lock .pad-key:active { background: var(--line); }
}
/* Ledger: square keys, a quiet card. */
:root[data-theme="ledger"] .lock .pad-key { border-radius: var(--radius); background: var(--panel); font-weight: 600; }

/* =========================================================================
   Checkout: the Pay window
   ========================================================================= */
.sheet.wide:has([data-pay]) { width: min(1120px, 100%); }
[data-pay] .sheet-head h2 { font-size: 22px; }
[data-pay] .pay-layout { grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }

/* The left side: the amount, the order's lines, the totals, what's paid and the tip. */
[data-pay] .pay-summary { container-type: inline-size; padding: 18px; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--panel-2); min-width: 0; }
[data-pay] .due-label { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; }
[data-pay] .due { font-size: min(54px, 13cqi); letter-spacing: -.02em; margin-bottom: 8px; white-space: nowrap; overflow-wrap: normal; }
[data-pay] .due.long { font-size: min(38px, 10.5cqi); }
[data-pay] .pay-lines { max-height: 210px; overflow-y: auto; margin: 0 0 8px; border-top: 1px solid var(--line); }
[data-pay] .pay-lines .line { padding: 8px 2px; font-size: 15px; grid-template-columns: 28px minmax(0, 1fr) auto; }
[data-pay] .pay-lines .line:last-child { border-bottom: 0; }
[data-pay] .pay-summary .totals { margin: 0; padding: 8px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
[data-pay] .paid-list li { font-weight: 600; }
[data-pay] .tip-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 16px; }
[data-pay] .tip-row > strong { grid-column: 1 / -1; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
[data-pay] .tip-row .btn { display: flex; flex-direction: column; gap: 1px; min-height: 60px; padding: 4px 6px; font-size: 17px; }
[data-pay] .tip-row .btn { container-type: inline-size; }
[data-pay] .tip-row .btn small.long { font-size: max(11px, min(12.5px, 11.5cqi)); letter-spacing: -.02em; }
[data-pay] .tip-row .btn small { white-space: nowrap; max-width: 100%; font-size: 12.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
[data-pay] .tip-row .btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
[data-pay] .tip-row .btn.on small { color: inherit; opacity: .75; }
[data-pay] .tip-row input { grid-column: span 2; width: auto; min-height: 60px; border-radius: var(--radius); font-size: 17px; }

/* The right side: Cash, Card and Other as big tiles, then what each one needs. */
[data-pay] .pay-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0; border: 0; background: none; box-shadow: none; }
[data-pay] .pay-ways button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 8px;
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--panel); color: var(--text); font-size: 18px; font-weight: 700;
}
[data-pay] .pay-ways button + button { border-left: 1px solid var(--line); }
[data-pay] .pay-ways button svg { width: 32px; height: 32px; }
[data-pay] .pay-ways button.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); box-shadow: none; }
[data-pay] .quick { gap: 10px; }
[data-pay] .quick .btn.big { min-height: 72px; font-size: 22px; border-radius: calc(var(--radius) + 2px); white-space: nowrap; }
[data-pay] .quick.long .btn.big { font-size: 16px; padding-inline: 8px; overflow-wrap: normal; }
[data-pay] .amount-display { min-height: 60px; font-size: 28px; border-radius: var(--radius); background: var(--panel); }
[data-pay] .amount-pad { gap: 10px; }
[data-pay] .amount-pad .pad-key { min-height: 60px; border-radius: var(--radius); background: var(--panel); }
[data-pay] .pay-methods > .btn.big.primary { min-height: 72px; font-size: 20px; border-radius: calc(var(--radius) + 4px); }
[data-pay] .cp-reader-row { padding: 16px; border: 1px solid var(--line); background: var(--panel); }

/* The card reader at work: the accent card says what's happening (Night Rail's bright card). */
[data-pay] .cp-wait:not(.cp-bad) { padding: 24px 18px 18px; border-radius: calc(var(--radius) + 6px); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); }
:root[data-theme="night-rail"] [data-pay] .cp-wait:not(.cp-bad) { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
:root[data-theme="night-rail"] [data-pay] .cp-wait:not(.cp-bad) :is(.muted, small) { color: inherit; opacity: .8; }
:root[data-theme="night-rail"] [data-pay] .cp-wait:not(.cp-bad) .cp-ring { border-color: color-mix(in srgb, var(--accent-text) 45%, transparent); }
:root[data-theme="night-rail"] [data-pay] .cp-wait:not(.cp-bad) .btn { background: var(--accent-text); color: var(--accent); border-color: var(--accent-text); }
[data-pay] .cp-wait.cp-bad { padding: 22px 16px 16px; border-radius: calc(var(--radius) + 6px); border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 8%, var(--panel)); }
[data-pay] .cp-amt { font-size: 40px; }

/* Night Rail: amounts in the fixed-width face. */
:root[data-theme="night-rail"] :is([data-pay] .due, [data-pay] .quick .btn, [data-pay] .amount-display, [data-pay] .cp-amt, [data-pay] .tip-row small, .done .change) { font-family: var(--mono); }

/* =========================================================================
   Paid: the check, the change, then the receipt choices and the next order
   ========================================================================= */
.done { container-type: inline-size; }
.done .change { font-size: min(64px, 11cqi); white-space: nowrap; overflow-wrap: normal; }
.done-actions { gap: 10px; }
.done-actions .btn.big { min-height: 64px; border-radius: calc(var(--radius) + 2px); }
.done-actions .primary { min-height: 76px; font-size: 21px; border-radius: calc(var(--radius) + 4px); }
:root[data-theme="night-rail"] .done-check:not(.warn):not(.bad) { border-radius: 22px; background: var(--accent); color: var(--accent-text); box-shadow: none; }

/* Short screens (1024x768, 1280x800, 1366x768): everything smaller, so the button that takes the
   money stays in view without scrolling. The order's lines show about three, and scroll. */
@media (min-width: 761px) and (max-height: 820px) {
  .sheet.wide:has([data-pay]) { padding-top: 14px; padding-bottom: 14px; }
  [data-pay] .sheet-head { margin-bottom: 8px; }
  [data-pay] .pay-layout { gap: 18px; }
  [data-pay] .pay-summary { padding: 14px; }
  [data-pay] .due { font-size: min(44px, 13cqi); margin-bottom: 4px; }
  [data-pay] .due.long { font-size: min(32px, 10.5cqi); }
  [data-pay] .pay-lines { max-height: 124px; }
  [data-pay] .pay-lines .line { padding: 5px 2px; }
  [data-pay] .tip-row { margin-top: 10px; gap: 6px; }
  [data-pay] .tip-row .btn, [data-pay] .tip-row input { min-height: 50px; }
  [data-pay] .pay-methods { gap: 10px; }
  [data-pay] .pay-ways { gap: 8px; }
  [data-pay] .pay-ways button { min-height: 64px; flex-direction: row; gap: 10px; font-size: 17px; }
  [data-pay] .pay-ways button svg { width: 24px; height: 24px; }
  [data-pay] .quick { gap: 8px; }
  [data-pay] .quick .btn.big { min-height: 52px; font-size: 19px; }
  [data-pay] .amount-display { min-height: 48px; font-size: 22px; padding: 6px 12px; }
  [data-pay] .amount-pad { gap: 8px; }
  [data-pay] .amount-pad .pad-key { min-height: 48px; font-size: 19px; }
  [data-pay] .pay-methods > .btn.big.primary { min-height: 56px; font-size: 19px; }
}
@media (min-width: 761px) and (max-height: 640px) {
  [data-pay] .pay-lines { display: none; }
}

/* Phones and small tablets: one column; the lines stay on the order screen behind. */
@media (max-width: 760px) {
  [data-pay] .pay-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  [data-pay] .pay-lines { display: none; }
  [data-pay] .due { font-size: min(40px, 13cqi); }
  [data-pay] .due.long { font-size: min(30px, 10.5cqi); }
  [data-pay] .pay-ways button { min-height: 72px; font-size: 16px; }
  [data-pay] .pay-ways button svg { width: 26px; height: 26px; }
  [data-pay] .quick .btn.big { min-height: 60px; font-size: 19px; }
  .done .change { font-size: min(52px, 11cqi); }
}
@media (max-width: 380px) {
  [data-pay] .tip-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [data-pay] .tip-row input { grid-column: span 3; }
}

/* =========================================================================
   Stage 3, 0.33.0: the rest of the register to match the Fast list.
   Lists are one panel of rows with a line between them (like the sell screen), not separate
   floating cards; figures never break inside a number; Night Rail shows amounts in its fixed-width
   face. Sales, Customers, Inventory, Appointments, the Menu and Products editors, Reports and
   close-out, the top bar, windows and toasts.
   ========================================================================= */

/* ---- One panel of rows ---- */
:is(.sh-list, .rw-list, .inv-list) {
  gap: 0; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); overflow: hidden; background: var(--panel);
}
:is(.sh-list, .rw-list, .inv-list):has(> .empty:only-child) { border: 0; background: none; }
:is(.sh-list, .rw-list, .inv-list) > :is(.sh-row, .rw-item, .inv-item) {
  margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; min-height: 64px;
}
:is(.sh-list, .rw-list, .inv-list) > :is(.sh-row, .rw-item, .inv-item):last-child { border-bottom: 0; }
:is(.sh-list, .rw-list, .inv-list) > :is(.sh-row, .rw-item, .inv-item):hover { background: color-mix(in srgb, var(--text) 4%, transparent); border-color: var(--line); }
:is(.sh-list, .rw-list, .inv-list) > :is(.sh-row, .rw-item, .inv-item):focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -3px; }
.rw-list > .rw-item { position: relative; padding-left: 16px; }

/* The Menu and Products editors: rows too, the photo or initial as a small square at the start. */
.menu-grid { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); overflow: hidden; background: var(--panel); }
.menu-grid > .menu-card {
  grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-rows: auto auto; grid-template-areas: "ph name foot" "ph sub foot";
  align-items: center; align-content: center; row-gap: 2px; min-height: 68px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; transform: none;
}
.menu-grid > .menu-card:last-child { border-bottom: 0; }
.menu-grid > .menu-card:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.menu-grid > .menu-card .mc-photo { grid-area: ph; width: 48px; height: 48px; border-radius: calc(var(--radius) - 2px); font-size: 19px; }
.menu-grid > .menu-card .mc-name { grid-area: name; }
.menu-grid > .menu-card .mc-sub { grid-area: sub; -webkit-line-clamp: 1; line-clamp: 1; }
.menu-grid > .menu-card .mc-foot { grid-area: foot; margin: 0; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; flex-wrap: nowrap; }
.menu-grid > .menu-card .mc-foot .stock { white-space: nowrap; }
.menu-grid > .menu-card .mc-price { white-space: nowrap; font-size: 16px; }
.menu-grid > .menu-card.add { grid-template-columns: auto auto; grid-template-areas: none; justify-content: start; gap: 12px; border-style: solid; color: var(--accent); }
.menu-grid > .menu-card.add .mc-plus { width: 40px; height: 40px; background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); color: var(--accent); }
@media (max-width: 420px) {
  .menu-grid > .menu-card { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 10px 12px; column-gap: 10px; }
  .menu-grid > .menu-card .mc-photo { width: 44px; height: 44px; }
}

/* ---- Figures: one line, smaller when long, never split ---- */
/* A tile's figure is always one line; app.js statLong marks the long ones so they get smaller. */
.stat-n { white-space: nowrap; overflow-wrap: normal; }
.stat-n.long { font-size: clamp(13px, 13cqw, 22px); }
.stat-n.xlong { font-size: clamp(11px, 9.5cqw, 20px); }
@media (max-width: 760px) { .sh-stats .stat-n.long { font-size: min(17px, 11.5cqw); } }
:is(.sh-total, .rw-item-num b, .rw-tile b, .mc-price, .totals > div > span:last-child, .tbl td.num, .tbl th.num, .kv dd.num) { white-space: nowrap; }
.rw-tile { container-type: inline-size; }
.rw-tile b { font-size: clamp(16px, 16cqw, 26px); white-space: nowrap; }
:root[data-theme="night-rail"] :is(.stat-n, .sh-total, .sh-no strong, .rw-item-num b, .rw-tile b, .mc-price, .tbl td.num, .sheet .totals span:last-child, .drawer-totals span:last-child) { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:root[data-theme="ledger"] :is(.stat-n, .sh-total, .tbl td.num) { font-variant-numeric: tabular-nums; }

/* ---- Number tiles: quiet, the figure first ---- */
:root[data-theme="night-rail"] .stat { background: var(--panel); border-color: var(--line); }
:root[data-theme="night-rail"] .stat .stat-ico { color: var(--accent); }

/* ---- Reports and close-out: tables read as rows, totals stand out ---- */
.card .tbl tr:hover, .card .mini tr:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.drawer-totals { background: var(--panel-2); border-radius: calc(var(--radius) + 2px); }

/* ---- The top bar and the phone tabs ---- */
:root[data-theme="night-rail"] .bar { background: var(--bg); border-bottom-color: var(--line); }
:root[data-theme="night-rail"] :is(.nav, .tabbar) button.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
:root[data-theme="night-rail"] .tabbar { background: var(--bg); border-top-color: var(--line); }

/* ---- Windows and toasts ---- */
.sheet { border-radius: calc(var(--radius) + 8px); }
.sheet .list-row { min-height: 56px; border-radius: calc(var(--radius) + 2px); }
.toast { display: flex; align-items: center; gap: 10px; border-radius: calc(var(--radius) + 2px); font-size: 15.5px; line-height: 1.35; }
:root[data-theme="night-rail"] .toast:not(.error) { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--accent), 0 12px 32px rgba(0, 0, 0, .5); padding-left: 22px; }
:root[data-theme="night-rail"] .toast.error { background: var(--bad); color: var(--accent-text); }
@media (max-width: 760px) {
  .sheet { border-radius: calc(var(--radius) + 8px) calc(var(--radius) + 8px) 0 0; }
}
/* Phones: the customer filters and the inventory filters in one row that slides sideways, so the
   list starts higher (Customers had three rows of filters at 390). */
@media (max-width: 760px) {
  .rw-filters { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; overscroll-behavior-x: contain; scroll-padding-inline: 4px; }
  .rw-filters::-webkit-scrollbar { display: none; }
  .rw-filters > * { flex: none; }
}

/* ---- 0.33.0 tester round ---- */
/* Reports' small tables: the amount keeps its own column and one line; names wrap instead. */
.mini td.num { white-space: nowrap; width: 1%; padding-left: 12px; font-variant-numeric: tabular-nums; }
.mini td:first-child { overflow-wrap: anywhere; }
:root[data-theme="night-rail"] .mini td.num:last-child { font-family: var(--mono); }

/* Cash drawer: long labels (Spanish) wrap inside their buttons; one column on narrow phones. */
.drawer-actions .btn { white-space: normal; min-width: 0; line-height: 1.2; }
@media (max-width: 420px) { .drawer-actions { grid-template-columns: minmax(0, 1fr); } }

/* The top bar with more sections than fit their names: icons only (app.js fitNav). */
.nav.nav-tight button > span:not(.nav-badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav.nav-tight button svg { display: block; }
.nav.nav-tight button { padding: 6px 12px; position: relative; }

/* Appointments: a 30-minute block on one line (time, name, service), the status as a dot of text. */
.ap-appt.short { flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 6px; padding-top: 2px; padding-bottom: 2px; }
.ap-appt.short > span { flex: 0 1 auto; min-width: 0; }
.ap-appt.short .ap-time { flex: none; }
.ap-appt.short .ap-svc { flex: 1 1 0; }
.ap-appt.short .ap-tag { flex: none; font-size: 10px; }

/* Toasts on phones: across the screen (16px each side), above the tabs, two lines at most. */
@media (max-width: 760px) {
  .toast { left: 16px; right: 16px; transform: none; max-width: none; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .toast .toast-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
}

/* A page's X stays beside its title on tablets too; its buttons go on the line below. */
@media (min-width: 761px) and (max-width: 1100px) {
  .page-head { row-gap: 8px; }
  .page-head > .page-x, .page-head > .spacer + .page-x { order: 1; margin-left: auto; }
  .page-head > :not(h1):not(.page-x) { order: 2; }
  .page-head:has(> :not(h1):not(.page-x))::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
}

/* The week's schedule: on iPads held upright, the one-day-at-a-time view (the week grid was cramped). */
@media (min-width: 761px) and (max-width: 900px) {
  .sc-grid { display: none; }
  .sc-phone { display: block; }
}

/* Product editor sizes on tablets: a card per size, so a 12-digit barcode shows whole. */
@media (min-width: 761px) and (max-width: 1100px) {
  .var-head { display: none; }
  .var-row, .var-row.lite, .var-row.bc, .var-row.inv { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px); align-items: start; }
  .var-cell { display: grid; gap: 4px; min-width: 0; }
  .var-cell.var-wide, .var-cell:has(input[data-k="barcode"]) { grid-column: span 2; }
  .var-row [data-del] { grid-column: 1 / -1; }
  .var-lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
  .var-row input { width: 100%; }
}

/* =========================================================================
   Stage 4, 0.34.0: Settings in the new look. The section rail on the left (one sliding row of chips
   on phones), each section one panel of rows: the label and its help on the left, the control on
   the right; long help as small muted lines; actions that remove things at the bottom of their
   section. Markup, ids and data-* hooks unchanged.
   ========================================================================= */
.set-panels { max-width: 880px; }
.set-h { font-size: 22px; }
.set-card { border-radius: calc(var(--radius) + 4px); }
.set-text small, .set-field small, .switch small { line-height: 1.4; }

/* Fields stay stacked (label above its box): a row for some and not others mixed layouts inside one
   group (an address, the business name beside the logo). Switches and choices are the rows. */
/* Every menu and box in Settings is a full-size target. */
.settings-page :is(select, input[type="text"], input[type="tel"], input[type="email"], input[type="number"], input:not([type])) { min-height: 44px; }
.settings-page .kv select { min-height: 44px; padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; }
.settings-page .kv dd { min-width: 0; }

/* Removing things sits apart, at the bottom of its section. */
.set-danger { margin-top: 8px; padding-top: 14px; border-top: 1px dashed color-mix(in srgb, var(--bad) 35%, var(--line)); }

/* The rail: Night Rail's chosen section in its accent, quieter hover. */
:root[data-theme="night-rail"] .set-nav button.on { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
:root[data-theme="night-rail"] .set-nav button.on .set-nav-text strong { color: var(--accent); }
:root[data-theme="ledger"] .set-nav button { border-radius: var(--radius); }

/* Short screens (1024x768, 1366x768): the rail without its hints, so all ten sections are in view. */
@media (min-width: 761px) and (max-height: 820px) {
  .set-nav-text small { display: none; }
  .set-nav button { min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
  .set-ico { width: 32px; height: 32px; }
}

/* Phones: the sections as one row of chips that slides sideways (they took five rows at 390). */
@media (max-width: 760px) {
  .settings-page .set-nav { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scroll-padding-inline: 4px; padding-bottom: 6px; }
  .settings-page .set-nav::-webkit-scrollbar { display: none; }
  .settings-page .set-nav button { white-space: nowrap; }
  .set-card > .set-row { align-items: flex-start; }
  .set-danger { justify-content: stretch; }
  .set-danger .btn { width: 100%; white-space: normal; }
}

/* ---- 0.34.0 polish ---- */
/* The top bar with a long store name: app.js fitNav narrows the name (and logo), then shows icons
   only, then narrows the name again and moves the clock aside, so every section fits. */
.bar.bar-tight .bar-biz { max-width: 150px; }
.bar.bar-tight .bar-logo.has-logo { max-width: 72px; }
.bar.bar-tighter .bar-biz { max-width: 96px; }
.bar.bar-tighter .bar-logo.has-logo { max-width: 40px; }
.bar.bar-tighter .bar-clock { display: none; }
.bar-biz { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Settings: every pill, tab and small button at least 44px. */
.settings-page :is(.pick span, .lang-pick button, .qe-tabs button, .chip-btn, .area-tab, .seg button) { min-height: 44px; }
.settings-page .tax-pct button { width: 44px; }
.settings-page .tax-row { grid-template-columns: minmax(0, 1fr) auto 44px; }
.settings-page .tax-del { width: 44px; height: 44px; }

/* Actions that take something away: quiet red words, apart at the bottom of their group. */
.danger-link { color: var(--bad); border-color: transparent; background: transparent; }
.danger-link:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); }
.set-danger.logo-danger { justify-content: flex-start; margin: 4px 0 0; padding-top: 10px; }
.set-danger.tax-danger { justify-content: flex-start; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }

/* Store checkup: its heading and first line sit together (no empty band between them). */
.owner-checkup > .set-mini { padding-bottom: 4px; }
.owner-checkup > .set-mini + p { border-top: 0; padding-top: 0; }

/* Sales tax's save bar on phones: one row (Not saved, Undo, Save) above the tabs, never over a box. */
@media (max-width: 760px) {
  .set-savebar { flex-wrap: nowrap; gap: 8px; padding: 10px; }
  .set-savebar .badge { white-space: nowrap; }
  .set-savebar .btn { min-height: 44px; padding: 0 12px; white-space: nowrap; }
  .set-savebar .spacer { flex: 1 1 0; min-width: 0; }
}
/* The narrowest phones: the bar's own warning color says "not saved", so the badge steps aside and
   Undo and Save keep one row. */
@media (max-width: 400px) {
  .set-savebar .badge { display: none; }
  .set-savebar .spacer { display: none; }
  .set-savebar .btn { flex: 1 1 auto; min-width: 0; }
  .set-savebar .btn.primary { margin-left: 0; }
}
