/* Corkdoor app. Mobile first. Uses ../tokens.css and ../base.css */
:root {
  --nav-h: 68px;
  /* the phone's status bar (top) and home bar or Android buttons (bottom). env() is the browser's own number; the Android app also gets
     --safe-area-inset-* from Capacitor on every page load and rotation, so the larger of the two always wins and nothing is hand tuned */
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  --safe-t: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --tap: 48px;
}
html { scroll-padding-top: 0; -webkit-text-size-adjust: 100%; }
body { background: var(--app-sand); min-height: 100svh; overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
.boot { padding: var(--space-xl) var(--space-md); color: var(--color-muted); }
button { cursor: pointer; }
button, a, input, select, textarea { touch-action: manipulation; }

/* shell */
.shell { max-width: 640px; margin-inline: auto; min-height: 100svh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  padding: calc(var(--space-sm) + var(--safe-t)) var(--space-md) var(--space-sm); background: color-mix(in oklab, var(--app-sand) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--app-sand-rule); }
.brand { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.02em; display: flex; align-items: center; gap: var(--space-xs); }
a.brand { color: inherit; text-decoration: none; }
.brand i { width: 14px; height: 14px; border-radius: 4px; background: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.linkbtn { background: none; border: 0; color: var(--color-muted); font-size: var(--text-sm); min-height: 44px; padding: 0 var(--space-xs); text-decoration: underline; text-underline-offset: 3px; }
main { flex: 1; padding: var(--space-md) var(--space-md) calc(var(--nav-h) + var(--safe-b) + var(--space-xl)); }
h1.page { font-size: var(--text-2xl); max-width: none; margin: var(--space-xs) 0 var(--space-md); }
h2.sub { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); margin: var(--space-lg) 0 var(--space-xs); max-width: none; line-height: 1.3; }
.muted { color: var(--color-muted); font-size: var(--text-sm); }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky-nav); padding-bottom: var(--safe-b); background: var(--color-sheet); border-top: 1px solid var(--app-sand-rule); }
.nav-in { max-width: 640px; margin-inline: auto; height: var(--nav-h); display: grid; grid-template-columns: 1fr 1fr 84px 1fr 1fr; align-items: center; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%; font-size: 0.75rem; font-weight: 500; color: var(--color-muted); text-decoration: none; }
.nav a svg { width: 24px; height: 24px; }
.nav a[aria-current="page"] { color: var(--color-ink); }
.nav a[aria-current="page"] svg { color: var(--color-accent); }
.snap { justify-self: center; width: 64px; height: 64px; margin-top: -26px; border-radius: 50%; border: 4px solid var(--color-sheet); background: var(--color-accent); color: var(--color-accent-ink);
  display: grid; place-items: center; box-shadow: var(--shadow-lift); }
.snap svg { width: 28px; height: 28px; }
.snap:active { transform: scale(0.95); }

/* cards and lists */
.card { background: var(--color-sheet); border: 1px solid var(--app-sand-rule); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.list { display: grid; gap: var(--space-xs); margin: 0; padding: 0; list-style: none; }
.rcpt { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: var(--space-sm); padding: var(--space-sm); min-height: 72px; text-decoration: none; color: inherit; }
.rcpt:active { background: var(--app-sand); }
.thumb { width: 56px; height: 56px; border-radius: 8px; background: var(--app-sand-3); overflow: hidden; display: grid; place-items: center; font-size: 0.75rem; font-weight: 600; color: var(--color-muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.r-main { min-width: 0; }
.r-vendor { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-meta { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-amt { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.badge { display: inline-block; font-size: 0.6875rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--color-yellow-soft); color: var(--color-yellow-ink); margin-top: 2px; }
.badge.ok { background: var(--color-green-soft); color: var(--color-green); }
.chips { display: flex; gap: var(--space-xs); overflow-x: auto; padding-bottom: var(--space-2xs); margin-bottom: var(--space-xs); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
/* the "What is it?" choices wrap onto more rows so every one can be seen without scrolling sideways */
.chips.wrap { flex-wrap: wrap; justify-content: center; overflow: visible; padding-bottom: 0; }
.chips.wrap .chip { flex: 0 0 calc((100% - 2 * var(--space-xs)) / 3); min-width: 0; justify-content: center; text-align: center; white-space: normal; line-height: 1.2; padding-inline: 8px; }
@media (max-width: 479px) { .chips.wrap .chip { flex-basis: calc((100% - var(--space-xs)) / 2); } }
/* the second row (kinds of utility or insurance) sits under a thin line with its own small heading */
.chips.wrap.sub { margin-top: var(--space-xs); padding-top: var(--space-sm); border-top: 1px solid var(--app-sand-rule); }
.chips.wrap .sub-ask { flex: 0 0 100%; font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); }
.chip { flex: none; min-height: 40px; padding: 0 var(--space-md); border-radius: 999px; border: 1px solid var(--app-sand-rule); background: var(--color-sheet); color: var(--color-ink-2); font-weight: 500; font-size: var(--text-sm); }
.chip[aria-pressed="true"] { background: var(--color-ink); color: var(--color-paper-2); border-color: var(--color-ink); }
.empty { padding: var(--space-xl) var(--space-lg); text-align: center; display: grid; gap: var(--space-xs); justify-items: center; }
.empty h2 { font-size: var(--text-xl); }

/* forms */
form { display: grid; gap: var(--space-md); }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--text-sm); font-weight: 600; }
input, select, textarea { width: 100%; min-height: var(--tap); padding: 10px 14px; font-size: 16px; /* 16px stops iOS zoom */ color: var(--color-ink); background: var(--color-sheet);
  border: 1px solid var(--app-sand-rule); border-radius: 10px; appearance: none; -webkit-appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--color-muted) 50%), linear-gradient(135deg, var(--color-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
textarea { min-height: 88px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; border-color: var(--color-focus); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.btn { min-height: var(--tap); padding: 0 var(--space-lg); border-radius: 10px; border: 1px solid var(--color-ink); background: var(--color-ink); color: var(--color-paper-2); font-weight: 600; font-size: var(--text-md); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.accent { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.btn.ghost { background: transparent; color: var(--color-ink); border-color: var(--app-sand-rule); }
.btn.danger { background: transparent; border-color: transparent; color: var(--color-error); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn.block { width: 100%; }
.actions { display: grid; gap: var(--space-xs); margin-top: var(--space-xs); }
.err { color: var(--color-error); font-size: var(--text-sm); min-height: 1.2em; }

/* receipt photo */
.photo { display: block; border-radius: var(--radius-card); overflow: hidden; background: var(--app-sand-3); border: 1px solid var(--app-sand-rule); margin-bottom: var(--space-md); max-height: 46svh; }
.photo { position: relative; }
.scan { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.scan::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 28%;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent, #e8772e) 38%, transparent));
  border-bottom: 2px solid var(--accent, #e8772e); box-shadow: 0 2px 12px color-mix(in srgb, var(--accent, #e8772e) 70%, transparent);
  transform: translateY(-100%); animation: scanpass .7s ease-in-out forwards; }
@keyframes scanpass {
  0% { transform: translateY(-100%); opacity: 1; }
  50% { transform: translateY(357%); }
  50.1% { transform: translateY(357%) scaleY(-1); }
  100% { transform: translateY(-100%) scaleY(-1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .scan { display: none; } }
.photo img { width: 100%; max-height: 46svh; object-fit: contain; background: var(--app-sand-3); }
.pdfbox { padding: var(--space-lg); text-align: center; font-weight: 600; }
.readrow { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin: calc(var(--space-xs) * -1) 0 var(--space-md); min-height: 44px; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-left: -6px; padding: 0 6px; color: var(--color-muted); text-decoration: none; font-size: var(--text-sm); }

/* units + export */
.unit { padding: var(--space-md); display: grid; gap: var(--space-xs); }
.unit-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); }
.unit-name { font-weight: 600; font-size: var(--text-lg); font-family: var(--font-display); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { padding: 10px 4px; text-align: left; border-bottom: 1px solid var(--app-sand-rule); }
td.num, th.num { text-align: right; }
tfoot td { font-weight: 600; border-bottom: 0; }
.tablewrap { padding: var(--space-xs) var(--space-md); }

/* auth */
.auth { max-width: 420px; margin-inline: auto; padding: calc(var(--space-2xl) + var(--safe-t)) var(--space-md) var(--space-xl); display: grid; gap: var(--space-lg); }
.auth h1 { font-size: var(--text-2xl); }
.auth .card { padding: var(--space-lg); }
.note { background: var(--color-green-soft); color: var(--color-green); padding: var(--space-sm) var(--space-md); border-radius: 10px; font-size: var(--text-sm); }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + var(--space-md)); z-index: var(--z-toast); background: var(--color-ink); color: var(--color-paper-2);
  padding: 12px 18px; border-radius: 999px; font-size: var(--text-sm); box-shadow: var(--shadow-lift); max-width: calc(100vw - 32px); text-align: center; }

@media (min-width: 700px) {
  main { padding-top: var(--space-lg); }
  .nav-in { border-inline: 1px solid var(--app-sand-rule); }
}

/* unit board: a sand surface, one pile per Schedule E category */
.unit-name { color: inherit; text-decoration: none; }
.unit-open { text-decoration: none; }
.unit-head h1.page { margin-bottom: var(--space-3xs); }
.unit-head .muted { margin-bottom: var(--space-sm); }
.board-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin: var(--space-xs) 0 var(--space-sm); min-height: 44px; }
.board-sum { font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); font-variant-numeric: tabular-nums; }
.board-bar select { width: auto; min-height: 40px; padding-block: 6px; font-size: 16px; }
.board { border-radius: 10px; padding: var(--space-md) var(--space-sm) var(--space-lg); border: 6px solid oklch(36% 0.06 55);
  background: url("../assets/sand-grain.png") 0 0 / 256px 256px, url("../assets/sand-glint.png") 0 0 / 224px 224px, url("../assets/sand-tone.png") 0 0 / 640px 640px, var(--color-sand);
  box-shadow: inset 0 0 0 1px oklch(24% 0.05 55 / 0.55), inset 0 var(--space-sm) var(--space-md) calc(-1 * var(--space-xs)) color-mix(in oklab, var(--color-ink) 14%, transparent),
    0 10px 18px -12px oklch(18% 0.006 60 / 0.45); }
.piles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--space-md) var(--space-md); align-items: start; }
.pile-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-sm); padding: 0 var(--space-2xs) var(--space-xs); margin-bottom: var(--space-xs); border-bottom: 1px solid color-mix(in oklab, var(--color-ink) 22%, transparent); }
.pile-name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-md); line-height: 1.15; letter-spacing: -0.01em; max-width: none; text-wrap: balance; }
.pile-count { display: block; font-size: var(--text-xs); color: var(--color-ink-2); }
.pile-sum { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slips { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.slip { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: start; gap: var(--space-xs); padding: 7px 10px 7px 22px; min-height: 40px; font-size: var(--text-sm); line-height: 1.3; color: inherit; text-decoration: none;
  background: var(--color-sheet); border-radius: 3px; transform: rotate(var(--tilt, 0deg)); transition: transform var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out);
  box-shadow: 0 1px 1px oklch(18% 0.006 60 / 0.12), 0 9px 14px -10px oklch(18% 0.006 60 / 0.5); }
.slip::before { content: ""; position: absolute; left: 9px; top: 11px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, oklch(80% 0.13 45), oklch(58% 0.19 35)); box-shadow: 0 1px 1.5px oklch(18% 0.006 60 / 0.4); }
.slip:active { transform: rotate(0deg) translateY(1px); }
@media (hover: hover) { .slip:hover { transform: rotate(0deg) translateY(-1px); } }
.pile-more { display: block; width: 100%; margin-top: 6px; min-height: 40px; background: none; border: 1px dashed color-mix(in oklab, var(--color-ink) 30%, transparent);
  border-radius: 10px; color: var(--color-ink-2); font: inherit; font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.pile-more:hover { background: color-mix(in oklab, var(--color-ink) 6%, transparent); }
.slip-main { display: grid; gap: 1px; min-width: 0; }
.slip-vendor { font-weight: 600; overflow-wrap: anywhere; }
.slip-meta { font-size: var(--text-xs); color: var(--color-muted); overflow-wrap: anywhere; }
.slip-amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slip .badge { justify-self: start; }
/* a receipt dated after today: a red bar across the top of its slip */
.slip-bar { grid-column: 1 / -1; margin: -7px -10px 2px -22px; padding: 3px 10px 3px 22px; background: var(--color-error); color: #fff; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.01em; border-radius: 3px 3px 0 0; }
.slip.has-bar::before { top: 30px; }   /* the pin sits on the paper, just under the bar */
.board-empty { display: grid; justify-items: center; gap: var(--space-xs); text-align: center; padding: var(--space-xl) var(--space-md); }
.board-empty-t { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); }
.board-empty p { color: var(--color-ink); }

/* inline "new category" form on the Check it screen, and the custom category list */
.newcat { padding: var(--space-md); display: grid; gap: var(--space-sm); background: var(--app-sand); box-shadow: none; }
.newcat .field + .field { margin-top: 0; }
.newcat .row2 .btn { padding-inline: var(--space-sm); }

/* receipts: search + unit filter, coming up */
.r-filters { display: grid; grid-template-columns: 1fr auto; gap: var(--space-xs); margin-bottom: var(--space-xs); }
.r-filters input, .r-filters select { min-height: 44px; font-size: 16px; }
.r-filters select { width: auto; max-width: 42vw; }
.coming { padding: 12px 14px; margin-bottom: var(--space-sm); background: var(--color-yellow-soft); border-color: transparent; }
.coming-list { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 4px; }
.coming-list li { display: flex; justify-content: space-between; gap: var(--space-sm); font-size: var(--text-sm); }
.coming-t { font-weight: 600; color: var(--color-yellow-ink); }
.coming-list li.late .coming-t { color: var(--color-error); }

/* rent grid */
.rent-card { padding: 14px; margin-bottom: var(--space-sm); }
.rent-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.rent-cell { display: grid; gap: 1px; justify-items: center; align-content: center; min-height: 52px; padding: 4px; border-radius: 8px; border: 1px solid var(--app-sand-rule); background: var(--color-paper-2, #fff); color: var(--color-ink-2); font: inherit; cursor: pointer; }
.rent-cell .rc-m { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.rent-cell .rc-a { font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.rent-cell.paid { background: var(--color-green-soft); border-color: transparent; color: var(--color-green); font-weight: 600; }
.rent-cell.due .rc-a { color: var(--color-muted); font-size: 0.6875rem; }
.rent-cell.future { opacity: 0.55; }
.rent-cell[aria-pressed="true"] { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.rent-edit { display: grid; gap: var(--space-sm); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--app-sand-rule); }
.rent-edit-t { font-family: var(--font-display); font-size: var(--text-md); margin: 0; }
@media (min-width: 520px) { .rent-grid { grid-template-columns: repeat(6, 1fr); } }

/* key dates, contractors, more */
.date-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); padding: 12px 14px; }
.date-row.late { border-color: var(--color-error); }
.date-row.done { opacity: 0.6; }
.date-actions { display: flex; align-items: center; gap: var(--space-sm); flex: none; }
.btn.small { min-height: 36px; padding: 0 var(--space-md); font-size: var(--text-sm); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--text-sm); font-weight: 600; }
.check input { width: 20px; height: 20px; min-height: 0; }
.contractor { padding: 14px; display: grid; gap: 4px; }
.contractor.muted-card { opacity: 0.6; }
.k-status { font-size: var(--text-sm); }
.k-w9 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-sm); margin-top: 6px; }
.badge.hot { background: var(--color-error); color: #fff; }
.more-item { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); padding: 14px 16px; color: inherit; text-decoration: none; min-height: 60px; }
.fine { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-md); }

/* printable report */
.report { background: var(--color-sheet); border: 1px solid var(--app-sand-rule); border-radius: var(--radius-card); padding: var(--space-md); }
.rep-unit { margin-top: var(--space-lg); break-inside: avoid; }
.rep-unit h2 { font-family: var(--font-display); font-size: var(--text-lg); margin: 0 0 2px; }
.rep-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: var(--text-sm); }
.rep-table td { padding: 6px 4px; border-bottom: 1px solid var(--app-sand-rule); vertical-align: top; }
.rep-table td:first-child { width: 2.2em; color: var(--color-muted); }
.rep-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-income td { font-weight: 600; }
.rep-net td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--color-ink); }
@media print {
  .nav, .top, .toast, .no-print { display: none !important; }
  body, .shell { background: #fff !important; }
  main { padding: 0 !important; }
  .report { border: 0; padding: 0; box-shadow: none; }
}

/* add to home screen */
.install-card { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); padding: 14px 16px; margin-top: var(--space-md); }
.install-card .install-btn { flex: none; min-height: 44px; font-weight: 600; }
.sheet { width: min(92vw, 420px); margin: auto; padding: var(--space-lg); border: 1px solid var(--app-sand-rule); border-radius: var(--radius-card); background: var(--color-sheet); color: var(--color-ink); }
.sheet::backdrop { background: oklch(18% 0.006 60 / 0.5); }
/* duplicate receipt sheet: the gentle red warning under "Don't warn me" (light red fill, dark red text) */
.dup-off-row { margin-top: var(--space-md); padding-top: 12px; border-top: 1px solid var(--app-sand-rule); display: grid; gap: 8px; }
.dup-off-note { margin: 0; padding: 8px 10px; border: 1px solid oklch(80% 0.08 25); border-radius: 8px; background: oklch(95% 0.03 25); color: oklch(42% 0.14 25); font-size: var(--text-sm); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dup-off-note { background: oklch(30% 0.06 25); border-color: oklch(45% 0.1 25); color: oklch(88% 0.06 25); } }
:root[data-theme="dark"] .dup-off-note { background: oklch(30% 0.06 25); border-color: oklch(45% 0.1 25); color: oklch(88% 0.06 25); }
/* receipt photo popup: nearly full screen, the photo zooms inside its own stage (see showPhotoLightbox in app.js) */
.photo-lightbox { width: min(96vw, 960px); max-width: none; max-height: none; margin: auto; padding: 10px; border: 0; border-radius: var(--radius-card); background: var(--color-sheet); color: var(--color-ink); overflow: hidden; }
.photo-lightbox::backdrop { background: oklch(12% 0.006 60 / 0.82); }
.lb-stage { position: relative; height: calc(100vh - 110px); height: calc(100dvh - 110px); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 8px; background: oklch(94% 0.01 80); cursor: zoom-in; }
.lb-stage.zoomed { cursor: grab; }
.lb-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; -webkit-user-drag: none; pointer-events: none; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 10px; }
.lb-bar .btn { min-height: 44px; min-width: 96px; }
@media (max-width: 600px) { .photo-lightbox { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); } .lb-stage { height: calc(100dvh - 76px - env(safe-area-inset-bottom)); } }
.checkout-sheet { width: min(96vw, 520px); max-height: 94vh; max-height: 94dvh; overflow: auto; padding: var(--space-md); }
/* on a phone the card form takes the whole screen (vh counts the Safari address bar, dvh does not), and scrolls inside, so nothing is cut off */
@media (max-width: 600px) {
  .checkout-sheet { position: fixed; inset: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0;
    padding: var(--space-sm) var(--space-sm) calc(var(--space-lg) + env(safe-area-inset-bottom, 0px)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .checkout-head { position: sticky; top: 0; z-index: 2; background: var(--color-sheet); padding: 4px 0 8px; margin-bottom: 0; }
  .checkout-mount { min-height: 60dvh; }
}
.checkout-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-sm); }
.checkout-head h2 { margin: 0; }
/* the cancel reasons: tap to tick, with a box that fills in and a tinted row */
.cancel-opt { display: flex; align-items: center; gap: 10px; }
.cancel-opt::before { content: ""; flex: none; width: 20px; height: 20px; border: 2px solid var(--color-muted); border-radius: 5px; box-sizing: border-box; }
.cancel-opt[aria-pressed="true"] { background: var(--color-accent-soft); border-color: var(--color-accent, #e8672f); font-weight: 600; }
.cancel-opt[aria-pressed="true"]::before { border-color: var(--color-accent, #e8672f); background: var(--color-accent, #e8672f) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 6.8' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
/* soft grey bars shown while the card and receipts load */
.skel { height: 14px; border-radius: 6px; margin: 10px 0; background: linear-gradient(90deg, var(--app-sand, #efe6cf) 25%, #f8f2e2 50%, var(--app-sand, #efe6cf) 75%); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.bill-what { display: block; margin-top: 2px; font-size: var(--text-xs, 0.8125rem); color: var(--color-muted); }
.plan-mine { margin-top: 6px; font-size: var(--text-lg); }
.plan-covers { font-size: var(--text-sm); color: var(--color-muted); margin-bottom: 4px; }
/* the More page: three groups with a bigger gap between them */
.more-label { margin: 28px 0 8px; font-family: var(--font-body, inherit); font-size: var(--text-xs, 12px); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); }
h1.page + .more-label { margin-top: 4px; }
.more-install { margin-top: 28px; }
/* the owner preview: the panel on More, and a small badge that stays on screen while a preview is on */
.preview-card { margin-top: 28px; border: 2px dashed #6b4fbb; padding: var(--space-md); }
.preview-dock { display: none; }
/* on a laptop the panel sits at the bottom of the sidebar instead (it can be hidden); the More page copy and the badge are not needed there */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  main .preview-card, .preview-pill { display: none !important; }
  .preview-dock { display: flex; flex-direction: column; position: absolute; left: var(--space-sm); right: var(--space-sm); bottom: var(--space-sm); z-index: 2;
    max-height: calc(100svh - 360px - var(--demo-h, 0px)); min-height: 44px; background: var(--color-surface, #fff); border: 2px dashed #6b4fbb; border-radius: 12px; overflow: hidden; }
  .preview-dock.is-on { background: #f4f0fc; }
  .preview-dock .preview-card { order: 0; margin: 0; border: 0; padding: 10px 10px 0; overflow-y: auto; flex: 1 1 auto; min-height: 0; background: none; }
  .preview-compact .field { margin: 0 0 8px; }
  .preview-compact label { font-size: var(--text-xs, 0.75rem); margin-bottom: 4px; display: block; }
  .preview-compact .preview-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .preview-compact .seg-btn { font-size: 0.75rem; padding: 6px 4px; min-height: 32px; width: 100%; white-space: nowrap; overflow: visible; text-overflow: clip; }
  .preview-compact select { padding: 6px 8px; min-height: 34px; }
  .preview-compact .btn { min-height: 34px; font-size: 0.8125rem; }
  .preview-toggle { order: 1; display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 12px; border: 0; background: #6b4fbb; color: #fff; font: inherit; font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
  .preview-state { order: 2; padding: 6px 12px 8px; color: #4b2f9a; font-size: 0.75rem; line-height: 1.3; }
}
.preview-seg { flex-wrap: wrap; }
.preview-seg .seg-btn { flex: 1 1 auto; }
.preview-pill { position: fixed; left: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 50; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: #6b4fbb; color: #fff; border-radius: 999px; font-size: var(--text-sm); box-shadow: 0 4px 14px rgb(0 0 0 / 0.25); max-width: calc(100vw - 24px); }
.preview-pill .btn { background: #fff; color: #4b2f9a; border-color: #fff; }
/* an anchored Terms or Privacy heading must clear the yellow or red banner that sits above the page */
.privacy .sub { scroll-margin-top: calc(var(--demo-h, 0px) + 24px); }
.plan-opt.is-small { opacity: 0.85; }
.rent-cell:disabled { opacity: 0.65; cursor: default; }
/* a read only unit sits below the active ones, slightly faded but still easy to read */
.card.is-readonly { opacity: 0.78; background: color-mix(in oklab, var(--color-sheet) 80%, var(--color-rule)); }
/* the downgrade banner and notes use Excel's conditional formatting colours: light red fill with dark red text, and yellow fill with dark yellow text */
.acct-banner.acct-choose { background: #FFC7CE; color: #9C0006; border-bottom: 1px solid #9C0006; }
.acct-banner.acct-chosen { background: #FFEB9C; color: #9C5700; border-bottom: 1px solid #9C5700; }
.acct-banner.acct-choose .btn { background: #9C0006; color: #fff; border-color: #9C0006; }
.acct-banner.acct-chosen .btn { background: #9C5700; color: #fff; border-color: #9C5700; }
.acct-banner.acct-chosen .btn.ghost, .acct-banner.acct-choose .btn.ghost { background: transparent; color: inherit; }
.note.note-red { background: #FFC7CE; color: #9C0006; }
.note.note-red a { color: inherit; text-decoration: underline; }
.note.note-yellow { background: #FFEB9C; color: #9C5700; }
.note-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: 10px; }
.note-red .btn.accent { background: #9C0006; border-color: #9C0006; color: #fff; }
.note-yellow .btn.accent { background: #9C5700; border-color: #9C5700; color: #fff; }
.note-red .btn.ghost, .note-yellow .btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.pick-sheet { width: min(96vw, 480px); max-height: 94vh; overflow: auto; }
.pick-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
/* each unit is a tappable row; a green check and the words "Stays active" or "Read only" show the choice */
.pick-row { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-sm); align-items: center; padding: 10px; border: 1px solid var(--app-sand-rule); border-radius: 10px; cursor: pointer; }
.pick-row.on { background: var(--color-green-soft); border-color: var(--color-green); }
.pick-row.locked { opacity: 0.55; cursor: not-allowed; }
.pick-row:focus-within { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.pick-mark { width: 26px; height: 26px; border: 2px solid var(--app-sand-rule); border-radius: 7px; display: grid; place-items: center; font-weight: 700; color: transparent; background: var(--color-sheet); }
.pick-row.on .pick-mark { background: var(--color-green); border-color: var(--color-green); color: #fff; }
.pick-state { font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2, #6b6256); }
.pick-row.on .pick-state { color: var(--color-green); }
.pick-name { display: grid; }
.pick-when { font-size: var(--text-sm); }
.pick-count { margin: 0 0 8px; font-weight: 600; }
.pick-names { margin: 0; padding-left: 1.2em; }
.bill-list { list-style: none; margin: 0; padding: 0; display: grid; }
.bill-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-md); align-items: center; padding: 8px 0; border-top: 1px solid var(--app-sand-rule); }
.bill-row:first-child { border-top: 0; }
.bill-links { display: flex; gap: var(--space-sm); }
.sheet h2 { font-family: var(--font-display); font-size: var(--text-lg); margin: 0 0 4px; }
.sheet-steps { padding-left: 1.2em; display: grid; gap: 10px; margin: var(--space-md) 0; }

/* PDF first page preview, unit buttons */
.photo .pdfpage { display: block; width: 100%; max-height: 46svh; object-fit: contain; background: #fff; }
.unit-seg { display: flex; flex-wrap: nowrap; gap: var(--space-xs); }
.seg-btn { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: var(--tap); padding: 0 var(--space-sm); border-radius: 10px; border: 1px solid var(--app-sand-rule); background: var(--color-sheet); color: var(--color-ink-2); font: inherit; font-weight: 500; cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--color-ink); color: var(--color-paper-2); border-color: var(--color-ink); font-weight: 600; }
.bill-seg { display: flex; gap: var(--space-xs); margin: 0 0 var(--space-md); }
.bill-seg .seg-btn { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; padding-block: 8px; text-align: center; }
/* the Plan & billing row on More as the trial's progress bar: the card fills from the left (--p), soft green for days 1 to 10, yellow for 11 to 20, red for 21 to 30 */
.more-item.trial-bar { --p: 0%; --fill: oklch(89% 0.07 150); --edge: oklch(60% 0.09 150); }
.more-item.trial-bar.is-yellow { --fill: oklch(91.5% 0.12 95); --edge: oklch(66% 0.11 85); }
.more-item.trial-bar.is-red { --fill: oklch(86% 0.08 25); --edge: oklch(60% 0.12 25); }
/* the grouped list style (apple.css) makes a card inside a list transparent, so this selector is written to outrank it */
.list:not(.unit-papers) > li > .more-item.trial-bar {
  background: linear-gradient(90deg, transparent calc(var(--p) - 1px), color-mix(in oklab, var(--edge) 50%, transparent) calc(var(--p) - 1px), color-mix(in oklab, var(--edge) 50%, transparent) var(--p), transparent var(--p)), linear-gradient(90deg, var(--fill) var(--p), var(--color-sheet) var(--p)); background-repeat: no-repeat; }
@media (prefers-reduced-motion: no-preference) { .more-item.trial-bar { transition: background 0.25s ease; } }
.plan-includes > summary { cursor: pointer; margin: 0; }
.plan-includes[open] > summary { margin-bottom: var(--space-xs); }
.checkout-summary { margin: 0 0 var(--space-sm); font-weight: 600; }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); }

/* snap menu: slides out from behind the bottom bar */
.snapscrim { position: fixed; inset: 0; z-index: calc(var(--z-sticky-nav) - 2); background: transparent; }
.snapmenu { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: calc(var(--z-sticky-nav) - 1); display: flex; justify-content: center; padding-inline: var(--space-md);
  pointer-events: none; transform: translateY(calc(100% + 10px)); visibility: hidden; transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.22s; }
.snapmenu[data-open="true"] { transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.snapmenu-in { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(100%, 420px); padding: 12px; border-radius: 18px; background: var(--color-sheet); border: 1px solid var(--app-sand-rule); box-shadow: 0 10px 30px -8px oklch(18% 0.006 60 / 0.35); }
.snapopt { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 82px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--app-sand-rule); background: var(--color-paper-2, #fff); color: var(--color-ink); font: inherit; font-size: var(--text-xs); font-weight: 600; cursor: pointer; }
.snapopt svg { width: 28px; height: 28px; color: var(--color-accent); }
.snapopt:active { transform: translateY(1px); background: var(--color-accent-soft); }
@media (prefers-reduced-motion: reduce) { .snapmenu { transition: none; } }

/* receipt that still needs a check */
.checkform { border: 2px solid var(--color-accent); border-radius: var(--radius-card); padding: 14px; background: color-mix(in oklab, var(--color-accent-soft) 35%, var(--color-sheet)); }
.check-banner { margin: 0 0 4px; font-size: var(--text-sm); font-weight: 600; color: var(--color-ink); }
.field.flag > input, .field.flag > select, .field.flag > textarea, .field.flag .unit-seg { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.field.flag > label, .field.flag .label-row label { color: var(--color-ink); }
.field.flag > label::after, .field.flag .label-row label::after { content: " · fill in"; font-weight: 500; color: var(--color-accent); }
.snapsub { display: block; font-size: 0.6875rem; font-weight: 400; line-height: 1.2; color: var(--color-muted); margin-top: -2px; }

/* heads-up messages, vendor memory */
.alerts { display: grid; gap: 6px; }
.alerts:empty { display: none; }
.alert { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: var(--text-sm); background: var(--color-yellow-soft); color: var(--color-yellow-ink); }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.hint { margin: 0; font-size: var(--text-xs); color: var(--color-ink-2); }

/* ideas */
.idea { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; cursor: pointer; min-height: 60px; }
.idea input[type="checkbox"] { flex: none; width: 24px; height: 24px; min-height: 0; margin-top: 2px; accent-color: var(--color-accent); }
.idea-body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.idea-t { font-weight: 600; }
.idea-d { font-size: var(--text-sm); color: var(--color-ink-2); }
.idea-count { flex: none; font-size: var(--text-xs); font-weight: 600; color: var(--color-muted); white-space: nowrap; }
.idea-note { padding: 12px 14px; display: grid; gap: 4px; }
.idea-note p { margin: 0; overflow-wrap: anywhere; }

/* privacy page */
.privacy { display: grid; gap: var(--space-sm); max-width: 640px; margin-inline: auto; }
.privacy p, .privacy li { max-width: none; }
.priv-list { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.privacy-public { padding-block: var(--space-lg); }

/* delete account */
.danger-wrap { margin-top: var(--space-xl); display: grid; gap: var(--space-sm); }
.danger-link { color: var(--color-error); justify-self: start; min-height: 44px; }
.danger-zone { scroll-margin-top: calc(var(--demo-h, 0px) + var(--safe-t) + 72px); padding: 16px; display: grid; gap: var(--space-sm); border-color: var(--color-error); }
.danger-zone p { margin: 0; }
.btn.danger-solid { background: var(--color-error); border-color: var(--color-error); color: #fff; }

/* AI reading settings */
.ai-page { display: grid; gap: var(--space-sm); }
.ai-status { padding: 14px 16px; display: grid; gap: 6px; justify-items: start; }
.ai-status p { margin: 0; }
.ai-warn { padding: 16px; display: grid; gap: var(--space-sm); border-color: var(--color-accent); }
.ai-warn p { margin: 0; }

/* date inputs: text on the left, no centered indent (iPhone centers them by default) */
input[type="date"] { -webkit-appearance: none; appearance: none; display: block; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type="date"]::-webkit-datetime-edit { padding: 0; }
input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }

/* amount with a dollar sign */
.money-in { position: relative; }
.money-sign { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--color-muted); font-size: 16px; pointer-events: none; }
.money-in input { padding-left: 28px; }
.field.flag > .money-in > input { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }

/* slide to confirm */
.slide { position: relative; width: 100%; height: 52px; border-radius: 999px; overflow: hidden; user-select: none; -webkit-user-select: none;
  background: color-mix(in oklab, var(--color-error) 10%, var(--color-sheet)); border: 1px solid color-mix(in oklab, var(--color-error) 40%, transparent); }
.slide-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: color-mix(in oklab, var(--color-error) 28%, transparent); }
.slide-text { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 44px; font-weight: 600; font-size: var(--text-sm); color: var(--color-error); pointer-events: none; }
.slide-knob { position: absolute; left: 3px; top: 3px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--color-error); color: #fff; font-size: 20px; line-height: 1;
  cursor: grab; touch-action: none; box-shadow: 0 1px 3px oklch(18% 0.006 60 / 0.35); }
.slide[data-state="drag"] .slide-knob { cursor: grabbing; }
.slide-back .slide-knob, .slide-back .slide-fill { transition: transform 0.22s ease-out, width 0.22s ease-out; }
.slide.is-disabled { opacity: 0.45; }
.slide.is-disabled .slide-knob { cursor: not-allowed; }
.slide-knob:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.slide-row { flex-basis: 100%; margin-top: 4px; }
.date-row { flex-wrap: wrap; }

/* units at a glance, unit details page */
.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.glance-stat { display: grid; gap: 1px; padding: 8px 10px; border-radius: 10px; background: var(--app-sand-3, var(--color-paper-3)); min-width: 0; }
.glance-v { font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glance-l { font-size: 0.6875rem; color: var(--color-ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.glance-stat.neg .glance-v { color: var(--color-error); }
.glance-sub { font-size: 0.6875rem; color: var(--color-ink-2); line-height: 1.25; overflow-wrap: anywhere; }
a.glance-stat { color: inherit; text-decoration: none; }
a.glance-stat.tap { cursor: pointer; border: 1px solid transparent; transition: border-color .15s; }
a.glance-stat.tap:hover, a.glance-stat.tap:focus-visible { border-color: var(--color-accent); }
a.glance-stat.tap.on { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.glance-lines { display: grid; gap: 4px; margin-top: 10px; }
.glance-line { font-size: var(--text-sm); color: var(--color-ink-2); text-decoration: none; padding-left: 16px; position: relative; }
.glance-line::before { content: ""; position: absolute; left: 2px; top: 0.5em; width: 7px; height: 7px; border-radius: 50%; background: var(--color-muted); }
.glance-line.ok::before { background: var(--color-green); }
.glance-line.warn { color: var(--color-ink); font-weight: 600; }
.glance-line.warn::before { background: var(--color-accent); }
.unit-open { display: block; margin-top: 10px; }
.unit-notes { margin: 4px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--color-yellow-soft); color: var(--color-yellow-ink); font-size: var(--text-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.ud-form { display: grid; gap: var(--space-sm); }
.ud-form textarea { min-height: 120px; }
a.linkbtn { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }

/* address block spacing on the unit details page */
.ud-form .row2 { align-items: start; }

/* unit details page: tighter */
.ud-form { gap: 10px; }
.ud-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.ud-grid.ud-street { grid-template-columns: 2fr 1fr; }
.ud-grid.ud-csz { grid-template-columns: 1.5fr 0.9fr 1fr; }
.ud-grid .hint.ud-side { align-self: end; padding-bottom: 14px; }
.ud-form .field { gap: 4px; }
.ud-form input, .ud-form select, .ud-form textarea { padding-inline: 10px; }
.ud-form .money-in input { padding-left: 24px; }
.ud-form .money-sign { left: 10px; }
.ud-form textarea { min-height: 76px; }
.ud-form .hint { margin-top: -4px; }
.ud-form .actions { margin-top: 2px; }

/* overview */
.attn { padding: 12px 14px; margin-bottom: var(--space-sm); }
.attn.ok { padding: 10px 14px; }

/* page title in the top bar */
.top-title { flex: 1; min-width: 0; text-align: center; font-weight: 600; font-size: var(--text-lg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-ink); }
.top-title:empty { display: none; }
h1.page.in-top { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* demo page banner */
.demo-banner { position: sticky; top: 0; z-index: calc(var(--z-sticky) + 1); display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap;
  padding: calc(var(--space-xs) + var(--safe-t)) var(--space-md) var(--space-xs); background: #c4281c; color: #fff; font-size: var(--text-sm); font-weight: 600; line-height: 1.3; }
.demo-banner .btn { background: #fff; color: #8f1d14; border-color: #fff; min-height: 36px; padding: 0 12px; text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
.is-demo .top, .has-banner .top { top: var(--demo-h, 48px); padding-top: var(--space-sm); }

/* demo banner stays one slim row */
.demo-banner { flex-wrap: nowrap; padding-block: 6px; font-size: 0.8125rem; }
.demo-msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-short { display: none; }
@media (max-width: 479px) { .demo-long { display: none; } .demo-short { display: inline; } }
.demo-banner .btn { min-height: 30px; padding: 0 10px; font-size: 0.8125rem; flex: none; }
.is-demo .top, .has-banner .top { padding-top: 10px; }

/* Check-it form: let wide children (unit chips) scroll instead of stretching the form past the screen */
.checkform { grid-template-columns: minmax(0, 1fr); }
.checkform > * { min-width: 0; }
.row2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.field { grid-template-columns: minmax(0, 1fr); }

/* laptop and desktop: the bottom tab bar becomes a left sidebar and the content gets room.
   Gated on a real mouse so phones and tablets keep the phone layout. */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  :root { --nav-h: 0px; --side-w: 232px; }
  .shell { max-width: 1280px; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: auto auto 1fr; align-content: start; }
  .demo-banner { grid-column: 1 / -1; }
  .top { grid-column: 2; grid-row: 2; padding-inline: var(--space-xl); }
  .top .brand { display: none; }
  .top-title { text-align: left; }
  main { grid-column: 2; grid-row: 3; width: 100%; max-width: 1000px; padding: var(--space-lg) var(--space-xl) var(--space-2xl); }

  .nav { grid-column: 1; grid-row: 2 / 4; position: sticky; top: var(--demo-h, 0px); align-self: start; z-index: var(--z-sticky);
    height: calc(100svh - var(--demo-h, 0px)); padding: var(--space-lg) var(--space-sm); border-top: 0; border-right: 1px solid var(--app-sand-rule); }
  .nav::before { content: "Corkdoor"; display: flex; align-items: center; gap: var(--space-xs); padding: 0 12px var(--space-lg);
    font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.02em; }
  .nav-in { max-width: none; height: auto; display: flex; flex-direction: column; align-items: stretch; gap: 4px; border-inline: 0; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; font-size: var(--text-sm); }
  .nav a:hover { background: var(--app-sand); color: var(--color-ink); }
  .nav a[aria-current="page"] { background: var(--color-accent-soft); }
  .snap { order: -1; width: 100%; height: 48px; margin: 0 0 var(--space-md); border: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: none; }
  .snap svg { width: 22px; height: 22px; }
  .snap::after { content: "Add a receipt"; font-weight: 600; font-size: var(--text-sm); }
  .snap:hover { filter: brightness(0.97); }

  /* the add menu drops out beside the sidebar button instead of rising from the bottom bar */
  .snapmenu { left: max(var(--space-sm), calc((100vw - 1280px) / 2 + var(--space-sm))); right: auto; bottom: auto; top: calc(var(--demo-h, 0px) + 138px); padding: 0; justify-content: flex-start; transform: translateY(-6px); opacity: 0; transition: transform 0.18s ease, opacity 0.18s ease, visibility 0s linear 0.18s; }
  .snapmenu[data-open="true"] { transform: none; opacity: 1; }
  .snapmenu-in { grid-template-columns: 1fr; width: calc(var(--side-w) - var(--space-md)); gap: 6px; padding: 8px; }
  .snapopt { grid-template-columns: auto 1fr; justify-items: start; align-items: center; min-height: 48px; gap: 12px; padding: 8px 12px; }
  .snapopt svg { width: 22px; height: 22px; }
  .snapsub { grid-column: 2; font-weight: 400; color: var(--color-muted); margin-top: -8px; }
  .toast { bottom: var(--space-lg); }
  .list.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
  /* receipt screen: photo stays in view on the left while the form scrolls on the right */
  main:has(.r-split) { max-width: 1120px; }
  .r-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-xl); align-items: start; }
  .r-split:has(.r-side:empty) { grid-template-columns: minmax(0, 640px); }
  .r-side:empty { display: none; }
  .r-side { position: sticky; top: calc(var(--demo-h, 0px) + 72px); }
  .r-side .photo, .r-side .photo img { max-height: 68svh; }
}

/* demo sandbox */
.demo-acts { display: flex; align-items: center; gap: 10px; flex: none; }
.demo-reset { background: none; border: 0; color: #fff; font: inherit; font-size: 0.8125rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; min-height: 30px; padding: 0 4px; }
/* the add menu holds four choices in the demo (Type it in), so show two per row on a phone */
.snapmenu-in:has(> :nth-child(4)) { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) { .snapmenu-in:has(> :nth-child(4)) { grid-template-columns: 1fr; } }
.snapnote { margin: 2px 4px 0; padding-top: 8px; border-top: 1px solid var(--app-sand-rule); font-size: var(--text-xs); line-height: 1.35; color: var(--color-muted); max-width: none; }

/* welcome page after confirming an email: one centered column, papers pinned to the same sand board the unit pages use */
.welcome { max-width: 680px; margin-inline: auto; }
.welcome-note { margin-bottom: var(--space-sm); font-weight: 600; }
.welcome-intro { margin: 0 0 var(--space-md); max-width: none; }
.welcome-board { padding: var(--space-lg) var(--space-md) var(--space-md); }
.whead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2xs) var(--space-sm); }
.whead h2 { white-space: nowrap; }
.wtoggle { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 999px; font: inherit; font-size: var(--text-sm); font-weight: 600;
  color: var(--color-ink-2); background: var(--app-sand, #f6efdc); border: 1px solid var(--app-sand-rule); }
.wtoggle i { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.wtoggle[aria-expanded="true"] i { transform: translateY(1px) rotate(225deg); }
.welcome-form { display: grid; gap: var(--space-lg); }
.welcome-units { display: grid; gap: var(--space-lg); }
.wblock { position: relative; padding: var(--space-lg) var(--space-md) var(--space-md); display: grid; gap: var(--space-sm);
  background: var(--color-sheet); border-radius: 4px; border: 0; transform: rotate(var(--tilt, 0deg));
  box-shadow: 0 1px 1px oklch(18% 0.006 60 / 0.12), 0 12px 18px -12px oklch(18% 0.006 60 / 0.55); }
.wblock::before { content: ""; position: absolute; left: 50%; top: -5px; width: 11px; height: 11px; margin-left: -5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, oklch(80% 0.13 45), oklch(58% 0.19 35)); box-shadow: 0 1px 2px oklch(18% 0.006 60 / 0.45); }
.welcome-form > .wblock:nth-child(odd), .welcome-units > .wblock:nth-child(odd) { --tilt: -0.3deg; }
.welcome-form > .wblock:nth-child(even), .welcome-units > .wblock:nth-child(even) { --tilt: 0.25deg; }
.wgrid { display: grid; gap: var(--space-sm); align-items: start; }
.wgrid.w2 { grid-template-columns: 1fr 1fr; }
.wgrid.w3 { grid-template-columns: 1.5fr 0.9fr 1fr; }
.wblock .field, .wblock .wgrid > * { min-width: 0; }
.wextra { display: grid; gap: var(--space-sm); }
.wblock:not(.show-details) .wextra { display: none; }
.welcome-actions { display: grid; gap: var(--space-xs); }
.welcome-actions .linkbtn { color: var(--color-ink-2); justify-self: center; }
.welcome-err { min-height: 0; margin: 0; text-align: center; }
.welcome-err:empty { display: none; }
@media (max-width: 479px) { .wgrid.w2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .wblock { transform: none; } .wtoggle i { transition: none; } }
.rep-for { font-weight: 600; font-size: var(--text-lg); margin: 0 0 var(--space-2xs); max-width: none; }

/* Units page: each unit is a paper pinned to the framed board (same look as the welcome page and a unit's receipt board) */
.units-board { padding: var(--space-lg) var(--space-md) var(--space-md); }
.unit-papers { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
@media (min-width: 760px) { .unit-papers { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } }
.unit-papers > .unit { position: relative; padding: var(--space-lg) var(--space-md) var(--space-md); border: 0; border-radius: 4px; transform: rotate(var(--tilt, 0deg));
  box-shadow: 0 1px 1px oklch(18% 0.006 60 / 0.12), 0 12px 18px -12px oklch(18% 0.006 60 / 0.55); }
.unit-papers > .unit::before { content: ""; position: absolute; left: 50%; top: -5px; width: 11px; height: 11px; margin-left: -5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, oklch(80% 0.13 45), oklch(58% 0.19 35)); box-shadow: 0 1px 2px oklch(18% 0.006 60 / 0.45); }
.unit-papers > .unit:nth-child(odd) { --tilt: -0.3deg; }
.unit-papers > .unit:nth-child(even) { --tilt: 0.25deg; }
@media (prefers-reduced-motion: reduce) { .unit-papers > .unit { transform: none; } }
/* on a phone the frame and paper padding must not squeeze the money: keep every dollar amount readable */
@media (max-width: 559px) {
  .units-board { padding: var(--space-lg) 6px var(--space-sm); }
  .unit-papers > .unit { padding: var(--space-lg) 12px var(--space-sm); }
  .unit-papers .glance { gap: 6px; }
  .unit-papers .glance-stat { padding: 8px 6px; }
  .unit-papers .glance-v { font-size: 0.9375rem; }
}
@media (max-width: 389px) { .unit-papers .glance-v { font-size: 0.8125rem; } .unit-papers .glance-stat { padding: 8px 5px; } }

/* address autofill dropdown under the street field */
.ac-host { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: var(--z-sticky); margin: 4px 0 0; padding: 4px; list-style: none; max-height: 280px; overflow: auto;
  background: var(--color-sheet); border: 1px solid var(--app-sand-rule); border-radius: 10px; box-shadow: 0 12px 24px -10px oklch(18% 0.006 60 / 0.45); }
.ac-list[hidden] { display: none; }
.ac-item { display: grid; gap: 1px; padding: 9px 10px; min-height: 44px; border-radius: 8px; cursor: pointer; }
.ac-item:hover, .ac-item[aria-selected="true"] { background: var(--color-accent-soft); }
.ac-main { font-weight: 600; font-size: var(--text-sm); }
.ac-sec { font-size: var(--text-xs); color: var(--color-muted); }
.ac-attr { padding: 6px 10px 2px; font-size: 0.6875rem; color: var(--color-muted); text-align: right; }

/* sign in / create account screens */
.auth-aside { text-align: center; margin-top: var(--space-2xs); }
.auth .label-row { min-height: 0; }
.auth .label-row .linkbtn { min-height: 32px; font-size: var(--text-sm); }

/* Email a receipt page (More): one tidy column, the address on a pinned paper */
.inbox-page { max-width: 620px; display: grid; gap: var(--space-md); }
.inbox-intro { margin: 0; color: var(--color-ink-2); font-size: var(--text-md); max-width: none; }
.inbox-address { position: relative; padding: var(--space-lg) var(--space-md) var(--space-md); text-align: center; border-radius: 6px;
  box-shadow: 0 1px 1px oklch(18% 0.006 60 / 0.12), 0 12px 18px -12px oklch(18% 0.006 60 / 0.45); }
.inbox-address::before { content: ""; position: absolute; left: 50%; top: -5px; width: 11px; height: 11px; margin-left: -5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, oklch(80% 0.13 45), oklch(58% 0.19 35)); box-shadow: 0 1px 2px oklch(18% 0.006 60 / 0.45); }
.inbox-label { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); }
.inbox-addr { margin: var(--space-xs) 0 var(--space-md); padding: 12px 14px; border-radius: 10px; border: 1px dashed var(--app-sand-rule);
  background: var(--app-sand-3, var(--color-paper-3)); font-weight: 600; font-size: var(--text-md); word-break: break-all; user-select: all; }
.inbox-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.inbox-actions .btn { flex: 1 1 140px; }
.inbox-tip { margin: var(--space-sm) 0 0; font-size: var(--text-sm); color: var(--color-ink-2); }
.inbox-card { padding: var(--space-md); }
.inbox-h { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); margin: 0 0 var(--space-sm); max-width: none; line-height: 1.3; }
.inbox-sub { margin: 0 0 var(--space-sm); font-size: var(--text-sm); color: var(--color-ink-2); }
.inbox-steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.inbox-steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; line-height: 1.45; }
.inbox-steps li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-accent-soft); color: var(--color-ink); font-weight: 600; font-size: var(--text-sm); }
.inbox-senders { list-style: none; margin: 0 0 var(--space-sm); padding: 0; display: grid; gap: var(--space-xs); }
.inbox-senders li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: 8px 12px; min-height: 44px;
  border: 1px solid var(--app-sand-rule); border-radius: 10px; background: var(--color-paper-2, #fff); }
.sender-mail { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.inbox-add { display: flex; gap: var(--space-xs); }
.inbox-add input { flex: 1 1 auto; min-width: 0; }
.inbox-add .btn { flex: none; padding: 0 var(--space-md); }
.inbox-foot { margin: 0; }
.inbox-reset { text-align: center; }
.inbox-conf { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.inbox-conf .btn { flex: none; }
@media (max-width: 479px) { .inbox-conf { flex-direction: column; align-items: stretch; } }

/* Terms and Privacy: a readable column (the sign-in width made them feel squished), a little more air, text at body size */
.auth.privacy-public { max-width: 760px; gap: var(--space-md); }
.privacy { max-width: 700px; gap: var(--space-md); line-height: 1.65; }
.privacy p, .privacy li { font-size: var(--text-md); }
.privacy h2.sub { margin-top: var(--space-lg); }
.privacy .priv-list { gap: 12px; }
.privacy h1.page { font-size: var(--text-xl, 1.75rem); margin-bottom: var(--space-xs); }

/* Sign in, create account and reset on a big screen: the phone sized card looked lost on a wide page, so everything grows a step */
@media (min-width: 900px) {
  .auth:not(.privacy-public) { max-width: 520px; padding-top: calc(var(--space-2xl) * 1.5 + var(--safe-t)); gap: var(--space-xl); }
  .auth:not(.privacy-public) h1 { font-size: 2.25rem; }
  .auth:not(.privacy-public) .card { padding: var(--space-xl); }
  .auth:not(.privacy-public) .hint { font-size: var(--text-sm); }
  .auth:not(.privacy-public) input { min-height: 54px; font-size: 1.0625rem; }
  .auth:not(.privacy-public) .btn { min-height: 54px; font-size: 1.0625rem; }
  .auth:not(.privacy-public) .muted { font-size: var(--text-md); }
}

.trial-note { margin: 0; padding: var(--space-sm) var(--space-md); border-radius: 10px; background: var(--color-green-soft); color: var(--color-ink); font-size: var(--text-sm); line-height: 1.5; max-width: none; }
.auth .hint { max-width: none; }

/* "iPhone app coming soon" note on the sign up page: under the form card on narrower screens, a card at the right edge on wide ones */
.ios-note { position: relative; display: flex; align-items: flex-start; gap: var(--space-sm); padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md);
  border: 1px solid var(--app-sand-rule); border-radius: 14px; background: var(--color-sheet); box-shadow: var(--shadow-card); font-size: var(--text-sm); line-height: 1.45; color: var(--color-ink-2); }
.ios-pin { flex: none; width: 12px; height: 12px; margin-top: 5px; border-radius: 4px; background: var(--color-accent); }
.ios-text { min-width: 0; display: grid; gap: 2px; }
.ios-text strong { color: var(--color-ink); font-size: var(--text-md); }
.ios-x { flex: none; width: 32px; height: 32px; margin: -4px -2px 0 0; border: 0; background: none; color: var(--color-muted); font-size: 1.5rem; line-height: 1; border-radius: 8px; cursor: pointer; }
.ios-x:hover { background: var(--app-sand-3, #efe3c8); color: var(--color-ink); }
@media (min-width: 1200px) {
  .ios-note { position: fixed; right: var(--space-xl); top: 50%; width: 300px; z-index: 5; opacity: 0; transform: translateY(-50%) translateX(28px); animation: ios-in 0.5s ease 1s forwards; }
  @keyframes ios-in { to { opacity: 1; transform: translateY(-50%); } }
}
@media (prefers-reduced-motion: reduce) { .ios-note { animation: none !important; opacity: 1 !important; transform: none; } @media (min-width: 1200px) { .ios-note { transform: translateY(-50%) !important; } } }

/* Plan page: status with a trial bar, the plans, what is included, questions */
.plan-statusrow { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.plan-bar { height: 8px; border-radius: 99px; background: var(--app-sand-3, #efe3c8); overflow: hidden; margin-top: 10px; }
.plan-bar i { display: block; height: 100%; background: var(--color-accent); border-radius: 99px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.plan-opt { display: grid; align-content: start; gap: 2px; padding: var(--space-md); }
.plan-opt.is-rec { border: 2px solid var(--color-accent); }
.plan-opt .plan-flag { justify-self: start; margin-bottom: 6px; }
.plan-name { font-weight: 600; font-size: var(--text-md); }
.plan-after { margin: 2px 0 10px; color: var(--color-muted); font-size: var(--text-sm); }
.plan-note { margin: 0; font-size: var(--text-sm); }
.plan-included { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.plan-included li { position: relative; padding-left: 26px; line-height: 1.4; }
.plan-included li::before { content: ""; position: absolute; left: 5px; top: 0.3em; width: 6px; height: 11px; border: solid var(--color-green); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.plan-faq { border-top: 1px solid var(--app-sand-rule); padding: 10px 0; }
.plan-faq:first-of-type { border-top: 0; }
.plan-faq summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 600; list-style: none; }
.plan-faq summary::-webkit-details-marker { display: none; }
.plan-faq summary::after { content: "+"; color: var(--color-muted); }
.plan-faq[open] summary::after { content: "\2013"; }
.plan-faq p { margin: 8px 0 0; color: var(--color-ink-2); }
@media (max-width: 479px) { .plan-grid { gap: var(--space-sm); } .plan-opt { padding: var(--space-sm); } .plan-opt .btn { padding-inline: 8px; font-size: var(--text-sm); } }
.plan-more { margin: 0; text-align: center; padding: var(--space-xs) 0; }

/* trial banner (same slim bar as the demo banner, calmer colours) */
.acct-banner.acct-trial { background: var(--app-sand-3, #efe3c8); color: var(--color-ink); border-bottom: 1px solid var(--app-sand-rule); }
.acct-banner.acct-trial .btn { background: var(--color-ink); color: var(--color-paper-2, #fff); border-color: var(--color-ink); }
.acct-banner.acct-ended { background: var(--color-accent); color: var(--color-ink); }
.acct-banner.acct-ended .btn { background: var(--color-ink); color: var(--color-paper-2, #fff); border-color: var(--color-ink); }

/* Plan page (More, Plan) */
.plan-page { max-width: 620px; display: grid; gap: var(--space-md); }
.plan-card { padding: var(--space-md); }
.plan-h { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); margin: 0 0 var(--space-xs); max-width: none; line-height: 1.3; }
.plan-promise { background: var(--color-green-soft); border-color: transparent; }
.plan-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.plan-tier { border: 1px solid var(--app-sand-rule); border-radius: 12px; padding: var(--space-sm) var(--space-md); background: var(--color-paper-2, #fff); }
.plan-price { font-family: var(--font-display); font-weight: 600; font-size: var(--text-2xl, 1.75rem); letter-spacing: -0.02em; }
.plan-price span { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); margin-left: 2px; }
.plan-what { color: var(--color-ink-2); font-size: var(--text-sm); }

.oauth { display: grid; gap: var(--space-xs); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.google-btn:hover { background: #f8f9fa; }
.g-mark { font-weight: 700; font-size: 1.1em; background: linear-gradient(90deg, #4285f4 0 35%, #ea4335 35% 60%, #fbbc05 60% 80%, #34a853 80%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--color-muted, #6b6b6b); font-size: var(--text-sm); max-width: none; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .25; }
/* the home screen row wraps its button under the text on narrow phones, so it never widens the page */
.install-card { flex-wrap: wrap; }
.install-card > div { flex: 1 1 14rem; min-width: 0; }
/* More list: long descriptions wrap instead of widening every card past the screen */
.list > li { min-width: 0; }
.more-item > div:first-child { min-width: 0; }
.more-item .r-meta { white-space: normal; }
/* small phones: city gets its own line so State and ZIP have room (they were cut off at 360 wide) */
@media (max-width: 479px) { .wgrid.w3 { grid-template-columns: 1fr 1fr; } .wgrid.w3 > :first-child { grid-column: 1 / -1; } }
.install-card .install-btn { padding-left: 0; }

/* tax year page: the less common formats sit under one line */
.more-formats summary { cursor: pointer; font-weight: 600; color: var(--color-muted); min-height: 44px; display: flex; align-items: center; list-style: none; }
.more-formats summary::-webkit-details-marker { display: none; }
.more-formats summary::before { content: "+"; margin-right: 8px; }
.more-formats[open] summary::before { content: "\2212"; }
.apple-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #000; color: #fff; border: 1px solid #000; font-weight: 600; }
.apple-btn:hover { background: #1a1a1a; }

/* Sign in and create account on a phone: with the Apple and Google buttons added, tighten the spacing so the whole page fits without scrolling */
@media (max-width: 899px) {
  .auth:not(.privacy-public) { padding-top: calc(var(--space-md) + var(--safe-t)); padding-bottom: var(--space-sm); gap: var(--space-sm); }
  .auth:not(.privacy-public) h1 { font-size: 1.5rem; line-height: 1.2; }
  .auth:not(.privacy-public) .card { padding: var(--space-md); }
  .auth:not(.privacy-public) .card form { gap: var(--space-sm); }
  .auth:not(.privacy-public) .oauth { gap: 8px; }
  .auth:not(.privacy-public) .oauth .btn { min-height: 44px; }
  .auth:not(.privacy-public) .or-line { margin: 0; }
  .auth:not(.privacy-public) .field { gap: 4px; }
  .auth:not(.privacy-public) .auth-aside { margin-top: 0; }
}

/* More page: notification switches */
.notify-row { padding: var(--space-sm) var(--space-md); }
.notify-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.notify-text { min-width: 0; }
.notify-details { margin-top: 10px; padding-top: 10px; border-top: 1px solid color-mix(in oklab, currentColor 12%, transparent); font-size: var(--text-sm); }
.info-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; border-radius: 50%; border: 1.5px solid var(--color-muted); background: none; color: var(--color-muted); font: italic 700 13px/1 Georgia, serif; vertical-align: 1px; padding: 0; cursor: pointer; position: relative; }
.info-btn::after { content: ""; position: absolute; inset: -11px; }
.info-btn[aria-expanded="true"] { background: var(--color-muted); color: #fff; }
.switch { flex: none; position: relative; width: 51px; height: 31px; padding: 0; border: 0; border-radius: 999px; background: #d3ccbb; cursor: pointer; transition: background .2s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--color-green, #2e9d57); }
.switch[aria-checked="true"] .knob { transform: translateX(20px); }
.switch:disabled { opacity: .55; cursor: default; }
.switch::after { content: ""; position: absolute; inset: -7px -4px; }

/* the one time AI question in the iPhone app: a small card, not a full screen */
.sheet.ai-ask { width: min(86vw, 340px); padding: var(--space-md); }
.ai-ask h2 { font-size: var(--text-md, 1.0625rem); margin: 0 0 6px; }
.ai-ask-text { margin: 0 0 6px; font-size: var(--text-sm); line-height: 1.4; }
.ai-ask-fine { margin: 0 0 10px; font-size: 0.8125rem; line-height: 1.4; }
.ai-ask:focus, .ai-ask h2:focus { outline: none; }
.ai-ask-fine a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; background: none; border: 0; padding: 0; box-shadow: none; }
.ai-ask .btn { min-height: 44px; }

/* More page switch rows: the short line under the title wraps instead of being cut off */
.notify-text .r-meta { white-space: normal; overflow: visible; text-overflow: clip; }

/* the banner at the top keeps clear of the iPhone status bar and notch */
.demo-banner { padding-top: calc(6px + var(--safe-t)); }

/* unit buttons on the check page: long names wrap onto a second line instead of being cut off, two to a row */
.unit-seg { flex-wrap: wrap; justify-content: center; }
.unit-seg .seg-btn { flex: 0 0 calc((100% - 2 * var(--space-xs)) / 3); white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.2; padding-block: 8px; text-align: center; }

/* Check it on a phone: the photo is a slim strip (tap to see it full size) so the form is on the first screen */
@media (max-width: 899px) {
  .r-side .photo { max-height: 128px; margin-bottom: var(--space-sm); }
  .r-side .photo img, .r-side .photo .pdfpage { max-height: 128px; width: 100%; object-fit: cover; object-position: top; }
  .r-side .photo::after { content: "Tap to enlarge"; position: absolute; right: 8px; bottom: 8px; padding: 2px 9px; border-radius: 999px; background: rgb(0 0 0 / .55); color: #fff; font-size: 0.75rem; line-height: 1.5; pointer-events: none; }
}
@media (min-width: 900px) { .save-next { display: none; } }

/* plan cards: the two buttons sit level with each other whichever card has the "Fits your units" label */
.plan-opt { display: flex; flex-direction: column; }
.plan-opt > .btn { margin-top: auto; }
.plan-flag-gap { display: block; height: 22px; margin-bottom: 6px; }
/* Coming soon cards get padding; Suggestions tick boxes show (the app's input style hides checkmarks) */
.coming-item { padding: var(--space-md); }
.idea input[type="checkbox"] { appearance: auto; -webkit-appearance: checkbox; }

/* tick boxes and radio buttons everywhere: the app's input style removes the native look, which hid the checkmark */
input[type="checkbox"], input[type="radio"] { appearance: auto; -webkit-appearance: auto; width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--color-accent); }

/* plan cards: the "Fits your units" label is only as wide as its text, and everything in the buttons is centered */
.plan-opt .plan-flag { align-self: flex-start; }
.plan-opt .btn { display: flex; justify-content: center; align-items: center; text-align: center; }

/* Overview "ready to log": the pinned papers sit a little tighter than the Units page, and the buttons inside use the full paper width */
.this-month .unit-papers > .unit { gap: var(--space-2xs); }
.this-month .rent-tap, .this-month .rent-tap + .rent-tap { margin-top: 6px; }
.this-month .unit-top { align-items: center; }

/* "Review and respond": the page that lists what was offered, with Accept or Deny on each. One column, big tap targets, Done stays reachable on a phone. */
.auth.approve { max-width: 560px; gap: var(--space-md); }
.approve-card { display: grid; gap: var(--space-md); }
.approve-card .card { padding: var(--space-lg); display: grid; gap: var(--space-sm); }
.approve-card h1 { font-size: var(--text-xl); margin: 0; line-height: 1.2; }
.approve-quick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); }
.approve-items { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.approve-item { display: grid; gap: var(--space-sm); padding: var(--space-md); background: var(--color-sheet); border: 1.5px solid var(--app-sand-rule); border-radius: var(--radius-card, 14px); transition: border-color var(--dur-short, .15s) var(--ease-out, ease); }
.approve-item h2 { margin: 0; font-size: 1.0625rem; font-weight: 600; overflow-wrap: anywhere; }
.approve-desc { margin: 0; font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.45; }
.approve-item.is-accept { border-color: var(--color-green); }
.approve-item.is-deny { border-color: var(--color-error); }
.approve-seg { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); }
.approve-seg button { min-height: var(--tap, 46px); border-radius: 10px; border: 1px solid var(--app-sand-rule); background: var(--color-sheet); color: var(--color-ink); font: inherit; font-weight: 600; cursor: pointer; }
.approve-seg button[aria-pressed="true"].yes { background: var(--color-green); border-color: var(--color-green); color: #fff; }
.approve-seg button[aria-pressed="true"].no { background: var(--color-error); border-color: var(--color-error); color: #fff; }
.approve-done { display: grid; gap: var(--space-xs); position: sticky; bottom: 0; padding: var(--space-sm) 0 calc(var(--space-sm) + var(--safe-b, 0px)); background: linear-gradient(to top, var(--app-sand) 72%, transparent); }
.approve-summary { display: grid; gap: var(--space-sm); }
.approve-summary ul { margin: 4px 0 0; padding-left: 20px; }
.approve-block { gap: 4px; }
.approve-support, .approve-foot { text-align: center; }
@media (max-width: 479px) { .auth.approve { padding-inline: var(--space-sm); } .approve-card .card { padding: var(--space-md); } }

/* per unit access when inviting: a row for each unit with None, View, Edit */
.access-list { display: grid; gap: var(--space-xs); margin-left: 32px; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--app-sand-rule); }
.access-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.access-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 15.5rem; max-width: 100%; }
.access-seg .seg-btn { flex: none; min-height: 40px; padding: 0 6px; font-size: var(--text-sm); }
@media (max-width: 479px) { .access-list { margin-left: 0; } .access-seg { width: 100%; } }

/* shared units: can edit is green, view only is blue, so they read apart at a glance */
.badge.share-edit { background: var(--color-green-soft); color: var(--color-green); }
.badge.share-view { background: oklch(92% 0.04 250); color: oklch(40% 0.12 250); }

/* Info sharing: your units and how many people can use each one */
.share-table { width: 100%; border-collapse: collapse; }
.share-table th { text-align: left; font-size: 0.6875rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-ink-2); padding: 4px 8px 6px 0; border-bottom: 1px solid var(--app-sand-rule); }
.share-table td { vertical-align: top; padding: 10px 8px 10px 0; border-bottom: 1px solid var(--app-sand-rule); font-size: var(--text-sm); }
.share-table tr:last-child td { border-bottom: 0; }
.share-table .st-unit { font-weight: 600; width: 34%; overflow-wrap: anywhere; }
.share-table .st-count { font-weight: 600; }
.share-table .st-person { color: var(--color-ink-2); overflow-wrap: anywhere; margin-top: 2px; }

/* Info sharing: the one box. People on a unit sit on a line with their role chooser. */
.share-table .st-person { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; color: var(--color-ink); }
.share-table .st-who { overflow-wrap: anywhere; min-width: 0; }
.share-table .st-ctl { display: flex; align-items: center; gap: 8px; }
.share-table .st-sel { width: auto; min-height: 34px; padding-block: 4px; font-size: var(--text-sm); }
.share-table .st-c { text-align: center; white-space: nowrap; width: 5.5rem; }
.share-table .st-wait { font-size: var(--text-xs); white-space: normal; }
.st-sep { border: 0; border-top: 2px solid var(--app-sand-rule); margin: var(--space-sm) 0; }
.st-counts { display: flex; gap: var(--space-md); flex-wrap: wrap; font-size: var(--text-sm); color: var(--color-ink-2); }

.share-table .st-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.share-table .st-actions .linkbtn { min-height: 28px; font-size: var(--text-xs); }
.share-table .st-name { width: min(16rem, 100%); min-height: 36px; padding-block: 4px; }
.share-table .st-label { font-weight: 600; }

/* Info sharing: compact role choosers so they don't stretch the table rows */
.share-table select.st-sel { height: 30px; min-height: 0; padding: 2px 32px 2px 10px; font-size: 0.8125rem; line-height: 1.2; border-radius: 8px; }   /* keeps the normal arrow */
.share-table .st-person { margin-top: 2px; }
.share-table td { padding-block: 8px; }
.share-table .st-actions .linkbtn { min-height: 24px; padding-block: 0; }
.share-table .st-name { min-height: 30px; }

/* Info sharing on a phone: the units table stacks (unit name, then its people at full width) and the tick columns get narrower */
@media (max-width: 599px) {
  .share-table.stack thead { display: none; }
  .share-table.stack tr, .share-table.stack td { display: block; width: auto; }
  .share-table.stack tr { padding: 8px 0; border-bottom: 1px solid var(--app-sand-rule); }
  .share-table.stack tr:last-child { border-bottom: 0; }
  .share-table.stack td { border: 0; padding: 1px 0; }
  .share-table.stack .st-unit { font-size: var(--text-md, 1rem); }
  .share-table .st-c { width: 3.6rem; font-size: 0.625rem; }
  .share-table .st-person { align-items: flex-start; }
}

/* phone: the bottom tabs keep clear of the rounded screen corners, and sit above the home bar */
@media (max-width: 1023px) {
  .nav-in { padding-inline: max(14px, env(safe-area-inset-left)); }
  .nav { padding-bottom: max(var(--safe-b), 4px); }
}

/* the $ sign and the number share one centre line, and the two boxes in a row start at the same height */
.money-sign { display: flex; align-items: center; top: 0; bottom: 0; height: 100%; transform: none; line-height: 1; }
.money-in input { line-height: normal; }
.row2 { align-items: start; }

/* a long page name in the top bar wraps to two smaller lines and ends with "..." if still too long, so the bar keeps its height */
.top-title.two { white-space: normal; font-size: var(--text-sm); line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }

/* ---- first time setup (onboarding.js): a full screen page that asks one thing at a time ---- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ov-empty { margin-top: var(--space-xl); }   /* air between the cards above (this month's rent) and the empty receipts card */
body.onb-open { overflow: hidden; }
.onb { position: fixed; inset: 0; z-index: 450; overflow-y: auto; display: flex; justify-content: center; padding: var(--space-xl) var(--space-md); background: var(--cork-grain), var(--app-sand); }   /* the same background as the rest of the app */
.onb-curtain { position: fixed; inset: 0; z-index: 449; background: var(--cork-grain), var(--app-sand); }
.onb-inner { width: min(100%, 560px); margin: auto; display: grid; gap: var(--space-md); }
.onb-title { margin: 0; width: 100%; max-width: none; text-align: center; font-family: var(--font-display); font-weight: 600; font-size: var(--text-2xl); letter-spacing: -0.02em; }
.onb-trial { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--color-green-soft); color: var(--color-ink); font-size: var(--text-sm); line-height: 1.4; text-align: center; }
.onb-back { justify-self: start; min-height: 32px; margin: -6px 0 -4px -6px; font-size: var(--text-sm); }
.onb-exit { justify-self: center; min-height: 32px; margin-top: 2px; font-size: var(--text-xs); color: var(--color-muted); opacity: .85; }
.onb-bar { height: 10px; border-radius: 99px; background: var(--app-sand-3, #e8dcc0); overflow: hidden; }
.onb-bar span { display: block; height: 100%; border-radius: inherit; background: var(--color-accent, #e8672f); transition: width .9s cubic-bezier(.22, 1, .36, 1); }
.onb-bar.small { height: 8px; }
.onb-bar.small span { transition: none; }
.onb-paper { padding: var(--space-lg) var(--space-md) var(--space-md); display: block; transform: none; }   /* straight on purpose: even a slight tilt makes the letters look like they sit at different heights */
.onb-banner, .onb-nudge { transform: none; }
.onb-step { display: grid; gap: var(--space-sm); outline: none; transition: opacity .2s ease, transform .3s cubic-bezier(.22, 1, .36, 1); }
.onb-step.leaving { opacity: 0; transform: translateY(6px); }
.onb-step.entering { opacity: 0; transform: translateY(14px); transition: none; }
.onb-complete { text-align: center; font-size: var(--text-2xl); }
.onb-h3 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); line-height: 1.15; letter-spacing: -0.01em; }
.onb-nudge { margin: var(--space-md) 0; display: grid; gap: 12px; }
.onb-h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.01em; }
.onb-sub { margin: 0; color: var(--color-ink-2); font-size: var(--text-md); line-height: 1.4; }
.onb-form { display: grid; gap: var(--space-sm); }
.onb-actions { display: grid; gap: 8px; margin-top: 6px; }
.month-chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }   /* all twelve months: two rows of six */
.month-chips .seg-btn { flex: none; width: 100%; min-height: 54px; padding: 4px 2px; display: grid; place-content: center; gap: 1px; line-height: 1.1; }
.mc-m { font-weight: 700; font-size: var(--text-md); }
.mc-y { font-size: var(--text-xs); opacity: .7; }
.rent-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 8px; }
.rent-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.rent-who input { flex: none; }
.field label.rent-who { display: flex; margin: 0; align-items: center; }   /* beats .field label (block), so the tick sits beside the name */
.rent-sum:empty { display: none; }
.onb-extra { display: grid; gap: var(--space-sm); }
.onb-extra[hidden] { display: none; }
.onb-notes { margin: 0; padding: 0 0 0 18px; display: grid; gap: 6px; color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.4; }
.onb-added { display: grid; gap: 6px; margin-bottom: 4px; padding-bottom: 12px; border-bottom: 1px dashed var(--app-sand-rule, #d9ccb0); }
.onb-added[hidden] { display: none; }
.onb-added-title { margin: 0; font-size: var(--text-sm); font-weight: 700; color: var(--color-ink-2); }
.onb-added-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.onb-added-list li { display: flex; align-items: baseline; gap: 8px; font-size: var(--text-md); line-height: 1.35; overflow-wrap: anywhere; }
.onb-added-list li { align-items: center; }
.onb-added-text { flex: 1 1 auto; min-width: 0; }
.onb-icon { flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--color-muted); cursor: pointer; }
.onb-icon:hover, .onb-icon:focus-visible { background: var(--app-sand-3, #e8dcc0); color: var(--color-ink); }
.onb-icon.danger:hover, .onb-icon.danger:focus-visible { color: var(--color-error); }
.onb-icon svg { width: 18px; height: 18px; }
.onb-key { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; color: var(--color-ink); }
.onb-added-tick { flex: none; color: var(--color-green); font-weight: 800; }
.onb-more { justify-self: start; padding-left: 0; }
.onb-unitname { margin: 0; font-weight: 600; }
.remind-row { display: flex; align-items: center; gap: 8px; }
.remind-row input { width: 84px; flex: none; }
.remind-row select { flex: none; width: 124px; min-width: 0; }
.onb-form .unit-seg { flex-wrap: wrap; }
.onb-form .seg-btn { flex: 1 1 120px; }
.onb-credit { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 14px; border-radius: 12px; background: var(--color-accent-soft); }
.onb-credit-body { flex: 1 1 220px; min-width: 0; }
.setup-badge { flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-content: center; text-align: center; color: #fff;
  background: radial-gradient(circle at 35% 28%, oklch(76% 0.17 48), var(--color-accent, #e8672f) 70%); box-shadow: 0 2px 0 oklch(50% 0.15 38 / .35), 0 8px 14px -8px oklch(40% 0.12 38 / .7); transform: rotate(-8deg); }
.setup-badge b { font-size: 2rem; line-height: 1; font-weight: 800; letter-spacing: -0.02em; }
.setup-badge i { font-style: normal; font-size: var(--text-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1.1; }
.setup-extra-tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--color-accent-soft); color: var(--color-ink); }
.onb-credit .setup-extra-tag { background: #fff; }
.setup-count { color: var(--color-muted); font-size: var(--text-sm); }
.onb-banner { margin: var(--space-md) 0; display: grid; gap: 10px; }
.onb-banner-top, .onb-banner-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 599px) { .onb-trial { display: none; } }   /* the green trial note is left off phones: it makes every step taller */
.onb-form .wgrid.w2.keep2 { grid-template-columns: 1fr 1fr; }   /* stays two across on a phone: date and repeats side by side */
@media (max-width: 479px) { .onb-form { gap: 10px; } .onb-sub { font-size: var(--text-s, 0.9rem); } .onb-paper { padding: var(--space-md) var(--space-sm) var(--space-sm); } .onb-form .field label { margin-bottom: 3px; } .onb-form input, .onb-form select { min-height: 44px; } }
@media (max-width: 479px) { .onb { padding: var(--space-lg) var(--space-sm); } .setup-badge { width: 64px; height: 64px; } .setup-badge b { font-size: 1.6rem; } }
@media (prefers-reduced-motion: reduce) { .onb-bar span, .onb-step, .onb-step.leaving, .onb-step.entering { transition: none; } .onb-paper { transform: none; } }

/* Check it, after a photo is read: the payee, amount and date as one card that types itself in, and the category reel */
.ro { display: grid; gap: 12px; padding: 14px; background: var(--color-sheet); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.ro[hidden], .ro-detail[hidden], .cat-roll[hidden] { display: none; }
.ro-detail { display: contents; }
.ro-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.ro-top.nothumb { grid-template-columns: minmax(0, 1fr); }
.ro-thumb { width: 56px; height: 72px; padding: 0; border: 1px solid var(--app-sand-rule); border-radius: 8px; overflow: hidden; background: none; cursor: pointer; }
.ro-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ro-lab { font-size: var(--text-sm); color: var(--color-ink-2); }
.ro-payee { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.02em; line-height: 1.2; min-height: 1.2em; overflow-wrap: anywhere; margin-top: 2px; }
.ro-board { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-top: 1px solid var(--app-sand-rule); padding-top: 10px; }
.ro-amt { font-family: var(--font-round); font-weight: 600; font-size: 2.2rem; letter-spacing: -0.03em; line-height: 1.1; min-height: 1.1em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ro-date { color: var(--color-ink-2); font-variant-numeric: tabular-nums; text-align: right; min-height: 1.2em; }
.ro-caret::after { content: ""; display: inline-block; width: 2px; height: 0.9em; margin-left: 2px; vertical-align: -0.08em; background: var(--color-accent); animation: ro-blink 0.8s steps(1) infinite; }
@keyframes ro-blink { 50% { opacity: 0; } }
.ro { position: relative; }
.ro-top { padding-right: 34px; }
.ro-retake { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--color-ink-2); cursor: pointer; }
.ro-retake:hover { background: var(--app-sand-rule); }
.ro-tap { cursor: pointer; text-decoration: underline dotted var(--app-sand-rule); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.ro-ed { font: inherit; min-height: 0; margin: 0; padding: 2px 8px; border-radius: 8px; width: 100%; min-width: 0; }
.ro-ed-payee { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.02em; }
.ro-ed-amount { font-family: var(--font-round); font-weight: 600; font-size: 2.2rem; letter-spacing: -0.03em; flex: 1; font-variant-numeric: tabular-nums; }
.ro-ed-date { width: auto; flex: none; }
.ro-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--text-sm); color: var(--color-ink-2); }
.ro-foot .linkbtn { margin-left: auto; font-size: var(--text-sm); }
.ro-foot[hidden], .ro-big[hidden], .readrow[hidden] { display: none; }
@media (max-width: 899px) { .back.ro-back { display: none; } }
.selwrap { position: relative; }
.cat-roll { position: absolute; inset: 0; overflow: hidden; pointer-events: none; box-sizing: border-box; }
.cat-roll-col { transition: transform 0.85s cubic-bezier(0.2, 0.7, 0.1, 1); will-change: transform; }
.cat-roll-col > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px) { .ro-thumb { display: none; } .ro-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 899px) { .r-side .photo.ro-hide { display: none; } }
@media (prefers-reduced-motion: reduce) { .cat-roll { display: none; } .ro-caret::after { animation: none; } }
.unit-seg[data-n="few"] .seg-btn { flex: 1 1 0; }   /* one to three units share a single row */
/* the repeat warning and the sheet's View it link read as part of the sentence: no 44px tap box stretching the line gap */
.alert { line-height: 1.35; }
.alert .linkbtn, .sheet p .linkbtn { min-height: 0; padding: 0; font-size: inherit; line-height: inherit; color: inherit; font-weight: 600; vertical-align: baseline; }
.sheet p { line-height: 1.4; }
/* a unit name that is too long for its button shows two lines at most, a touch smaller, then "..." (the full name is the button's tooltip) */
.unit-seg .seg-btn { font-size: 0.94em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; align-content: center; }
/* nothing between the warning and the file button when there is no error to show, and the button sits snug under a warning */
.err-q:empty { display: none; }
.alerts:not(:empty) + .err-q + .actions { margin-top: calc(var(--space-sm) - var(--space-md)); }

/* Bottom sheets: the popups on Check it. Slide up from the bottom, only as tall as their content; a centered card on a wide screen. */
dialog.bsheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 520px; max-height: 88dvh; padding: 0; border: 0; border-radius: 28px 28px 0 0; background: var(--color-sheet); color: var(--color-ink);
  box-shadow: 0 -8px 40px rgb(0 0 0 / 0.22); overflow: hidden; flex-direction: column; transform: translateY(105%); transition: transform 0.36s cubic-bezier(0.22, 0.9, 0.25, 1); }
dialog.bsheet[open] { display: flex; }
dialog.bsheet.in { transform: none; }
dialog.bsheet.drag { transition: none; }
dialog.bsheet::backdrop { background: rgb(20 15 10 / 0.4); opacity: 0; transition: opacity 0.3s ease; }
dialog.bsheet.in::backdrop { opacity: 1; }
.bs-grab { flex: none; height: 26px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.bs-grab i { width: 38px; height: 5px; border-radius: 3px; background: var(--app-sand-rule); }
.bs-body { display: grid; gap: 10px; padding: 0 16px max(20px, env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; outline: none; }
.bs-title { margin: 0; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: -0.02em; line-height: 1.2; text-align: center; }
.bs-note { margin: 0; font-size: var(--text-sm); line-height: 1.4; color: var(--color-ink-2); text-align: center; }
.bs-grp { display: grid; border-radius: 14px; background: color-mix(in oklab, var(--color-ink) 5%, var(--color-sheet)); overflow: hidden; padding: 0; }
button.bs-grp { width: 100%; font: inherit; color: inherit; border: 0; text-align: left; cursor: pointer; padding: 10px 14px; gap: 4px; }
.bs-one { padding: 10px 14px; gap: 1px; }
.bs-one b { font-size: 1rem; font-weight: 600; }
.bs-one small { color: var(--color-ink-2); font-size: var(--text-sm); }
.bs-d1 { display: flex; align-items: flex-start; gap: 10px; font-size: 1rem; }
.bs-nm { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; white-space: nowrap; line-height: 1.25; }
.bs-nm > span { display: inline-block; }
.bs-nm.long { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.bs-nm.long > span { animation: bs-pan 7s ease-in-out infinite alternate; }
@keyframes bs-pan { 0%, 18% { transform: translateX(0); } 82%, 100% { transform: translateX(calc(var(--dist) * -1)); } }
.bs-d1 b:not(.bs-nm), .bs-dt { flex: none; white-space: nowrap; line-height: 1.25; font-variant-numeric: tabular-nums; font-weight: 600; }
.bs-dt { color: var(--color-ink-2); font-weight: 400; }
.bs-d2 { display: flex; justify-content: space-between; gap: 10px; font-size: var(--text-sm); color: var(--color-ink-2); }
.bs-lnk { color: var(--color-accent); font-weight: 600; flex: none; }
.bs-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.bs-row + .bs-row { border-top: 1px solid var(--app-sand-rule); }
.bs-k { color: var(--color-ink-2); } .bs-v { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.bs-img { display: block; width: 100%; max-height: 38vh; object-fit: contain; border-radius: 10px; background: color-mix(in oklab, var(--color-ink) 5%, var(--color-sheet)); }
.bs-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bs-btns .btn { min-height: 46px; padding-inline: 8px; }
.bs-body .dup-off-row { margin: 0; padding: 0; border: 0; gap: 6px; }
.bs-tg { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 1; min-width: 0; font-size: var(--text-sm); color: var(--color-ink-2); cursor: pointer; }
.bs-sw { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 42px; height: 26px; margin: 0; border-radius: 99px; background: var(--app-sand-rule); cursor: pointer; transition: background 0.2s; }
.bs-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / 0.3); transition: transform 0.2s; }
.bs-sw:checked { background: oklch(70% 0.17 150); } .bs-sw:checked::after { transform: translateX(16px); }
@media (min-width: 700px) {
  dialog.bsheet { inset: 0; margin: auto; height: fit-content; border-radius: 24px; transform: translateY(14px) scale(0.97); opacity: 0; transition: transform 0.25s ease, opacity 0.25s ease; box-shadow: 0 12px 48px rgb(0 0 0 / 0.25); }
  dialog.bsheet.in { transform: none; opacity: 1; }
  .bs-grab { display: none; } .bs-body { padding-top: 22px; }
}
@media (prefers-reduced-motion: reduce) { dialog.bsheet, dialog.bsheet::backdrop, .bs-sw, .bs-sw::after { transition: none; } .bs-nm.long > span { animation: none; } .bs-nm.long { text-overflow: ellipsis; -webkit-mask-image: none; mask-image: none; } }

html.bs-open, html.bs-open body { overflow: hidden; overscroll-behavior: none; }
dialog.bsheet { touch-action: none; }
.bs-body { touch-action: pan-y; }

/* the switch: a track and knob drawn by us, with the real checkbox laid invisibly over it */
.bs-swt { position: relative; flex: none; width: 46px; height: 28px; }
.bs-swt input.bs-sw { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; appearance: none; -webkit-appearance: none; }
.bs-swt i { position: absolute; inset: 0; border-radius: 99px; background: var(--app-sand-rule); transition: background 0.2s; pointer-events: none; }
.bs-swt i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / 0.3); transition: transform 0.2s; }
.bs-swt input:checked + i { background: oklch(70% 0.17 150); }
.bs-swt input:checked + i::after { transform: translateX(18px); }
.bs-swt input:focus-visible + i { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.bs-one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 0.8125rem; }
@media (prefers-reduced-motion: reduce) { .bs-swt i, .bs-swt i::after { transition: none; } }

/* the card while the photo is being read: grey bars where the payee, amount and date will type in, and a light sweeping the thumbnail */
.ro.is-reading .ro-payee, .ro.is-reading .ro-amt, .ro.is-reading .ro-date { color: transparent; border-radius: 8px; background: linear-gradient(90deg, var(--app-sand-rule) 25%, color-mix(in oklab, var(--app-sand-rule) 35%, transparent) 50%, var(--app-sand-rule) 75%); background-size: 200% 100%; animation: ro-shim 1.3s linear infinite; }
.ro.is-reading .ro-payee { width: 70%; } .ro.is-reading .ro-amt { width: 7.5rem; } .ro.is-reading .ro-date { width: 6rem; }
@keyframes ro-shim { to { background-position: -200% 0; } }
.ro.is-reading .ro-thumb { position: relative; }
.ro.is-reading .ro-thumb::after { content: ""; position: absolute; left: 0; right: 0; height: 18px; top: -18px; background: linear-gradient(transparent, color-mix(in oklab, var(--color-accent) 50%, transparent), transparent); animation: ro-sweep 1.2s ease-in-out infinite; }
@keyframes ro-sweep { to { top: 100%; } }
@media (prefers-reduced-motion: reduce) { .ro.is-reading .ro-payee, .ro.is-reading .ro-amt, .ro.is-reading .ro-date, .ro.is-reading .ro-thumb::after { animation: none; } }

.ro-board { position: relative; }
.ro-limit { position: absolute; right: 0; bottom: 100%; margin-bottom: 1px; font-size: 0.5625rem; line-height: 1; color: var(--color-ink-2); opacity: 0.8; font-variant-numeric: tabular-nums; pointer-events: none; }
.ro-limit[hidden] { display: none; }

/* a year at a glance for a short term unit: twelve month tiles with the nights booked, darker when fuller, this month ringed */
.mg { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; color: inherit; text-decoration: none; margin-top: 2px; }
.mg-cell { display: grid; justify-items: center; gap: 1px; padding: 6px 2px 5px; border-radius: 10px; background: color-mix(in oklab, var(--color-ink) 5%, transparent);
  background-image: linear-gradient(oklch(66% 0.14 var(--hue, 200) / calc(var(--o, 0) * 0.85)), oklch(66% 0.14 var(--hue, 200) / calc(var(--o, 0) * 0.85))); }
.mg-cell small { font-size: 0.6875rem; line-height: 1.1; color: var(--color-ink-2); }
.mg-cell b { font-size: 1.05rem; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--color-ink); }
.mg-cell:not(.has) b { color: var(--color-ink-2); font-weight: 400; }
.mg-cell.now { outline: 2px solid var(--color-accent); outline-offset: -2px; }
a.mg:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: 10px; }

/* For your tax preparer: short term rentals (Tax year page, printed report) */
.str-card { display: grid; gap: var(--space-sm); margin-top: var(--space-md); }
.str-card > .str-unit { display: grid; gap: 6px; }
.str-card h3 { margin: 6px 0 0; font-size: var(--text-md); }
.str-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.str-table td, .str-table th { padding: 5px 0; border-top: 1px solid var(--app-sand-rule); text-align: left; vertical-align: top; font-weight: 400; }
.str-table th { font-weight: 600; color: var(--color-ink-2); border-top: 0; }
.str-table .num { text-align: right; font-variant-numeric: tabular-nums; padding-left: 10px; }
.str-flag { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: var(--text-sm); background: var(--color-yellow-soft); color: var(--color-yellow-ink); }
.str-forms { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: var(--text-sm); }
@media print { .str-card { break-inside: avoid; } }

/* the code from a sign up or reset email: big, spaced digits */
.auth input.otp { font-size: 1.35rem; letter-spacing: .18em; text-align: center; font-variant-numeric: tabular-nums; }

/* The demo opened inside the iPhone app (2026-11-22): a full screen frame over the app, closed by the demo's own Return to your profile button */
/* A frame never learns the phone's bar sizes (they read 0 inside it), so the demo's red banner sat under the clock and its tabs under
   Android's buttons. The frame now stops at the bars: the wrapper takes the app's own --safe-t and --safe-b as borders, so it follows
   whatever the phone reports, on any phone, with no fixed numbers. Both are Corkdoor's own page colour, so the clock and battery sit on
   the same colour as everywhere else in the app and the red demo banner starts just below them. */
.demo-frame-wrap { position: fixed; inset: 0; z-index: 10000; box-sizing: border-box; background: var(--color-paper, #f5f1e8);
  border-top: var(--safe-t) solid var(--app-sand, #f5f1e8); border-bottom: var(--safe-b) solid var(--app-sand, #f5f1e8); }
.demo-frame { display: block; width: 100%; height: 100%; border: 0; }
.mg-cell .mg-u { font-size: 0.55rem; opacity: 0.75; }

/* Type it in on a phone: the tab bar steps aside so the main button is never under it */
@media not all and (min-width: 1024px) and (hover: hover) and (pointer: fine) { body.task-screen .nav { display: none; } body.task-screen main { padding-bottom: calc(var(--safe-b) + var(--space-xl)); } }

/* ---- setup rent grid (onboarding.js, step 3): a card per unit, twelve month buttons, one All paid tap ---- */
.rg-cards { display: grid; gap: var(--space-sm); }
.rg-card { padding: 14px; display: grid; gap: 10px; }
.rg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rg-name { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; min-width: 0; overflow-wrap: anywhere; }
.rg-rent { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 0 12px; min-height: 40px; border-radius: 12px; background: oklch(18% 0.006 60 / 0.06); font-variant-numeric: tabular-nums; }
.rg-rent input { width: 74px; border: 0; outline: 0; background: transparent; box-shadow: none; padding: 0; min-height: 0; text-align: right; font-weight: 600; font-size: 1rem; -moz-appearance: textfield; appearance: textfield; }
.rg-sign { color: var(--color-muted); font-weight: 600; }
.rg-rent small { color: var(--color-muted); font-size: .75rem; white-space: nowrap; }
.rg-all { min-height: 44px; border: 0; border-radius: 12px; background: var(--color-accent); color: var(--color-accent-ink); font-weight: 600; font-size: .9375rem; }
.rg-all:active { transform: scale(.98); }
.rg-all.is-all { background: var(--color-green-soft); color: var(--color-green); }
.rg-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.rg-m { position: relative; min-height: 44px; border: 0; border-radius: 12px; font-size: .875rem; font-weight: 600; background: oklch(18% 0.006 60 / 0.06); color: var(--color-muted); transition: background .2s, color .2s, transform .12s; }
.rg-m:active { transform: scale(.94); }
.rg-m[data-s="paid"] { background: var(--color-green-soft); color: var(--color-green); }
.rg-m[data-s="paid"]::after { content: "\2713"; position: absolute; top: 3px; right: 6px; font-size: .625rem; }
.rg-m[data-s="vacant"] { background: var(--color-yellow-soft); color: var(--color-yellow-ink); font-weight: 500; font-size: .75rem; }
.rg-m:disabled { opacity: .4; background: transparent; box-shadow: inset 0 0 0 1px var(--ios-sep, oklch(18% 0.006 60 / 0.12)); }
.rg-earlier { justify-self: start; padding-left: 0; text-align: left; }
.rg-auto { margin-top: 2px; }
.rg-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: var(--radius-card); background: var(--color-ink); color: var(--color-paper-2); }
.rg-total span { font-size: .9375rem; opacity: .8; }
.rg-total b { font-family: var(--font-display); font-size: 1.75rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rg-year { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 11px; background: oklch(18% 0.006 60 / 0.08); }
.rg-year button { min-height: 36px; border: 0; border-radius: 9px; background: transparent; font-size: .9375rem; font-weight: 500; color: var(--color-ink-2); transition: background .2s, box-shadow .2s; }
.rg-year button[aria-pressed="true"] { background: var(--color-sheet); color: var(--color-ink); font-weight: 600; box-shadow: 0 1px 3px oklch(18% 0.006 60 / .18), 0 0 0 .5px oklch(18% 0.006 60 / .12); }

/* Check it on a phone: a little tighter so the File button comes up above the tab bar (less space on top, smaller gaps, a shorter note box, no tall tap box beside the Unit label) */
@media (max-width: 899px) {
  main:has(.r-split) { padding-top: var(--space-xs); }
  .r-split { gap: var(--space-sm); }
  .r-split form { gap: 12px; }
  .r-split .ro { gap: 10px; padding: 12px; }
  .r-split .label-row .linkbtn { min-height: 24px; }
  .r-split #f-note { min-height: 64px; height: 64px; }
}

/* sign in page: "New here? Start your free 30 day trial" as a full width outlined button (the small link was missed), also offered under a failed sign in */
.btn.new-here { background: var(--color-sheet, #fff); color: var(--color-ink); border-color: color-mix(in oklab, var(--color-ink) 22%, transparent); font-size: var(--text-md); }
.err .btn.new-here { margin-top: var(--space-sm); }
