/* BooksAtHand app styles. Colours, type, spacing and radii follow the
   BooksAtHand Design System (tokens.json): keep names and values in step with it. */

:root {
  color-scheme: light dark;
  --paper: #F7F4EC;
  --surface: #FFFFFF;
  --field: #FBFAF6;
  --line: #DBD4C5;
  --line-strong: #7A7368;
  --ink: #1B201E;
  --ink-muted: #5B635E;
  --forest: #1E5B4B;
  --forest-hover: #164536;
  --on-forest: #FFFFFF;
  --forest-soft: #E2EFEA;
  --marigold: #EBA937;
  --on-marigold: #1B201E;
  --marigold-soft: #FCEFD3;
  --marigold-ink: #7A520B;
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --focus-ring: #1E5B4B;
  --brand-panel: #1E5B4B;      /* sign-in side panel */
  --on-brand-panel: #F7F4EC;
  --raised: #FFFFFF;           /* bars that float over the page (save bar) */
  --raised-line: #D9D3C4;
  --shadow-raised: 0 -1px 0 rgba(27, 32, 30, 0.02), 0 8px 24px rgba(27, 32, 30, 0.10);
  --scrim: rgba(14, 18, 16, 0.62);  /* behind every popup, menu panel and dialog */

  /* One typeface everywhere, on every device and in the PDFs: Arimo (Helvetica's shapes and widths;
     see fonts.css). Helvetica and Arial only show for the moment before it loads.
     --font-serif is kept as a name so headings don't need touching; it's Arimo too. */
  --font-sans: Arimo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: var(--font-sans);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --radius-sm: 7px; --radius-md: 10px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow-tab: 0 1px 2px rgba(0, 0, 0, 0.08);
  /* Depth: anything that floats over the page (menus, pop-ups, the chat, dialogs, sheets, tips). */
  --shadow-pop: 0 0 0 1px rgba(27, 32, 30, 0.03), 0 2px 6px rgba(27, 32, 30, 0.06), 0 14px 36px rgba(27, 32, 30, 0.16), 0 32px 72px -24px rgba(27, 32, 30, 0.22);
  --shadow-sheet: 0 -2px 6px rgba(27, 32, 30, 0.05), 0 -16px 44px rgba(27, 32, 30, 0.20);
}
/* Dark theme: follows the device unless the person picked Light or Dark (data-theme on <html>).
   Material Design's neutral greys (owner, Nov 18): #121212 pages, cards a step lighter, bars and
   menus lighter again; no tint, so green shows only where it means something. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #121212;
    --surface: #1E1E1E;
    --field: #181818;
    --line: #383838;
    --line-strong: #8C8C8C;
    --ink: #E3E3E3;
    --ink-muted: #A0A0A0;
    --forest: #5DB79B;
    --forest-hover: #74C6AB;
    --on-forest: #0D1A15;
    --forest-soft: #17302A;
    --marigold: #F0B54D;
    --marigold-soft: #3A2E14;
    --marigold-ink: #F3C66E;
    --danger: #F2877D;
    --danger-soft: #3A1D1A;
    --focus-ring: #74C6AB;
    --brand-panel: #173F35;
    --on-brand-panel: #E3E3E3;
    --raised: #2C2C2C;
    --raised-line: #3A3A3A;
    --shadow-raised: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-pop: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.55), 0 36px 80px -24px rgba(0, 0, 0, 0.6);
    --shadow-sheet: 0 -2px 6px rgba(0, 0, 0, 0.3), 0 -18px 48px rgba(0, 0, 0, 0.55);
    --scrim: rgba(0, 0, 0, 0.72);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121212;
  --surface: #1E1E1E;
  --field: #181818;
  --line: #383838;
  --line-strong: #8C8C8C;
  --ink: #E3E3E3;
  --ink-muted: #A0A0A0;
  --forest: #5DB79B;
  --forest-hover: #74C6AB;
  --on-forest: #0D1A15;
  --forest-soft: #17302A;
  --marigold: #F0B54D;
  --marigold-soft: #3A2E14;
  --marigold-ink: #F3C66E;
  --danger: #F2877D;
  --danger-soft: #3A1D1A;
  --focus-ring: #74C6AB;
  --brand-panel: #173F35;
  --on-brand-panel: #E3E3E3;
  --raised: #2C2C2C;
  --raised-line: #3A3A3A;
  --shadow-raised: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-pop: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.55), 0 36px 80px -24px rgba(0, 0, 0, 0.6);
  --shadow-sheet: 0 -2px 6px rgba(0, 0, 0, 0.3), 0 -18px 48px rgba(0, 0, 0, 0.55);
  --scrim: rgba(0, 0, 0, 0.72);
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2 { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
[hidden] { display: none !important; }

/* Logo lockup: mark + wordmark */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 32px; height: 32px; display: block; }
/* Logo: one mark everywhere, light or dark (the same tile as the app icon): logo.svg */
.brand img { border-radius: 22%; }
.brand span { font-family: var(--font-serif); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; line-height: 1; }

/* Single-card screens (sign in, onboarding, reset) */
.card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px var(--space-5);
}
.card h1 { font-family: var(--font-serif); font-weight: 600; font-size: 24px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.01em; }
.card .lead { margin: 0 0 22px; color: var(--ink-muted); }
.fine { font-size: 13px; color: var(--ink-muted); margin: 18px 0 0; text-align: center; }

label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.optional { font-weight: 400; color: var(--ink-muted); }
.field { margin-bottom: var(--space-4); }
input, select {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  padding: 12px 14px; min-height: 48px;
  appearance: none; -webkit-appearance: none;
}
input::placeholder { color: var(--ink-muted); opacity: 0.8; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px;
}
input:focus, select:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: transparent; }
/* Tick boxes and round choices: drawn by the app, so they look the same on every phone and computer.
   A rounded square that fills green with a tick; a circle with a green dot. */
input[type="checkbox"], input[type="radio"] {
  appearance: none; -webkit-appearance: none; flex: none; display: inline-block; vertical-align: middle;
  width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; cursor: pointer;
  border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--field) no-repeat center / 16px 16px;
  transition: background-color .12s, border-color .12s;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--forest); }
input[type="checkbox"]:checked { background-color: var(--forest); border-color: var(--forest); background-image: var(--tick-img); }
input[type="radio"]:checked { border-color: var(--forest); background-image: radial-gradient(circle, var(--forest) 0 4.5px, transparent 5px); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .5; cursor: default; }
@media (pointer: coarse) { input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; } input[type="checkbox"] { background-size: 17px 17px; } }
/* Tick boxes and round choices: a ring only when moving with the keyboard, never on a tap or click. */
input[type="checkbox"]:focus, input[type="radio"]:focus { outline: none; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
input.code { font-size: 28px; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; padding-left: 0.4em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  white-space: nowrap;   /* a button's label is always one line */
  width: 100%; min-height: 48px; padding: 12px var(--space-4);
  font: inherit; font-weight: 600; border-radius: var(--radius-md); border: 1px solid transparent;
  background: var(--forest); color: var(--on-forest); cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--forest-hover); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; background: var(--forest); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--field); }
.btn.inline { width: auto; }
/* Two full-width buttons stacked: a gap between them. (No weight, so any row of buttons side by
   side, which sets its own margins, wins; otherwise the gap would push one button out of line.) */
:where(.btn.secondary + .btn, .btn + .btn.secondary) { margin-top: 10px; }
:where(.form-actions, .biz-row-actions, .doc-actions, .dialog-actions, .savebar, .panel-head, .page-head, .closed-banner, .row-between, .pub-bar) .btn { margin-top: 0; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--forest); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--forest-hover); }
.link:disabled { color: var(--ink-muted); cursor: default; text-decoration: none; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-top: var(--space-4); font-size: 14px; }

.alert { border-radius: var(--radius-md); padding: 10px var(--space-3); font-size: 14px; margin-bottom: var(--space-4); }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--forest-soft); color: var(--forest); }
.alert.info { background: var(--info-soft); color: var(--info-ink); }

/* inline-block everywhere: inside a line of text a plain span has no size and can't turn */
.spinner { display: inline-block; flex: none; vertical-align: -3px; box-sizing: border-box; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
/* "Loading…" lines wait a moment before showing, so a fast load never flashes them */
.biz-loading, .nt-loading, .bell-loading { animation: load-late .2s ease-out .35s both; }
@keyframes load-late { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* App shell */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 12px var(--space-4); border-bottom: 1px solid var(--line); background: var(--surface);
}
.topbar .brand img { width: 28px; height: 28px; }
.topbar .who { display: flex; align-items: center; gap: var(--space-3); font-size: 14px; color: var(--ink-muted); min-width: 0; }
.topbar .who strong { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
:root { --frame: 1040px; --side-w: 0px; --top-h: 69px; }   /* every app screen: the same left edge (computers: beside the sidebar, the whole width) */
.main { max-width: var(--frame); margin: 0 auto; padding: 28px var(--space-4) 64px; }
.main h1 { font-family: var(--font-serif); font-weight: 600; font-size: 30px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -0.01em; }
.main .lead { color: var(--ink-muted); margin: 0 0 var(--space-5); }
@media (max-width: 560px) {
  .main h1 { font-size: 25px; }
  /* Phones: less space at the sides, so cards and lists get the width */
  .main { padding-top: 20px; padding-left: var(--space-3); padding-right: var(--space-3); }
  .topbar { padding-left: var(--space-3); padding-right: var(--space-3); }
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; margin-bottom: var(--space-4); }
@media (max-width: 560px) { .panel { padding: 16px; } }
.panel h2 { font-size: 17px; margin: 0 0 6px; }
.panel p { margin: 0 0 var(--space-4); color: var(--ink-muted); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin: 0; }
.facts div { background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3); }
.facts dt { font-size: 12px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px var(--space-2); border-radius: var(--radius-pill); background: var(--marigold-soft); color: var(--marigold-ink); vertical-align: middle; margin-left: 6px; }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; } }


/* Password field with Show/Hide */
.pw { position: relative; }
.pw input { padding-right: 72px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font: inherit; font-size: 13px; font-weight: 600; color: var(--forest); background: none; border: 0; padding: 8px 10px; cursor: pointer; }

/* Theme switch: one button showing the theme in use; each click moves System -> Light -> Dark */
.theme-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink-muted); cursor: pointer; }
.theme-btn:hover { color: var(--ink); background: var(--field); }
.theme-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.theme-btn svg { width: 20px; height: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Top bar on phones: the page heading already shows the business name */
.topbar .link { white-space: nowrap; }
@media (max-width: 560px) {
  .topbar .who strong { display: none; }
  .topbar .brand span { font-size: 17px; }
}

/* Section nav under the top bar */

/* Onboarding checklist */
.progress { height: 8px; border-radius: var(--radius-pill); background: var(--field); border: 1px solid var(--line); overflow: hidden; margin: var(--space-3) 0 var(--space-4); }
.progress span { display: block; height: 100%; background: var(--forest); border-radius: var(--radius-pill); transition: width .3s; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.step { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--field); }
.step .tick { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); color: var(--ink-muted); font-size: 13px; font-weight: 600; }
.step.done .tick { background: var(--forest); border-color: var(--forest); color: var(--on-forest); }
.step .tick svg { width: 14px; height: 14px; }
.step.soon .tick { border-style: dashed; }   /* can't be done yet */
.step .what { flex: 1; min-width: 0; }
.step .what strong { display: block; font-size: 15px; }
.step .what span { display: block; font-size: 13px; color: var(--ink-muted); }
.step.done .what strong { color: var(--ink-muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.step .go { flex: none; font-size: 14px; font-weight: 600; color: var(--forest); text-decoration: none; white-space: nowrap; padding: 8px 4px; }
.step .go:hover { text-decoration: underline; }
/* The sales tax step asks its question in place: Yes (the number) or Not yet. */
.step.step-ask { align-items: flex-start; }
.tax-q { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.tax-q-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.tax-q-acts .btn { width: auto; margin: 0; }
.tax-q-form { display: flex; flex-direction: column; gap: 6px; max-width: 360px; }
.tax-q-form .field { margin: 0; }
.step .what .tax-q-form label span { color: var(--ink); font-weight: 600; font-size: 13px; }
.tax-q .alert { margin: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }

/* Settings form */
.panel h2 { scroll-margin-top: var(--space-4); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-3); }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 0 var(--space-3); }
@media (max-width: 520px) { .grid-3 { grid-template-columns: 1fr 1fr; } .grid-3 > :last-child { grid-column: 1 / -1; } }
/* Business profile: how customers pay */
.pay-panel .pay-method .addr-extra { margin: 4px 0 10px 9px; }
.pay-panel .pay-method .field.last { margin-bottom: 0; }
textarea { width: 100%; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 12px 14px; min-height: 96px; resize: vertical; }
textarea:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: transparent; }
.hint { display: block; font-size: 13px; color: var(--ink-muted); margin-top: 6px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 14px; cursor: pointer; }
.check input { margin: 1px 0 0; }
.logo-row { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.logo-box { width: 120px; height: 80px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--field); display: grid; place-items: center; overflow: hidden; color: var(--ink-muted); font-size: 12px; text-align: center; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* With a logo, the box takes the logo's own shape: square stays square, wide stays wide, nothing cut off. */
.logo-box.has-img { width: auto; height: auto; min-width: 64px; min-height: 64px; padding: 8px; border-style: solid; border-color: var(--line); background: transparent; }
.logo-box.has-img img { display: block; width: auto; height: auto; max-width: min(240px, 60vw); max-height: 96px; }
.logo-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 14px; width: auto; }
details.advanced { border-top: 1px solid var(--line); padding-top: var(--space-4); }
details.advanced summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: var(--space-2); min-height: 32px; }
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
details.advanced[open] summary::before { transform: rotate(45deg); }
.preview-line { font-size: 14px; color: var(--ink-muted); margin: 0 0 var(--space-4); }
.preview-line strong { color: var(--ink); font-variant-numeric: tabular-nums; }
/* Save bar: floats at the bottom of the screen, slightly raised from the page */
.savebar {
  position: sticky; bottom: var(--space-3); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
  margin-top: var(--space-2); padding: 10px 10px 10px var(--space-4);
  background: var(--raised); border: 1px solid var(--raised-line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised);
}
.savebar-msg { flex: 1 1 96px; min-width: 0; font-size: 14px; color: var(--ink-muted); }   /* too little room for the note: the buttons go to their own row instead of running into it */
.savebar-dirty { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.savebar-dirty::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--marigold); }
.savebar-ok { color: var(--forest); font-weight: 500; }
.savebar-actions { display: flex; gap: var(--space-2); margin-left: auto; }
.savebar .btn { width: auto; min-height: 44px; padding: 10px 18px; }
.savebar .btn.secondary + .btn { margin-top: 0; }
.savebar .btn[hidden] { display: none; }
#error + .savebar, .alert + .savebar { margin-top: 0; }
.readonly-value { font-weight: 600; margin: 0 0 6px; }

/* Sign-in screens.
   Phones: logo top-left, theme button top-right, form below.
   Wide screens: brand panel on the left (logo in its top-left corner), form on the right. */
.auth { min-height: 100vh; min-height: 100dvh; }
.auth-aside { display: none; }
.auth-main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.auth-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-4) 0; }
.auth-head .brand span { font-size: 20px; }
.auth-theme { display: flex; margin-left: auto; }
.auth-view { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; padding: 28px var(--space-4) 48px; }
.switch { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; font-size: 14px; color: var(--ink-muted); }
.switch a { color: var(--forest); font-weight: 600; text-underline-offset: 2px; }
.switch a:hover { color: var(--forest-hover); }

@media (min-width: 960px) {
  .auth { display: grid; grid-template-columns: minmax(380px, 42%) 1fr; }
  .auth-aside {
    position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-6);
    padding: 32px 48px 40px; background: var(--brand-panel); color: var(--on-brand-panel);
  }
  .auth-aside .brand { color: var(--on-brand-panel); align-self: flex-start; }
  .auth-aside .brand img { display: block; }
  /* The pitch sits in the middle of the panel: heading centred, the points as a centred block */
  .auth-pitch { align-self: center; width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; }
  .auth-pitch-title { font-family: var(--font-serif); font-weight: 600; font-size: 38px; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 28px; text-align: center; text-wrap: balance; }
  .auth-pitch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
  .auth-pitch li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.5; opacity: 0.92; }
  .auth-pitch li svg { flex: none; width: 22px; height: 22px; margin-top: 1px; padding: 3px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: var(--marigold); }
  .auth-aside-foot { margin: 0; font-size: 13px; opacity: 0.8; position: relative; z-index: 1; text-align: center; }
  .auth-brand { visibility: hidden; }   /* the panel already shows the logo */
  .auth-head { padding: 28px 32px 0; }
  .auth-view { justify-content: center; padding: 24px 32px 10vh; }
}

/* Footer: who we serve, copyright and the legal pages. Small and quiet; on every layout. */
.site-foot { font-size: 12.5px; line-height: 1.6; color: var(--ink-muted); text-align: center; }
.site-foot p { margin: 0; }
.site-foot p + p { margin-top: 4px; }
.site-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-foot a:hover { color: var(--ink); }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none !important; }
.foot-brand img { display: block; border-radius: 22%; }
.foot-reach { display: flex; justify-content: center; }   /* the three flags, centred */
.foot-flags { display: inline-flex; gap: 6px; }
.foot-flags img { display: block; width: 18px; height: 13px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); }
/* Small print links: a middle dot between them, and one before them on a computer, where they share
   the © line ("… All rights reserved. · Terms of Use · Privacy Policy"); on phones they get a line of
   their own. The dots are text, not part of the links. */
.foot-links { display: inline-flex; align-items: baseline; gap: 8px; margin-left: 4px; white-space: nowrap; }
.foot-links::before { content: "·"; }
.foot-links .sep, .ml-links .sep { color: var(--ink-muted); }
.auth-foot { padding: 0 var(--space-4) 24px; }
/* The signed-in app has no footer (phones and desktops): BooksAtHand's logo, ©, Terms and
   Privacy are at the bottom of the account menu. */
/* The public pages' footer sits at the bottom of the screen when a page is short, and after the
   content when it's long, so it doesn't jump around between pages. */
#app-layout:not([hidden]), .pub:not([hidden]) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
#app-layout > .main, .pub > .pub-view { flex: 1 0 auto; width: 100%; }
.pub > .pub-foot { flex: none; width: 100%; }
.pub-foot { max-width: 760px; margin: 0 auto; padding: 0 var(--space-4) 140px; }   /* clear of the Accept / Pay bar */
@media (max-width: 719px) {
  .foot-links { display: flex; justify-content: center; margin: 2px 0 0; }
  .foot-links::before { content: none; }
}
/* The customer's page (quote, invoice, receipt): just the "Sent with BooksAtHand" line, with the
   logo next to the link. The Terms and Privacy pages keep the full footer. */
.foot-sent { display: none; }
body[data-view="publicquote"] .pub-foot { margin-top: 22px; }
body[data-view="publicquote"] .pub-foot > * { display: none; }
body[data-view="publicquote"] .pub-foot > .foot-sent { display: block; }
/* Line 1: "Sent with" and the logo with the name, set like the logotype (no underline).
   Line 2: what BooksAtHand is. */
.fs-brand { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.foot-sent .fs-brand a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.fs-brand a img { display: block; border-radius: 22%; }
.foot-sent .fs-tag { margin-top: 2px; font-size: 12px; }
/* Customer form: an individual has no contact person or tax number. (The tax information is for
   the business owner, so it shows for every customer.) */
.is-individual .biz-only { display: none !important; }
/* Account menu: BooksAtHand's small print under Sign out */
/* Set apart from Sign out as the menu's own footer: a tinted band along the bottom edge. */
.menu-legal { margin: var(--space-2) calc(-1 * var(--space-2)) calc(-1 * var(--space-2)); padding: 10px 12px 8px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--paper); text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--ink-muted); }
.menu-legal p { margin: 0; }
.ml-brand { display: flex; align-items: center; justify-content: center; gap: 6px; }
.ml-brand img { display: block; border-radius: 22%; }
@media (min-width: 720px) { .ml-brand img { width: 22px; height: 22px; } .ml-brand { gap: 8px; } }   /* easier to make out on a computer */
.ml-links { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin-top: 2px !important; }
.ml-links a { display: inline-block; padding: 4px 0; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ml-links a:hover { color: var(--ink); }
.ml-version { margin-top: 2px !important; font-size: 11.5px; color: var(--ink-muted); opacity: .85; font-variant-numeric: tabular-nums; }
@media (min-width: 960px) {
  .auth-foot { display: none; }
  .auth-aside-foot { color: inherit; }
  .auth-aside-foot a:hover { color: inherit; opacity: 1; }
}

/* Signed-in top bar actions */
.top-actions { display: flex; align-items: center; gap: var(--space-2); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); color: var(--ink-muted); text-decoration: none; border: 1px solid transparent; }
.icon-btn:hover { color: var(--ink); background: var(--field); }
.icon-btn[aria-current="page"] { color: var(--forest); background: var(--forest-soft); }
.icon-btn svg { width: 22px; height: 22px; }
.account { position: relative; }
.avatar-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--forest); color: var(--on-forest); font-weight: 600; font-size: 15px; }
.avatar-btn:hover .avatar, .avatar-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 3px var(--forest-soft); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16); padding: var(--space-2); }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: var(--space-1); }
.menu-head strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head span { display: block; font-size: 13px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 8px 12px; }
.menu-label { font-size: 14px; color: var(--ink-muted); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; min-height: 44px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--field); }
/* Anything that can't be undone (Delete, Cancel invoice, Withdraw, Write off): red, icon too. */
.menu-item.danger-text, .menu-item.danger-text svg, .btn.secondary.danger-text { color: var(--danger); }
.btn.secondary.danger-text { border-color: var(--danger); }
/* More ▾: the arrow after the word, like Send ▾ (a button that opens a list of choices). */
.more-btn svg { order: 2; }
.menu-item svg { width: 18px; height: 18px; color: var(--ink-muted); }
.menu-sep { height: 1px; background: var(--line); margin: var(--space-1) 0; }
.page-error { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }


/* "Leave without saving?" */
.dialog { width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--raised-line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4); }
.dialog::backdrop { background: var(--scrim); }
.dialog:focus { outline: none; }
.dialog form { padding: 24px; }
.dialog h2 { font-family: var(--font-serif); font-weight: 600; font-size: 22px; margin: 0 0 8px; }
.dialog p { margin: 0 0 20px; color: var(--ink-muted); }
.dialog-actions { display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }
.dialog-actions .btn { width: auto; }
.dialog-actions .btn.secondary + .btn { margin-top: 0; }
.btn.danger { background: var(--danger); color: #FFFFFF; }
.btn.danger:hover { background: var(--danger); filter: brightness(0.92); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { color: #1A0B09; } }
:root[data-theme="dark"] .btn.danger { color: #1A0B09; }

/* Moving between screens */
.view-pending { visibility: hidden; }
body.view-loading .site-foot { visibility: hidden; }
/* Placeholders while a screen loads (BAH.skeleton): grey shapes in its layout, with a soft shimmer */
body.skel-on #app-view { display: none; }
.view-skel[hidden] { display: none; }
.view-skel { animation: load-late .2s ease-out both; }
.sk { display: block; position: relative; overflow: hidden; height: 12px; border-radius: 6px; background: color-mix(in srgb, var(--ink) 9%, transparent); }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 55%, transparent), transparent); animation: sk-shine 1.4s ease-in-out infinite; }
@keyframes sk-shine { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }
.sk-grow { flex: 1; min-width: 0; }
.sk-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: var(--space-5); }
.sk-h1 { height: 30px; width: 220px; max-width: 70%; border-radius: 8px; margin-bottom: 10px; }
.sk-lead { height: 14px; width: 320px; max-width: 85%; }
.sk-h2 { height: 16px; width: 160px; margin-bottom: 14px; }
.sk-btn { height: 44px; width: 136px; border-radius: var(--radius-md); flex: none; }
.sk-btn.short { width: 92px; }
.sk-back { height: 12px; width: 90px; margin: 4px 0 16px; }
.sk-chips { display: flex; gap: 6px; margin-bottom: var(--space-3); }
.sk-chip { height: 36px; width: 78px; border-radius: var(--radius-pill); }
.sk-tools { display: flex; gap: 8px; margin-bottom: var(--space-3); }
.sk-search { flex: 1; height: 48px; border-radius: var(--radius-md); }
.sk-square { width: 48px; height: 48px; border-radius: var(--radius-md); flex: none; }
.sk-list .sk-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 112px 128px 210px; gap: 14px; align-items: center; min-height: 60px; padding: 10px 16px; border-top: 1px solid var(--line); }
.sk-list .sk-row.sk-th { min-height: 0; padding: 14px 16px; border-top: 0; background: var(--field); }
.sk-prow { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; }
.sk-prow + .sk-prow { border-top: 1px solid var(--line); }
.sk-avatar.sm { width: 38px; height: 38px; }
.sk-end { width: 90px; flex: none; }
.sk-col { display: flex; flex-direction: column; gap: 8px; }
.sk-tiny { height: 8px; width: 56px; }
.sk-small { height: 10px; margin-top: 8px; }
.sk-pill { height: 22px; width: 96px; border-radius: var(--radius-pill); }
.sk-r { margin-left: auto; }
.sk-panel .sk-small:first-child { margin-top: 0; }
.sk-field { margin-top: 18px; }
.sk-label { height: 10px; width: 120px; margin-bottom: 8px; }
.sk-input { height: 48px; border-radius: var(--radius-md); margin-top: 6px; }
.sk-acts { display: flex; gap: 8px; margin: 16px 0 var(--space-5); }
.sk-doc { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-4); align-items: start; }
.sk-paper { min-height: 420px; }
.sk-logo { width: 46px; height: 46px; border-radius: 10px; margin-bottom: 18px; }
.sk-gap { height: 28px; }
.sk-line { display: flex; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.sk-who { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.sk-avatar { width: 52px; height: 52px; border-radius: 50%; flex: none; }
.sk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-bottom: var(--space-4); }
.sk-stat { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.sk-progress { height: 8px; margin: 14px 0 16px; }
.sk-step { display: flex; align-items: center; gap: 12px; padding: 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.sk-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.sk-step .sk-small { margin-top: 8px; }
.sk-rows .sk-li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; list-style: none; }
.sk-rows .sk-li .sk-avatar { width: 40px; height: 40px; }
.sk-rows .sk-li .sk-small { margin-top: 8px; }
.w15 { width: 15%; } .w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
@media (max-width: 719px) {
  .sk-head .sk-btn { width: 72px; height: 38px; }
  .sk-list .sk-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .sk-list .sk-row > :nth-child(1), .sk-list .sk-row > :nth-child(3), .sk-list .sk-th { display: none; }
  .sk-list .sk-row > .sk-r { grid-column: 2; grid-row: 1; }
  .sk-list .sk-row > .sk-pill { grid-column: 2; grid-row: 2; width: 70px; margin-left: auto; }
  .sk-list .sk-row > .sk-col { grid-column: 1; grid-row: 1 / span 2; }
  .sk-doc { grid-template-columns: 1fr; }
  .sk-side { display: none; }
  .sk-stats { gap: var(--space-2); }
}
.view-spin { position: fixed; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%); color: var(--forest); pointer-events: none; }
.view-spin .spinner { display: block; width: 28px; height: 28px; border-width: 3px; }   /* block, so it has its size and turns */
h1[tabindex="-1"]:focus { outline: none; }
/* Thin bar across the top while a screen loads (shown only if it takes more than a moment) */
.loader { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .15s; }
.loader.on { opacity: 1; }
.loader::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--marigold); border-radius: 0 2px 2px 0; animation: loader-slide 1.1s ease-in-out infinite; }
@keyframes loader-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) {
  .loader::before { width: 100%; animation: loader-pulse 1.4s ease-in-out infinite; }
  @keyframes loader-pulse { 50% { opacity: 0.35; } }
}
/* First load only: a small spinner in the middle, after a short pause so fast loads never show it */
.boot { position: fixed; inset: 0; display: grid; place-items: center; color: var(--forest); animation: boot-in .2s .35s both; }
.boot .spinner { width: 28px; height: 28px; border-width: 3px; }
@keyframes boot-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- + New, account menu, floating + (phones) and the bookkeeper card ---------- */
.popover { position: relative; }
.top-actions { gap: 6px; }
.new-btn { width: auto; min-height: 40px; padding: 0 10px 0 12px; gap: 6px; font-size: 14px; }
.new-btn svg { width: 18px; height: 18px; }
.new-btn .i-plus { stroke-width: 2.25; }
.new-btn .i-chev { width: 16px; height: 16px; opacity: 0.85; transition: transform .15s; }
.new-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--forest-soft); }
.new-btn[aria-expanded="true"] .i-chev { transform: rotate(180deg); }
.new-menu { width: 300px; }
.menu-title { margin: 8px 12px 4px; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.menu-head + .menu-title { margin-top: 10px; }
.menu-item.rich { gap: 12px; padding: 8px 12px; min-height: 56px; }
.menu-item.rich .mi-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menu-item.rich .mi-text strong { font-size: 15px; font-weight: 600; }
.menu-item.rich .mi-text span { font-size: 13px; color: var(--ink-muted); }
.mi-icon { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--forest-soft); color: var(--forest); }
.mi-icon.warm { border-radius: 50%; background: var(--marigold-soft); color: var(--marigold-ink); }
.menu-item.rich .mi-icon svg { width: 20px; height: 20px; color: inherit; }
#account-menu { width: 300px; }

/* ---------- Notifications: the bell, its count, and the list ---------- */
.bell-btn { -webkit-tap-highlight-color: transparent; position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--ink-muted); cursor: pointer; }
.bell-btn svg { width: 22px; height: 22px; }
.bell-btn:hover, .bell-btn[aria-expanded="true"] { color: var(--forest); background: var(--forest-soft); }
.bell-btn:focus { outline: none; }
.bell-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.bell-count { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #D92D20; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); font-variant-numeric: tabular-nums; }
.bell-count[hidden] { display: none; }
.bell-menu { width: 380px; padding: 0; display: flex; flex-direction: column; max-height: min(620px, calc(100vh - 90px)); }
.bell-menu[hidden] { display: none; }
.bell-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.bell-titles { flex: 1; min-width: 0; }
.bell-head h2 { margin: 0; font-family: inherit; font-size: 17px; font-weight: 700; }
.bell-titles span { display: block; font-size: 13px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell-readall { font-size: 14px; white-space: nowrap; }
.bell-readall[hidden] { display: none; }
.bell-close { display: none; place-items: center; width: 40px; height: 40px; margin-right: -8px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.bell-close svg { width: 22px; height: 22px; }
.bell-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.bell-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.bell-item:hover { background: var(--field); }
.bell-item:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.bell-item.is-new { background: var(--forest-soft); }
.bell-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--field); color: var(--ink-muted); }
.bell-ic svg { width: 18px; height: 18px; }
.bell-ic.good { background: var(--forest-soft); color: var(--forest); }
.bell-item.is-new .bell-ic.good { background: var(--surface); }
.bell-ic.bad { background: var(--danger-soft); color: var(--danger); }
.bell-ic.warn { background: var(--marigold-soft); color: var(--marigold-ink); }
.bell-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bell-tx strong { font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.bell-sub { font-size: 13px; color: var(--ink-muted); line-height: 1.4; overflow-wrap: anywhere; }
.bell-biz { align-self: flex-start; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); color: var(--ink-muted); }
.bell-dot { flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--forest); }
.bell-empty { margin: 0; padding: 28px 20px; font-size: 14px; color: var(--ink-muted); text-align: center; }
.bell-empty .spinner { margin-right: 6px; }
.bell-more { align-self: center; margin: 10px 0 2px; font-size: 14px; }
.bell-more[hidden] { display: none; }
.bell-foot { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--forest); font-size: 14px; font-weight: 600; text-decoration: none; }
.bell-foot svg { width: 18px; height: 18px; }
.bell-foot:hover { background: var(--field); }
/* Pop-ups under the bell (computers only; phones just get the count). */
.bell-toasts { position: fixed; top: 74px; right: 16px; z-index: 65; display: flex; flex-direction: column; gap: 10px; width: 340px; max-width: calc(100vw - 32px); pointer-events: none; }
.bell-toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px 12px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18); animation: bt-in .22s ease-out; transition: opacity .2s, transform .2s; }
.bell-toast.is-leaving { opacity: 0; transform: translateX(16px); }
@keyframes bt-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.bt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.bt-main strong { font-size: 14.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.bt-sub { font-size: 13px; color: var(--ink-muted); line-height: 1.4; overflow-wrap: anywhere; }
.bt-open { margin-top: 4px; font-size: 13.5px; font-weight: 600; color: var(--forest); }
.bt-main:hover .bt-open { text-decoration: underline; }
.bt-main:focus { outline: none; }
.bt-main:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: 4px; }
.bt-close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin: -4px 0 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-muted); cursor: pointer; }
.bt-close:hover { background: var(--field); color: var(--ink); }
.bt-close svg { width: 18px; height: 18px; }
@media (max-width: 719px) { .bell-toasts { display: none; } }
@media (prefers-reduced-motion: reduce) { .bell-toast { animation: none; transition: none; } }
/* The business switcher: something new in another business. */
#sw-btn.has-news .biz-tile { position: relative; }
#sw-btn.has-news .biz-tile::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #D92D20; box-shadow: 0 0 0 2px var(--surface); }
.biz-news { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #D92D20; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
/* Phones: the list fills the screen, with a close button. */
@media (max-width: 719px) {
  .bell-menu { position: fixed; inset: 0; top: 0; z-index: 70; width: auto; max-width: none; max-height: none; border: 0; border-radius: 0; box-shadow: none; padding-bottom: env(safe-area-inset-bottom); }
  .bell-head { padding: 12px 16px 10px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .bell-close { display: grid; }
  .bell-btn { width: 40px; height: 40px; }
}


/* The faded page behind the phone Create sheet */
.fab-scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); }
@media (max-width: 719px) {
  .main { padding-bottom: calc(172px + env(safe-area-inset-bottom)); }   /* the end of the page scrolls clear of the bottom bar and Ask us */
}

/* Cards (Help and feedback, Your bookkeeper): drop from the top bar on desktop, rise from the + on phones */
.pop-card { position: fixed; top: 72px; right: 24px; z-index: 50; width: 360px; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 16px 40px rgba(27, 32, 30, 0.18); }
/* While an overlay is open on phones the page is pinned where it was (app.js BAH.scrollLock). */
body.scroll-locked { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
.pop-card, .create-sheet { overscroll-behavior: contain; }

.bk-close { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink-muted); cursor: pointer; }
.bk-close:hover { background: var(--field); color: var(--ink); }
.bk-close svg { width: 20px; height: 20px; }
.bk-head { display: flex; align-items: center; gap: 12px; margin: 0 36px 14px 0; }
.bk-avatar { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--marigold-soft); color: var(--marigold-ink); }
.bk-avatar svg { width: 26px; height: 26px; }
.bk-head h2 { margin: 0 0 3px; font-family: var(--font-serif); font-weight: 600; font-size: 22px; line-height: 1.2; }
.bk-head p { margin: 0; font-size: 13px; color: var(--ink-muted); }
.bk-lead { margin: 0 0 12px; font-size: 15px; }
.bk-soon { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--marigold-soft); color: var(--marigold-ink); font-size: 13px; font-weight: 500; }
.bk-hours { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--field); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.bk-hours svg { flex: none; width: 18px; height: 18px; }
.bk-actions { display: flex; flex-direction: column; gap: 8px; }
.bk-actions .btn { min-height: 48px; }
.bk-actions .btn svg { width: 20px; height: 20px; }
.bk-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bk-row .btn.secondary + .btn, .bk-actions .btn + .bk-row .btn { margin-top: 0; }
.bk-actions .btn.secondary:disabled { background: transparent; }
.bk-fine { margin: 14px 0 0; font-size: 12px; color: var(--ink-muted); }

/* Section placeholders (Invoices, Quotes, Customers and their New screens) */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5); }
.page-head .lead { margin: 0; color: var(--ink-muted); }
.page-action { width: auto; min-height: 44px; padding: 0 18px; gap: 6px; }
.page-action svg { width: 16px; height: 16px; stroke-width: 2.25; }
.page-head .page-action-2 { margin-left: auto; margin-right: calc(var(--space-4) * -1 + 8px); }
.back-link { display: inline-block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--forest); text-decoration: none; }
.back-link:hover { text-decoration: underline; }
/* Drawings for empty screens (BAH.art) */
.art { display: block; width: 160px; height: 120px; margin: 0 auto 14px; }
.art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.art .a-bg { fill: var(--forest-soft); }
.art .a-ln { fill: none; stroke: var(--forest); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.art .a-pp { fill: var(--surface); }
.art .a-pp.a-ln, .art .a-soft.a-ln, .art .a-acc.a-ln { stroke: var(--forest); }
.art .a-soft { fill: var(--marigold-soft); }
.art .a-acc { fill: var(--marigold); }
.art .a-acc2 { fill: var(--forest); opacity: .35; }
.art .a-fg { fill: var(--forest); }
.art .a-tk { fill: none; stroke: var(--on-forest); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art .a-thin { stroke-width: 1.8; opacity: .7; }
.art .a-thick { stroke-width: 3.6; }
.art .a-handle { stroke-width: 6; }
.art.small { width: 120px; height: 90px; margin-bottom: 8px; }
.card.empty { max-width: none; text-align: center; padding: 40px var(--space-5); }
.card.empty h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.card.empty p { margin: 0 auto; max-width: 440px; color: var(--ink-muted); }
.card.empty .btn { width: auto; margin-top: 20px; }
@media (max-width: 560px) { .card.empty { padding: 28px 16px; } }

/* Theme choice in the account menu */
.theme-row { padding: 2px 0 6px; }
.theme-row .menu-title { margin-top: 6px; }
.theme-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin: 0 8px; padding: 3px; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-md); }
.theme-choice [role=radio] { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 6px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.theme-choice [role=radio]:hover { color: var(--ink); }
.theme-choice [role=radio][aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-tab); }
.theme-choice svg { width: 16px; height: 16px; flex: none; }

/* Cards: scroll inside if the screen is short (phones with the keyboard up) */
.pop-card { max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); overflow-y: auto; }
@media (max-width: 719px) { .pop-card { max-height: calc(100dvh - 140px); } }
.pop-card .field { margin-bottom: 12px; }
.pop-card textarea { min-height: 96px; }
.pop-card .alert { margin: 0 0 12px; }
.pop-card #help-sent { margin: 4px 0 0; }
.interest { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.interest p { margin: 0 0 10px; font-size: 14px; color: var(--ink-muted); }
.interest p strong { color: var(--ink); }
.interest .btn { width: auto; min-height: 44px; padding: 10px 18px; }   /* standard size, not full width */
.interest-done { color: var(--forest) !important; font-weight: 500; }
.pop-card textarea { max-height: 220px; }
/* Short phones (iPhone SE, 13 mini, 14 with Safari's bars): a more compact card that fits. */
@media (max-width: 719px) and (max-height: 760px) {
  .pop-card { padding: 16px; }
  .pop-card .bk-head { gap: 10px; margin-bottom: 10px; }
  .pop-card .bk-avatar { width: 40px; height: 40px; }
  .pop-card .bk-avatar svg { width: 22px; height: 22px; }
  .pop-card .bk-head h2 { font-size: 19px; }
  .pop-card .bk-lead { font-size: 14px; margin-bottom: 10px; }
  .pop-card .field { margin-bottom: 10px; }
  .pop-card label { margin-bottom: 4px; }
  .pop-card select { min-height: 44px; padding-top: 9px; padding-bottom: 9px; background-position: calc(100% - 20px) 19px, calc(100% - 15px) 19px; }
  .pop-card textarea { min-height: 76px; padding: 10px 12px; }
  .pop-card .btn { min-height: 44px; }
  .pop-card .interest { margin-top: 12px; padding-top: 10px; }
  .pop-card .interest-more { display: none; }
  .pop-card .interest .btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }
}
/* Very short screens (iPhone SE with Safari's bars): the card drops its intro lines too. */
@media (max-width: 719px) and (max-height: 600px) {
  .pop-card .bk-head p, .pop-card .bk-lead { display: none; }
  .pop-card .bk-head { margin-bottom: 8px; }
  .pop-card { max-height: calc(100dvh - 116px - env(safe-area-inset-bottom)); }
  .pop-card textarea { min-height: 68px; }
}

/* Logo size check in Settings */
.logo-check { margin: 8px 0 0; font-size: 13px; color: var(--forest); }
.logo-check.warn { padding: 8px 10px; border-radius: var(--radius-md); background: var(--marigold-soft); color: var(--marigold-ink); }

/* Customers list */
.search { position: relative; margin-bottom: var(--space-3); }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
.search input { padding-left: 42px; background: var(--surface); }
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.cust-list { list-style: none; margin: 0; padding: 0; }
.cust-list li + li { border-top: 1px solid var(--line); }
.cust-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.cust-row:hover { background: var(--field); }
.cust-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.cust-avatar { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--forest-soft); color: var(--forest); font-size: 14px; font-weight: 600; }
.cust-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cust-main strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-main span { font-size: 13px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-place { flex: none; max-width: 40%; font-size: 13px; color: var(--ink-muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-row svg { flex: none; width: 18px; height: 18px; color: var(--ink-muted); }
@media (max-width: 520px) { .cust-place { display: none; } }
.more { display: block; width: 100%; padding: 14px; border-top: 1px solid var(--line) !important; text-align: center; text-decoration: none; font-weight: 600; }
.no-results { margin: 8px 0 0; padding: 28px 16px; text-align: center; color: var(--ink-muted); }

/* Customer form */
.danger-zone h2 { color: var(--danger); }
.btn.danger-outline { width: auto; background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.danger-outline:hover { background: var(--danger-soft); }
.panel h2 + .field, .panel h2 + .grid-2 { margin-top: 14px; }

/* Search that waits for the server: spinner in the box, list faded until results arrive */
.search .spinner { display: none; position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-width: 2px; color: var(--forest); }
.search.is-busy svg { display: none; }
.search.is-busy .spinner { display: block; }
.list-card { transition: opacity .15s; }
.list-card.is-stale { opacity: 0.5; }


/* Page headings, one style everywhere: the title, a one-line summary under it, the main button on the right. */
.page-title { min-width: 0; }
.page-title h1 { margin-bottom: 2px; }

/* Home: steps already done fold into one line; the latest documents */
.steps-done { margin-top: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--field); }
.steps-done > summary { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-3); cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; color: var(--ink-muted); border-radius: var(--radius-md); }
.steps-done > summary::-webkit-details-marker { display: none; }
.steps-done > summary:hover { color: var(--ink); }
.steps-done > summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.steps-done > summary .tick { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--forest); color: var(--on-forest); }
.steps-done > summary .tick svg { width: 14px; height: 14px; }
.steps-done > summary span:not(.tick) { flex: 1; }
.steps-done > summary .chev { flex: none; width: 18px; height: 18px; transition: transform .15s; }
.steps-done[open] > summary .chev { transform: rotate(180deg); }
.steps-done > .steps { padding: 0 var(--space-2) var(--space-2); }
.steps-done .step { background: var(--surface); }
.recent { margin-top: var(--space-5); }
.section-title { margin: 0 0 var(--space-3); font-size: 17px; font-weight: 600; }
.recent-empty h3 { margin: 0 0 6px; font-size: 17px; }
.recent-go { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.recent-go .btn { width: auto; margin: 0; }
.show-setup { margin: 0; }
/* Home: the same heading as every other page */
.welcome h1 { overflow-wrap: anywhere; }


/* ---------- Products and services ---------- */
.mi-plain { display: inline-flex; }
.alert.warn { background: var(--marigold-soft); color: var(--marigold-ink); }
/* List pages: a small button on the right of the title row, on phones too (the floating + still
   creates anything from anywhere). Phones show it short ("+ New"), so the title keeps its room. */
.page-action .pa-short { display: none; }
.page-action[hidden] { display: none; }
@media (max-width: 719px) {
  .page-head { flex-wrap: nowrap; align-items: flex-start; gap: 12px; }
  .page-head > div:first-child { flex: 1 1 auto; min-width: 0; }
  .page-action { flex: none; min-height: 38px; padding: 0 12px; gap: 5px; font-size: 14px; margin-top: 4px; }
  .page-action svg { width: 14px; height: 14px; }
}
@media (max-width: 719px) {
  .page-action .pa-full { display: none; }
  .page-action .pa-short { display: inline; }
}
/* A list's search, with its View options button beside it (the same on phones). */
.list-tools { display: flex; align-items: center; gap: 8px; margin-bottom: var(--space-3); }
.list-tools[hidden] { display: none; }
.list-tools .search { flex: 1; min-width: 0; margin-bottom: 0; }
/* View options: a square button the height of the search box; tinted while something extra is shown. */
.view-wrap { position: relative; flex: none; }
.view-btn { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--ink-muted); cursor: pointer; }
.view-btn svg { width: 22px; height: 22px; }
.view-btn:hover, .view-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--ink-muted); }
.view-btn.is-on { background: var(--forest-soft); border-color: var(--forest); color: var(--forest); }
.view-btn:focus { outline: none; }
.view-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.view-menu { width: 300px; z-index: 46; }   /* above the phone's + button */
.menu .view-head { margin: 0; padding: 8px 12px 4px; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.menu-item.view-opt { align-items: flex-start; gap: 12px; }
.view-opt .mi-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 1px; }
.view-opt .mi-text strong { font-size: 15px; font-weight: 500; }
.view-opt .mi-text span { font-size: 13px; color: var(--ink-muted); }
.view-opt[aria-checked="true"] .mi-text strong { font-weight: 600; }
/* The tick box and round choice inside the menu, drawn like the real ones. */
.tickbox, .view-dot { flex: none; width: 20px; height: 20px; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--field) no-repeat center / 16px 16px; }
.view-dot { border-radius: 50%; }
.tickbox.on { background-color: var(--forest); border-color: var(--forest); background-image: var(--tick-img); }
.view-opt[aria-checked="true"] .view-dot { border-color: var(--forest); background-image: radial-gradient(circle, var(--forest) 0 4.5px, transparent 5px); }
@media (pointer: coarse) { .tickbox, .view-dot { width: 22px; height: 22px; } .tickbox { background-size: 17px 17px; } }
/* Customer page: the filters, with View options at the end of the row. */
/* A customer's documents: chips, then search and View options, like every other list. */
.cv-tools[hidden] { display: none; }
.cv-list-wrap { transition: opacity .15s; }
.cv-list-wrap.is-stale { opacity: 0.5; }
.item-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--forest-soft); color: var(--forest); }
.item-icon svg { width: 18px !important; height: 18px !important; color: var(--forest) !important; }
.item-price { flex: none; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-row.is-archived .item-icon, .item-row.is-archived .item-price { opacity: 0.55; }
.badge.muted { background: var(--field); color: var(--ink-muted); border: 1px solid var(--line); margin-left: 4px; font-size: 11px; }
fieldset.field { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.kind-choice { display: inline-flex; gap: 2px; padding: 3px; background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius-md); }
.kind-choice label { margin: 0; }
.kind-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; pointer-events: none; }
.kind-choice span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 20px; border-radius: var(--radius-sm); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.kind-choice span:hover { background: var(--surface); }
.kind-choice input:checked + span { background: var(--forest); color: var(--on-forest); box-shadow: var(--shadow-tab); }
.kind-choice input:focus-visible + span { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.money-input { position: relative; }
.money-sign { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
.money-input input { padding-left: 30px; font-variant-numeric: tabular-nums; }
.field.narrow { max-width: 280px; }

/* ---------- Settings sections and Your account ---------- */
.set-group { margin-bottom: var(--space-5); }
.set-title { margin: 0 0 8px; font-family: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-muted); }
.set-list { list-style: none; margin: 0; padding: 0; }
.set-list li + li { border-top: 1px solid var(--line); }
.set-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.set-row:hover { background: var(--field); }
.set-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
/* Tax registration: today's rates, read only */
.rg-rates { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.rg-rates-title { margin: 0 0 8px; font-weight: 500; }
.rg-rates-list { list-style: none; margin: 0; padding: 0; }
.rg-rates-list li { display: flex; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rg-rates-list li:last-child { border-bottom: 0; }
.rg-rates-list strong { flex: none; min-width: 96px; font-weight: 500; font-variant-numeric: tabular-nums; }
.rg-rates-list span { color: var(--ink-muted); }
/* Registrations list: the number and today's rates wrap rather than cut off (a short list) */
.tx-list .cust-main span { white-space: normal; }
.set-row .chev { flex: none; width: 18px; height: 18px; color: var(--ink-muted); }
.badge.on { background: var(--forest-soft); color: var(--forest); }
.ac-pw-hint { margin: -6px 0 16px; }

/* ---------- Tax ---------- */
.where-choice { display: grid; gap: 10px; margin: 12px 0 8px; }
.where-opt { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; font-weight: 400; }
.where-opt:hover { border-color: var(--forest); }
.where-opt input { margin: 1px 0 0; }
.where-opt span { display: flex; flex-direction: column; gap: 2px; }
.where-opt strong { font-size: 15px; font-weight: 600; }
.where-opt small { font-size: 13px; color: var(--ink-muted); }
.where-opt:has(input:checked) { border-color: var(--forest); background: var(--forest-soft); }
.where-opt:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
@media (min-width: 720px) { .where-choice { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tx-status { font-size: 13px; color: var(--ink-muted); display: inline-flex; align-items: center; gap: 6px; }
.tx-status.is-busy::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--forest); border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.tx-status.is-ok { color: var(--forest); font-weight: 600; }
.tx-list { margin: 12px 0; }
.tx-empty { color: var(--ink-muted); margin: 12px 0; }
.tx-actions { margin: 12px 0 4px; }
.tx-actions .btn { width: auto; display: inline-flex; align-items: center; gap: 6px; }
.tx-actions .btn svg { width: 16px; height: 16px; }
.tx-none { margin-top: 16px; }
/* Tax registrations, country-wide first: a heading over each part, with a line under it. */
.tx-sec { display: flex; flex-direction: column; gap: 2px; margin: 28px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.tx-sec small { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.tx-cw-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.tx-cw-main { display: flex; flex-direction: column; gap: 6px; max-width: 680px; }
.tx-cw-name { display: flex; align-items: center; gap: 10px; }
.tx-cw-name h3 { margin: 0; font-size: 18px; font-weight: 600; }
.tx-cw-main p { margin: 0; line-height: 1.55; }
.tx-cw-num { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tx-cw-more { color: var(--ink-muted); }
.tx-cw-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.tx-cw-acts .btn { width: auto; min-height: 40px; margin: 0; }   /* side by side: no stacked-button gap */
/* A list with nothing in it yet: no gap above what follows. */
.tx-list[hidden] + .tx-actions, .tx-list[hidden] + .tx-empty { margin-top: 0; }
.tx-list:first-child { margin-top: 0; }
.tx-cw .rg-rates { margin-top: 18px; }
.tx-only { margin: 14px 0 0; }
/* Other countries: each country's own block, its country-wide tax first. */
.tx-other { display: flex; flex-direction: column; gap: 18px; margin-bottom: 14px; }
.tx-other-h { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.tx-other .tx-list { margin: 0; }
.tx-other .tx-only { margin-top: 10px; }
#rg-only { margin: 14px 0 0; }
.tx-free { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.tx-free .help-note { margin: 0 0 10px; color: var(--ink-muted); font-size: 13px; line-height: 1.5; max-width: 760px; }
.tx-how { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-muted); font-size: 14px; }
.pct-input input { padding-left: 14px; padding-right: 34px; }
.pct-sign { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
/* Customer page: what tax their invoices get */
.tax-note { background: var(--forest-soft); border-color: transparent; }
.tax-note-head { display: flex; align-items: center; gap: 8px; color: var(--forest); }
.tax-note-icon svg { width: 18px; height: 18px; display: block; }
.tax-note-head .spinner { display: none; width: 14px; height: 14px; color: var(--forest); }
.tax-note.is-busy .spinner { display: block; }
.tax-note.is-busy .tax-note-main, .tax-note.is-busy .tax-note-why { opacity: 0.5; }
.panel.tax-note .tax-note-main { margin: 8px 0 2px; font-size: 17px; font-weight: 600; color: var(--ink); }
.tax-note-why { margin: 0 0 6px; font-size: 14px; color: var(--ink-muted); }
.tax-note-notes { margin: 0 0 8px; padding-left: 18px; font-size: 13px; color: var(--ink-muted); }
.tax-note-notes:empty { display: none; }
.tax-note .help-actions { margin-top: 10px; }

/* Phones: the floating + sits above a save bar instead of covering it (height measured in app.js) */
@media (max-width: 719px) {
  /* At the end of the page the save bar rests where it floats (so it never slides under the +),
     with room above it so the last fields scroll clear of the +. */
  body.has-savebar .main { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body.has-savebar #app-view .savebar { margin-top: 88px; }
}
/* Business profile: tax summary */
.tax-sum { margin: 4px 0 16px; font-size: 15px; }
.tax-sum-head { display: flex; align-items: center; gap: 8px; }
.tax-sum-head .label-text { margin: 0; }
.where-field { margin-bottom: 20px; }
.where-field .where-choice { margin-top: 0; }
.tax-regs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tax-regs strong { font-weight: 600; margin-right: 6px; }
.tax-regs .muted { color: var(--ink-muted); }
.tax-sum.is-busy .tax-regs { opacity: 0.5; }
#tax-spin { display: none; width: 14px; height: 14px; color: var(--forest); }
.tax-sum.is-busy #tax-spin { display: block; }
#tax-link { width: auto; display: inline-flex; }

/* ---- More than one business (item 6b) ---- */
/* Top bar, left: the logo mark, then the business you're working in (opens the list of businesses). */
.top-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.top-left .brand { flex: none; }
.biz-wrap { min-width: 0; }
.biz-btn { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 320px; min-height: 44px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.biz-btn:hover, .biz-btn[aria-expanded="true"] { border-color: var(--line-strong); background: var(--field); }
.biz-tile { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--forest-soft); color: var(--forest); font-weight: 700; font-size: 15px; }
.biz-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.biz-text strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-text span { font-size: 12px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-btn .i-chev { flex: none; width: 18px; height: 18px; margin-left: auto; color: var(--ink-muted); }
@media (min-width: 720px) { .biz-btn { min-width: 300px; max-width: 400px; } }
.menu.biz-menu { left: 0; right: auto; width: 320px; }
.biz-list { display: flex; flex-direction: column; gap: 2px; }
.menu-item.biz-item { gap: 12px; padding: 8px 12px; min-height: 52px; }
.menu-item.biz-item[aria-current="true"] { background: var(--forest-soft); }
.menu-item.biz-item.is-closed .biz-tile:not(.has-logo) { background: var(--field); color: var(--ink-muted); }
.menu-item.biz-item .spinner { margin-left: auto; }
.biz-tick { margin-left: auto; display: inline-flex; color: var(--forest); }
.menu-item .biz-tick svg { width: 18px; height: 18px; color: inherit; }
.biz-loading { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px; font-size: 14px; color: var(--ink-muted); }
.menu-head .mh-label { font-size: 12px; }
@media (max-width: 719px) {
  /* Phones: the business menu takes the free width of the bar. */
  .biz-wrap { flex: 1 1 auto; }
  .biz-btn { width: 100%; max-width: none; }
  .menu.biz-menu { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; max-width: none; }
}

/* A closed business: records only. Its banner shows, and the ways to create something new don't. */
.closed-banner { max-width: calc(var(--frame) - 2 * var(--space-4)); margin: 16px auto 0; padding: 12px 16px; border-radius: var(--radius-md); background: var(--marigold-soft); color: var(--marigold-ink); font-size: 14px; }
.closed-banner:not([hidden]) { display: flex; align-items: center; gap: 12px; }
.closed-banner > span { flex: 1; min-width: 0; }
.closed-banner a { color: inherit; font-weight: 600; }
@media (max-width: 1071px) { .closed-banner { margin: 12px 16px 0; } }
@media (max-width: 560px) { .closed-banner { margin: 12px 12px 0; } }
body.biz-closed .side-new-wrap, body.biz-closed .tab-new,
body.biz-closed [data-create],
body.biz-closed a[href$="/new"]:not([href^="/settings/businesses"]) { display: none !important; }

/* Your businesses */
.biz-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.biz-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.biz-row.is-current { border-color: var(--forest); }
.biz-row.is-closed .biz-tile:not(.has-logo) { background: var(--field); color: var(--ink-muted); }
.biz-row .biz-text { flex: 1; }
.biz-row .biz-text strong { white-space: normal; }
.biz-row .biz-text span { white-space: normal; font-size: 13px; }
.biz-row-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--forest-soft); color: var(--forest); vertical-align: 1px; }
.tag.muted { background: var(--field); color: var(--ink-muted); }
@media (max-width: 560px) {
  .biz-row { flex-wrap: wrap; }
  .biz-row-actions { width: 100%; padding-left: 44px; }
}

/* Add a business: optional copies */
/* A form's buttons (owner, Nov 18): Cancel, then the main one, standard size, at the right.
   Never a full-width button inside a page (the sign-in cards keep theirs). Phones: side by side, halves. */
.form-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: var(--space-4); }
.form-actions .btn { width: auto; min-height: 44px; padding: 10px 18px; margin-top: 0; }
.form-actions .btn:disabled { background: transparent; }
.form-actions .btn:not(.secondary):disabled { background: var(--forest); }
@media (max-width: 560px) { .form-actions .btn { flex: 1 1 0; } }
.check-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0; }
.check-list .check, .check.opt { padding: 8px 0; font-size: 15px; }
/* An error for one box: right under it */
.field-error { margin: 6px 0 0; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--danger); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.check .check-text { display: flex; flex-direction: column; gap: 2px; }
.check .check-text span { font-size: 13px; color: var(--ink-muted); }
.check input:disabled + .check-text { opacity: 0.6; }
.copy-from[hidden] { display: none; }

/* Business profile: place that never changes, extra addresses, close or reopen */
.locked-place { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--field); font-size: 15px; }
.locked-place svg { flex: none; width: 18px; height: 18px; color: var(--ink-muted); }
.locked-place strong { font-weight: 600; }
.addr-extra { margin-top: 12px; padding-left: 14px; border-left: 3px solid var(--line); }
.panel.danger-zone h2 { margin-top: 0; }

/* ---- One style for help across the app ----
   A help section opens and closes from a green "▸ label" (a <details class="help-disc">).
   Inside (.help-body): short paragraphs with a bold lead-in, italics for side notes, and every
   action as a small secondary button in .help-actions: + adds, → opens a page, ↗ opens an
   official site in a new tab. No links inside help text. */
.label-text { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.help-disc { margin-top: 8px; font-size: 14px; }
.help-disc > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; list-style: none; cursor: pointer; color: var(--forest); font-weight: 600; }
.help-disc > summary::-webkit-details-marker { display: none; }
.help-disc > summary::before { content: ""; flex: none; width: 0; height: 0; border-left: 6px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform .15s; }
.help-disc[open] > summary::before { transform: rotate(90deg); }
.help-disc > summary:hover { color: var(--forest-hover); text-decoration: underline; text-underline-offset: 3px; }
.help-disc > summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.help-disc > summary h2 { display: inline; margin: 0; font: inherit; color: inherit; }
.help-panel { padding-top: 14px; padding-bottom: 14px; }
.help-panel .help-disc { margin-top: 0; }
.help-panel .help-disc > summary { font-size: 16px; }
.help-panel .help-disc[open] { padding-bottom: 8px; }
.help-body { font-size: 14px; }
.help-body p, .panel .help-body p { margin: 8px 0 0; color: var(--ink-muted); }
.help-body strong { color: var(--ink); font-weight: 600; }
.help-body em { font-style: italic; }
.help-body .help-note { font-size: 13px; }
.tt-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tt-foot .help-note { margin: 0; color: var(--ink-muted); }
.tt-foot .help-actions { margin-top: 10px; }
.help-body .help-sub { margin-top: 14px; }
.help-body .tx-how { margin-top: 6px; }
.help-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.help-actions .btn.secondary + .btn { margin-top: 0; }
.help-actions .btn { width: auto; min-height: 40px; margin-top: 0; padding: 8px 14px; gap: 6px; color: var(--forest); }
.help-actions .btn svg { flex: none; width: 16px; height: 16px; }
.tips-intro { margin: 8px 0 0; }
/* Business profile › Tax: the Tips, below the registrations */
.help-disc.tax-tips { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.help-disc.tax-tips > summary { font-size: 15px; }
.prefix-grid .next-no { margin-top: 6px; }
.prefix-grid .next-no strong { color: var(--ink); font-variant-numeric: tabular-nums; }
#tx-nudge p { margin: 0 0 4px; }

/* One link style everywhere, visited or not (buttons, menus and rows keep their own colours). */
:where(a) { color: var(--forest); text-underline-offset: 2px; }
:where(a:visited) { color: var(--forest); }
:where(a:hover) { color: var(--forest-hover); }
.closed-banner .btn { flex: none; margin: 0; color: var(--marigold-ink); border-color: currentColor; }   /* a small button, like the rest */
.closed-banner .btn svg { order: 2; width: 16px; height: 16px; }
.closed-banner .btn:hover { background: rgba(0, 0, 0, 0.05); }

/* Business logos in the business menu, Your businesses and Settings: the whole logo at its real
   shape, on a clear (transparent) background; the first letter only when there's no logo. */
.biz-tile.has-logo { width: auto; min-width: 32px; max-width: 72px; padding: 2px; background: transparent; border: 1px solid var(--line); overflow: hidden; }
.biz-tile.has-logo img { display: block; width: auto; height: auto; max-width: 66px; max-height: 26px; }
.is-closed .biz-tile.has-logo { background: transparent; }
.is-closed .biz-tile.has-logo img { filter: grayscale(1); opacity: 0.6; }

/* Settings: the business you're working in, by name */
.set-biz { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.set-biz .biz-tile { width: 48px; height: 48px; border-radius: 12px; font-size: 22px; }
.set-biz .biz-tile.has-logo { width: auto; max-width: 120px; padding: 4px; }
.set-biz .biz-tile.has-logo img { max-width: 110px; max-height: 38px; }
.set-biz-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-biz h2 { margin: 0; font-family: var(--font-serif); font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; }
.set-biz-text span { font-size: 14px; color: var(--ink-muted); }
@media (max-width: 560px) { .set-biz h2 { font-size: 20px; } }

/* Desktop: help bubble, bottom right (phones have the + button, which has Help in it) */
.help-bubble { display: none; }
@media (min-width: 720px) {
  .help-bubble { display: grid; place-items: center; position: fixed; right: 24px; bottom: 24px; z-index: 45; width: 56px; height: 56px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--forest); cursor: pointer; box-shadow: 0 6px 18px rgba(27, 32, 30, 0.16), 0 2px 4px rgba(0, 0, 0, 0.08); }
  .help-bubble:hover { border-color: var(--forest); background: var(--forest-soft); }
  .help-bubble:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
  .help-bubble svg { display: block; width: 28px; height: 28px; }
  .help-bubble .hb-close { display: none; }
  .help-bubble .hb-close svg { width: 24px; height: 24px; }
  .help-bubble[aria-expanded="true"] .hb-open { display: none; }
  .help-bubble[aria-expanded="true"] .hb-close { display: block; }
  /* Help opened from the bubble rises from it, instead of dropping from the top bar. */
  .pop-card.from-bubble { top: auto; bottom: 92px; }
  body:not(.has-savebar) .main { padding-bottom: 96px; }   /* the end of the page scrolls clear of the help bubble */
}
/* Computers: Ask us never moves. The save bar stops short of the corner instead (full-width pages
   always; settings and forms, capped on very wide screens, only when they'd reach the picture). */
@media (min-width: 720px) {
  .savebar { margin-right: 76px; }
  :is(body[data-view="settingshub"], body[data-view="accounthub"], body[data-view="personal"], body[data-view="settings"], body[data-view="account"], body[data-view="notifications"],
      body[data-view="tax"], body[data-view="newtaxreg"], body[data-view="taxreg"], body[data-view="confirmemail"],
      body[data-view="businesses"], body[data-view="addbusiness"], body[data-view="newcustomer"], body[data-view="customer"],
      body[data-view="newitem"], body[data-view="item"]) .savebar { margin-right: clamp(0px, calc(76px - (100vw - var(--side-w) - 1204px)), 76px); }
}

/* ---- Country dropdown with flags (app.js BAH.flagSelect) ----
   Looks like the other fields. The real <select> stays underneath, hidden. */
.fs { position: relative; }
.fs-native { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; min-height: 0; }
/* The arrow is drawn the same way as on the other dropdowns. */
.fs-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 40px 10px 14px; font: inherit; color: var(--ink); text-align: left; background-color: var(--field);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat;
  border: 1px solid var(--line-strong); border-radius: var(--radius-md); cursor: pointer; }
.fs-button:focus-visible, .fs.is-open .fs-button { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: transparent; }
.fs-button.is-placeholder .fs-text { color: var(--ink-muted); }
.fs-button .fs-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-flag { flex: none; display: inline-flex; width: 24px; height: 18px; }
.fs-flag img { display: block; width: 24px; height: 18px; border-radius: 3px; box-shadow: 0 0 0 1px var(--line-strong); object-fit: cover; }
.fs-flag.is-empty { visibility: hidden; }
.fs-button .fs-flag.is-empty { display: none; }
.fs-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(27, 32, 30, 0.18); }
.fs-head { display: none; }
.fs-list { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.fs-option { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 15px; }
.fs-option:hover, .fs-option.is-active { background: var(--field); }
.fs-option[aria-selected="true"] { font-weight: 600; }
.fs-option.is-placeholder { color: var(--ink-muted); }
.fs-option .fs-text { flex: 1; }
.fs-tick { flex: none; width: 18px; height: 18px; color: var(--forest); }
.fs-scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); }
/* Phones: the list opens as a panel from the bottom, rows sized for thumbs. */
.fs-pop.is-fixed { position: fixed; right: auto; z-index: 70; }
.fs.is-sheet .fs-pop { position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 61; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; border-bottom: 0; }
.fs.is-sheet .fs-head { display: block; padding: 10px 10px 8px; font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.fs.is-sheet .fs-list { max-height: 60vh; max-height: 60dvh; }
.fs.is-sheet .fs-option { min-height: 52px; font-size: 16px; }

/* ---------- Quotes (item 7): list, editor, quote page, the customer's page ---------- */
:root { --info-soft: #E6EEFA; --info-ink: #2B4C8C; --violet-soft: #EFE7FA; --violet-ink: #5B3A8C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --info-soft: #1B2A40; --info-ink: #9DB8E8; --violet-soft: #2A2140; --violet-ink: #C3A8EC; } }
:root[data-theme="dark"] { --info-soft: #1B2A40; --info-ink: #9DB8E8; --violet-soft: #2A2140; --violet-ink: #C3A8EC; }
/* The tick in a ticked box, in the colour that sits on green (white, or near-black in dark). */
:root { --tick-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tick-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230D1A15' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); } }
:root[data-theme="dark"] { --tick-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230D1A15' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--field); color: var(--ink-muted); border: 1px solid var(--line); vertical-align: middle; }
.pill.sent { background: var(--info-soft); color: var(--info-ink); border-color: transparent; }
.pill.viewed { background: var(--violet-soft); color: var(--violet-ink); border-color: transparent; }
.pill.ok { background: var(--forest-soft); color: var(--forest); border-color: transparent; }
.pill.warn { background: var(--marigold-soft); color: var(--marigold-ink); border-color: transparent; }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* List */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 var(--space-3); }
.chip { min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip:hover { background: var(--field); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { font-weight: 500; opacity: .75; margin-left: 4px; }
/* Document lists on wide screens: fixed columns under a heading row, so numbers, dates, amounts and
   statuses line up down the page. Phones keep the stacked rows (below). */
.list-card { font-variant-numeric: tabular-nums; }
.list-head { display: grid; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--field); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }
.list-head .r { text-align: right; }
.q-head, .q-row { grid-template-columns: var(--cols-n, 104px minmax(0, 1fr) 112px 128px 210px); }
.q-row { display: grid; gap: 14px; align-items: baseline; align-content: center; min-height: 60px; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.q-row .q-date { font-size: 14px; color: var(--ink-muted); white-space: nowrap; }
.q-row .q-who .q-when { display: none; }
.q-row:hover { background: var(--field); }
.q-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.q-row .q-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.q-row .q-num.is-draft { color: var(--ink-muted); font-weight: 500; }
.q-row .q-who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.q-row .q-who strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-row .q-who span { font-size: 13px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-row .q-amt { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-row .q-st { min-width: 0; }
/* "Show linked documents": a line under a row, and the documents and payments linked to it */
.q-sub { grid-column: 2 / -1; margin-top: -8px; padding-left: 10px; border-left: 2px solid var(--line); font-size: 12.5px; color: var(--ink-muted); }
.q-kids { list-style: none; margin: -6px 0 6px; padding: 0; }
.cust-list .q-kids li { border-top: 0; }
.q-row.q-kid { min-height: 0; padding-top: 5px; padding-bottom: 5px; }
.q-kid .q-who { padding-left: 10px; border-left: 2px solid var(--line); }
.q-kid .q-who strong { font-size: 14px; font-weight: 500; }
.q-kid .q-amt { font-size: 14px; font-weight: 500; }
@media (max-width: 719px) {
  .list-head { display: none; }
  .q-row .q-date { display: none; }
  .q-row .q-who .q-when { display: inline; }
  .q-row .q-st { text-align: right; }
  .q-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .q-row .q-who { grid-column: 1; grid-row: 1; }
  .q-row .q-amt { grid-column: 2; grid-row: 1; }
  .q-row .q-num { grid-column: 1; grid-row: 2; font-size: 13px; color: var(--ink-muted); font-weight: 500; }
  .q-row .q-st { grid-column: 2; grid-row: 2; }
  .q-sub { grid-column: 1 / -1; grid-row: 3; margin-top: 0; }
  .q-kid .q-num { display: none; }
  /* Linked rows: amount and status side by side on one line, so they stay short. */
  .q-row.q-kid { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
  .q-kid .q-who { grid-row: 1; }
  .q-kid .q-who strong { white-space: normal; }
  .q-kid .q-amt { grid-column: 2; grid-row: 1; }
  .q-kid .q-st { grid-column: 3; grid-row: 1; }
}

/* Editor */
.doc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.main .doc-head h1 { margin: 0; }
.doc-head + .lead { margin-top: 2px; }
.combo { position: relative; }
.combo .search { margin-bottom: 0; }
.combo-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(27, 32, 30, 0.18); }
.combo-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.combo-opt:hover, .combo-opt.is-active { background: var(--field); }
.combo-opt .co-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--forest-soft); color: var(--forest); font-size: 13px; font-weight: 600; }
.combo-opt .co-icon svg { width: 16px; height: 16px; }
.combo-opt .co-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.combo-opt .co-text strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-opt .co-text span { font-size: 13px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-opt .co-price { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.combo-opt.is-new { color: var(--forest); font-weight: 600; }
.combo-opt.is-new .co-icon { background: transparent; }
.combo-opt.is-quiet { color: var(--ink-muted); font-size: 14px; min-height: 40px; }
.combo-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.combo-empty { padding: 10px; font-size: 14px; color: var(--ink-muted); }
.cust-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--field); }
.cust-card .cc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cust-card .cc-main strong { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-card .cc-main span { font-size: 13px; color: var(--ink-muted); }
.cust-card .btn { flex: none; }
.cust-card + .grid-2, .combo + .grid-2 { margin-top: var(--space-4); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius-md); }
.seg label { margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label > span { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 4px 8px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink); text-align: center; cursor: pointer; }
.seg label > span:hover { background: var(--surface); }
.seg input:checked + span { background: var(--forest); color: var(--on-forest); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.seg input:focus-visible + span { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.seg .s-short { display: none; }
@media (max-width: 520px) { .seg .s-full { display: none; } .seg .s-short { display: inline; } }
fieldset.field { border: 0; padding: 0; margin: 0 0 var(--space-4); min-width: 0; }
fieldset.field legend { font-size: 14px; font-weight: 600; margin: 0 0 6px; padding: 0; }
fieldset.field.last { margin-bottom: 0; }

.lines-head { display: grid; grid-template-columns: 22px minmax(0, 1fr) 76px 92px 120px 96px 40px; gap: 8px; padding: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .03em; }
.lines-head .r { text-align: right; }
.lines { list-style: none; margin: 0; padding: 0; }
.ln { border-top: 1px solid var(--line); }
.ln.is-dragging { opacity: .4; }
.ln.drop-before { box-shadow: inset 0 2px 0 var(--forest); }
.ln-sum { display: none; }
.ln-edit { display: grid; grid-template-columns: 22px minmax(0, 1fr) 76px 92px 120px 96px 40px; gap: 8px; align-items: start; padding: 10px 0; }
.ln-edit input:not([type="checkbox"]):not([type="radio"]), .ln-edit select { min-height: 42px; padding: 8px 10px; }
.ln-edit .money-input input { padding-left: 24px; }
.ln-edit .money-sign { left: 10px; }
.ln-edit label.ln-label { display: none; }
.ln-drag { padding-top: 11px; color: var(--ink-muted); cursor: grab; display: flex; justify-content: center; }
.ln-drag svg { width: 16px; height: 16px; }
.ln-name { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ln-name .f-desc { min-height: 36px; font-size: 14px; }
.ln-qty input, .ln-price input { text-align: right; font-variant-numeric: tabular-nums; }
.ln-amt { padding-top: 11px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ln-amt .ln-label-txt { display: none; }
.ln-del { display: flex; justify-content: center; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 42px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-muted); cursor: pointer; }
.icon-btn:hover { background: var(--field); color: var(--danger); }
.icon-btn svg { width: 18px; height: 18px; }
.ln-opts { grid-column: 2 / 7; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; color: var(--ink-muted); }
.ln-opts select { min-height: 34px; width: auto; padding: 4px 32px 4px 10px; font-size: 13px; background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; }
.ln-opts .check { font-size: 13px; color: var(--ink-muted); align-items: center; }
.ln-opts .check input { margin: 0; }
.ln-opts .ln-linked { display: inline-flex; align-items: center; gap: 4px; }
.ln-opts .ln-linked svg { width: 14px; height: 14px; }
.ln-done, .ln-move { display: none; }
.lines-empty { padding: 14px 0 6px; color: var(--ink-muted); font-size: 14px; border-top: 1px solid var(--line); }
.lines + .combo { margin-top: var(--space-3); }
.qa .search input { padding-left: 42px; }
@media (max-width: 719px) {
  .lines-head { display: none; }
  .ln-sum { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 12px 0; border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
  .ln-sum .ls-top { display: flex; justify-content: space-between; gap: 12px; }
  .ln-sum strong { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ln-sum .ls-amt { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
  .ln-sum .ls-meta { font-size: 13px; color: var(--ink-muted); }
  .ln-sum .ls-meta.is-problem { color: var(--danger); }
  .ln:not(.open) .ln-edit { display: none; }
  .ln.open .ln-sum { display: none; }
  .ln-edit { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 0 14px; }
  .ln-edit label.ln-label { display: block; font-size: 13px; margin: 0 0 4px; }
  .ln-drag, .ln-del { display: none; }
  .ln-name { grid-column: 1 / -1; }
  .ln-amt { grid-column: 1 / -1; padding-top: 0; display: flex; justify-content: space-between; }
  .ln-amt .ln-label-txt { display: inline; font-weight: 500; color: var(--ink-muted); }
  .ln-opts { grid-column: 1 / -1; }
  .ln-tools { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
  .ln-done, .ln-move { display: inline-flex; }
  .ln-tools .btn, .ln-tools .btn.secondary + .btn { min-height: 40px; margin: 0; }
  .ln-tools .ln-move { width: 44px; padding: 0; }
  .ln-tools .ln-move svg { width: 18px; height: 18px; }
  .ln-tools .ln-remove { margin-left: auto; color: var(--danger); border-color: transparent; }
}
@media (min-width: 720px) { .ln-tools { display: none; } }
/* Payments (item 8b): the Record payment box and the list on an invoice. */
.pay-ways { border: 0; padding: 0; margin: 0 0 var(--space-4); min-width: 0; }
.pay-ways legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-methods label { position: relative; }
.pay-methods input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pay-methods span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; color: var(--ink); background: transparent; }
.pay-methods input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pay-methods input:focus-visible + span { outline: 2px solid var(--forest); outline-offset: 2px; }
.qe-paid-ref { margin-top: var(--space-4); }
/* Fixing invoices (item 8c) */
.fix-steps { margin: 0 0 var(--space-4); padding-left: 20px; font-size: 14.5px; line-height: 1.5; }
.fix-steps li { margin-bottom: 6px; }
.refund-mode { margin-bottom: var(--space-3); grid-template-columns: 1fr 1fr; max-width: 320px; }
.refund-sum.is-stale { opacity: 0.5; }
.refund-lines { list-style: none; margin: 0 0 var(--space-3); padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.refund-lines li { display: grid; grid-template-columns: auto minmax(0, 1fr) 88px; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); }
.refund-lines li:first-child { border-top: 0; }
.refund-lines .rl-name { min-width: 0; font-size: 14px; }
.refund-lines .rl-name span { display: block; font-size: 12.5px; color: var(--ink-muted); }
.refund-lines input[type="text"] { width: 100%; min-height: 38px; padding: 6px 10px; text-align: right; }

.refund-lines input[type="text"]:disabled { opacity: 0.5; }
.refund-sum { margin: 0 0 var(--space-4) auto; max-width: 280px; }
.wo-panel .job-sum dt, .wo-panel .job-sum dd { font-size: 14px; }
.wo-panel .hint { margin-top: 12px; }
.pay-over { margin: calc(-1 * var(--space-2)) 0 var(--space-4); }
.pay-thanks { margin-bottom: var(--space-2); }
.pay-no-email { margin: 0 0 var(--space-2); }
.pays { list-style: none; margin: 0; padding: 0; }
.pays li { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto minmax(36px, auto); gap: 12px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.pays li:first-child { border-top: 0; }
.pays .p-date { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pays .p-how { min-width: 0; }
.pays .p-how .p-ref { color: var(--ink-muted); }
.pays .p-how .p-cr { display: block; font-size: 12.5px; color: var(--ink-muted); }
.pays .p-amt { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.pays .p-x { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-muted); cursor: pointer; }
.pays .p-x:hover { background: var(--field); color: var(--ink); }
.pays .p-x svg { width: 18px; height: 18px; }
.pays li.removed { color: var(--ink-muted); }
.pays li.removed .p-amt { text-decoration: line-through; font-weight: 500; }
.pays li.removed .p-gone { font-size: 12.5px; text-align: center; }
.pays.no-x li { grid-template-columns: 104px minmax(0, 1fr) auto; padding-right: 0; }
@media (max-width: 600px) {
  .pays li { grid-template-columns: minmax(0, 1fr) auto minmax(36px, auto); gap: 2px 10px; }
  .pays.no-x li { grid-template-columns: minmax(0, 1fr) auto; }
  .pays .p-how { grid-column: 1; grid-row: 1; }
  .pays .p-date { grid-column: 1; grid-row: 2; font-size: 12.5px; }
  .pays .p-amt { grid-column: 2; grid-row: 1 / span 2; }
  .pays .p-x, .pays .p-gone { grid-column: 3; grid-row: 1 / span 2; }
}
.paper .p-tot .p-paid { color: var(--p-muted, inherit); }
.paper .p-tot .p-due { border-top: 1px solid var(--p-line); }

/* An invoice made from a quote: lines grouped by where they came from, and what that came to. */
.ln-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 14px 0 6px; border-top: 1px solid var(--line); }
.ln-group strong { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.ln-group span { font-size: 12px; color: var(--ink-muted); }
.ln-group + .ln { border-top-style: dashed; }
.from-box .hint { margin: 0 0 var(--space-3); }
.from-box .totals.from-rows { max-width: none; margin: 0; font-size: 14px; gap: 6px 0; }
.from-box .totals.from-rows .grand { font-size: 15px; font-weight: 700; padding-top: 6px; }
.totals-wrap { position: relative; margin-top: var(--space-4); }
.totals { margin: 0 0 0 auto; max-width: 340px; display: grid; grid-template-columns: 1fr auto; gap: 8px 0; font-variant-numeric: tabular-nums; transition: opacity .15s; }
.totals dt { color: var(--ink-muted); }
.totals dd { margin: 0; padding-left: 20px; text-align: right; }
.totals .grand { font-size: 20px; font-weight: 700; color: var(--ink); padding-top: 8px; border-top: 1px solid var(--line); }
.totals-wrap.is-busy .totals { opacity: .5; }
.totals-wrap.is-busy .totals { opacity: 1; }
.totals-wrap.is-busy .totals dd { opacity: .45; }
.totals-wrap.is-busy dt.grand::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; vertical-align: -1px; border: 2px solid var(--forest); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.taxwhy { font-size: 13px; color: var(--ink-muted); margin: 10px 0 0; text-align: right; }
.tax-notes { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; color: var(--ink-muted); text-align: right; }
/* A link at the end of a note ("Tax registrations ›") never breaks across lines: it moves to the
   next line whole (owner, Nov 24: it was splitting on phones). */
.go-link { white-space: nowrap; }
.panel p.taxwhy { margin: 10px 0 0; }
/* Tax step 2: a changed rate, the Change link on each tax line, an exempt sale, a walk-in's place. */
.totals .tax-change { margin-left: 8px; font-size: 13px; font-weight: 500; }
.totals .tax-changed { margin-left: 6px; font-size: 12px; color: var(--ink-muted); }
.tax-exempt { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--line); }
.tax-exempt .grid-2 { margin-top: 4px; }
.tax-exempt-from { margin: 8px 0 0; font-size: 14px; color: var(--ink-muted); }
.tax-exempt-from strong { color: var(--ink); font-weight: 500; }
.qe-place { margin-top: 12px; }
/* How each tax is made up (BAH.taxMakeup): the editor, a document's page, the staff portal. */
.tax-mk { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin: 10px 0 0 auto; max-width: 460px; }
.tax-mk[hidden] { display: none; }
/* A tax line's row: opens its make-up in a panel over the page (BAH.taxMakeup). */
.tax-mk-line { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: none; color: var(--forest); font: inherit; font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; transition: background .12s, border-color .12s; }
.tax-mk-line:hover { background: var(--forest-soft); }
.tax-mk-line[aria-expanded="true"] { border-color: var(--forest); background: var(--forest-soft); }
.tax-mk-line svg { width: 16px; height: 16px; flex: none; }
.tax-mk-flag { padding: 1px 8px; border-radius: var(--radius-pill); background: var(--marigold-soft); color: var(--marigold-ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tax-mk-pop { position: absolute; top: 0; left: 0; z-index: 55; box-sizing: border-box; width: 380px; max-width: calc(100vw - 32px); overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); outline: none; }
.tax-mk-pop[hidden] { display: none; }
.tax-mk-pop.show:not([hidden]) { animation: menu-in .14s ease-out; transform-origin: top right; }
.tax-mk-pop.up.show { transform-origin: bottom right; }
.tax-mk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tax-mk-head h3 { margin: 6px 0 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.tax-mk-pop .tax-mk-x { position: static; flex: none; margin: -6px -8px 0 0; }
.tax-mk-pop .hint { margin: 8px 0 0; }
.tax-mk-note { margin-top: 12px; }
.tax-mk-scrim { position: fixed; inset: 0; z-index: 54; background: var(--scrim); animation: load-late .18s ease-out; }
.tax-mk-scrim[hidden] { display: none; }
@media (max-width: 719px) {
  .tax-mk { align-items: stretch; max-width: none; }
  .tax-mk-pop { position: fixed; top: auto !important; left: 0 !important; right: 0; bottom: 0; width: auto; max-width: none; max-height: 82dvh; padding: 10px 18px calc(20px + env(safe-area-inset-bottom)); border: 0; border-radius: 20px 20px 0 0; box-shadow: var(--shadow-sheet); }
  .tax-mk-pop.show:not([hidden]) { animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1); }
  .tax-mk-pop::before { content: ""; display: block; width: 40px; height: 5px; margin: 0 auto 6px; border-radius: 999px; background: var(--line-strong); }
}
@media (prefers-reduced-motion: reduce) { .tax-mk-pop.show, .tax-mk-scrim { animation: none; } }
.tax-mk-parts { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.tax-mk-parts td { padding: 4px 0; border-top: 1px solid var(--line); }
.tax-mk-parts td.r { text-align: right; }
.tax-mk-parts .tax-mk-total td { font-weight: 500; }
.tax-mk-pick { border: 0; margin: 10px 0 0; padding: 0; }
.tax-mk-pick legend { font-size: 13px; font-weight: 500; padding: 0; margin-bottom: 6px; }
.tax-mk-pick .radio { display: flex; gap: 8px; align-items: baseline; font-size: 13px; padding: 4px 0; }
.tax-mk-check { margin: 10px 0 0; font-size: 13px; }
.tax-mk-note .help-note { font-size: 12px; margin: 10px 0 6px; }
/* The customer's copy: a tax's parts in small print under it, when the business shows them. */
.p-tparts { font-size: 11.5px; color: var(--ink-muted); margin: -4px 0 4px; text-align: right; }
.qe-place .qe-place-hint { grid-column: 1 / -1; margin-top: -6px; }
.rate-input { max-width: 160px; }
.rate-input input { padding-left: 14px; padding-right: 34px; }
.rate-reset { margin-top: 6px; }
.cf-exempt-seg { grid-template-columns: 1fr 1fr; max-width: 360px; }
.cf-exempt-places { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 16px; margin-top: 8px; }
.cf-exempt-places .check { padding: 6px 0; }
#cf-exempt-fields { margin-top: 8px; }
/* Repeating invoices: the Repeat panel in the editor. */
.rp-every { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }
.rp-last { margin-top: 8px; }
.rp-mode { grid-template-columns: 1fr 1fr; }
.rp-next { margin: 4px 0 0; font-size: 14px; color: var(--ink-muted); }
.rp-next strong { color: var(--ink); font-weight: 500; }
/* A repeating invoice's page: what each invoice has. */
.sv-lines { list-style: none; margin: 0 0 12px; padding: 0; }
.sv-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sv-lines li:first-child { border-top: 0; }
.sv-lines strong { font-weight: 500; }
.sv-lines .sv-qp { grid-column: 1; font-size: 13px; color: var(--ink-muted); }
.sv-lines .sv-amt { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; }
#rl-list-card { --cols-w: 128px minmax(0, 1.4fr) minmax(0, 1fr) 108px 96px 124px 170px; }
.savebar .btn svg { width: 16px; height: 16px; }
.savebar .btn { gap: 6px; }
.bl-short { display: none; }
.savebar-error { flex: 1 1 100%; order: -1; margin: 0; padding: 10px 12px; font-size: 14px; }
.doc-delete { margin: var(--space-2) 0 var(--space-4); }
.doc-delete .btn { width: auto; }
@media (max-width: 719px) {
  .doc-edit .savebar { padding: 8px; }
  .doc-edit .savebar .savebar-msg { display: none; }
  .doc-edit .savebar .savebar-actions { width: 100%; gap: 6px; }
  .doc-edit .savebar .savebar-actions .btn { flex: 1 1 0; min-width: 0; padding: 10px 8px; }
  .doc-edit .savebar #qe-cancel { flex: 0.8 1 0; }
  .bl-full { display: none; }
  .bl-short { display: inline; }
}

/* Send dialog */
.dialog.wide { width: min(500px, calc(100vw - 32px)); }
.dialog .field { margin-bottom: 14px; }
.dialog label, .dialog legend { font-size: 13px; }
.dialog .hint { font-size: 12px; }
.dialog textarea { min-height: 96px; max-height: 32vh; }
.dialog .dialog-lead { margin: -2px 0 14px; font-size: 14px; color: var(--ink-muted); }
.dialog.wide h2 { font-size: 20px; }
@media (max-width: 719px) {
  .dialog.wide { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .dialog.wide form { padding: 18px 16px 16px; }
  .dialog.wide h2 { font-size: 18px; margin-bottom: 6px; }
  .dialog.wide .field { margin-bottom: 12px; }
  .dialog.wide input:not([type="checkbox"]):not([type="radio"]), .dialog.wide select { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }   /* not tick boxes: they stay square */
  .dialog.wide .dialog-actions .btn { flex: 1; min-height: 44px; white-space: nowrap; }
  .dialog.wide .dialog-actions > .btn:not(.secondary) { flex: 1.6; }   /* "Record $1,234.56" never wraps */
  .dialog.wide .dialog-actions .split { flex: 1.8; }
  .dialog.wide .dialog-actions .split > .btn:first-child { flex: 1; white-space: nowrap; }
}
/* A button with a ▾ for the other way to do it (Send quote ▾ → Mark as sent). */
.split { position: relative; display: inline-flex; }
.split > .btn { width: auto; margin: 0; }
.split.has-more > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split > .btn.split-caret, .dialog .dialog-actions .split > .btn.split-caret { flex: none; width: 44px; min-width: 44px; padding: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid color-mix(in srgb, var(--on-forest) 35%, transparent); }
.split-caret svg { width: 18px; height: 18px; }
.split-caret[aria-expanded="true"] svg { transform: rotate(180deg); }
.split-menu { top: auto; bottom: calc(100% + 6px); right: 0; width: 300px; max-width: calc(100vw - 56px); }
.split-menu .menu-item.rich { white-space: normal; }

/* The quote and invoice pages */
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: var(--space-4) 0 var(--space-5); }
.doc-actions .btn, .doc-actions .btn.secondary + .btn, .doc-actions .btn + .btn.secondary { width: auto; margin: 0; min-height: 44px; gap: 6px; }
.doc-actions .btn svg { width: 16px; height: 16px; }
.doc-actions .l-short { display: none; }   /* phones show the short label (below) */
.doc-actions .more-wrap { position: relative; }
.doc-actions .menu { left: 0; right: auto; }
.doc-actions .hint { flex-basis: 100%; margin: 0; }
@media (max-width: 719px) {
  /* Phones: the main action on its own row, the rest side by side underneath. (More's menu opens
     towards whichever side keeps it on the screen.) */
  .doc-actions { gap: 8px; margin: var(--space-3) 0 var(--space-4); }
  .doc-actions > .btn:not(.secondary) { flex: 1 1 100%; }
  .doc-actions > .btn.secondary { flex: 1 1 0; min-width: 0; }
  .doc-actions > .more-wrap { flex: 1 1 0; min-width: 0; }   /* the row under the main button: all the same width, More ▾ too */
  .doc-actions .l-full { display: none; }
  .doc-actions .l-short { display: inline; }
  .doc-actions > .btn.secondary { padding: 10px 8px; }
  .doc-actions .more-wrap .btn { width: 100%; padding: 10px 8px; }
  .doc-actions .more-wrap:last-child .menu { left: auto; right: 0; }
}
.doc-two { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-4); align-items: start; }
@media (max-width: 959px) { .doc-two { grid-template-columns: minmax(0, 1fr); } }
.doc-side .panel { padding: 18px; }
.doc-side .panel h2 { font-size: 15px; margin-bottom: 10px; }
.doc-side .panel p { margin: 0; font-size: 14px; }
/* Lists: drafts ticked to mark as sent together */
.cust-list li.has-pick { position: relative; }
.q-pick { position: absolute; left: 12px; top: 17px; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; cursor: pointer; }
.has-pick > .q-row .q-num { padding-left: 30px; }
.pick-bar { position: sticky; top: 8px; z-index: 6; display: flex; align-items: center; gap: 8px; margin-bottom: var(--space-3); padding: 10px 12px 10px 16px; border-radius: var(--radius-md); background: var(--forest-soft); color: var(--forest); font-weight: 600; font-size: 14px; }
.pick-bar[hidden] { display: none; }
.pick-bar span { flex: 1; min-width: 0; }
.pick-bar .btn { width: auto; margin: 0; }
@media (max-width: 719px) {
  .has-pick > .q-row { padding-left: 48px; }
  .has-pick > .q-row .q-num { padding-left: 0; }
  .q-pick { top: 16px; }
}
/* A document's Reminders box */
.cf-rem { margin-top: 4px; }
.rem-box p { margin-bottom: 8px !important; font-size: 14px; }
.rem-box .rem-to { display: block; color: var(--ink-muted); font-size: 13px; overflow-wrap: anywhere; }
.rem-box .rem-sent { color: var(--ink-muted); font-size: 13px; }
.rem-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rem-acts:empty { display: none; }
.rem-acts .btn { width: auto; margin: 0; flex: 1 1 auto; }
/* Business profile › Reminders */
.rem-panel .rem-more { margin-top: 4px; padding-left: 30px; }
.rem-panel .rem-more[hidden] { display: none; }
.rem-label { margin: 14px 0 6px !important; font-size: 14px; font-weight: 600; color: var(--ink) !important; }
.rem-days { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 2px 24px; margin-bottom: 8px; }   /* before and on the day | after */
.rem-days > :nth-child(-n+3) { grid-column: 1; }
.rem-days > :nth-child(4) { grid-area: 1 / 2; } .rem-days > :nth-child(5) { grid-area: 2 / 2; } .rem-days > :nth-child(6) { grid-area: 3 / 2; } .rem-days > :nth-child(7) { grid-area: 4 / 2; }
@media (max-width: 560px) { .rem-days { grid-template-columns: 1fr; } .rem-days > * { grid-area: auto !important; } }
.rem-days .check { margin: 0; }
.rem-panel .hint { display: block; margin-top: 10px; }
@media (max-width: 560px) { .rem-panel .rem-more { padding-left: 0; } }
/* A document's link for the customer: Copy link and See what they see, with the address shown short */
.link-note { margin-bottom: 8px !important; }
.link-url { margin: 0 0 12px !important; font-size: 13px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.link-field { display: none; min-height: 40px; font-size: 13px; padding: 8px 10px; margin-bottom: 10px; }
.show-field .link-field { display: block; }
.link-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.link-acts .btn { width: auto; flex: 1 1 auto; margin: 0; gap: 6px; }
.link-acts .btn svg { width: 16px; height: 16px; flex: none; }
.link-acts .btn.is-done { color: var(--forest); border-color: var(--forest); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 14px; overflow-wrap: anywhere; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--forest); }
.timeline li::after { content: ""; position: absolute; left: 7.5px; top: 17px; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.muted::before { background: var(--line-strong); }
.timeline .t-when { display: block; font-size: 12px; color: var(--ink-muted); }
.timeline .t-msg { display: block; margin-top: 4px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--field); font-size: 13px; white-space: pre-line; }
.versions { list-style: none; margin: 0; padding: 0; }
.versions li + li { border-top: 1px solid var(--line); }
.versions button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.versions button span { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.versions button[aria-current="true"] { font-weight: 600; }
.version-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* The document itself: always light, like paper. */
.paper { --p-ink: #1B201E; --p-muted: #5A625F; --p-line: #E3E0D8; background: #FFFFFF; color: var(--p-ink); border: 1px solid var(--line); border-radius: 12px; padding: 28px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.paper .p-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.paper .p-logo { display: block; max-width: 160px; max-height: 64px; object-fit: contain; margin-bottom: 10px; }
.paper .p-tile { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: #1E5B4B; color: #FFFFFF; font-weight: 700; font-size: 20px; margin-bottom: 10px; }
.paper .p-title { margin: 0 0 4px; font-family: var(--font-serif); font-weight: 600; font-size: 24px; color: var(--p-ink); }
.paper .p-from { font-size: 13px; color: var(--p-muted); }
.paper .p-from strong { color: var(--p-ink); }
.paper .p-meta { flex: none; font-size: 13px; color: var(--p-muted); text-align: right; line-height: 1.7; }
.paper .p-meta .p-num { color: var(--p-ink); font-size: 15px; font-weight: 600; }
.paper .p-to { margin-bottom: 18px; }
.paper .p-label { display: block; font-size: 11px; font-weight: 600; color: var(--p-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.paper .p-lines { border-top: 1px solid var(--p-line); }
.paper .p-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 100px 100px; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--p-line); }
.paper .p-row.p-th { padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--p-muted); text-transform: uppercase; letter-spacing: .05em; }
.paper .p-row .r { text-align: right; font-variant-numeric: tabular-nums; }
.paper .p-desc { font-size: 12px; color: var(--p-muted); white-space: pre-line; }
.paper .p-qp { display: none; font-size: 12px; color: var(--p-muted); }
.paper .p-tot { margin: 12px 0 0 auto; width: 280px; max-width: 100%; }
.paper .p-tot div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.paper .p-tot .p-grand { font-weight: 700; font-size: 17px; border-top: 1px solid var(--p-line); padding-top: 8px; margin-top: 4px; }
.paper .p-notes { margin-top: 22px; white-space: pre-line; }
.paper .p-pay { margin-top: 22px; padding: 12px 14px; border: 1px solid var(--p-line); border-radius: 8px; font-size: 13px; line-height: 1.6; }
.paper .p-pay strong { display: block; margin-bottom: 2px; font-size: 13px; }
.paper .p-small { margin-top: 14px; font-size: 12px; color: var(--p-muted); }
.paper .p-small p { margin: 0 0 4px; color: var(--p-muted); }
@media (max-width: 560px) {
  .paper { padding: 18px; }
  .paper .p-head { flex-direction: column; gap: 10px; }
  .paper .p-meta { text-align: left; }
  .paper .p-row { grid-template-columns: minmax(0, 1fr) auto; }
  .paper .p-row.p-th .p-hq, .paper .p-row.p-th .p-hp, .paper .p-row .p-q, .paper .p-row .p-p { display: none; }
  .paper .p-qp { display: block; }
}

/* The customer's page (no account, no app chrome) */
.pub { min-height: 100vh; min-height: 100dvh; background: var(--paper); }
.pub-view { max-width: 760px; margin: 0 auto; padding: 24px var(--space-4) 28px; }
.pub-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.pub-top .biz-tile { width: 44px; height: 44px; border-radius: 10px; font-size: 19px; }
.pub-top strong { display: block; font-size: 17px; }
.pub-top .pt-sub { font-size: 13px; color: var(--ink-muted); }
.pub-top .pt-who { flex: 1; min-width: 0; }
.pub-top .pq-pdf { flex: none; width: auto; min-height: 40px; padding: 0 14px; gap: 6px; font-size: 14px; }
.pub-top .pq-pdf svg { width: 18px; height: 18px; }
.pub-state { margin-bottom: var(--space-4); }
.pub .panel { margin-top: var(--space-4); }
.pub .pq-billing { margin: 0 0 var(--space-4); }
.pub-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--raised); border-top: 1px solid var(--raised-line); padding: 12px var(--space-4) calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.06); }
.pub-bar .in { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.pub-bar .btn { width: auto; flex: 1; margin: 0; gap: 6px; }
.pub-bar .btn svg { width: 16px; height: 16px; }
.pub-bar .tt { flex: 1.2; font-size: 13px; color: var(--ink-muted); }
.pub-bar .tt strong { display: block; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .pub-bar .tt { display: none; } }
@media (max-width: 420px) { .pub-bar.is-invoice .tt { display: block; } }
.pub-bar.is-invoice .btn { flex: none; }
.field.last { margin-bottom: 0; }

/* "Before your first quote": what a first quote needs, ticked off as it's done (Quotes, later Invoices and Receipts). */
.setup-steps { text-align: left; margin: 18px 0 0; }
.setup-steps a.step { color: inherit; text-decoration: none; }
.setup-steps a.step:hover { border-color: var(--line-strong); }
.setup-steps a.step:hover .go { text-decoration: underline; }
.setup-steps a.step:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.setup-steps .tick svg { width: 16px; height: 16px; }
.setup-card .sl-short, .setup-steps .what .sl-short { display: none; }
@media (max-width: 719px) {
  .card.setup-card { padding: 16px; text-align: left; }
  .setup-card .art { display: none; }
  .setup-card h2 { font-size: 17px; margin-bottom: 4px; }
  .setup-card p.setup-lead { margin: 0; font-size: 14px; max-width: none; }
  .setup-card .sl-full, .setup-steps .what .sl-full { display: none; }
  .setup-card .sl-short { display: inline; }
  .setup-steps .what .sl-short { display: block; }
  .setup-steps { margin-top: 12px; gap: 6px; }
  .setup-steps .step { padding: 10px 12px; gap: 10px; }
  .setup-steps .tick { width: 24px; height: 24px; font-size: 12px; }
  .setup-steps .tick svg { width: 14px; height: 14px; }
  .setup-steps .what strong { font-size: 15px; }
  .setup-steps .what span { font-size: 12.5px; }
  .setup-steps .go { padding: 6px 0; }
}
/* The customer's name opens their page. */
.cust-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.cust-link:hover { text-decoration-color: currentColor; }
#qv-lead .cust-link { color: var(--forest); text-decoration-color: currentColor; }

/* Extra work on an accepted quote */
.extras { margin-bottom: var(--space-4); }
.extras .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.extras .panel-head h2 { margin: 0; }
.extras .panel-head .btn { width: auto; }
.extras-list { list-style: none; margin: 0; padding: 0; }
.extras-list a { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.extras-list li:first-child a { border-top: 0; }
.extras-list a:hover { background: var(--field); }
.extras-list .x-num { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.extras-list .x-num.is-draft { color: var(--ink-muted); font-weight: 500; }
.extras-list .x-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.extras-list .x-amt { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.job-sum { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.job-sum dt { color: var(--ink-muted); }
.job-sum dd { margin: 0; text-align: right; }
.job-sum .grand { font-weight: 700; color: var(--ink); }
.job-sum .wait { color: var(--marigold-ink); }
.job-sum .inv { color: var(--ink-muted); }
.job-sum dd.inv { color: var(--ink); }
@media (max-width: 719px) {
  .extras-list a { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .extras-list .x-num { grid-column: 1; grid-row: 2; font-size: 12.5px; color: var(--ink-muted); font-weight: 500; }
  .extras-list .x-what { grid-column: 1; grid-row: 1; }
  .extras-list .x-amt { grid-column: 2; grid-row: 1; text-align: right; }
  .extras-list .x-st { grid-column: 2; grid-row: 2; text-align: right; }
}
/* Billing a quote (one invoice or in parts, and a deposit): the editor panel and its dialog */
.bill-fields .seg { grid-template-columns: 1fr 1fr; max-width: 360px; }
.bill-fields .dep-check { margin-top: var(--space-2); }
.dep-row { margin: var(--space-3) 0 0 32px; }
.dep-row .seg.dep-kind { max-width: 240px; margin-bottom: var(--space-3); }
.dep-field { margin-bottom: 0; }
.dep-input, .part-input { max-width: 200px; }
.dep-input input, .part-input input { padding-right: 34px; }
.dep-input:not(:has(.money-sign:not([hidden]))) input, .part-input:not(:has(.money-sign:not([hidden]))) input { padding-left: 14px; }
.dep-pct { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
@media (max-width: 719px) { .dep-row { margin-left: 0; } }
/* Bill a part */
.part-mode { margin-bottom: var(--space-3); grid-template-columns: 1fr 1fr; max-width: 320px; }
.part-field { margin-bottom: var(--space-2); }
.part-all { margin-top: 8px; }
.part-sum { margin: var(--space-3) 0; }
.part-sum .over { color: var(--danger); font-weight: 600; }
/* The quote's Billing panel */
.bill-how { margin: 4px 0 10px; font-size: 14px; color: var(--ink-muted); }
.bill-bar { height: 8px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); overflow: hidden; }
.bill-bar span { display: block; height: 100%; width: 0; background: var(--forest); border-radius: 999px; transition: width .3s ease; }
.bill-nums { margin: 8px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.bill-panel .bill-job { margin: 4px 0 0; }
.bill-docs:not([hidden]) { margin-top: 10px; border-top: 1px solid var(--line); }
/* On an invoice for part of a quote: the quote's lines are its share, not changed here */
.ln.is-locked .ln-sum, .ln-dep .ln-sum { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 12px 0; cursor: default; }
.ln.is-locked .ls-top, .ln-dep .ls-top { display: flex; justify-content: space-between; gap: 12px; }
.ln.is-locked .ls-name, .ln-dep .ls-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln.is-locked .ls-amt, .ln-dep .ls-amt { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.ln.is-locked .ls-meta, .ln-dep .ls-meta { font-size: 13px; color: var(--ink-muted); }
.ln.is-locked .ln-edit { display: none; }
.ln-dep { list-style: none; border-top: 1px solid var(--line); }
.paper .p-job.p-billbox { width: 380px; }
.paper .p-billbox span:first-child { flex: none; color: var(--p-muted); }
.paper .p-billbox span:last-child { text-align: right; }
/* On the paper: "Part 2 for QUO-0004" under the title */
.paper .p-part { margin: -2px 0 8px; font-size: 14px; font-weight: 600; color: var(--p-muted, var(--ink-muted)); }
/* On the extra work's page: which quote it's for */
.job-for { margin: 0 0 var(--space-3); font-size: 14px; color: var(--ink-muted); }
/* On the paper: what the job comes to with this extra work */
.paper .p-job { margin: 16px 0 0 auto; width: 300px; max-width: 100%; padding: 10px 12px; border: 1px solid var(--p-line); border-radius: 8px; font-size: 13px; }
.paper .p-job div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; font-variant-numeric: tabular-nums; }
.paper .p-job .p-jt { font-weight: 700; font-size: 14px; border-top: 1px solid var(--p-line); margin-top: 4px; padding-top: 6px; }

/* Linked documents: a customer's quotes, where a product is used (later invoices and receipts too). */
.linked { margin-bottom: var(--space-4); }
.linked-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.linked-head h2 { margin: 0; flex: 1; }
.linked-head .btn { width: auto; }
.linked-head .spinner { display: none; color: var(--forest); }
.linked[aria-busy="true"] .linked-head .spinner { display: inline-block; }
.linked-sum { margin: 0 0 6px; font-size: 14px; color: var(--ink-muted); }
.linked-list { list-style: none; margin: 0; padding: 0; }
.linked-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.linked-list a:hover { background: var(--field); }
.linked-list .lk-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.linked-list .lk-main strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linked-list .lk-main span { font-size: 13px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linked-list .lk-amt { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.linked-all { display: inline-block; margin-top: 10px; font-size: 14px; }
@media (max-width: 719px) {
  .linked-list a { grid-template-columns: minmax(0, 1fr) auto; }
  .linked-list .lk-st { grid-column: 2; text-align: right; }
  .linked-list .lk-amt { grid-column: 2; grid-row: 1; }
  .linked-list .lk-main { grid-row: 1 / span 2; }
}
/* Quotes list for one customer */
.for-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 var(--space-3); padding: 10px 14px; border-radius: var(--radius-md); background: var(--forest-soft); font-size: 14px; }
/* "Changed somewhere else" note on a form */
.live-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* A customer's page: card, what's open, documents */
.cv-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: var(--space-5); }
.cv-av { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--forest-soft); color: var(--forest); font-weight: 700; font-size: 20px; }
.cv-main { flex: 1; min-width: 180px; }
.main .cv-main h1 { margin: 0; overflow-wrap: anywhere; }
.cv-main p { margin: 2px 0 0; color: var(--ink-muted); font-size: 14px; }
.cv-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.cv-acts .btn.secondary, .cv-acts .btn.secondary + .btn.secondary { width: auto; min-height: 40px; margin: 0; padding: 8px 14px; font-size: 14px; gap: 6px; }
.cv-acts .btn svg { width: 16px; height: 16px; flex: none; }
.cv-portal .panel-head .btn { width: auto; margin: 0; gap: 6px; }
.cv-portal .panel-head .btn svg { width: 16px; height: 16px; flex: none; }
.cv-note strong { color: var(--ink); font-weight: 600; margin-right: 4px; }
.cv-note { margin: 0 0 var(--space-3); padding: 10px 12px; border-radius: var(--radius-md); background: var(--field); border: 1px solid var(--line); font-size: 14px; color: var(--ink-muted); white-space: pre-line; }
.cv-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin: 0 0 var(--space-4); }
.cv-stat { min-width: 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.cv-stat b { display: block; font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-stat span { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-muted); line-height: 1.3; }
.cv-stat.warn b { color: var(--marigold-ink); }
.cv-stat.bad b { color: var(--danger); }
.cv-stat.ok b { color: var(--forest); }
.cv-credit { margin-bottom: var(--space-4); }
.cv-credit .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.cv-credit .panel-head h2 { margin: 0; }
.cv-credit .hint { margin: 0 0 8px; }
.credit-list .p-how a { color: var(--ink); }
.credit-list .p-amt.plus { color: var(--forest); }
.cv-docs-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cv-docs-head h2 { margin: 0; flex: 1; }
.cv-new { position: relative; }
.cv-new .btn { width: auto; gap: 6px; }
.cv-new .btn svg { width: 16px; height: 16px; }
.cv-new .menu { right: 0; left: auto; width: 290px; }
.cv-chips { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 8px; padding-bottom: 2px; scrollbar-width: none; }
.cv-chips::-webkit-scrollbar { display: none; }
.cv-chips .chip { flex: none; }
.chips.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.chips.more-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px); mask-image: linear-gradient(to right, transparent, #000 40px); }
.chips.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.cv-list { list-style: none; margin: 0; padding: 0; }
.cv-head, .cv-row { grid-template-columns: 84px minmax(0, 1fr) 128px 150px; }
.cv-head { gap: 4px 12px; padding: 8px 4px; background: none; border-top: 1px solid var(--line); border-bottom: 0; }
.cv-head:has(+ .cv-list:empty) { display: none; }
.cv-row { display: grid; gap: 4px 12px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.cv-row:hover { background: var(--field); }
.cv-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.cv-type { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-muted); }
.cv-type.t-quote { color: var(--info-ink); }
.cv-type.t-invoice { color: var(--forest); }
.cv-type.t-receipt { color: var(--violet-ink); }
.cv-type.t-credit_note { color: var(--ink-muted); }
.cv-type-in { display: none; }
.cv-what { min-width: 0; }
.cv-what strong { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-what > span { display: block; font-size: 13px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-amt { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cv-st { min-width: 0; }
/* A quote's invoices and receipts, under it */
.cv-kids { list-style: none; margin: 0 0 4px; padding: 0; }
.cv-kid { padding: 6px 4px; border-top: 0; }
.cv-kid .cv-what { padding-left: 10px; border-left: 2px solid var(--line); }
.cv-kid .cv-what strong { font-size: 14px; font-weight: 500; }
.cv-kid .cv-amt { font-weight: 500; font-size: 14px; }
.cv-sub { grid-column: 2 / -1; padding-left: 10px; border-left: 2px solid var(--line); font-size: 12.5px; color: var(--ink-muted); }
.cv-empty { margin: 4px 0 0; padding: 20px 16px 8px; text-align: center; font-size: 14px; color: var(--ink-muted); }
.cv-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 14px; }
.cv-foot .link:only-child { margin-left: auto; }
.cv-foot .cv-lists { display: flex; flex-wrap: wrap; gap: 4px 16px; }
@media (max-width: 719px) {
  .cv-card { gap: 12px; }
  .cv-av { width: 44px; height: 44px; font-size: 18px; }
  .cv-acts { width: 100%; }
  .cv-acts .btn.secondary, .cv-acts .btn.secondary + .btn.secondary { flex: 1 1 0; min-width: 0; padding: 8px 6px; }
  .cv-sum { gap: var(--space-2); }
  .cv-stat { padding: 9px 10px; }
  .cv-stat b { font-size: 16px; }
  .cv-stat span { font-size: 12px; }
  .cv-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 2px; }
  .cv-st { text-align: right; }
  .cv-row > .cv-type { display: none; }
  .cv-type-in { display: inline; margin-right: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-muted); vertical-align: 1px; }
  .cv-what { grid-column: 1; grid-row: 1 / span 2; }
  .cv-amt { grid-column: 2; grid-row: 1; }
  .cv-st { grid-column: 2; grid-row: 2; }
  .cv-sub { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; }
  .cv-row.cv-kid { grid-template-columns: minmax(0, 1fr) auto auto; padding: 6px 2px; }
  .cv-kid .cv-what { grid-row: 1; }
  .cv-kid .cv-what strong { white-space: normal; }
  .cv-kid .cv-amt { grid-column: 2; grid-row: 1; }
  .cv-kid .cv-st { grid-column: 3; grid-row: 1; }
  .cv-new .menu { width: min(290px, calc(100vw - 48px)); }
}

/* Terms of Use and Privacy Policy */
.legal { max-width: 720px; margin: 0 auto; }
.legal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.legal-head .brand span { font-size: 18px; }
.legal-body { font-size: 15.5px; line-height: 1.65; }
.legal-body h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; }
.legal-body .legal-date { margin: 0 0 24px; color: var(--ink-muted); font-size: 14px; }
.legal-body h2 { font-size: 19px; margin: 32px 0 8px; }
.legal-body p, .legal-body ul { margin: 0 0 12px; }
.legal-body ul { padding-left: 22px; }
.legal-body li { margin-bottom: 6px; }
.legal-body .legal-summary { padding: 14px 16px; border-radius: 12px; background: var(--forest-soft, rgba(30, 91, 75, 0.08)); }
.agree-note { margin: 12px 0 0; font-size: 13px; color: var(--ink-muted); text-align: center; }
.agree-note a { color: inherit; text-underline-offset: 2px; }

/* ---------- Settings › Notifications ---------- */
/* "Saved": a small note that floats at the bottom of the screen for a moment. */
.nt-saved { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 8px); margin: 0; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: var(--radius-pill); background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 600; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.nt-saved.on { opacity: 1; transform: translate(-50%, 0); }
.nt-check { padding: 10px 0; }
.nt-check .check-text strong { font-size: 15px; font-weight: 500; color: var(--ink); }
.nt-emails { list-style: none; margin: 0 0 var(--space-4); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); }
.nt-email { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.nt-email:first-child { border-top: 0; }
.nt-loading { padding: 12px; color: var(--ink-muted); font-size: 14px; }
.nt-addr { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nt-addr strong { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.nt-addr span { font-size: 13px; color: var(--ink-muted); }
.nt-resend { font-size: 14px; }
.nt-remove { flex: none; border: 0; background: transparent; cursor: pointer; }
.nt-add { margin: 0; }
.nt-add[hidden] { display: none; }
.nt-add .field { margin-bottom: 0; }
.nt-add-row { display: flex; gap: 8px; }
.nt-add-row input { flex: 1; min-width: 0; }
.nt-add-row .btn { flex: none; width: auto; }
.nt-biz { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.nt-b + .nt-b { border-top: 1px solid var(--line); }
.nt-b-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.nt-b-head:hover { background: var(--field); }
.nt-b-head:focus { outline: none; }
.nt-b-head:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.nt-b-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nt-b-text strong { font-size: 15px; font-weight: 600; }
.nt-b-text span { font-size: 13px; color: var(--ink-muted); overflow-wrap: anywhere; }
.nt-b-head .chev { flex: none; width: 20px; height: 20px; color: var(--ink-muted); transition: transform .15s; }
.nt-b.is-open .nt-b-head .chev { transform: rotate(180deg); }
.nt-b-body { padding: 0 14px 10px 58px; }
.nt-b-body[hidden] { display: none; }
.nt-sub { margin: 10px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
@media (max-width: 560px) {
  .nt-b-body { padding-left: 14px; }
}


/* ===================== Navigation: sidebar (computers), bottom bar (phones), Ask us ===================== */
.sidenav, .tabbar, .create-sheet { display: none; }

/* ---- Computers and tablets: the sidebar beside the page; the top bar stays on top ---- */
@media (min-width: 720px) {
  body { --side-w: 72px; }
  body.side-open { --side-w: 244px; }
  .topbar { position: sticky; top: 0; z-index: 35; }
  .sidenav { display: flex; flex-direction: column; gap: 2px; position: fixed; z-index: 30; left: 0; top: var(--top-h); bottom: 0; width: var(--side-w); padding: 12px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; scrollbar-width: none; transition: width .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s ease; }
  .sidenav::-webkit-scrollbar { display: none; }
  .sidenav a[data-nav], .side-toggle, .side-new { position: relative; display: flex; width: 100%; min-width: 0; box-sizing: border-box; align-items: center; gap: 14px; flex: none; height: 44px; padding: 0 13px; border: 0; border-radius: var(--radius-md); background: none; color: var(--ink-muted); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; overflow: hidden; }
  .sidenav a[data-nav] svg, .side-toggle svg, .side-new svg, .sidenav [data-gear] svg { width: 20px; height: 20px; flex: none; }
  .sidenav a[data-nav]:hover, .side-toggle:hover { background: var(--field); color: var(--ink); }
  .sidenav a[data-nav]:focus-visible, .side-toggle:focus-visible, .side-new:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
  .sidenav a[data-nav][aria-current="page"] { background: var(--forest-soft); color: var(--forest); }
  .side-toggle { height: 40px; margin-bottom: 4px; font-size: 14px; }
  .side-toggle .st-out { display: none; }
  body:not(.side-open) .side-toggle .st-in { display: none; }
  body:not(.side-open) .side-toggle .st-out { display: inline; }
  .side-new { background: var(--forest); color: var(--on-forest); margin-bottom: 10px; }
  .side-new:hover { background: var(--forest-hover); }
  .side-new[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--forest-soft); }
  .side-new svg { stroke-width: 2.4; }
  .side-sep { display: block; flex: none; height: 1px; margin: 10px 6px; background: var(--line); }
  .sn-label { transition: opacity .18s ease .04s, transform .22s cubic-bezier(.2, .8, .2, 1); }
  body:not(.side-open) .sidenav:not(.peek) .sn-label { opacity: 0; transform: translateX(-6px); transition-delay: 0s; }
  .side-new-wrap { position: static; display: block; width: 100%; }
  .side-new-wrap .menu.new-menu { position: fixed; left: calc(var(--side-w) + 8px); top: calc(var(--top-h) + 64px); right: auto; width: 300px; }
  /* Icons only: the name shows beside an icon under the pointer (or keyboard focus). */
  .side-tip { position: fixed; z-index: 60; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none; }
  .side-tip::before { content: ""; position: absolute; left: -5px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-left: 0; border-right-color: var(--ink); }
  /* The page: beside the sidebar, the whole width. Settings and forms use the same frame up to
     1140px of content (what a 1440px screen gives them); wider than that, the right side stays empty
     so fields don't stretch across very wide screens. Lists and documents keep the whole width. */
  #app-layout .main { transition: margin-left .22s cubic-bezier(.2, .8, .2, 1), width .22s cubic-bezier(.2, .8, .2, 1); width: calc(100% - var(--side-w)); margin-left: var(--side-w); margin-right: 0; max-width: none; padding-left: 32px; padding-right: 32px; }
  :is(body[data-view="settingshub"], body[data-view="accounthub"], body[data-view="personal"], body[data-view="settings"], body[data-view="account"], body[data-view="notifications"],
      body[data-view="tax"], body[data-view="newtaxreg"], body[data-view="taxreg"], body[data-view="confirmemail"],
      body[data-view="businesses"], body[data-view="addbusiness"], body[data-view="newcustomer"], body[data-view="customer"],
      body[data-view="newitem"], body[data-view="item"]) #app-view { padding-right: max(32px, calc(100% - var(--side-w) - 1172px)); }
  #app-layout .view-skel { width: calc(100% - var(--side-w)); margin-left: var(--side-w); margin-right: 0; max-width: none; padding-left: 32px; padding-right: 32px; }
  #app-layout .view-skel.narrow { padding-right: max(32px, calc(100% - var(--side-w) - 1172px)); }
  .closed-banner { margin: 12px 32px 0 calc(var(--side-w) + 32px) !important; max-width: none; }
  .pop-card { top: calc(var(--top-h) + 8px); }
}

/* ---- Phones: the bottom bar, and the Create sheet from its + ---- */
@media (max-width: 719px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(66px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar :is(a, .tab-set) { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; color: var(--ink-muted); text-decoration: none; font-size: 11.5px; font-weight: 600; -webkit-tap-highlight-color: transparent; }
  .tabbar :is(a, .tab-set) svg { width: 23px; height: 23px; padding: 3px 13px; box-sizing: content-box; border-radius: 999px; }
  .tabbar :is(a, .tab-set)[aria-current="page"] { color: var(--forest); }
  .tabbar :is(a, .tab-set)[aria-current="page"] svg { background: var(--forest-soft); }
  .tab-new { justify-self: center; display: grid; place-items: center; width: 56px; height: 56px; margin-top: -22px; padding: 0; border: 4px solid var(--surface); border-radius: 18px; background: var(--forest); color: var(--on-forest); box-shadow: 0 6px 16px rgba(30, 91, 75, 0.35); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tab-new svg { width: 26px; height: 26px; transition: transform .15s; }
  .tab-new[aria-expanded="true"] svg { transform: rotate(45deg); }
  .create-sheet:not([hidden]) { display: block; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; max-height: calc(100dvh - 80px); overflow-y: auto; padding: 10px 12px calc(84px + env(safe-area-inset-bottom)); border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 30px rgba(27, 32, 30, 0.18); animation: sheet-up .18s ease-out; }
  .sheet-grab { display: block; width: 40px; height: 5px; margin: 0 auto 10px; border-radius: 999px; background: var(--line-strong); }
  .sheet-title { margin: 0 8px 6px; font-size: 17px; font-weight: 700; color: var(--ink); }
  .create-sheet .menu-item.rich { padding: 12px 8px; }
  body.fab-open .tabbar { z-index: 46; }
  body.fab-open .help-bubble, body.fab-open .hb-label { display: none !important; }
  /* Making something (a page with the Save bar) or typing: no bottom bar. */
  body.has-savebar .tabbar, body.kb-open .tabbar { display: none; }
  body:not(.has-savebar) .savebar { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .create-sheet:not([hidden]) { animation: none; } }

/* ---- Ask us: a person's picture, bottom right (computers and phones) ---- */
.help-bubble { display: grid !important; place-items: center; position: fixed; z-index: 45; right: 24px; bottom: 24px; width: 64px; height: 64px; padding: 0; border: 3px solid var(--surface); border-radius: 50%; background: #1E5B4B; color: var(--forest); cursor: pointer; box-shadow: 0 8px 22px rgba(30, 91, 75, 0.35), 0 2px 4px rgba(0, 0, 0, 0.1); }
.help-bubble:hover { box-shadow: 0 10px 26px rgba(30, 91, 75, 0.45), 0 2px 4px rgba(0, 0, 0, 0.1); }
.help-bubble:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
/* The face: the team's mark until a person is known (so it never flashes someone else); a person
   without a photo gets the drawn face (.is-person); a photo covers it (.has-photo). */
.help-bubble .hb-face { position: absolute; inset: 0; border-radius: 50%; background: #1E5B4B url("/assets/team-face.svg") center / cover no-repeat; }
.help-bubble .hb-face.is-person { background: var(--forest); color: var(--on-forest); display: grid; place-items: center; font-size: 22px; font-weight: 600; }
.help-bubble.is-team { background: #1E5B4B; }
.help-bubble .hb-badge { position: absolute; right: -4px; top: -4px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--forest); color: #fff; border: 2px solid var(--surface); }
.help-bubble .hb-badge svg { width: 12px; height: 12px; }
.help-bubble .hb-close { display: none; position: absolute; inset: 0; border-radius: 50%; background: rgba(15, 30, 24, .62); color: #fff; place-items: center; }
.help-bubble .hb-close svg { width: 26px; height: 26px; }
.help-bubble[aria-expanded="true"] .hb-close { display: grid; }
.help-bubble[aria-expanded="true"] .hb-badge { display: none; }
.hb-label { position: fixed; z-index: 45; right: 102px; bottom: 43px; padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; animation: load-late .3s ease-out .4s both; }
.hb-label[hidden] { display: none; }
.pop-card.from-bubble { top: auto; bottom: 100px; }
@media (min-width: 720px) { body:not(.has-savebar) .main { padding-bottom: 104px; } }
@media (max-width: 719px) {
  .help-bubble { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 60px; height: 60px; }
  .hb-label { right: 86px; bottom: calc(97px + env(safe-area-inset-bottom)); }
  body.kb-open .help-bubble, body.has-savebar .hb-label { display: none !important; }
  /* A page with the Save bar (no bottom bar): Ask us stays, a little smaller, just above the Save bar. */
  body.has-savebar .help-bubble { bottom: calc(var(--savebar-h, 72px) + 24px + env(safe-area-inset-bottom)); width: 52px; height: 52px; }
  body.card-open .help-bubble { z-index: 51; }
}

/* Phones: Quotes | Invoices | Receipts at the top of those lists (they share the Sales tab) */
.sales-switch, .sk-switch { display: none; }
@media (max-width: 719px) {
  .sales-switch { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; margin: -4px 0 18px; padding: 4px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; }
  .sales-switch a { display: flex; align-items: center; justify-content: center; min-height: 38px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-muted); text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .sales-switch a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(27, 32, 30, 0.14); }
  .sales-switch a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
  .sk-switch { display: block; margin: -4px 0 18px; }
  .sk-switch .sk { display: block; height: 48px; border-radius: 12px; }
}

/* Column headings that sort the list (computers): click once for the natural order, again to turn it round */
.sort-head .sh { display: inline-flex; align-items: center; gap: 4px; min-width: 0; margin: -6px -6px; padding: 6px; border: 0; border-radius: 6px; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; text-align: left; cursor: pointer; }
.sort-head .sh > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sort-head .sh:hover { color: var(--ink); background: var(--surface); }
.sort-head .sh:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0; }
.sort-head .sh.r { flex-direction: row-reverse; justify-content: flex-start; justify-self: end; }   /* right-aligned: the arrow goes before the word */
.sort-head .sh-arrow { flex: none; width: 13px; height: 13px; opacity: 0; transition: transform .15s; }
.sort-head .sh:hover .sh-arrow { opacity: .45; }
.sort-head .sh.is-sorted { color: var(--forest); }
.sort-head .sh.is-sorted .sh-arrow { opacity: 1; }
.sort-head .sh.is-up .sh-arrow { transform: rotate(180deg); }

/* Quotes, invoices, receipts: Reference and Due (or Valid until) get their own columns when the list is wide enough */
#ql-list-card, #rl-list-card { container-type: inline-size; }
.q-row .q-ref, .q-row .q-due, .q-head .q-ref, .q-head .q-due { display: none; }
.q-row .q-ref, .q-row .q-due { font-size: 14px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@container (min-width: 900px) {
  .q-head .q-ref, .q-head .q-due, .q-row .q-ref, .q-row .q-due { display: block; }
  .q-head .q-ref.sh, .q-head .q-due.sh { display: inline-flex; }
  .q-head, .q-row { grid-template-columns: var(--cols-w, 112px minmax(0, 1.4fr) minmax(0, 1fr) 108px 108px 124px 196px); }
  .q-row:not(.q-kid) .q-who > span:not(.q-when) { display: none; }   /* the reference is in its own column (linked rows keep their line) */
}

/* Customers, Products and services: a heading row and columns on computers (email, phone; type, tax when wide) */
.people-list { container-type: inline-size; }
.people-list .c-col, .people-list .c-contact, .p-head { display: none; }
.people-list .cust-row .c-col { min-width: 0; font-size: 14px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-list .c-contact:empty { display: none !important; }
@container (min-width: 560px) {
  .people-list .p-head { display: grid; gap: 12px; }
  .people-list .cust-row { display: grid; }
  #cust-list-card .p-head, #cust-list-card .cust-row { grid-template-columns: var(--cols-n, 30px minmax(0, 1fr) minmax(120px, 220px) 18px); }
  #it-list-card .p-head, #it-list-card .cust-row { grid-template-columns: 30px minmax(0, 1fr) 140px 18px; }
  .p-head .c-h-name { grid-column: 1 / 3; }
  .people-list .cust-row .cust-place { max-width: none; text-align: left; font-size: 14px; }
  .people-list .p-head .cust-place { max-width: none; }
  .people-list .item-price { text-align: right; }
}
@container (min-width: 860px) {
  #cust-list-card .p-head, #cust-list-card .cust-row { grid-template-columns: var(--cols-w, 30px minmax(0, 1.3fr) minmax(0, 1.2fr) 150px minmax(120px, 200px) 18px); }
  #it-list-card .p-head, #it-list-card .cust-row { grid-template-columns: var(--cols-w, 30px minmax(0, 1.6fr) 110px 130px 140px 18px); }
  .people-list .c-col { display: block; }
  .people-list .p-head .c-col { display: inline-flex; }
  .people-list .c-sub { display: none; }
  .people-list .c-contact { display: block; }
}

/* Lists with drafts to tick (computers): the boxes sit in a gutter on the left, so every number,
   "Draft" included, starts at the same place */
@media (min-width: 720px) {
  .picks .q-head, .picks .q-row { padding-left: 52px; }
  .picks .has-pick > .q-row .q-num { padding-left: 0; }
  .picks .q-pick { left: 14px; }
  .q-row.q-kid .q-amt, .q-row.q-kid .q-st { align-self: baseline; }
}

/* View options › Show: columns switched off for this list */
@media (min-width: 720px) {
  .no-ref :is(.q-ref), .no-date :is(.q-date), .no-due :is(.q-due),
  .no-email .c-email, .no-phone .c-phone, .no-place .cust-place, .no-kind .i-kind, .no-tax .i-tax { display: none !important; }
}

/* Folded sidebar: pointing at it slides it open over the page (the page doesn't move); the toggle
   keeps it open and moves the page over. */
@media (min-width: 720px) {
  .sidenav.peek { width: 244px; box-shadow: 8px 0 28px rgba(15, 25, 20, 0.16); }
  body:not(.side-open) .sidenav.peek .side-toggle .st-in { display: inline; }
  body:not(.side-open) .sidenav.peek .side-toggle .st-out { display: none; }
  .sidenav.peek .side-new-wrap .menu.new-menu { left: 252px; }
  .sidenav a[data-nav], .side-toggle, .side-new { transition: background-color .15s ease, color .15s ease; }
}

/* ---- Motion: things open, close and change softly ---- */
.chip { transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease; }
.chip:active { transform: scale(.97); }
.q-row, .cust-row, .set-row, .step { transition: background-color .15s ease; }
.btn { transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .12s ease; }
.btn:active { transform: translateY(1px); }
.list-card { transition: opacity .2s ease; }
/* Menus are snappy: they appear at once, with only the briefest fade (no slide, no options stepping in). */
.menu:not([hidden]) { animation: menu-fade .08s linear; }
@keyframes menu-fade { from { opacity: 0; } to { opacity: 1; } }
.pop-card:not([hidden]) { animation: menu-in .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 719px) { .menu:not([hidden]):not(.create-sheet), .pop-card:not([hidden]) { animation-name: load-late; } }   /* phones: full-width panels only fade */
.fab-scrim:not([hidden]) { animation: load-late .2s ease; }
.side-tip:not([hidden]) { animation: load-late .12s ease; }
#app-view > * { animation: view-in .22s ease-out; }   /* (no fill: a finished animation must not leave stacking contexts that cover open menus) */
@keyframes view-in { from { opacity: 0; } to { opacity: 1; } }
.sort-head .sh-arrow { transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .15s ease; }
.help-bubble { transition: box-shadow .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1); }
.help-bubble:hover { transform: translateY(-2px); }
.tabbar :is(a, .tab-set) svg { transition: background-color .2s ease; }
@media (max-width: 719px) { .create-sheet:not([hidden]) { animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1); } }
@media (max-width: 719px) {
  /* Phones: the chips scroll sideways in one row instead of wrapping */
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 0 12px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidenav, .sn-label, #app-layout .main, .menu:not([hidden]), .pop-card:not([hidden]), #app-view > *, .help-bubble { transition: none !important; animation: none !important; }
}

/* =====================================================================================
   Look: "Quiet ledger". Lighter weights, hairlines, tables first, colour only where it means
   something. (Comes last so it sets the tone for everything above.)
   ===================================================================================== */
:root { --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px; }
body { font-size: 14px; letter-spacing: -0.003em; }
.main h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; }
.main .lead { font-size: 14px; }
.btn { min-height: 40px; padding: 0 14px; font-weight: 500; font-size: 14px; box-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.page-action { min-height: 40px; }
.btn.small, .closed-banner .btn { font-weight: 500; }
.dialog .dialog-actions .btn, .dialog.wide .dialog-actions .btn { min-height: 40px; }
.card, .panel, .list-card { box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.step { padding: 10px 12px; }
.step strong { font-weight: 500; }
.menu-item { font-size: 14px; min-height: 40px; }

/* Sidebar: same paper as the page, the current item lifted onto a card */
@media (min-width: 720px) {
  .sidenav { padding: 10px; gap: 1px; background: var(--paper); }
  .sidenav a[data-nav], .side-toggle, .side-new { height: 36px; font-size: 14px; font-weight: 500; padding: 0 11px; gap: 11px; border-radius: 7px; }
  .side-toggle { height: 34px; }
  .sidenav a[data-nav] svg, .side-toggle svg, .side-new svg, .sidenav [data-gear] svg { width: 18px; height: 18px; }
  .sidenav a[data-nav]:hover, .side-toggle:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
  .sidenav a[data-nav][aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .05); }
  .sidenav a[data-nav][aria-current="page"] svg { color: var(--forest); }
  .side-new { margin-bottom: 8px; }
  .side-sep { margin: 8px 4px; }
  .sidenav.peek { background: var(--paper); }
}

/* Filters: tabs with a count each (no black pills); the chosen one is underlined in green */
.chips { gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 6px 6px 0 0; background: none; color: var(--ink-muted); font-weight: 500; }
.chip::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--forest); transform: scaleX(0); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.chip:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--ink); }
.chip[aria-pressed="true"] { background: none; color: var(--ink); font-weight: 600; }
.chip[aria-pressed="true"]::after { transform: scaleX(1); }
.chip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.chip .n { min-width: 18px; padding: 0 5px; border-radius: 5px; background: var(--field); border: 1px solid var(--line); font-size: 12px; font-weight: 500; line-height: 18px; text-align: center; color: var(--ink-muted); font-variant-numeric: tabular-nums; transition: background-color .18s, color .18s, border-color .18s; }
.chip[aria-pressed="true"] .n { background: var(--forest-soft); border-color: transparent; color: var(--forest); }
.chip .n.zero { opacity: .6; }
.chip:active { transform: none; }
@media (max-width: 719px) { .chips { margin-left: -12px; margin-right: -12px; padding: 0 6px; } }

/* Search and View options */
.list-tools .search input { min-height: 38px; height: 38px; font-size: 14px; padding-left: 36px; }
.list-tools .search svg { left: 11px; width: 16px; height: 16px; }
.view-btn { width: 38px; height: 38px; }
.list-tools { margin-bottom: 12px; }

/* Tables */
.list-head { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; padding-top: 9px; padding-bottom: 9px; background: var(--surface); }
.q-row { min-height: 48px; padding-top: 9px; padding-bottom: 9px; }
.q-row .q-num { font-weight: 500; font-size: 13.5px; }
.q-row .q-who strong { font-weight: 500; font-size: 14px; }
.q-row .q-amt { font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }
.q-row .q-date, .q-row .q-ref, .q-row .q-due { font-size: 13.5px; }
.cust-list li + li { border-top-color: color-mix(in srgb, var(--line) 70%, transparent); }
/* Linked rows: a small ↳ connector instead of a line down the side */
.q-sub { border-left: 0; padding-left: 18px; position: relative; }
.q-kid .q-who { border-left: 0; padding-left: 18px; position: relative; }
.q-sub::before, .q-kid .q-who::before { content: ""; position: absolute; left: 4px; top: -2px; width: 8px; height: 9px; border-left: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); border-bottom-left-radius: 4px; }
.q-kid .q-who::before { top: 2px; }
.cust-row { min-height: 54px; padding-top: 8px; padding-bottom: 8px; }
.cust-main strong { font-weight: 500; font-size: 14px; }
.people-list .cust-avatar, .people-list .item-icon { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }
.people-list .item-icon svg { width: 16px; height: 16px; }
.item-price { font-weight: 500; font-size: 14px; }

/* Status tags: square-ish, a dot of the colour */
.pill { height: 22px; padding: 0 8px; border-radius: 6px; font-weight: 500; gap: 6px; }
.pill::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }

/* Phones: the Sales switch — the chosen one is a green tab with white text */
@media (max-width: 719px) {
  .sales-switch { padding: 3px; gap: 3px; border-radius: 10px; background: var(--field); border-color: var(--line); }
  .sales-switch a { min-height: 34px; border-radius: 7px; font-weight: 500; color: var(--ink-muted); transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
  .sales-switch a[aria-current="page"] { background: var(--forest); color: var(--on-forest); font-weight: 600; box-shadow: 0 1px 3px rgba(30, 91, 75, .3); }
  .tabbar :is(a, .tab-set) { font-weight: 500; }
  .tabbar :is(a, .tab-set)[aria-current="page"] { font-weight: 600; }
}

/* Reminders: each day is a tile you tick; ticked ones turn green */
.rem-days { gap: 8px; grid-template-columns: repeat(2, minmax(0, 240px)); }
.rem-days .rem-day { margin: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.rem-days .rem-day:hover { border-color: color-mix(in srgb, var(--forest) 45%, var(--line-strong)); }
.rem-days .rem-day:has(input:checked) { background: var(--forest-soft); border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); }
.rem-days .rem-day:has(input:checked) strong { color: var(--forest); }
.rem-days .rem-day strong { font-weight: 500; }
@media (max-width: 520px) { .rem-days { grid-template-columns: 1fr 1fr; } }
/* Computers and tablets: the choices line up in one row in the line's own order (before, the due
   date, after), wrapping only when there isn't room. */
@media (min-width: 561px) {
  .rem-days { display: flex; flex-wrap: wrap; gap: 8px; }
  .rem-days > * { grid-area: auto !important; flex: 0 0 auto; }
  .rem-days .rem-day strong { white-space: nowrap; }
}

/* Create (computers): a press, the + turns into ×, the menu grows out of the button */
@media (min-width: 720px) {
  .side-new svg { transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
  .side-new[aria-expanded="true"] svg { transform: rotate(135deg); }
  .side-new:active { transform: scale(.97); }
  .side-new[aria-expanded="true"] { animation: create-pop .32s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 0 0 3px var(--forest-soft); }
  @keyframes create-pop { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--forest) 45%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
  .side-new-wrap .menu.new-menu:not([hidden]) { animation: menu-fade .08s linear; }
  @keyframes create-menu { from { opacity: 0; transform: translateX(-6px) scale(.97); } to { opacity: 1; transform: none; } }
}
@keyframes item-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Create sheet (phones): a handle you can pull down to close it; options give under the finger */
@media (max-width: 719px) {
  /* The opening slide plays once: dragging and letting go never replay it (that was the flicker). */
  .create-sheet.opened, .create-sheet.dragging, .create-sheet.settling { animation: none !important; }
  .create-sheet.opened > .menu-item { animation: none !important; }
  .create-sheet .sheet-grab, .create-sheet .sheet-title { touch-action: none; }
  .create-sheet.dragging { transition: none; }
  .create-sheet.dragging .menu-item:active { transform: none; background: none; }
  .create-sheet.settling { transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
  .sheet-grab { position: relative; width: 44px; height: 5px; margin: 2px auto 12px; background: var(--line-strong); transition: width .2s ease, background-color .2s ease; }
  .sheet-grab::before { content: ""; position: absolute; left: -40px; right: -40px; top: -14px; bottom: -14px; }   /* a bigger target to grab */
  .create-sheet.dragging .sheet-grab { width: 56px; background: var(--ink-muted); }
  .create-sheet .menu-item { transition: background-color .15s ease, transform .12s ease; }
  .create-sheet .menu-item:active { transform: scale(.98); background: var(--field); }
  .tab-new:active { transform: scale(.94); }
  .tab-new { transition: transform .15s ease, box-shadow .2s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .chip::after, .side-new svg, .side-new-wrap .menu.new-menu:not([hidden]), .menu:not([hidden]) > .menu-item, .create-sheet.settling { transition: none !important; animation: none !important; }
}
/* The draft tick box sits level with the row's first line */
.q-pick, .picks .q-pick { top: 5px; }
.rem-days .rem-day { align-items: center; }

/* Phones: View options has no column choices (phone rows are short and always the same) */
@media (max-width: 719px) { .menu .vm-col { display: none; } }

/* Phones: the avatar is at the top right, next to the bell, and opens the same menu as a sheet from
   the bottom (your account, help, theme, signing out). The bottom bar's gear is Business settings. */
#account-menu .sheet-grab { display: none; }
@media (max-width: 719px) {
  #account-menu:not([hidden]) { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px calc(84px + env(safe-area-inset-bottom)); border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 30px rgba(27, 32, 30, 0.18); animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1); }
  #account-menu .sheet-grab { display: block; position: relative; width: 44px; height: 5px; margin: 2px auto 12px; border-radius: 999px; background: var(--line-strong); transition: width .2s ease, background-color .2s ease; }
  #account-menu .sheet-grab::before { content: ""; position: absolute; left: -40px; right: -40px; top: -14px; bottom: -14px; }
  #account-menu.opened, #account-menu.dragging, #account-menu.settling { animation: none !important; }
  #account-menu.opened > .menu-item { animation: none !important; }
  #account-menu.dragging { transition: none; }
  #account-menu.dragging .sheet-grab { width: 56px; background: var(--ink-muted); }
  #account-menu.settling { transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
  #account-menu .sheet-grab, #account-menu .menu-head { touch-action: none; }
}
@media (max-width: 719px) {
  /* The small print fills the foot of the Menu sheet, edge to edge, down under the bottom bar */
  #account-menu .menu-legal { margin: var(--space-2) -12px calc(-84px - env(safe-area-inset-bottom)); padding-bottom: calc(92px + env(safe-area-inset-bottom)); border-radius: 0; }
}

/* Quotes | Invoices | Receipts: the switch never fades or blinks when hopping between them */
body.sales-hop .view-skel { animation: none; }
body.sales-hop .view-skel > :not(.sales-switch) { animation: load-late .18s ease-out both; }
body.sales-hop #app-view > .sales-switch { animation: none; }

/* Computers: Business settings lives in the sidebar, so the account menu is about you (account,
   help, theme, sign out). Phones keep it in Menu (no sidebar there). */
@media (min-width: 720px) { #account-menu #menu-biz, #account-menu #menu-settings { display: none; } }
/* The sidebar's Collapse / Keep open sits at its foot */
@media (min-width: 720px) {
  .side-sep-foot, .side-foot-gap { margin-top: auto !important; }
  .side-foot-gap { display: block; flex: none; height: 0; }
  .side-toggle { margin-bottom: 0; flex: none; }
}

/* ---- Invoice reminders: Express | Advanced, the plan on a line, your own days ---- */
.seg.seg-2 { grid-template-columns: repeat(2, 1fr); max-width: 320px; }
.rem-mode-field { margin: 14px 0 4px; border: 0; padding: 0; }
.rem-mode-field .hint { display: block; margin-top: 6px; }
.rem-line { position: relative; margin: 10px 0 18px; padding: 4px 16px 4px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; }
.rl-empty { margin: 18px 0; text-align: center; color: var(--ink-muted); font-size: 13px; }
.rl-before, .rl-after { display: none; position: absolute; top: 9px; font-size: 11.5px; font-weight: 500; color: var(--ink-muted); white-space: nowrap; }
.rl-before { left: 12px; }
.rl-after { right: 12px; }
/* One lane per kind: its name on the left, its own line (invoices, then quotes) */
.rl-lane { position: relative; display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; padding: 38px 0 34px; }   /* room for the numbers above, the due date below */
.rl-lane + .rl-lane { border-top: 1px dashed var(--line); }
.rl-name { font-size: 12px; font-weight: 600; color: var(--ink); }
.rl-track { position: relative; height: 2px; margin: 0 4px; background: var(--line-strong); border-radius: 2px; }
.rl-due { position: absolute; top: -14px; width: 2px; height: 30px; margin-left: -1px; background: var(--ink); border-radius: 2px; }
.rl-due b { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); z-index: 1; padding: 0 4px; background: var(--paper); font-size: 11.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.rl-dot { position: absolute; top: -6px; width: 0; z-index: 2; transition: left .3s cubic-bezier(.2, .8, .2, 1); }
.rl-dot i { position: absolute; left: -7px; top: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--forest); border: 2.5px solid var(--paper); box-shadow: 0 0 0 1px var(--forest); animation: rl-pop .3s cubic-bezier(.2, .8, .2, 1); }
.rl-dot b { position: absolute; bottom: 18px; left: 0; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--forest); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rl-dot.on-due b { display: none; }
/* The repeats: a dashed tail from the last reminder, its first stop, then ×N or ∞ at the end */
.rl-rep { position: absolute; top: -1px; height: 0; border-top: 2px dashed color-mix(in srgb, var(--forest) 55%, transparent); background: var(--paper); }
.rl-dot.rep i { background: var(--paper); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--forest) 60%, transparent); width: 10px; height: 10px; left: -5px; top: 2px; }
.rl-dot.rep b { color: var(--ink-muted); font-weight: 500; }
.rl-more { position: absolute; right: -12px; top: -13px; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--forest-soft); color: var(--forest); font-size: 15px; font-weight: 700; line-height: 1; }
.rl-every { position: absolute; right: -8px; top: 18px; font-size: 11px; color: var(--ink-muted); white-space: nowrap; }
@keyframes rl-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.rem-steps { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; max-width: 460px; }
.rem-step { display: flex; align-items: center; gap: 8px; animation: item-in .22s cubic-bezier(.2, .8, .2, 1); }
.rem-step input { width: 76px; flex: none; text-align: center; }
.rem-step input[hidden] { display: none; }
.rem-step select { flex: 1; min-width: 0; }
.rem-del { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--ink-muted); cursor: pointer; }
.rem-del:hover { background: var(--field); color: var(--danger); }
.rem-del svg { width: 18px; height: 18px; }
.rem-add { margin: 0 0 14px; }
.rem-adv-opts { display: grid; gap: 10px; margin-bottom: 6px; }
.rem-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.rem-inline label { margin: 0; font-weight: 500; }
.rem-inline input[type="number"] { width: 72px; text-align: center; }
.rem-inline select { width: auto; min-width: 120px; }
/* Then keep reminding: shown only when ticked, as one sentence under it. Each part (Every [14] days /
   the choice / [5] more) stays together and lines up on the same middle line; whole parts wrap. */
#rem-repeat-opts { padding-left: 32px; margin: -6px 0 8px; row-gap: 10px; column-gap: 10px; animation: rr-in .2s ease-out; }
#rem-repeat-opts[hidden] { display: none; }
@keyframes rr-in { from { opacity: 0; transform: translateY(-4px); } }
.rr-part { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.rr-part[hidden] { display: none; }
.rem-repeat input[type="number"], .rem-quote-opts input[type="number"] { width: 60px; }
.rem-repeat select { min-width: 0; }
/* Reminders: small number boxes without the up/down arrows (the keyboard on phones is numeric) */
.rem-panel input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.rem-panel input[type="number"]::-webkit-inner-spin-button, .rem-panel input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rr-lead { white-space: nowrap; }
/* Phones: "Every" in its own column, and the three parts stacked beside it, their boxes lined up */
@media (max-width: 560px) {
  #rem-repeat-opts:not([hidden]) { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 10px; }
  #rem-repeat-opts .rr-lead { grid-column: 1; grid-row: 1; }
  #rem-repeat-opts .rr-part { grid-column: 2; justify-self: start; }
  #rem-repeat-opts .rr-part[hidden] { display: none; }
}
@media (prefers-reduced-motion: reduce) { #rem-repeat-opts { animation: none; } }
.rem-quote-opts { margin: -4px 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rem-hour { margin: 14px 0 2px; }
.rl-none { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; color: var(--ink-muted); }
.rv-list li.rv-none { color: var(--ink-muted); }
.rv-list li.rv-none i { display: none; }
#rem-quote-opts { padding-left: 0; margin-top: 4px; }
.rem-panel .help-disc { margin-top: 12px; }
.rem-panel .help-body a { color: var(--forest); font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .rl-dot, .rl-dot i, .rem-step { transition: none; animation: none; } }
/* The "Ask us anything" hint never sits over a Save bar's buttons */
body.has-savebar .hb-label { display: none !important; }

/* =====================================================================================
   Rows you can open end in a › (documents, customers, items, linked documents, settings,
   notifications). It nudges right under the pointer, so the whole row reads as a link.
   ===================================================================================== */
:root { --chev-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E"); }
a.q-row, a.cv-row, .linked-list a, a.bell-item { position: relative; }
.q-head, a.q-row { padding-right: 46px; }
.cv-head, a.cv-row, .linked-list a { padding-right: 34px; }
a.bell-item { padding-right: 38px; }
a.q-row::after, a.cv-row::after, .linked-list a::after, a.bell-item::after, a.pq-portal::after, a.po-row::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  background-color: var(--ink-muted); opacity: .75;
  -webkit-mask: var(--chev-mask) center / 18px no-repeat; mask: var(--chev-mask) center / 18px no-repeat;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .2s ease, background-color .2s ease;
}
a.cv-row::after, .linked-list a::after { right: 8px; }
a.q-row.q-kid::after { width: 15px; height: 15px; margin-top: -7.5px; -webkit-mask-size: 15px; mask-size: 15px; opacity: .55; }
@media (hover: hover) {
  a.q-row:hover::after, a.cv-row:hover::after, .linked-list a:hover::after, a.bell-item:hover::after, a.pq-portal:hover::after, a.po-row:hover::after { transform: translateX(3px); opacity: 1; background-color: var(--ink); }
  .cust-row:hover > svg:last-child, .set-row:hover .chev { transform: translateX(3px); color: var(--ink); }
}
.cust-row > svg:last-child, .set-row .chev { transition: transform .2s cubic-bezier(.2, .8, .2, 1), color .2s ease; }
a.q-row:focus-visible::after, a.cv-row:focus-visible::after { opacity: 1; background-color: var(--ink); }
@media (max-width: 719px) {
  .q-head, a.q-row { padding-right: 36px; }
  a.q-row::after { right: 10px; }
}
@media (prefers-reduced-motion: reduce) { a.q-row::after, a.cv-row::after, .linked-list a::after, a.bell-item::after, .cust-row > svg:last-child, .set-row .chev { transition: none; } }
/* Customer page: linked rows use the same small ↳ connector as the lists */
.cv-kid .cv-what, .cv-sub { border-left: 0; padding-left: 18px; position: relative; }
.cv-kid .cv-what::before, .cv-sub::before { content: ""; position: absolute; left: 4px; top: 1px; width: 8px; height: 9px; border-left: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); border-bottom-left-radius: 4px; }
a.cv-row.cv-kid::after { width: 15px; height: 15px; margin-top: -7.5px; -webkit-mask-size: 15px; mask-size: 15px; opacity: .55; }
/* Phones: the plan top to bottom — a line down the left, a dot per reminder, the due date (or a
   quote's expiry) as a bar, then the repeats with ×N or ∞ */
.rem-line.vertical { padding: 12px 14px; }
.rv-lane + .rv-lane { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
/* Wide enough but crowded (computers): invoices and quotes side by side */
.rem-line.vertical.side.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; }
.rem-line.vertical.side.two .rv-lane + .rv-lane { margin-top: 0; padding-top: 0; border-top: 0; padding-left: 24px; border-left: 1px dashed var(--line); }
.rv-name { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--ink); }
.rv-list { list-style: none; margin: 0; padding: 0; position: relative; }
.rv-list::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line-strong); border-radius: 2px; }
.rv-list li { position: relative; display: flex; align-items: center; min-height: 26px; padding-left: 26px; font-size: 13.5px; color: var(--ink); animation: rl-pop .25s cubic-bezier(.2, .8, .2, 1); }
.rv-list li i { position: absolute; left: 0; top: 50%; margin-top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--forest); border: 2.5px solid var(--paper); box-shadow: 0 0 0 1px var(--forest); }
.rv-list li.rv-mark { font-weight: 600; }
.rv-list li.rv-mark i { left: -2px; width: 18px; height: 4px; margin-top: -2px; border: 0; border-radius: 2px; box-shadow: none; background: var(--ink); }
.rv-list li.on-mark { font-weight: 600; }
.rv-list li.rep { color: var(--ink-muted); }
.rv-list li.rep i { background: var(--paper); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--forest) 60%, transparent); width: 10px; height: 10px; margin-top: -5px; left: 2px; }
.rv-inf { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin: 0 4px; padding: 0 5px; border-radius: 11px; background: var(--forest-soft); color: var(--forest); font-size: 14px; font-weight: 700; }

/* Sidebar: Sales (Quotes, Invoices, Receipts) and Books (Journal, Trial balance). The heading is a
   link to the group's overview; the arrow beside it opens and closes the pages under it
   (remembered), tucked under it on a thin guide line. Folded to icons: no arrow, all as icons. */
@media (min-width: 720px) {
  .side-group { display: flex; flex-direction: column; gap: 1px; flex: none; }
  .side-group-row { position: relative; flex: none; }
  .side-group-row .side-group-link { padding-right: 40px; }
  .side-group-head { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ink-muted); cursor: pointer; transition: background-color .15s ease, color .15s ease, opacity .15s ease; }
  .side-group-head:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
  .side-group-head:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
  .side-group-head .sg-chev { width: 16px; height: 16px; transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
  .side-group.is-closed .side-group-head .sg-chev { transform: rotate(-90deg); }
  .side-sub { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s cubic-bezier(.2, .8, .2, 1); }
  .side-sub-in { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1px; position: relative; }
  .side-group.is-closed .side-sub { grid-template-rows: 0fr; }
  /* The same layout folded or not (folded just hides the names), so nothing moves under the
     pointer when it slides open: the pages sit a little in, beside a thin guide line. */
  .side-sub-in a[data-nav] { padding-left: 17px; }
  .side-sub-in a[data-nav] svg { width: 16px; height: 16px; }
  .side-sub-in::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
  body:not(.side-open) .sidenav:not(.peek) .side-group-head { opacity: 0; pointer-events: none; }
  .side-sub-in a[data-nav] { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .side-sub, .side-group-head .sg-chev { transition: none; } }

.rem-add-full { margin: 0 0 14px; }

/* ---- Navigation: icons that fill in when chosen, and a sliding line instead of pills ----
   No shape behind the chosen item. It reads by its colour and weight, its icon filling in softly
   (with a small pop as it becomes the one), and a short green line that slides to it: beside it in
   the sidebar, above it in the bottom bar, under it in the Sales switch. */
svg .if { fill: currentColor; stroke: none; opacity: 0; transition: opacity .25s ease; }
.sidenav [aria-current="page"] .if, .side-group.is-closed .side-group-link.has-current .if,
.tabbar [aria-current="page"] .if { opacity: .22; }
@keyframes nav-pop { 0% { transform: scale(.82); } 45% { transform: scale(1.16); } 72% { transform: scale(.96); } 100% { transform: scale(1); } }
.nav-pop svg:first-of-type { animation: nav-pop .42s cubic-bezier(.3, .7, .4, 1); }

@media (min-width: 720px) {
  .sidenav a[data-nav][aria-current="page"], .sidenav a[data-nav][aria-current="page"]:hover { background: none; box-shadow: none; color: var(--ink); font-weight: 600; }
  .sidenav a[data-nav][aria-current="page"] svg { color: var(--forest); }
  .side-group.is-closed .side-group-link.has-current { color: var(--ink); font-weight: 600; }
  .side-group.is-closed .side-group-link.has-current svg { color: var(--forest); }
  .sidenav a[data-nav] svg { transition: color .2s ease; }
  .sidenav a[data-nav]:hover svg { color: var(--ink); }
  .sidenav a[data-nav][aria-current="page"]:hover svg { color: var(--forest); }
  .side-ink { position: absolute; z-index: 1; left: 3px; top: 0; width: 3px; height: 18px; border-radius: 3px; background: var(--forest); opacity: 0; pointer-events: none; }
  .side-ink.on { opacity: 1; }
  .side-ink.ready { transition: transform .34s cubic-bezier(.3, 1.25, .5, 1), opacity .2s ease; }
}

@media (max-width: 719px) {
  .tabbar :is(a, .tab-set) svg { padding: 3px 0; background: none !important; border-radius: 0; transition: color .2s ease; }
  .tabbar :is(a, .tab-set) { transition: color .2s ease; }
  .tabbar :is(a, .tab-set)[aria-current="page"] { color: var(--forest); font-weight: 600; }
  .tabbar :is(a, .tab-set):active svg { transform: scale(.9); transition: transform .08s ease; }
  .tab-ink { position: absolute; top: -1px; left: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--forest); opacity: 0; pointer-events: none; }
  .tab-ink.on { opacity: 1; }
  .tab-ink.ready { transition: transform .38s cubic-bezier(.3, 1.3, .5, 1), opacity .2s ease; }

  /* Sales: Quotes | Invoices | Receipts as tabs with a line that slides, like the filters below */
  .sales-switch { position: relative; gap: 0; padding: 0; margin: -6px 0 16px; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; --i: 0; }
  .sales-switch a, .sales-switch a[aria-current="page"] { min-height: 42px; border-radius: 0; background: none; box-shadow: none; color: var(--ink-muted); font-weight: 500; transition: color .2s ease; }
  .sales-switch a[aria-current="page"] { color: var(--ink); font-weight: 600; }
  .ss-ink { position: absolute; left: 0; bottom: -1px; width: var(--w, calc(100% / var(--n, 3))); height: 2px; transform: translateX(var(--x, calc(var(--i) * 100%))); transition: transform .34s cubic-bezier(.3, 1.2, .5, 1), width .34s cubic-bezier(.3, 1.2, .5, 1); pointer-events: none; }
  .sales-switch.ss-tight { grid-template-columns: repeat(var(--n), auto); justify-content: space-between; }
  .sales-switch.ss-tight a { white-space: nowrap; padding: 0 6px; }
  .ss-ink::before { content: ""; position: absolute; left: 50%; width: 56px; margin-left: -28px; top: 0; bottom: 0; border-radius: 2px 2px 0 0; background: var(--forest); }
}
.ss-ink { display: none; }
@media (max-width: 719px) { .ss-ink { display: block; } }

@media (prefers-reduced-motion: reduce) {
  .nav-pop svg:first-of-type { animation: none; }
  .side-ink.ready, .tab-ink.ready, .ss-ink { transition: opacity .2s ease; }
}

/* ---- Ask us: the chat with BooksAtHand's team (assets/ask.js) ----
   Computers: a panel above the picture, bottom right, that stays open from page to page.
   Phones: full screen, the keyboard pushing the message box up. Your messages on the right in a
   soft green; ours on the left with the person's picture, name and role. */
.help-bubble .hb-face.has-photo { background-size: cover; background-position: center; }
.help-bubble .hb-badge.has-count { width: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--marigold); color: var(--on-marigold); font-size: 12px; font-weight: 700; line-height: 1; }
.help-bubble .hb-badge.has-count svg { display: none; }
.help-bubble .hb-badge.has-count::after { content: attr(data-count); }
@keyframes ask-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.ask-panel { position: fixed; z-index: 52; right: 24px; bottom: 100px; width: 380px; height: min(620px, calc(100vh - 140px)); height: min(620px, calc(100dvh - 140px)); display: flex; flex-direction: column; box-sizing: border-box; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px rgba(27, 32, 30, .2), 0 2px 6px rgba(0, 0, 0, .06); overflow: hidden; transform-origin: 100% 100%; animation: ask-in .2s cubic-bezier(.2, .8, .2, 1); }
.ask-panel[hidden] { display: none; }
.ask-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); flex: none; }
.ask-head-pic, .ask-hello-pic, .ask-pic { flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--forest); color: var(--on-forest); font-weight: 600; line-height: 1; }
.ask-head-pic:not(.is-person), .ask-hello-pic:not(.is-person) { background: #1E5B4B url("/assets/team-face.svg") center / cover no-repeat; }
.ask-head-pic.is-person, .ask-hello-pic.is-person { background: var(--forest); color: var(--on-forest); }
.ask-head-pic { font-size: 17px; } .ask-hello-pic { font-size: 30px; } .ask-pic { font-size: 12px; }
.ask-head-pic.has-photo, .ask-hello-pic.has-photo { background-size: cover; background-position: center; }
.ask-head-pic { width: 40px; height: 40px; }
.ask-who { flex: 1; min-width: 0; }
.ask-who h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.2; }
.ask-who p { margin: 2px 0 0; font-size: 13px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-x { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-muted); cursor: pointer; }
.ask-x:hover { background: var(--field); color: var(--ink); }
.ask-x svg { width: 20px; height: 20px; }
.ask-access { flex: none; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--marigold-soft); font-size: 13px; }
.ask-access p { display: flex; gap: 8px; margin: 0; color: var(--ink); }
.ask-access p svg { width: 18px; height: 18px; flex: none; color: var(--marigold-ink); }
.ask-access-act { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 8px; }
.ask-access-act .btn { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.ask-views summary { cursor: pointer; color: var(--ink-muted); padding: 6px 0; }
.ask-views ul { margin: 4px 0 0; padding: 0; list-style: none; max-height: 120px; overflow: auto; }
.ask-views li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.ask-views time { color: var(--ink-muted); white-space: nowrap; }
.ask-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 8px; }
.ask-body.is-loading { opacity: .5; }
.ask-older { display: block; margin: 0 auto 10px; font-size: 13px; }
.ask-hello { text-align: center; padding: 18px 6px 8px; }
.ask-hello[hidden] { display: none; }
.ask-hello-pic { display: block; width: 72px; height: 72px; margin: 0 auto 12px; }
.ask-hello-name { margin: 0; font-size: 17px; font-weight: 600; }
.ask-hello-who { margin: 2px 0 10px; font-size: 13px; color: var(--ink-muted); }
.ask-hello-text { margin: 0 auto 16px; max-width: 290px; font-size: 14px; line-height: 1.5; color: var(--ink-muted); }
.ask-starts { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ask-start { min-width: 220px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.ask-start:hover { border-color: var(--forest); background: var(--forest-soft); }
.ask-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ask-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.ask-msg.grouped { margin-top: -6px; }
.ask-msg.mine { justify-content: flex-end; }
.ask-pic { width: 28px; height: 28px; background-size: cover; background-position: center; margin-bottom: 18px; }
.ask-pic.is-team:not([style]) { background: #1E5B4B url("/assets/team-face.svg") center / cover no-repeat; }
.ask-pic.ghost { visibility: hidden; }
/* The BooksAtHand team as the face: the mark on its green. */
.help-bubble .hb-face.is-team, .ask-head-pic.is-team, .ask-hello-pic.is-team { background: #1E5B4B url("/assets/team-face.svg") center / cover no-repeat; }
.ask-col { display: flex; flex-direction: column; min-width: 0; max-width: 82%; }
.ask-msg.mine .ask-col { align-items: flex-end; }
.ask-by { margin: 0 0 3px 2px; font-size: 12px; font-weight: 600; color: var(--ink); }
.ask-by span { font-weight: 400; color: var(--ink-muted); }
.ask-bubble { padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.ask-msg.theirs .ask-bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ask-msg.mine .ask-bubble { background: var(--forest-soft); border: 1px solid transparent; border-bottom-right-radius: 4px; }
.ask-msg.grouped.theirs .ask-bubble { border-top-left-radius: 4px; }
.ask-msg.grouped.mine .ask-bubble { border-top-right-radius: 4px; }
.ask-text { margin: 0; white-space: normal; }
.ask-text a { color: var(--forest); }
.ask-topic-tag { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-muted); }
.ask-msg time { margin: 3px 4px 0; font-size: 11px; color: var(--ink-muted); }
.ask-docs-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ask-doclink { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500; text-decoration: none; }
.ask-doclink svg { width: 15px; height: 15px; color: var(--forest); flex: none; }
.ask-doclink .adl-sub { color: var(--ink-muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-doclink:hover { border-color: var(--forest); }
.ask-file { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; text-decoration: none; max-width: 100%; }
.ask-file svg { width: 16px; height: 16px; flex: none; color: var(--ink-muted); }
.ask-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-img { display: block; margin-top: 6px; }
.ask-img img { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); min-width: 60px; min-height: 40px; }
.ask-sys { display: block; margin: 4px 12px; font-size: 12px; line-height: 1.5; color: var(--ink-muted); text-align: center; }
.ask-sys svg { display: inline-block; width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; }
.ask-sys time { white-space: nowrap; opacity: .85; }
.ask-sys time::before { content: " · "; }
.ask-card { padding: 0; overflow: hidden; }
.ask-card .ask-text { padding: 9px 12px 0; }
.ask-access-card { margin: 8px 0 0; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--paper); }
.aa-head { display: flex; align-items: center; gap: 7px; margin: 0 0 4px; font-size: 13px; }
.aa-head svg { width: 16px; height: 16px; color: var(--marigold-ink); flex: none; }
.aa-note { margin: 0 0 10px; font-size: 12.5px; line-height: 1.45; color: var(--ink-muted); }
.aa-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aa-act select { width: auto; min-height: 36px; padding: 4px 30px 4px 10px; font-size: 13px; background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; }
.aa-act .btn { min-height: 36px; padding: 6px 14px; margin: 0; }
.aa-act .link { font-size: 13px; }
.aa-done { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--ink-muted); }
.aa-done.ok { color: var(--forest); }
.aa-done svg { width: 15px; height: 15px; }
.ask-compose { position: relative; flex: none; padding: 8px 10px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.ask-compose .alert { margin: 0 0 8px; font-size: 13px; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-chips:has(.ask-chip:not([hidden])) { margin-bottom: 8px; }
.ask-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 4px 3px 10px; border-radius: 8px; background: var(--forest-soft); color: var(--forest); font-size: 12.5px; font-weight: 500; }
.ask-chip[hidden] { display: none; }
.ask-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-chip button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer; }
.ask-chip button:hover { background: color-mix(in srgb, var(--forest) 12%, transparent); }
.ask-chip svg { width: 13px; height: 13px; }
.ask-row { display: flex; align-items: flex-end; gap: 4px; }
.ask-tool { display: grid; place-items: center; flex: none; width: 38px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-muted); cursor: pointer; }
.ask-tool:hover, .ask-tool[aria-expanded="true"] { background: var(--field); color: var(--ink); }
.ask-tool svg { width: 20px; height: 20px; }
.ask-row textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 140px; padding: 9px 12px; resize: none; border-radius: 10px; font-size: 15px; line-height: 1.4; }
.ask-send { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: var(--forest); color: var(--on-forest); cursor: pointer; transition: background-color .15s ease, transform .1s ease; }
.ask-send:hover { background: var(--forest-hover); }
.ask-send:active { transform: scale(.94); }
.ask-send:disabled { opacity: .6; cursor: default; }
.ask-send svg { width: 19px; height: 19px; }
.ask-doc-menu { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 6px); max-height: 300px; overflow: auto; padding: 8px; }
.ask-doc-menu input { margin-bottom: 6px; }
.ask-doc-menu ul { list-style: none; margin: 0; padding: 0; }
.ask-doc-menu li button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ask-doc-menu li button:hover { background: var(--field); }
.ask-doc-menu li button strong { font-weight: 600; }
.ask-doc-menu li button span { font-size: 12.5px; color: var(--ink-muted); }
.ask-doc-none { padding: 8px 10px; color: var(--ink-muted); font-size: 13px; }
/* The picture shows the close state while the chat is open (computers). */
body.ask-open .hb-label { display: none !important; }
@media (min-width: 720px) {
  /* Under the top bar's menus (account, bell, business), which drop over it. */
  .ask-panel { z-index: 34; }
  /* The panel always opens just above the picture, on every page, in front of the page and its Save bar. */
}
@media (max-width: 719px) {
  .ask-panel { inset: 0 0 auto 0; right: 0; bottom: auto; width: auto; height: 100vh; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; z-index: 60; animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1); }
  .ask-head { padding: calc(10px + env(safe-area-inset-top)) 10px 10px 14px; }
  .ask-compose { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .ask-col { max-width: 86%; }
  body.ask-open .help-bubble { display: none !important; }
  .ask-row textarea { font-size: 16px; }   /* no zoom on iPhones */
}
@media (prefers-reduced-motion: reduce) { .ask-panel { animation: none; } }
/* Ask us: the home (Continue, recent conversations), the bar over a conversation, the end line */
.ask-head .ask-back { margin: 0 -6px 0 -8px; }
.ask-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; padding: 7px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-muted); }
.ask-bar[hidden] { display: none; }
.ask-bar .link { font-size: 13px; font-weight: 500; }
/* The bar's button: a real button (Mark as sorted with a tick; Back / Ask something new in a past one). */
.ask-bar { position: relative; min-height: 46px; }
.ask-bar-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 32px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .15s, background-color .15s, color .15s; }
.ask-bar-btn[hidden] { display: none; }
.ask-bar-btn svg { width: 15px; height: 15px; color: var(--forest); }
.ask-bar-btn:hover { border-color: var(--forest); color: var(--forest); background: var(--forest-soft); }
.ask-bar-btn:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
/* Asking first: the bar becomes the question. */
.ask-confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; width: 100%; font-size: 13px; color: var(--ink); line-height: 1.4; }
.ask-confirm[hidden] { display: none; }
.ask-bar.confirming { padding-top: 10px; padding-bottom: 10px; background: var(--field); }
.ask-bar.confirming > #ask-bar-text, .ask-bar.confirming > .ask-bar-btn { display: none; }
.ask-confirm-act { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ask-confirm-act .btn { margin: 0; }
.ask-confirm .btn.small, .ask-confirm .btn.secondary.small { min-height: 34px; height: 34px; padding: 0 12px; font-size: 13px; width: auto; }
@media (prefers-reduced-motion: no-preference) { .ask-confirm:not([hidden]) { animation: ask-confirm-in .18s ease-out; } }
@keyframes ask-confirm-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
/* "Is this sorted?" card */
.ask-sorted-card .aa-head svg { color: var(--forest); }
.ask-sorted-card .btn.small { display: inline-flex; align-items: center; gap: 6px; }
.ask-sorted-card .btn.small svg { width: 15px; height: 15px; }
.as-due { margin: 8px 0 0; font-size: 12px; color: var(--ink-muted); }
.ask-bubble.ask-card.no-text .ask-access-card { margin-top: 0; border-top: 0; }
/* A card with an icon: the icon hangs to the left of the title, and everything under it (note,
   buttons, the closing time, the answer) starts where the title starts. */
.ask-access-card.with-icon { padding-left: 36px; }
.ask-access-card.with-icon .aa-head { position: relative; }
.ask-access-card.with-icon .aa-head svg { position: absolute; left: -24px; top: 50%; margin-top: -8px; }
.ask-access-card.with-icon .aa-done svg { margin-left: -21px; }
.ask-bar .link[hidden] { display: none; }
.ask-continue { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k go" "t go"; gap: 2px 12px; align-items: center; width: 100%; margin: 4px 0 18px; padding: 12px 13px; border: 1px solid var(--forest); border-radius: 10px; background: var(--forest-soft); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.ask-continue[hidden] { display: none; }
.ask-continue .ac-k { grid-area: k; font-size: 12px; font-weight: 600; color: var(--forest); }
.ask-continue .ac-t { grid-area: t; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-continue .ac-go { grid-area: go; font-size: 13px; font-weight: 600; color: var(--forest); }
.ask-past { margin: 22px 0 4px; text-align: left; }
.ask-past[hidden] { display: none; }
.ask-past h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.ask-past ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ask-past li + li { border-top: 1px solid var(--line); }
.ask-past button { position: relative; display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 34px 10px 13px; border: 0; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.ask-past button:hover { background: var(--field); }
.ask-past button::after { content: ""; position: absolute; right: 8.5px; top: 50%; width: 12px; height: 12px; margin-top: -6px; background: var(--ink-muted); -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg>') center / contain no-repeat; mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg>') center / contain no-repeat; }
.ask-past .ap-t { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-past .ap-d { font-size: 12px; color: var(--ink-muted); }
.ask-list[hidden] { display: none; }
.ask-compose[hidden] { display: none; }
.ask-sys-end { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; }
.ask-sys-end::before, .ask-sys-end::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ask-sys-end time::before { content: " · "; }

/* Create account: this email already has an account. */
.exists-box { margin: -4px 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); font-size: 14px; line-height: 1.45; }
.exists-box p { margin: 0 0 10px; }
.exists-act { display: flex; gap: 8px; flex-wrap: wrap; }
.exists-act .btn { width: auto; margin: 0; min-height: 36px; padding: 6px 14px; }
@media (prefers-reduced-motion: no-preference) { .exists-box:not([hidden]) { animation: view-in .2s ease-out; } }

/* No business yet (just signed up): only Home and your account until one is created. */
body.no-biz #help-bubble, body.no-biz .side-new-wrap, body.no-biz #side-sales, body.no-biz #side-books, body.no-biz #sidenav [data-nav="customers"],
body.no-biz #sidenav [data-nav="items"], body.no-biz #sidenav [data-nav="settings"], body.no-biz #sidenav .side-sep:not(.side-sep-foot):not(.side-sep-keep),
body.no-biz #tabbar #tab-sales, body.no-biz #tabbar #tab-new, body.no-biz #tabbar [data-nav="customers"] { display: none !important; }
/* Phones: nothing for the bottom bar yet (your account is the avatar at the top). */
@media (max-width: 719px) { body.no-biz .tabbar { display: none !important; } }

/* Business settings: the business's tile beside its name, like the switcher. */
.set-head { display: flex; align-items: center; gap: 14px; }
.set-head .biz-tile { width: 44px; height: 44px; border-radius: 10px; font-size: 18px; flex: none; }
.pi-email { margin: 2px 0 0; font-size: 14px; }
.pi-email a { margin-left: 8px; color: var(--forest); font-weight: 500; }
.avatar-btn.is-here .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--forest); }

/* ---------- Books (general ledger) ---------- */
.ledger-list .cust-row { font-variant-numeric: tabular-nums; }
.ledger-list .item-price { font-variant-numeric: tabular-nums; }
.la-code { flex: none; min-width: 52px; font-size: 13px; font-weight: 600; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.lc-row .cust-main { flex: 1 1 auto; }
@container (min-width: 560px) {
  #bk-list-card .p-head, #bk-list-card .cust-row { grid-template-columns: 30px minmax(0, 1fr) 140px 18px; }
  #la-list-card .p-head, #la-list-card .cust-row { grid-template-columns: 60px minmax(0, 1fr) 140px 18px; }
  #lc-list-card .p-head, #lc-list-card .cust-row { grid-template-columns: minmax(0, 1fr) 140px 18px; }
  #la-list-card .p-head .c-h-acc { grid-column: auto; }
  .lc-head .c-col { display: none; }
  .lc-head .c-h-name { grid-column: auto; }
}
@container (min-width: 860px) {
  #bk-list-card .p-head, #bk-list-card .cust-row { grid-template-columns: var(--cols-w, 30px minmax(0, 1.4fr) 120px minmax(0, 1.2fr) 140px 18px); }
  #bk-list-card.no-acc .bk-acc { display: none !important; }
  #la-list-card .p-head, #la-list-card .cust-row { grid-template-columns: 60px minmax(0, 1.6fr) 140px 160px 18px; }
  #lc-list-card .p-head, #lc-list-card .cust-row { grid-template-columns: minmax(0, 1.4fr) 120px 130px 130px 150px 18px; }
  .lc-head .c-col { display: block; }
  .lc-head .c-h-name { grid-column: auto; }
  .ledger-list .c-col.r, .ledger-list .p-head .r { text-align: right; justify-content: flex-end; }
}
.ledger-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ls-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.ls-stat span { font-size: 13px; color: var(--ink-muted); }
.ls-stat strong { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.ledger-table th, .ledger-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ledger-table thead th { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.ledger-table tfoot th, .ledger-table tfoot td { border-bottom: 0; border-top: 1px solid var(--ink-muted); font-weight: 600; }
.ledger-table .r { text-align: right; white-space: nowrap; }
.ledger-table a { color: var(--ink); font-weight: 500; text-decoration: none; }
.ledger-table a:hover { color: var(--forest); text-decoration: underline; }
.ledger-table .be-note { color: var(--ink-muted); }
.ledger-table .tb-code { width: 72px; color: var(--ink-muted); }
.ledger-table .tb-empty { color: var(--ink-muted); text-align: center; padding: 24px 8px; }
.tb-ok { margin-left: 8px; }
.tb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.tb-date { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.tb-date input { width: auto; min-height: 40px; }
.tb-zero { margin: 0; font-size: 14px; }
.tb-panel { transition: opacity .2s ease; }
.tb-panel.is-stale { opacity: .55; }
.je-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.je-head, .je-line { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px 36px; gap: 8px; align-items: center; }
.je-head { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.je-head .r { text-align: right; }
.je-line select, .je-line .money-input { margin: 0; }
.je-line .money-input input { text-align: right; }
.je-del { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; background: none; color: var(--ink-muted); border-radius: 8px; cursor: pointer; }
.je-del:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.je-del svg { width: 18px; height: 18px; }
.je-del[hidden] { visibility: hidden; display: inline-grid; }
.je-totals { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: flex-end; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.je-totals strong { margin-left: 6px; color: var(--ink); font-weight: 600; }
.je-diff.is-ok { color: var(--forest); font-weight: 600; }
.je-diff.is-off { color: var(--danger); font-weight: 600; }
.je-help { margin-top: 12px; }
@media (max-width: 719px) {
  .je-head { display: none; }
  .je-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .je-line select { grid-column: 1 / -1; }
  .ledger-stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .ls-stat { padding: 10px 12px; }
  .ls-stat strong { font-size: 15px; }
}
.je-add svg, #je-add svg { width: 16px; height: 16px; }

/* Bottom bar: the gear is a button (it opens the settings sheet). */
.tabbar .tab-set { padding: 0; border: 0; background: none; font-family: inherit; cursor: pointer; }
.tabbar .tab-set[aria-expanded="true"] { color: var(--forest); }

/* ---------- Overviews (Sales, Books) ---------- */
.ov-new { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ov-make { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.ov-make:hover { border-color: color-mix(in srgb, var(--forest) 45%, var(--line)); background: color-mix(in srgb, var(--forest) 4%, var(--surface)); }
.ov-make:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.ov-make-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 9px; background: var(--forest); color: var(--on-forest); }
.ov-make-ic svg { width: 19px; height: 19px; }
.ov-make-ic svg .if { opacity: 0; }
.ov-make > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ov-make strong { font-weight: 600; font-size: 14px; }
.ov-make strong + span { font-size: 13px; color: var(--ink-muted); }
.ov-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ov-stat { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.ov-stat-label { font-size: 13px; color: var(--ink-muted); }
.ov-stat strong { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-stat-sub { font-size: 13px; color: var(--ink-muted); }
.ov-stat.is-late .ov-stat-sub { color: var(--danger); font-weight: 500; }
.ov-chart-panel { margin-bottom: 16px; }
.ov-chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 12px; }
.ov-chart-head h2 { margin: 0; }
.ov-chart-head .hint { margin: 0; }
.ov-links .set-row .item-icon svg { width: 20px; height: 20px; }
.ov-links { margin-bottom: 16px; }
@media (max-width: 899px) { .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 719px) {
  .ov-new { grid-template-columns: 1fr; gap: 8px; }
  .ov-make { padding: 12px 14px; }
  .ov-stats { gap: 8px; }
  .ov-stat { padding: 12px 14px; }
  .ov-stat strong { font-size: 18px; }
}

/* A bar chart: one series in the brand green, round 4px tops on the baseline, a 2px gap between
   bars, quiet gridlines with their amounts on the left; a tooltip on hover or focus. */
.bar-chart { position: relative; }
.bc-plot { position: relative; height: 220px; margin-left: 52px; margin-bottom: 24px; }
.bc-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.bc-grid.base { border-top-color: var(--line); }
.bc-grid span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bc-bars { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
.bc-col { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 100%; outline: none; cursor: default; }
.bc-bar { width: min(70%, 36px); border-radius: 4px 4px 0 0; background: var(--forest); transition: opacity .15s ease; }
.bc-bars:hover .bc-col:not(.on) .bc-bar { opacity: .55; }
.bc-col:focus-visible .bc-bar { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.bc-lab { position: absolute; top: calc(100% + 6px); font-size: 12px; color: var(--ink-muted); white-space: nowrap; }
.bc-col.on .bc-lab { color: var(--ink); font-weight: 600; }
.bc-tip { position: absolute; z-index: 2; transform: translateX(-50%); display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.bc-tip strong { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-chart.is-empty .bc-bars { opacity: .4; }
@media (max-width: 719px) {
  .bc-plot { height: 170px; margin-left: 44px; }
  .bc-lab { font-size: 11px; }
  .bc-bars .bc-col:nth-child(even) .bc-lab { visibility: hidden; }
}

/* Chart of accounts: what it is (and isn't). */
.coa-note { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--forest) 5%, var(--surface)); font-size: 14px; }
.coa-note svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--forest); }
.coa-note p { margin: 0; }
.coa-note p + p { margin-top: 6px; color: var(--ink-muted); }

/* Your account: help, theme and signing out (phones: the avatar opens this page). */
.ah-app { margin-top: 16px; }
.ah-app button.set-row { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ah-app .ah-theme { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.ah-app .ah-theme .cust-main { flex: 1 1 auto; }
.ah-app .ah-out strong { color: var(--danger); }
.ah-legal { margin: 20px 0 0; padding: 4px 64px 8px; font-size: 13px; color: var(--ink-muted); text-align: center; }
.ah-legal p { margin: 0; }
.ah-legal .ml-brand img { width: 20px; height: 20px; }
@media (min-width: 720px) { .ah-app { display: none; } }

/* Settings, Your account and overview rows open a page: they end in a › like every row you can open. */
.set-list a.set-row, .set-list button.set-row { position: relative; padding-right: 44px; }
.set-list a.set-row::after, .set-list button.set-row:not(.ah-out)::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  background-color: var(--ink-muted); opacity: .75;
  -webkit-mask: var(--chev-mask) center / 18px no-repeat; mask: var(--chev-mask) center / 18px no-repeat;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .2s ease, background-color .2s ease;
}
.set-list a.set-row:hover::after, .set-list button.set-row:hover::after { transform: translateX(3px); opacity: 1; background-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .set-list a.set-row::after, .set-list button.set-row::after { transition: none; } }

/* Phones: the settings sheet is headed by the business, like the Business settings page. */
.ss-head { display: flex; align-items: center; gap: 14px; margin: 2px 8px 12px; }
.ss-head .biz-tile { width: 56px; height: 56px; border-radius: 14px; font-size: 24px; flex: none; }
.ss-head .sheet-title { font-size: 19px; }
.ss-head .sheet-title { margin: 0; padding: 0; }
.ss-place { margin: 3px 0 0; font-size: 14px; color: var(--ink-muted); }
.ah-legal .ml-links a { display: inline-flex; align-items: center; min-height: 28px; }

/* Sign-in panel: things on their way say so. */
.auth-pitch .soon { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: var(--marigold); font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; vertical-align: 1px; }

/* Phones and narrow screens: keywords scrolling past above the sign-in card. Faded at both ends;
   still (wrapping) for people who'd rather less motion. */
.auth-marquee { display: block; margin: 18px 0 0; }
.mq-row { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.mq-track { display: flex; width: max-content; animation: mq-scroll 26s linear infinite; }
.mq-track span { display: inline-flex; align-items: center; gap: 12px; padding-right: 12px; font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.mq-track span::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--marigold); }
@keyframes mq-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .mq-row { -webkit-mask-image: none; mask-image: none; padding: 0 var(--space-4); }
  .mq-track { animation: none; width: auto; justify-content: center; }
  .mq-track span { font-size: 14px; }
  .mq-track span:nth-child(n+3) { display: none; }
  .mq-track span:nth-child(2)::after { display: none; }
}

/* A person's picture: round, filling its holder (the top-right button, Your account, Personal information). */
.avatar.has-photo, .pi-pic.has-photo, .pic-round.has-photo { background: var(--field); overflow: hidden; }
.avatar.has-photo img, .pi-pic img, .pic-round img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.pic-round { border-radius: 50%; overflow: hidden; }
.pi-photo { display: flex; align-items: center; gap: 16px; margin: 4px 0 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); transition: opacity .2s ease; }
.pi-photo.is-busy { opacity: .55; pointer-events: none; }
.pi-pic { display: grid; place-items: center; flex: none; width: 72px; height: 72px; border-radius: 50%; background: var(--forest); color: var(--on-forest); font-size: 28px; font-weight: 600; }
.pi-photo-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pi-photo-text .hint { margin: 0; }
.pi-photo-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pi-photo-act .btn { margin: 0; cursor: pointer; }
#pi-file:focus-visible + .btn, .pi-photo-act label:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* The keywords twice, on the sign-in side only (never the computer's green panel): one clear row just
   under the sign-in card (it follows the card as the steps change), and the same words big and very
   faint behind it, drifting both ways. */
.mq-rev .mq-track { animation-direction: reverse; }
@media all {
  .auth-main { position: relative; }
  .auth-main > .auth-view { order: 2; flex: 0 0 auto; position: relative; z-index: 1; }
  .auth-marquee { order: 3; margin: -28px 0 auto; padding-bottom: 32px; position: relative; z-index: 1; }
  .auth-main > .auth-foot { order: 4; }
  .auth-main > .auth-head, .auth-main > .auth-foot { position: relative; z-index: 1; }
  .auth-mq-bg { position: absolute; inset: 0; z-index: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 8px 0; overflow: hidden; pointer-events: none; }
  .auth-mq-bg .mq-track { animation-duration: 60s; }
  .auth-mq-bg .mq-track span { font-size: 46px; font-weight: 700; letter-spacing: -.015em; color: var(--mq-faint, rgba(27, 32, 30, .022)); gap: 22px; padding-right: 22px; }
  .auth-mq-bg .mq-track span::after { width: 10px; height: 10px; background: var(--mq-faint-dot, rgba(235, 169, 55, .09)); }
}
@media (prefers-reduced-motion: reduce) { .auth-mq-bg { display: none !important; } }

/* Computers: the card and its row of keywords sit together in the middle of the sign-in side. */
@media (min-width: 960px) {
  .auth-main > .auth-view { margin-top: auto; padding-bottom: 48px; }
  .auth-marquee { margin: -24px 0 auto; padding-bottom: 10vh; }
  .auth-marquee .mq-row { max-width: 640px; margin: 0 auto; }
  .auth-mq-bg .mq-track span { font-size: 64px; }
  /* A sign-in side without the keyword row (the staff portal's): the card alone in the middle. */
  .auth-main:not(:has(.auth-marquee)) > .auth-view { margin-bottom: auto; padding-bottom: 10vh; }
}

/* The background keywords stay in the background: barely there on light, barely lighter than the
   page on dark. */
:root { --mq-faint: rgba(27, 32, 30, .022); --mq-faint-dot: rgba(235, 169, 55, .09); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --mq-faint: rgba(255, 255, 255, .018); --mq-faint-dot: rgba(240, 181, 77, .07); } }
:root[data-theme="dark"] { --mq-faint: rgba(255, 255, 255, .018); --mq-faint-dot: rgba(240, 181, 77, .07); }

/* The overviews' placeholder: four figures and a chart of grey bars. */
.sk-ov { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sk-chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; margin-top: 12px; }
.sk-chart .sk { flex: 1; border-radius: 4px 4px 0 0; }
@media (max-width: 899px) { .sk-ov { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Phones: the gear spins as its sheet opens and back as it closes, like the + turning to ×. */
.tabbar .tab-set [data-gear] svg { transition: transform .4s cubic-bezier(.3, 1.3, .5, 1), color .2s ease; }
.tabbar .tab-set[aria-expanded="true"] [data-gear] svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .tabbar .tab-set [data-gear] svg { transition: none; } }

/* Depth: everything that floats over the page casts the same soft shadow, so it reads as in front.
   Sheets that rise from the bottom of a phone cast it upwards; full-screen panels need none. */
.menu, .view-menu, .pop-card, .tax-mk-pop, .fs-pop, .combo-menu, .bell-toast, .dialog, .nt-saved, .hb-label, .bc-tip, .side-tip, .ask-panel { box-shadow: var(--shadow-pop); }
@media (min-width: 720px) {
  .sidenav.peek { box-shadow: var(--shadow-pop); }
}
@media (max-width: 719px) {
  .create-sheet:not([hidden]), #account-menu:not([hidden]) { box-shadow: var(--shadow-sheet); }
  .bell-menu, .ask-panel { box-shadow: none; }
}

/* Business settings: Books shows only on phones (computers have it in the sidebar). */
@media (min-width: 720px) { .set-list > li.phone-only { display: none; } }

/* Phones, in Sales or Books: the switch above the page (outside the screen the router swaps), so it
   never reloads; it lines up with the page's edges, and the page under it starts a little higher. */
.section-switch[hidden] { display: none !important; }
@media (min-width: 720px) { .section-switch { display: none !important; } }
@media (max-width: 719px) {
  #app-layout > .section-switch { margin: 14px var(--space-3) 0; }
  body.has-section #app-layout > .main { padding-top: 16px; }
  .section-switch.ss-still .ss-ink { transition: none; }
}
.sv-sched { margin-top: 0; padding-top: 0; border-top: 0; gap: 8px 16px; }

/* A customer's statement: three figures, then dated rows with a running balance. */
.st-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.st-sum > div { background: var(--field); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.st-sum span { font-size: 13px; color: var(--ink-muted); }
.st-sum strong { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-sum .is-bad strong { color: var(--danger, #B42318); }
.st-list { list-style: none; margin: 0; padding: 0; }
.st-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 110px 130px 110px; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.st-head { border-top: 0; font-size: 12px; color: var(--ink-muted); font-weight: 500; padding-top: 0; }
.st-row .r, .st-ch, .st-pd, .st-bal { text-align: right; }
.st-date { color: var(--ink-muted); white-space: nowrap; }
.st-open .st-what { color: var(--ink-muted); }
.st-none .st-what { grid-column: 1 / -1; color: var(--ink-muted); }
.st-close { display: flex; justify-content: flex-end; gap: 24px; align-items: baseline; padding: 12px 0 0; border-top: 1px solid var(--line); }
.st-close strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.st-range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.st-range select, .st-range input { width: auto; min-width: 0; }
.st-range .btn { width: auto; margin: 0; gap: 6px; }
.st-range .btn svg { width: 16px; height: 16px; }
@media (max-width: 719px) {
  .st-sum { gap: 8px; }
  .st-sum > div { padding: 10px; }
  .st-sum strong { font-size: 15px; }
  .st-head { display: none; }
  .st-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .st-row .st-date { grid-column: 1; grid-row: 2; font-size: 13px; }
  .st-row .st-what { grid-column: 1; grid-row: 1; }
  .st-row .st-ch, .st-row .st-pd { grid-column: 2; grid-row: 1; }
  .st-row .st-ch:empty, .st-row .st-pd:empty { display: none; }
  .st-row .st-bal { grid-column: 2; grid-row: 2; font-size: 13px; color: var(--ink-muted); }
}

/* The customer portal */
.po-out { margin-left: auto; }
.po-sign h1 { font-size: 22px; margin: 0 0 8px; }
.po-sign #po-code { max-width: 200px; font-size: 22px; letter-spacing: 6px; font-variant-numeric: tabular-nums; }
.po-code-acts { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.po-docs { list-style: none; margin: 0; padding: 0; }
.po-docs > li { border-top: 1px solid var(--line); }
.po-docs > li:first-child { border-top: 0; }
.po-docs a.po-row { position: relative; padding-right: 40px !important; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 14px; align-items: baseline; padding: 12px 4px; color: var(--ink); text-decoration: none; }
.po-docs a.po-row:hover { background: var(--field); }
.po-row strong { font-weight: 500; }
.po-row .po-amt { font-variant-numeric: tabular-nums; text-align: right; }
.po-row .po-sub { grid-column: 1 / -1; font-size: 13px; color: var(--ink-muted); }
.po-row .po-log { grid-column: 1 / -1; font-size: 13px; color: var(--ink-muted); }
.po-pay { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; padding: 10px 4px; font-size: 14px; }
.po-pay .po-amt { font-variant-numeric: tabular-nums; }
@media (max-width: 719px) { .po-pay { grid-template-columns: minmax(0, 1fr) auto; } .po-pay .po-when { grid-column: 1 / -1; font-size: 13px; color: var(--ink-muted); } }
.pq-portal { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; padding: 14px 40px 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; position: relative; }
.pq-portal:hover { background: var(--field); }
.pq-portal > span { display: flex; flex-direction: column; gap: 2px; }
.pq-portal strong { font-weight: 500; }
.pq-portal span span { font-size: 13px; color: var(--ink-muted); }

/* Home, the dashboard: cards on a grid of 12 on computers (owner, Nov 21), each a quarter, a third,
   a half, two thirds, three quarters or the full width (--w in twelfths, set by home.js), flowing
   in order; the cards in a row share its height, and a list fills its card. Tablets: two across
   (up to a half: half; wider: full). Phones: one column, in the same order. */
.hm-board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.hm-board > .hm-card { margin: 0 !important; min-width: 0; }
.hm-board > .hm-block { display: flex; flex-direction: column; }
.hm-board > .hm-block > .list-card, .hm-board > .hm-block > .card { flex: 1 1 auto; }
@media (min-width: 720px) and (max-width: 1099px) {
  .hm-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-board > .hm-card { grid-column: span 2; }
  .hm-board > .hm-card[data-w="3"], .hm-board > .hm-card[data-w="4"], .hm-board > .hm-card[data-w="6"] { grid-column: span 1; }
}
@media (min-width: 1100px) {
  .hm-board { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: stretch; }
  .hm-board > .hm-card { grid-column: span var(--w, 12); }
}
/* Figures in half the width or less: two by two. */
.hm-board > .ov-stats[data-w="6"], .hm-board > .ov-stats[data-w="4"], .hm-board > .ov-stats[data-w="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hm-block { margin-bottom: 16px; }
.hm-activity .bell-tx strong { font-size: 14px; font-weight: 500; }
.hm-row .item-icon.is-late { background: var(--danger-soft); }
.hm-row .item-icon.is-late svg { color: var(--danger) !important; }
.hm-row .item-icon.is-warn { background: var(--marigold-soft); }
.hm-row .item-icon.is-warn svg { color: var(--marigold-ink) !important; }
.hm-row .cust-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-row .cust-main strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-row .cust-main > span { font-size: 13px; color: var(--ink-muted); }
.hm-amt { flex: none; font-weight: 500; font-variant-numeric: tabular-nums; }
.hm-date { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 38px; height: 40px; border: 1px solid var(--line); border-radius: 8px; line-height: 1.05; }
.hm-date b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hm-date span { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .03em; }
.hm-clear { display: flex; align-items: center; gap: 12px; padding: 16px; margin: 0; }
.hm-clear-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--forest-soft); color: var(--forest); }
.hm-clear-ic svg { width: 18px; height: 18px; }
.hm-clear > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.hm-clear strong { font-weight: 500; }
.hm-clear > span:last-child > span { font-size: 13px; color: var(--ink-muted); }
.card.hm-none { margin: 0; padding: 16px; font-size: 14px; color: var(--ink-muted); }
.hm-activity .bell-item:last-child { border-bottom: 0; }
.hm-tax h2 { margin-bottom: 10px; }
.hm-tax .chips { margin-bottom: 4px; }
.hm-tax-list { list-style: none; margin: 0; padding: 0; }
.hm-tax-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hm-tax-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hm-tax-name strong { font-weight: 500; }
.hm-tax-name span { font-size: 13px; color: var(--ink-muted); }
.hm-tax-list li.hm-tax-total { border-bottom: 0; }
.hm-tax-list li.hm-tax-total strong, .hm-tax-list li.hm-tax-total .hm-amt { font-weight: 600; }
.panel p.hm-tax-what { margin: 10px 0 0; }
.hm-tax-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.panel .hm-tax-foot .help-note { margin: 0 0 10px; font-size: 13px; color: var(--ink-muted); }
.hm-tax-foot .btn { width: auto; margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.hm-tax-foot .btn svg { width: 16px; height: 16px; flex: none; }

/* Phones and tablets: every box you type in is at least 16px. iPhones zoom the page in on any
   smaller text box when it's tapped (and stay zoomed); at 16px they don't, and pinch zoom still
   works. Computers keep 14px. */
@media (pointer: coarse) {
  input:not(.code):not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }
}

/* Home's cards, as Edit layout places them. */
.hm-board .hm-off { display: none !important; }
.card.hm-none, .card.hm-clear { max-width: none; }

/* Edit layout, on the page: a dashed frame and a bar on every card (handle, name, width ⅓ ⅔ Full,
   eye), a grip on each card's right edge to stretch it, the hidden cards in a tray, Cancel / Save
   layout in the save bar. While a card is carried, its place shows dashed green and a copy of it
   follows the pointer; the other cards slide aside. */
.hm-ctl { display: none; }
.hm-editing .hm-board .hm-card { position: relative; padding: 0 10px 10px; border-radius: var(--radius-lg); outline: 1.5px dashed var(--line-strong); outline-offset: 0; background-clip: padding-box; }
.hm-editing .hm-board .ov-stats.hm-card { padding-top: 0; }
.hm-editing .hm-board .panel.hm-card { padding: 0 16px 16px; }
/* The bar names the card, so its own heading steps aside while editing. */
.hm-editing .hm-board .hm-card > .section-title, .hm-editing .hm-board .ov-chart-head h2, .hm-editing .hm-board .hm-tax > h2,
.hm-ghost > .section-title, .hm-ghost .ov-chart-head h2, .hm-ghost.hm-tax > h2 { display: none; }
.hm-editing .hm-ctl, .hm-ghost > .hm-ctl { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; margin: 0 -10px 10px; padding: 6px 6px 6px 4px; border-bottom: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--field); font-size: 13px; }
.hm-editing .panel.hm-card .hm-ctl, .hm-ghost.panel > .hm-ctl { margin: 0 -16px 12px; }
.hm-editing .hm-card > :not(.hm-ctl):not(.hm-size) { pointer-events: none; user-select: none; }
.hm-ctl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.hm-grip, .hm-eye { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-muted); }
.hm-grip { cursor: grab; touch-action: none; }
/* The whole card is the handle while editing (the buttons on its bar aside). */
.hm-editing .hm-board > .hm-card { cursor: grab; -webkit-touch-callout: none; user-select: none; }
.hm-editing .hm-board > .hm-card:hover:not(.hm-source) { outline-color: var(--forest); }
.hm-editing .hm-board > .hm-card.is-held { outline: 2px solid var(--forest); transform: scale(.99); transition: transform .15s; }
.hm-grip:hover, .hm-eye:hover { background: var(--surface); color: var(--ink); }
.hm-grip svg { width: 18px; height: 18px; }
.hm-eye svg { width: 19px; height: 19px; }
/* The width: − ⅔ +, one size narrower or wider (¼ ⅓ ½ ⅔ ¾ Full). */
.hm-widths { flex: none; display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); cursor: default; }
.hm-wbtn { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; background: none; color: var(--ink-muted); cursor: pointer; }
.hm-wbtn svg { width: 15px; height: 15px; }
.hm-wbtn:hover:not(:disabled) { background: var(--field); color: var(--ink); }
.hm-wbtn:disabled { opacity: .3; cursor: not-allowed; }
.hm-wbtn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.hm-wlabel { min-width: 38px; padding: 0 4px; text-align: center; font-size: 13px; font-weight: 600; color: var(--forest); border-left: 1px solid var(--line); border-right: 1px solid var(--line); line-height: 30px; }
/* The grip on the right edge: pull it to stretch the card across. */
.hm-size { display: none; }
@media (min-width: 1100px) {
  .hm-editing .hm-board .hm-size { display: block; position: absolute; top: 50%; right: -7px; z-index: 2; width: 12px; height: 56px; margin-top: -28px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: ew-resize; touch-action: none; box-shadow: var(--shadow-pop); }
  .hm-editing .hm-board .hm-size::before { content: ""; position: absolute; inset: 14px 3px; border-left: 1.5px solid var(--line-strong); border-right: 1.5px solid var(--line-strong); }
  .hm-editing .hm-board .hm-size:hover, .hm-card.is-sizing .hm-size { border-color: var(--forest); background: var(--forest-soft); }
}
@media (max-width: 1099px) { .hm-widths { display: none; } }
.hm-editing .hm-board .hm-card.is-sizing { outline: 2px solid var(--forest); }
body.hm-sizing, body.hm-sizing * { cursor: ew-resize !important; user-select: none; }
/* Carrying a card: its place, and the copy that follows the pointer. */
.hm-editing .hm-board .hm-card.hm-source { outline: 2px dashed var(--forest); background: var(--forest-soft); }
.hm-board .hm-card.hm-source > * { visibility: hidden; }
.hm-ghost { position: fixed !important; z-index: 60; margin: 0 !important; padding: 0 10px 10px; border-radius: var(--radius-lg); outline: 2px solid var(--forest); max-height: 340px; overflow: hidden; background: var(--paper); box-shadow: var(--shadow-pop); pointer-events: none; transition: transform .16s cubic-bezier(.2, .8, .2, 1), box-shadow .16s; }
.hm-ghost.panel { padding: 0 16px 16px; }
.hm-ghost.is-up { transform: scale(1.02) rotate(.5deg); }
.hm-ghost.is-settling { transition: left .2s cubic-bezier(.2, .8, .2, 1), top .2s cubic-bezier(.2, .8, .2, 1), transform .2s; transform: none; }
.hm-ghost .hm-size { display: none !important; }
.hm-ghost .hm-grip { cursor: grabbing; }
body.hm-dragging, body.hm-dragging * { cursor: grabbing !important; user-select: none; }
.hm-editbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.hm-editbar-how { flex: 1 1 420px; margin: 0; font-size: 14px; color: var(--ink-muted); }
.hm-editbar-how strong { color: var(--ink); font-weight: 600; }
.hm-tray { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hm-tray-label { font-size: 13px; color: var(--ink-muted); }
.hm-tray-list { display: contents; }
.hm-tray-add { width: auto; margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.hm-tray-add svg { width: 15px; height: 15px; flex: none; }
.hm-editbar #hm-lay-error { flex-basis: 100%; margin: 0; }
.hm-editbar #hm-lay-reset { order: 2; }
.hm-savebar { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .hm-ghost, .hm-ghost.is-up { transform: none; transition: none; } }
/* Home's rows say a whole thing ("Record a payment or send a reminder"): they wrap rather than cut off. */
.hm-row .cust-main strong, .hm-row .cust-main > span { white-space: normal !important; overflow: visible; text-overflow: clip; }

/* Books › Tax owed (tax engine, step 6) */
.tr-tools { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 0 0 16px; }
.tr-tools .chips { margin: 0; }
.tr-dates { display: flex; gap: 12px; }
.tr-dates label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-muted); }
.tr-dates input { min-width: 150px; }
#tr-body { transition: opacity .15s; }
#tr-body.is-stale { opacity: .55; }
.tr-sum { margin-bottom: 16px; }
.tr-total { display: flex; flex-direction: column; gap: 2px; }
.tr-total span { font-size: 13px; color: var(--ink-muted); }
.tr-total strong { font-size: 28px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tr-total em { font-style: normal; font-size: 13px; color: var(--ink-muted); }
.tr-regs { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.tr-reg, .tr-untaxed, .tr-none { margin: 0; }
.tr-untaxed { margin-bottom: 16px; }
.tr-reg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.tr-reg-head h2 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.tr-num { font-size: 13px; color: var(--ink-muted); }
.tr-owed { text-align: right; display: flex; flex-direction: column; gap: 2px; flex: none; }
.tr-owed span { font-size: 13px; color: var(--ink-muted); }
.tr-owed strong { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tr-table, .tr-docs { width: 100%; }
.tr-table td.r, .tr-table th.r, .tr-docs td.r, .tr-docs th.r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-table tr.tr-less td { color: var(--ink-muted); }
.tr-table tfoot th, .tr-table tfoot td { font-weight: 600; }
.tr-check { margin: 0 0 24px; font-size: 13.5px; color: var(--forest); }
.tr-check::before { content: "✓ "; }
.tr-check:empty { display: none; }
.tr-check.is-off { color: var(--marigold-ink); }
.tr-check.is-off::before { content: "⚠ "; }
.tr-docs-wrap .tb-panel { margin-top: 0; }
.tr-foot { margin-top: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.tr-none p { margin: 0 0 10px; }
@media (max-width: 719px) {
  .tr-dates { width: 100%; }
  .tr-dates label { flex: 1; }
  .tr-dates input { min-width: 0; width: 100%; }
  .tr-docs .tr-cust { display: none; }
}
.hm-more { font-size: 14px; font-weight: 500; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }

/* Help and feedback on phones (owner, Nov 18): in the middle of the screen, over the dimmed page.
   Computers keep it dropping from the top bar. */
@media (max-width: 719px) {
  body.card-open .help-bubble { display: none !important; }   /* the card is in the middle; the picture waits */
  .pop-card, .pop-card.from-bubble { top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: calc(100vw - 32px); max-width: 420px; max-height: calc(100dvh - 48px); }
}

/* Ask us: a reply arrives while the chat is shut (owner, Nov 18: a number alone wasn't enough).
   The picture rings out twice, and beside it a card shows who wrote and the start of it, until it's
   opened or put away. The tab's title gets the count too. */
.hb-peek { position: fixed; z-index: 46; right: 100px; bottom: 24px; display: flex; align-items: flex-start; width: 320px; max-width: calc(100vw - 132px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop);
  animation: peek-in .32s cubic-bezier(.2, .8, .2, 1); }
.hb-peek[hidden] { display: none; }
.hb-peek::after { content: ""; position: absolute; right: -7px; bottom: 26px; width: 12px; height: 12px; background: var(--surface);
  border-right: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.hp-open { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: flex-start; padding: 12px 4px 12px 12px; border: 0; background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; border-radius: 14px 0 0 14px; }
.hp-face { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #1E5B4B center / cover no-repeat; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 15px; }
.hp-face.is-team { background: #1E5B4B url("/apple-touch-icon.png") center / 70% no-repeat; }
.hp-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hp-who { font-size: 13px; font-weight: 600; color: var(--ink); }
.hp-who small { font-weight: 500; color: var(--ink-muted); font-size: 12px; margin-left: 4px; }
.hp-text { font-size: 14px; line-height: 1.4; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hp-open:hover .hp-text { color: var(--forest); }
.hp-x { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin: 6px 6px 0 0; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-muted); cursor: pointer; }
.hp-x:hover { background: var(--field); color: var(--ink); }
.hp-x svg { width: 16px; height: 16px; }
@keyframes peek-in { from { opacity: 0; transform: translateX(12px) scale(.96); } to { opacity: 1; transform: none; } }
/* The picture rings out: two soft green rings and a small hop. */
.help-bubble.ping { animation: hb-hop .5s cubic-bezier(.2, .8, .2, 1) 2; }
.help-bubble.ping::before, .help-bubble.ping::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--forest);
  animation: hb-ring 1.2s ease-out 2; pointer-events: none; }
.help-bubble.ping::after { animation-delay: .3s; }
@keyframes hb-ring { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }
@keyframes hb-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-6px); } }
@media (max-width: 719px) {
  .hb-peek { right: 14px; left: 14px; width: auto; max-width: none; bottom: calc(150px + env(safe-area-inset-bottom)); }
  .hb-peek::after { right: 24px; bottom: -7px; transform: rotate(135deg); }
  body.has-savebar .hb-peek { bottom: calc(var(--savebar-h, 72px) + 86px + env(safe-area-inset-bottom)); }
  body.kb-open .hb-peek { display: none; }
}
body.fab-open .hb-peek, body.card-open .hb-peek { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hb-peek, .help-bubble.ping, .help-bubble.ping::before, .help-bubble.ping::after { animation: none !important; }
}
