/* Daily Receipt: the native app's look. System grouped backgrounds and the system blue tint (the native build sets no
   global accent colour), iOS 26 controls (glass toolbar buttons and tab bar, capsule bordered buttons, insetGrouped
   lists), and the receipt in SF Mono with ReceiptTheme's exact paper / ink / accent colours (which stay the same in
   dark mode, like the native receipt). Follows the system appearance and the store's data-theme override (/mobile.js). */
:root {
  --tint: rgb(0, 122, 255);
  --text: #000;
  --text2: rgba(60, 60, 67, 0.6);
  --text3: rgba(60, 60, 67, 0.3);
  --grouped: #f2f2f7;                       /* systemGroupedBackground */
  --row: #fff;                              /* secondarySystemGroupedBackground */
  --card: #fff;                             /* .background inside the grouped screen */
  --sep: rgba(60, 60, 67, 0.22);
  --fill: rgba(120, 120, 128, 0.16);
  --fill2: rgba(118, 118, 128, 0.12);
  --green: rgb(52, 199, 89); --red: rgb(255, 59, 48); --orange: rgb(255, 149, 0);
  --glass: rgba(255, 255, 255, 0.82);
  --glass-edge: rgba(0, 0, 0, 0.05);
  --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Roboto Mono", monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --tabbar-space: calc(var(--sab) + 116px); /* tab bar (20 + 62) + room so Save / Share / Edit always clear it */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tint: rgb(10, 132, 255);
    --text: #fff; --text2: rgba(235, 235, 245, 0.6); --text3: rgba(235, 235, 245, 0.3);
    --grouped: #000; --row: #1c1c1e; --card: #1c1c1e; --sep: rgba(84, 84, 88, 0.55);
    --fill: rgba(120, 120, 128, 0.32); --fill2: rgba(118, 118, 128, 0.24);
    --green: rgb(48, 209, 88); --red: rgb(255, 69, 58); --orange: rgb(255, 159, 10);
    --glass: rgba(44, 44, 46, 0.78); --glass-edge: rgba(255, 255, 255, 0.08);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --tint: rgb(10, 132, 255);
  --text: #fff; --text2: rgba(235, 235, 245, 0.6); --text3: rgba(235, 235, 245, 0.3);
  --grouped: #000; --row: #1c1c1e; --card: #1c1c1e; --sep: rgba(84, 84, 88, 0.55);
  --fill: rgba(120, 120, 128, 0.32); --fill2: rgba(118, 118, 128, 0.24);
  --green: rgb(48, 209, 88); --red: rgb(255, 69, 58); --orange: rgb(255, 159, 10);
  --glass: rgba(44, 44, 46, 0.78); --glass-edge: rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--grouped); color: var(--text); font: 17px/1.29 var(--sys); -webkit-font-smoothing: antialiased; letter-spacing: -0.01em; }
body { overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; letter-spacing: inherit; }
button:disabled { cursor: default; }
input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.nav-title:focus { outline: none; }
[hidden] { display: none !important; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
hr { border: 0; margin: 0; }

/* ---------- type (Dynamic Type "Large") ---------- */
.t-headline { font-size: 17px; line-height: 22px; font-weight: 600; }
.t-subheadline { font-size: 15px; line-height: 20px; }
.t-footnote { font-size: 13px; line-height: 18px; }
.t-caption { font-size: 12px; line-height: 16px; letter-spacing: 0; }
.t-caption2 { font-size: 11px; line-height: 13px; letter-spacing: 0.01em; }
.w-medium { font-weight: 500; } .w-semibold { font-weight: 600; }
.c-2 { color: var(--text2); } .c-3 { color: var(--text3); } .c-red { color: var(--red); }
.tint { color: var(--tint); }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; display: block; }
.vstack { display: flex; flex-direction: column; min-width: 0; }
.hstack { display: flex; align-items: center; gap: 8px; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap2 { gap: 2px; } .gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap14 { gap: 14px; }
.sf { display: inline-block; vertical-align: -0.125em; flex: none; overflow: visible; }
.label { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.label > .sf { font-size: 1.05em; }

/* ---------- app frame ---------- */
#app { position: fixed; inset: 0; overflow: hidden; }
#stack, #sheets { position: absolute; inset: 0; }
.tab-pane { position: absolute; inset: 0; }
#sheets { pointer-events: none; z-index: 20; }
#sheets > * { pointer-events: auto; }
#overlays { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
#overlays > * { pointer-events: auto; }
#toast { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 100px); z-index: 50; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.covered { visibility: hidden; }

/* ---------- screens + nav bar ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--grouped); padding-top: var(--sat); will-change: transform; }
.screen.in-sheet { padding-top: 0; }
.navbar { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; gap: 8px; min-height: 60px; padding: 8px 16px; flex: none; }
/* iOS 26 scroll edge effect: content fades and softens under the bar instead of a hard bar background */
.navbar::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: calc(-1 * var(--sat)); bottom: -18px; pointer-events: none;
  background: linear-gradient(var(--grouped) calc(var(--sat) + 40%), color-mix(in srgb, var(--grouped) 70%, transparent) 75%, transparent);
  opacity: 0; transition: opacity 0.2s; }
.navbar.scrolled::before { opacity: 1; }
.screen.in-sheet .navbar::before { top: 0; }
.nav-title { grid-column: 2; max-width: 240px; min-width: 0; font: 600 17px/22px var(--sys); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-title.hidden-title { visibility: hidden; }
.navbar.has-large .nav-title { opacity: 0; transition: opacity 0.18s; }
.navbar.has-large.show-title .nav-title { opacity: 1; }
.nav-leading { grid-column: 1; display: flex; align-items: center; justify-self: start; gap: 8px; }
.nav-trailing { grid-column: 3; display: flex; align-items: center; justify-self: end; gap: 8px; }
.screen-body { position: relative; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding-bottom: calc(var(--sab) + 24px); scrollbar-width: thin; }
#stack .screen-body { padding-bottom: var(--tabbar-space); }
#stack .screen { --colw: 760px; }
#stack .screen.today { --colw: 488px; }
@media (min-width: 700px) { #stack .navbar { padding-left: max(16px, calc((100% - var(--colw)) / 2)); padding-right: max(16px, calc((100% - var(--colw)) / 2)); } }
.large-title { font: 700 34px/41px var(--sys); letter-spacing: 0.01em; padding: 0 20px 8px; max-width: 760px; margin: 0 auto; }
.today .large-title { max-width: 488px; }

/* iOS 26 glass toolbar buttons */
.glass { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; min-width: 44px; padding: 0 16px; border-radius: 22px; font-size: 17px; color: var(--text);
  background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.8); backdrop-filter: blur(16px) saturate(1.8);
  box-shadow: 0 0 0 0.5px var(--glass-edge), 0 4px 16px rgba(0, 0, 0, 0.08); transition: transform 0.15s var(--ease), opacity 0.15s; white-space: nowrap; }
.glass-icon { padding: 0; width: 44px; font-size: 21px; }
.glass .sf { font-size: 21px; }
.glass-bold { font-weight: 600; }
.glass-prominent { background: var(--tint); color: #fff; box-shadow: 0 4px 16px color-mix(in srgb, var(--tint) 30%, transparent); }
.glass-subtle { color: var(--text2); }
.glass-subtle .sf { font-size: 19px; }
.glass:active:not(:disabled) { transform: scale(0.94); }
.glass:disabled { color: var(--text3); }
.glass-prominent:disabled { background: var(--fill); color: var(--text3); box-shadow: none; }
.nav-back .sf { font-size: 19px; margin-left: -2px; }

/* ---------- buttons ---------- */
.btn-bordered { --btn: var(--tint); display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; color: var(--btn); background: color-mix(in srgb, var(--btn) 14%, transparent); white-space: nowrap; font-weight: 500; transition: opacity 0.12s, transform 0.15s var(--ease); }
.btn-bordered:not(.prominent) { --btn: var(--tint); background: var(--fill2); }
.btn-bordered.size-regular { min-height: 34px; padding: 0 14px; font-size: 17px; }
.btn-bordered.size-large { min-height: 50px; padding: 0 20px; font-size: 17px; font-weight: 600; width: 100%; }
.btn-bordered.prominent { background: var(--btn); color: #fff; }
.btn-bordered:active:not(:disabled) { opacity: 0.7; }
.btn-bordered:disabled { opacity: 0.5; }
.btn-bordered .sf { font-size: 1.05em; }
.text-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--tint); min-height: 30px; }
.text-btn:active { opacity: 0.4; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; font-size: 19px; }
.icon-btn.tint { color: var(--tint); }
.icon-btn:disabled { color: var(--text3); }
.icon-btn:active:not(:disabled) { opacity: 0.4; }
.spinner { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2.2px solid var(--fill); border-top-color: var(--text2); animation: spin 0.8s linear infinite; }
.spinner.big { width: 30px; height: 30px; border-width: 3px; }
.spinner.dark { border-color: rgba(0, 0, 0, 0.15); border-top-color: #000; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- content columns ---------- */
.col { display: flex; flex-direction: column; gap: 24px; padding: 4px 16px 16px; max-width: 760px; margin: 0 auto; width: 100%; }
.today-col { max-width: 488px; }

/* ---------- Today ---------- */
.ready-state { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.ready-state .till-hero { margin-top: 48px; }
.ready-text { display: flex; flex-direction: column; gap: 6px; }
.rounded-title { font: 700 22px/28px var(--rounded); letter-spacing: 0; }
.print-btn { width: calc(100% - 64px); max-width: 420px; font-family: var(--rounded); min-height: 50px; box-shadow: 0 6px 10px var(--glow); }
.print-btn .sf { font-size: 18px; }
.web-note { max-width: 330px; padding: 0 12px; }
.loading-state { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 100px; }
.receipt-actions { display: flex; gap: 16px; margin-top: 0; }
.grow-btn { flex: 1 1 0; }
.edit-numbers { align-self: center; font-size: 15px; margin-top: -12px; }
.full-btn { width: 100%; }

/* ---------- the receipt ---------- */
.receipt-wrap { width: 100%; max-width: 456px; margin: 0 auto; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.28)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.16)); }
.receipt { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 26px 20px 22px; overflow: hidden;
  /* ReceiptView's paper → paperShadowEdge @ 35 % fade, always over the light grouped grey (as it looks natively in light mode),
     so in dark mode the bottom of the paper doesn't sink into the black background */
  background: linear-gradient(var(--paper), var(--edge35)), #f2f2f7; color: var(--ink); font: 400 13px/1.19 var(--mono); letter-spacing: 0; text-align: left; -webkit-user-select: text; user-select: text; }
.rc-header { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rc-title { font-size: 20px; font-weight: 700; letter-spacing: 1px; margin-right: -1px; }
.rc-store { font-size: 12px; font-weight: 500; letter-spacing: 3px; margin-right: -3px; color: var(--ink75); }
.rc-meta { display: flex; justify-content: space-between; gap: 8px; width: 100%; font-size: 12px; padding-top: 8px; }
.rc-rule { height: 1px; flex: none; background: repeating-linear-gradient(to right, var(--ink55) 0 4px, transparent 4px 7px); }
.rc-items { display: flex; flex-direction: column; gap: 6px; }
.rc-row { display: flex; align-items: baseline; gap: 8px; }
.rc-row > span:first-child, .rc-row > span:last-child { flex: none; white-space: nowrap; }
.rc-dots { flex: 1 1 auto; min-width: 4px; height: 13px; background: repeating-linear-gradient(to right, var(--ink40) 0 1px, transparent 1px 4px) 0 10px / 100% 1px no-repeat; }
.rc-special { display: flex; flex-direction: column; gap: 6px; }
.rc-heading { font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.rc-total { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 700; }
.rc-amount { font-size: 17px; color: var(--accent); white-space: nowrap; }
.rc-footer { text-align: center; font-weight: 500; color: var(--ink85); padding-top: 4px; }
.rc-barcode { display: flex; justify-content: center; align-items: flex-end; gap: 2px; height: 38px; margin-top: 6px; flex: none; }
.rc-barcode > span { background: var(--ink); flex: none; }
.rc-code { text-align: center; font-size: 11px; letter-spacing: 1px; color: var(--ink70); }
.rc-grain { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rc-creases i { position: absolute; left: 0; right: 0; height: 1.5px; margin-top: -0.75px; background: var(--ink05); pointer-events: none; }
.rc-creases i::after { content: ""; position: absolute; left: 0; right: 0; top: 1.95px; height: 0.5px; background: rgba(255, 255, 255, 0.25); }
.rc-curl { position: absolute; left: 0; right: 0; top: 0; height: 14px; background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)); pointer-events: none; }

/* ReceiptTillHero */
.till-hero { position: relative; width: 200px; height: 140px; flex: none; }
.till-paper { position: absolute; left: 46px; top: 9px; width: 108px; height: 62px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 14px 16px 18px;
  background: var(--paper); border-radius: 30px 30px 2px 2px; transform: rotate(-3deg); box-shadow: 0 0 0 0.5px var(--edge), 0 6px 16px rgba(0, 0, 0, 0.25); overflow: hidden; }
.till-paper::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 26px; border-radius: 30px 30px 0 0; background: linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)); }
.till-paper i { display: block; width: 74px; height: 3px; border-radius: 1px; background: var(--ink20); flex: none; }
.till-paper i.tp-bar { width: 56px; height: 6px; border-radius: 2px; background: var(--ink42); }
.till-body { position: absolute; left: 0; top: 22px; width: 200px; height: 96px; border-radius: 18px; background: linear-gradient(rgb(56, 56, 56), rgb(20, 20, 20));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 32px rgba(0, 0, 0, 0.35); }
.till-slot { position: absolute; top: 10px; left: 46px; width: 108px; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.6); }

/* ---------- History ---------- */
.history-col { gap: 8px; }
.week-card, .hist-row { width: 100%; background: var(--card); text-align: left; }
.week-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; margin-bottom: 4px; transition: transform 0.15s var(--ease); }
.week-card:active { transform: scale(0.985); }
.wc-icon { font-size: 22px; display: grid; place-items: center; }
.row-chevron { color: var(--text3); font-size: 14px; display: grid; place-items: center; flex: none; }
.row-chevron .sf { stroke-width: 3; }
.hist-row { position: relative; border-radius: 12px; overflow: hidden; }
.hist-row .swipe-inner { padding: 0; background: var(--card); }
.hist-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; text-align: left; }
.hist-main:active { background: var(--fill2); }
.stat-summary { display: flex; gap: 10px; font-size: 11px; line-height: 13px; color: var(--text3); letter-spacing: 0.01em; }
.stat-summary .label { gap: 3px; }
.hist-total { font: 600 17px/22px var(--mono); letter-spacing: 0; white-space: nowrap; flex: none; }
.empty-history { text-align: center; padding-top: 80px; }
.swipeable { padding: 0 !important; }
.swipe-inner { flex: 1; display: flex; align-items: center; min-width: 0; position: relative; z-index: 1; }
.swipe-delete { position: absolute; right: 0; top: 0; bottom: 0; width: 0; background: var(--red); color: #fff; font-size: 15px; font-weight: 500; overflow: hidden; white-space: nowrap; display: grid; place-items: center; }

/* Weekly */
.weekly-col { gap: 24px; max-width: 488px; }
.week-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 0; margin-bottom: -8px; }
.empty-week { text-align: center; padding-top: 80px; }
.sheet-receipt { max-width: 488px; padding-top: 8px; padding-bottom: 32px; }

/* ---------- insetGrouped list / form ---------- */
.form { padding: 4px 16px 24px; max-width: 720px; margin: 0 auto; width: 100%; }
.group { margin-top: 24px; }
.form > .group:first-child { margin-top: 8px; }
.group-header { padding: 0 20px 8px; font-size: 17px; line-height: 22px; font-weight: 600; color: var(--text2); }
.group-footer { padding: 8px 20px 0; font-size: 13px; line-height: 18px; color: var(--text2); }
.group-rows { background: var(--row); border-radius: 26px; overflow: hidden; }
.row { position: relative; display: flex; align-items: center; width: 100%; min-height: 52px; padding: 12px 20px; text-align: left; color: var(--text); gap: 10px; }
.group-rows > .row + .row::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; border-top: 0.5px solid var(--sep); z-index: 1; }
.group-rows > .opt-row + .opt-row.has-swatch::before, .group-rows > .row:has(.swatch) + .row::before { left: 70px; }
.group-rows > .perm-row + .row::before, .group-rows > .row + .perm-row::before { left: 58px; }
.row-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.row-btn { transition: background 0.15s; }
.row-btn:active { background: var(--fill2); }
.row-tint, .row-tint .label { color: var(--tint); }
.row-destructive, .row-destructive .label { color: var(--red); }
.labeled { justify-content: space-between; }
.lc-label { flex: none; max-width: 62%; }
.lc-value { color: var(--text2); text-align: right; min-width: 0; }
.field { flex: 1; width: 100%; min-width: 0; border: 0; outline: none; background: none; padding: 0; font-size: 17px; line-height: 22px; color: var(--text); -webkit-appearance: none; appearance: none; }
.field::placeholder { color: var(--text3); }
.field-trailing { text-align: right; }
.num-row { cursor: text; }
.num-field { font-variant-numeric: tabular-nums; }
.picker-row { position: relative; cursor: pointer; }
.picker-value { display: inline-flex; align-items: center; gap: 5px; color: var(--text2); text-align: right; min-width: 0; }
.picker-value .sf { font-size: 13px; }
.picker-select { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; font-size: 17px; }
.toggle-row { justify-content: space-between; gap: 12px; cursor: pointer; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 63px; height: 28px; margin: 0; border-radius: 14px; background: var(--fill); cursor: pointer; transition: background 0.25s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 37px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.04); transition: transform 0.3s var(--ease); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(22px); }
.stepper-row { justify-content: space-between; }
.stepper { display: inline-flex; align-items: center; height: 32px; border-radius: 16px; background: var(--fill2); flex: none; }
.stepper-btn { width: 50px; height: 32px; display: grid; place-items: center; font-size: 18px; color: var(--text); }
.stepper-btn:disabled { color: var(--text3); }
.stepper-btn:active:not(:disabled) { opacity: 0.4; }
.minus-bar { width: 14px; height: 2px; border-radius: 1px; background: currentColor; }
.stepper-sep { width: 1px; height: 18px; background: var(--sep); }
html.touch #app .stepper-btn, html.touch #app .tab-item, html.touch #app .icon-btn, html.touch #app .ob-skip { min-height: 0; }

/* Settings */
.opt-row { padding-top: 11px; padding-bottom: 11px; }
.opt-title { color: var(--tint); font-size: 17px; line-height: 22px; }
.opt-sub { color: color-mix(in srgb, var(--tint) 62%, transparent); }
.check { font-size: 22px; display: grid; place-items: center; flex: none; }
.swatch { position: relative; width: 36px; height: 44px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--ink20); display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 6px; flex: none; }
.swatch i { display: block; height: 1.5px; background: var(--ink35); }
.perm-row { gap: 10px; }
.perm-icon { width: 24px; display: grid; place-items: center; color: var(--text2); font-size: 18px; flex: none; }
.caption-row { min-height: 0; padding-top: 2px; padding-bottom: 12px; }
.group-rows > .row + .caption-row::before { display: none; }

/* Today's Numbers */
.numbers-intro { padding: 4px 20px 0; }
.numbers .form > .numbers-intro + .group { margin-top: 18px; }
.sheet-cta { padding: 28px 0 8px; }
.sheet-cta .btn-bordered { font-family: var(--rounded); }

/* ---------- TabView (iOS 26 floating glass tab bar) ---------- */
.tabbar { position: absolute; z-index: 10; left: 50%; bottom: calc(var(--sab) + 20px); transform: translateX(-50%); display: grid; grid-template-columns: repeat(2, 88px); padding: 4px; border-radius: 34px;
  background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); box-shadow: 0 0 0 0.5px var(--glass-edge), 0 8px 30px rgba(0, 0, 0, 0.12); --i: 0; }
.tab-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: 88px; border-radius: 30px; background: var(--fill); transform: translateX(calc(var(--i) * 100%)); transition: transform 0.38s var(--ease); }
.tab-item { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 54px; border-radius: 30px; color: var(--text); }
.tab-item.on { color: var(--tint); }
.tab-icon { position: relative; font-size: 25px; height: 28px; display: grid; place-items: center; }
.tab-icon .sf { grid-area: 1 / 1; }
.tab-label { font-size: 10px; line-height: 12px; font-weight: 600; letter-spacing: 0.01em; }
.tab-item:active .tab-icon { transform: scale(0.92); }
html.onboarding-open .tabbar { visibility: hidden; }
body.has-sheet .tabbar { z-index: 10; }

/* ---------- sheets ---------- */
.sheet-wrap { position: absolute; inset: 0; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.25); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--sat) + 10px); display: flex; flex-direction: column; background: var(--grouped); border-radius: 38px 38px 0 0; overflow: hidden; box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.12); transition: top 0.4s var(--ease); }
.sheet[data-detent="medium"] { top: 50%; }
.sheet-grabber { display: none; } /* the native sheets show no drag indicator; the bar still drags */
.sheet-stack { position: relative; flex: 1; }
.sheet .navbar { padding-top: 14px; }
@media (min-width: 700px) {
  .sheet { top: 50% !important; left: 50%; right: auto; bottom: auto; width: min(580px, calc(100% - 48px)); height: min(820px, calc(100% - 64px)); translate: -50% -50%; border-radius: 32px; }
  .sheet-grabber { display: none; }
  .sheet .navbar { padding-top: 10px; }
}

/* ---------- toast, alert, action sheet, menu ---------- */
.toast { display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(560px, 100%); padding: 12px 18px; border-radius: 999px; color: #fff; background: rgba(0, 0, 0, 0.86); font-size: 16px; pointer-events: auto; opacity: 0; transform: translateY(20px); transition: opacity 0.25s, transform 0.35s var(--ease); }
.toast.on { opacity: 1; transform: none; }
.toast-msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast > .grow { display: none; }
.toast-undo { font-weight: 600; color: #fff; }
.alert-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.3); padding: 24px; }
.alert { width: 300px; max-width: 100%; border-radius: 30px; overflow: hidden; background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); padding: 22px 18px 16px; text-align: left; }
.alert-title { font-weight: 600; font-size: 17px; }
.alert-message { font-size: 15px; line-height: 20px; margin-top: 6px; color: var(--text); }
.alert-field { display: block; width: 100%; margin-top: 14px; padding: 10px 14px; border-radius: 14px; border: 0; outline: none; background: var(--fill2); font-size: 17px; color: var(--text); }
.alert-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.alert-buttons.two { flex-direction: row; }
.alert-btn { flex: 1; min-height: 48px; border-radius: 24px; background: var(--fill2); font-size: 17px; font-weight: 500; text-align: center; color: var(--text); }
.alert-btn:not(.cancel):not(.destructive) { background: var(--tint); color: #fff; font-weight: 600; }
.alert-buttons:not(.two) .alert-btn.cancel:only-child { background: var(--tint); color: #fff; font-weight: 600; }
.alert-btn.destructive { color: var(--red); }
.alert-btn:active { opacity: 0.7; }
.as-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; background: rgba(0, 0, 0, 0.3); padding: 8px 8px calc(var(--sab) + 8px); }
.action-sheet { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 8px; }
.as-group { border-radius: 28px; overflow: hidden; background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); box-shadow: 0 0 0 0.5px var(--glass-edge); }
.as-head { padding: 14px 18px 12px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.as-title { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text2); }
.as-message { font-size: 13px; line-height: 18px; color: var(--text2); }
.as-btn { display: block; width: 100%; min-height: 57px; font-size: 20px; text-align: center; color: var(--tint); border-top: 0.5px solid var(--sep); }
.as-group > .as-btn:first-child { border-top: 0; }
.as-btn.destructive { color: var(--red); }
.as-cancel { font-weight: 600; border-top: 0; }
.as-btn:active { background: var(--fill2); }
.menu-scrim { position: absolute; inset: 0; }
.menu { position: fixed; min-width: 220px; max-width: 300px; border-radius: 22px; overflow: hidden; padding: 6px 0; background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); box-shadow: 0 0 0 0.5px var(--glass-edge), 0 16px 48px rgba(0, 0, 0, 0.22); transform-origin: top center; }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 44px; padding: 10px 18px; font-size: 17px; }
.menu-item:active, .menu-item:focus-visible { background: var(--fill2); outline: none; }
.menu-item.destructive { color: var(--red); }

/* ---------- onboarding (always the dark till gradient) ---------- */
.onboarding { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; background: linear-gradient(rgb(31, 31, 31), rgb(13, 13, 13)); color: #fff; padding-top: var(--sat); color-scheme: dark; }
.ob-store { position: absolute; top: calc(var(--sat) + 8px); left: 16px; z-index: 2; background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1); }
.ob-pager { flex: 1; overflow: hidden; touch-action: pan-y; outline: none; }
.ob-track { display: flex; height: 100%; transition: transform 0.45s var(--ease); }
.ob-page { flex: 0 0 100%; display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 24px 0 calc(var(--sab) + 24px); overflow-y: auto; -webkit-user-select: none; user-select: none; }
.ob-page.ob-pad { gap: 24px; padding-left: 20px; padding-right: 20px; }
.ob-page > * { width: 100%; max-width: 520px; }
.ob-spacer { flex: 1 1 0; min-height: 8px; }
.ob-hero { display: flex; justify-content: center; padding-bottom: 20px; }
.ob-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.ob-head.tight { gap: 8px; }
.ob-title { font: 700 34px/41px var(--rounded); letter-spacing: 0.01em; }
.ob-sub { font: 400 20px/25px var(--rounded); color: rgba(255, 255, 255, 0.65); }
.ob-title2 { font: 700 22px/28px var(--rounded); }
.ob-ask { padding: 0 40px; max-width: 520px; }
.ob-note { font-size: 15px; line-height: 20px; color: rgba(255, 255, 255, 0.55); }
.ob-perms { background: rgba(255, 255, 255, 0.06); border-radius: 18px; margin: 0 8px; width: calc(100% - 16px); }
.ob-perms hr { border-top: 0.5px solid rgba(255, 255, 255, 0.08); }
.ob-perm { display: flex; align-items: center; gap: 14px; padding: 16px; }
.ob-perm-icon { width: 30px; font-size: 21px; display: grid; place-items: center; flex: none; }
.ob-perm-title { font: 600 17px/22px var(--rounded); }
.ob-perm-detail { font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.55); letter-spacing: 0; }
.ob-primary { display: grid; place-items: center; width: calc(100% - 64px); max-width: 456px; min-height: 50px; padding: 14px; border-radius: 999px; background: #fff; color: #000; font: 700 17px/22px var(--rounded); box-shadow: 0 8px 14px rgba(0, 0, 0, 0.4); transition: transform 0.15s var(--ease), opacity 0.15s; flex: none; }
.ob-primary:active { transform: scale(0.97); opacity: 0.9; }
.ob-skip { margin-top: -14px; font-size: 15px; color: rgba(255, 255, 255, 0.6); min-height: 32px; width: auto !important; }
.ob-choices { display: flex; flex-direction: column; gap: 10px; padding: 0 20px; }
.ob-choice { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); color: #fff; text-align: left; box-shadow: inset 0 0 0 1.5px transparent; transition: background 0.2s, box-shadow 0.2s; }
.ob-choice.on { background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 60%, transparent); }
.ob-choice-title { font: 600 17px/22px var(--rounded); }
.ob-choice-sub { font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.55); letter-spacing: 0; }
.ob-check { font-size: 22px; display: grid; place-items: center; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }

/* ---------- wide windows: the tab bar moves to the top centre, as TabView does on iPad ---------- */
@media (min-width: 900px) {
  .tabbar { bottom: auto; top: calc(var(--sat) + 8px); grid-template-columns: repeat(2, 112px); padding: 3px; border-radius: 26px; }
  .tab-pill { top: 3px; bottom: 3px; left: 3px; width: 112px; border-radius: 22px; }
  .tab-item { flex-direction: row; gap: 6px; height: 40px; border-radius: 22px; }
  .tab-icon { font-size: 18px; height: 22px; }
  .tab-label { font-size: 15px; line-height: 20px; font-weight: 600; }
  #stack .navbar .nav-title { visibility: hidden; }
  #stack .screen-body { padding-bottom: calc(var(--sab) + 32px); }
  #toast { bottom: calc(var(--sab) + 24px); }
}

/* ---------- Yuzool OS: connection offer, connected numbers and their source apps ---------- */
.os-offer { margin-top: 4px; width: 100%; text-align: left; }
.os-offer-row { align-items: flex-start; gap: 14px; padding-top: 16px; padding-bottom: 16px; }
.os-offer-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; background: var(--tint); font-size: 18px; }
.os-offer-title { font-weight: 600; font-size: 16px; line-height: 21px; }
.os-offer-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.os-offer-btns .btn-bordered.size-regular { min-height: 32px; font-size: 15px; }
.os-today { width: 100%; text-align: left; margin-top: 0; }
.lc-src { display: flex; flex-direction: column; gap: 1px; }
.src-cap[hidden] { display: none; }
.os-sources { text-align: center; padding: 0 12px; margin-top: -6px; }
.os-perm-row .os-perm-btn { flex: none; }
