/* MaaSa design system (agreed 1 Nov 2026): bright white page, bright teal accent, Inter 15px, light mode only.
   Values match the design system tokens exactly; change them there first, then here. */
/* Inter (SIL OFL 1.1) served from MaaSa's own files – nothing loaded from Google Fonts (CRM-B, 5 Nov 2026). Variable font: 400/500/600 from one file. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --page: #ffffff; --surface-tint: #f2fafa; --surface-muted: #f6f8fa; --line: #edf0f3; --line-control: #8593a0;
  --ink: #22313f; --ink-muted: #5b6875; --ink-faint: #6b7884;
  --teal: #0e8a8a; --teal-strong: #0b7c7c; --teal-hover: #096868; --teal-soft: #ddf3f2; --teal-ink: #0b6e6e; --on-teal: #ffffff;
  --paid: #23784a; --paid-soft: #e3f5ea; --due: #94620e; --due-soft: #fdf3df; --late: #b03a2e; --late-soft: #fce9e6;
  --neutral: #4a5763; --neutral-soft: #eef1f4;   /* rule 9: Draft / Under review / Cancelled / Off */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px;
  --radius-sm: 6px; --radius-md: 10px; --radius-pill: 999px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/22px var(--font-sans); font-variant-numeric: tabular-nums; }
h1 { margin: 0 0 var(--space-2); font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -0.01em; }
h2 { margin: 0 0 var(--space-3); font-size: 18px; line-height: 26px; font-weight: 600; }
h3 { margin: 0 0 var(--space-2); font-size: 16px; line-height: 24px; font-weight: 600; }
p { margin: 0 0 var(--space-3); }
a { color: var(--teal-strong); text-decoration: none; }
a:hover { color: var(--teal-hover); text-decoration: underline; }
.muted { color: var(--ink-muted); margin: 0; }
.muted.lead { margin-bottom: var(--space-4); }
.small { font-size: 13px; line-height: 18px; }
.caption { font-size: 12px; line-height: 16px; color: var(--ink-faint); }
[hidden] { display: none !important; }

/* ---------- top bar and layout ---------- */
.topbar { display: flex; align-items: center; gap: var(--space-4); height: 56px; padding: 0 var(--space-6); border-bottom: 1px solid var(--line); background: var(--page); }
.wordmark { color: var(--teal); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
.topbar .where { color: var(--ink-muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--ink-muted); font-size: 13px; text-align: right; white-space: nowrap; }
.topbar .menu-toggle { display: none; }
.shell { display: flex; min-height: calc(100vh - 56px); }
.side { width: 220px; flex: none; background: var(--surface-tint); border-right: 1px solid var(--line); padding: var(--space-4) var(--space-3); }
.side a { display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--ink); font-weight: 500; }
.side a:hover { background: var(--teal-soft); text-decoration: none; color: var(--teal-ink); }
.side a.on { background: var(--teal-soft); color: var(--teal-ink); }
.content { flex: 1; min-width: 0; padding: var(--space-6); max-width: 1180px; }
.page-head { display: flex; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 200px; }
.crumb { font-size: 13px; color: var(--ink-muted); margin-bottom: var(--space-1); }

/* ---------- cards ---------- */
.card { background: var(--page); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-6); margin-bottom: var(--space-4); }
.narrow { max-width: 440px; }
/* Stage 4 Part A (UI-75): the MaaSa assistant section keeps a gap from the apps list above it */
section[data-assistant] { margin-top: var(--space-4); }
.signin { max-width: 400px; margin: var(--space-8) auto; padding: 0 var(--space-4); }
.signin .card { padding: var(--space-8) var(--space-6); }
.facts { display: grid; grid-template-columns: 180px 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.facts dt { color: var(--ink-muted); }
.facts dd { margin: 0; }

/* ---------- forms ---------- */
.field { margin-bottom: var(--space-4); }
.field label { display: block; font-weight: 500; margin-bottom: var(--space-1); }
.field .hint { font-size: 13px; color: var(--ink-muted); margin-top: var(--space-1); }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=month], input[type=number], input[type=search], select {
  width: 100%; height: 40px; padding: 0 var(--space-3); font: inherit; color: var(--ink);
  border: 1px solid var(--line-control); border-radius: var(--radius-sm); background: var(--page);
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--teal-strong); outline-offset: 1px; }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw button { position: absolute; right: 4px; top: 4px; height: 32px; }
.code-input { text-transform: uppercase; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 var(--space-4); }
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-4);
  font: inherit; font-weight: 500; border-radius: var(--radius-sm); border: 1px solid var(--teal-strong);
  background: var(--teal-strong); color: var(--on-teal); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--teal-hover); border-color: var(--teal-hover); }
/* UI fix 1 (UI-26, Owner 09 Nov 2026): a teal button keeps white words when pointed at, pressed or in focus –
   a link styled as a button took the link's hover colour (teal on teal) and its words vanished */
a.btn, a.btn:visited, .btn:hover, .btn:active, .btn:focus, .btn:focus-visible, summary.btn { color: var(--on-teal); text-decoration: none; }
.btn:active { background: var(--teal-ink); border-color: var(--teal-ink); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.wide { width: 100%; }
.btn.secondary { background: var(--page); color: var(--teal-strong); border-color: var(--line-control); }
.btn.secondary:hover { background: var(--surface-tint); color: var(--teal-hover); }
a.btn.secondary, .btn.secondary:active, .btn.secondary:focus, .btn.secondary:focus-visible, summary.btn.secondary { color: var(--teal-strong); background: var(--page); }
.btn.secondary:active { background: var(--teal-soft); color: var(--teal-ink); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--teal-strong); padding: 0 var(--space-2); height: 32px; }
.btn.quiet:hover { background: var(--surface-tint); }
a.btn.quiet, .btn.quiet:active, .btn.quiet:focus { color: var(--teal-strong); background: transparent; }
.btn.quiet:active { background: var(--teal-soft); }
.btn.danger { background: var(--page); color: var(--late); border-color: var(--line-control); }
.btn.danger:hover { background: var(--late-soft); }
a.btn.danger, .btn.danger:active, .btn.danger:focus { color: var(--late); background: var(--page); }
.btn.small { height: 32px; font-size: 13px; padding: 0 var(--space-3); }

/* ---------- messages ---------- */
.note { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); margin-bottom: var(--space-4); }
.note.error { background: var(--late-soft); color: var(--late); }
.note.ok { background: var(--paid-soft); color: var(--paid); }
.note.info { background: var(--surface-tint); color: var(--ink); border: 1px solid var(--line); }
.note.due { background: var(--due-soft); color: var(--due); }
.note pre { white-space: pre-wrap; word-break: break-all; margin: var(--space-2) 0 0; }
/* Stage 3 core update: the checks of a proposal (To review) */
ul.checks { list-style: none; padding: 0; margin: 0; }
ul.checks li { padding: var(--space-1) 0; }
.toast { position: fixed; left: 50%; bottom: var(--space-6); transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); font-size: 14px; z-index: 10; max-width: 90vw; }

/* ---------- status words ---------- */
.pill { display: inline-block; padding: 1px 10px; border-radius: var(--radius-pill); font-size: 13px; line-height: 20px; font-weight: 500; white-space: nowrap; }
.pill.ok { background: var(--paid-soft); color: var(--paid); }
.pill.due { background: var(--due-soft); color: var(--due); }
.pill.bad { background: var(--late-soft); color: var(--late); }
.pill.plain, .pill.neutral { background: var(--neutral-soft); color: var(--neutral); }
.pill.teal { background: var(--teal-soft); color: var(--teal-ink); }

/* ---------- tables (stacked cards on phones) ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-md); overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { background: var(--surface-muted); color: var(--ink-muted); font-weight: 500; font-size: 13px; text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); }
table.list td { padding: var(--space-3); border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num, table.list th.num { text-align: right; }
table.list td .actions { justify-content: flex-end; flex-wrap: nowrap; }
table.list td.nowrap { white-space: nowrap; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--surface-tint); }
.empty { padding: var(--space-6); text-align: center; color: var(--ink-muted); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-3); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); align-items: end; margin-bottom: var(--space-4); }
.filters .field { margin: 0; }

@media (max-width: 760px) {
  .topbar { padding: 0 var(--space-4); }
  .topbar .menu-toggle:not([hidden]) { display: inline-flex; }
  .shell { display: block; }
  .side { display: none; width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side.open { display: block; }
  .content { padding: var(--space-4); }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: var(--space-3); }
  .table-wrap { border: 0; }
  table.list thead { display: none; }
  table.list tr { display: block; border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: var(--space-3); padding: var(--space-2) var(--space-3); }
  table.list td { display: flex; gap: var(--space-3); justify-content: space-between; border: 0; padding: var(--space-1) 0; text-align: right; }
  table.list td::before { content: attr(data-label); color: var(--ink-muted); font-size: 13px; text-align: left; }
  table.list td.num { text-align: right; }
  table.list td.phone-off { display: none; }   /* P&P Part E (choice 21): phone cards show 3 facts */
  table.list td .actions { justify-content: flex-end; flex-wrap: nowrap; }
  table.list td.card-title { font-weight: 600; justify-content: flex-start; text-align: left; }
  table.list td.card-title::before { content: none; }
  table.list tr.gstr1-detail { border: 0; padding: 0; margin-top: calc(-1 * var(--space-2)); }
  table.list tr.gstr1-detail > td { display: block; padding: 0; }
  table.list tr.gstr1-detail > td::before { content: none; }
table.list td.nowrap { white-space: nowrap; }
  .topbar .who .name, .topbar .where { display: none; }
  .topbar { gap: var(--space-2); }
}

/* ---------- Stage 1B-1: tabs, filter chips, background jobs and system checks ---------- */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--line); margin-bottom: var(--space-4); }
.tabs a { padding: var(--space-2) var(--space-4); color: var(--ink-muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--teal-ink); text-decoration: none; }
.tabs a.on { color: var(--teal-ink); border-bottom-color: var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.chip { display: inline-block; padding: 4px 12px; border: 1px solid var(--line-control); border-radius: var(--radius-pill); color: var(--ink); font-size: 13px; }
.chip:hover { text-decoration: none; background: var(--surface-tint); }
.chip.on { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-ink); }
.bad-text { color: var(--late); }
.card h3 { margin-top: var(--space-6); }
.card .table-wrap { margin-bottom: var(--space-2); }
.card .actions { margin-bottom: var(--space-4); }
.row-form { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(200px, 2fr) auto; gap: var(--space-3); align-items: end; }
.row-form .field { margin: 0; }
input[type=file] { font: inherit; font-size: 13px; padding: var(--space-2) 0; max-width: 100%; }
@media (max-width: 760px) { .row-form { grid-template-columns: 1fr; } }

/* ---------- Stage 1B-2: client tabs – company, GST registrations, numbering, month lock ---------- */
.tick { display: flex; gap: var(--space-2); align-items: flex-start; font-weight: 400; margin-bottom: var(--space-2); cursor: pointer; }
.tick input { margin-top: 3px; }
.ticks { margin: var(--space-2) 0 0 var(--space-6); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: .02em; }
.logo-box { min-height: 64px; display: flex; align-items: center; margin-bottom: var(--space-3); }
.logo-box img { max-height: 96px; max-width: 280px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2); background: #fff; }
textarea { font: inherit; width: 100%; padding: var(--space-2) var(--space-3); border: 1px solid var(--line-control); border-radius: var(--radius-md); resize: vertical; }
.card h2 + .form-row, form h2 { margin-top: var(--space-4); }
form h2:first-of-type { margin-top: 0; }
.tabs { overflow-x: auto; }
.tabs a { white-space: nowrap; }
details.card > summary { cursor: pointer; font-weight: 600; }
details.card[open] > summary { margin-bottom: var(--space-4); }
.tick.inline { display: inline-flex; margin-right: var(--space-4); }
input.next-year { width: 120px; flex: none; margin-left: var(--space-2); height: 32px; }
.chips input[type=month] { width: auto; height: 30px; font-size: 13px; border-radius: var(--radius-pill); }

/* ---------- Stage 1B-2 (PR #10): masters, import, export ---------- */
.tabs.sub { margin-top: calc(-1 * var(--space-2)); }
.tabs.sub a { padding: var(--space-1) var(--space-3); font-size: 14px; }
.rows { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.sub-row { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-3) 0; background: var(--surface-muted); }
.sub-row .field { margin-bottom: var(--space-3); }
.sub-row .row-end { display: flex; align-items: flex-end; justify-content: flex-end; padding-bottom: var(--space-3); }
.page-head h2 { margin: 0; }
.bank-actions { margin: var(--space-2) 0 0; gap: var(--space-2); }
.bank-actions select, .bank-actions input[type=text] { width: auto; min-width: 160px; height: 32px; font-size: 13px; }
.note .bank-actions { margin-bottom: 0; }
details.card table.list { font-size: 14px; }

/* Stage 2 CRM-A */
.crm-search { max-width: 320px; }
.pre { white-space: pre-wrap; }
.tabs a.later { color: var(--ink-faint); cursor: default; }
.tabs a.later:hover { color: var(--ink-faint); }

/* ---------- Fix update after Stage 1B (3 Nov 2026): screen rules 1–5 ---------- */
/* Side menu with group headings (rule 3) */
.side { display: flex; flex-direction: column; gap: 2px; }
.side-top { display: none; }
.side .back { font-weight: 500; color: var(--teal-strong); padding: var(--space-1) var(--space-3); }
.side-client { padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--line); margin-bottom: var(--space-2); }
.side-client-name { font-weight: 600; line-height: 20px; }
.side a.side-item, .side a.side-sub { display: flex; align-items: center; gap: var(--space-2); }
.side a.side-item > span:first-child, .side a.side-sub > span:first-child { flex: 1; }
.side a.side-sub { padding-left: 34px; font-weight: 400; }
.side-head { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-2) var(--space-3); border: 0; background: transparent;
  font: inherit; font-weight: 500; color: var(--ink); text-align: left; border-radius: var(--radius-sm); cursor: pointer; }
.side-head:hover { background: var(--teal-soft); color: var(--teal-ink); }
.side-head .chev { width: 14px; color: var(--ink-muted); font-size: 12px; }
.side-head .grow { flex: 1; }
.side-group-items { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--space-1); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--due-soft); color: var(--due); font-size: 12px; font-weight: 600; line-height: 20px; }
.count.big { min-width: 28px; height: 26px; font-size: 14px; }
.menu-toggle .count { margin-left: var(--space-1); }
.phone-only { display: none !important; }
.desk-only { display: flex; }
.scrim { display: none; }
.flash { animation: flash 1.6s ease-out 1; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--teal-soft); } 25% { box-shadow: 0 0 0 4px var(--teal-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Home – "Needs your action" (rule 5) */
.action-list, .due-list { display: flex; flex-direction: column; }
.action-line, .due-line { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.action-line:last-child, .due-line:last-child { border-bottom: 0; }
.action-line:hover, .due-line:hover { text-decoration: none; background: var(--surface-tint); }
.action-line .grow, .due-line .grow { flex: 1; min-width: 0; }
.action-label { display: block; font-weight: 600; }
.action-detail { display: block; font-size: 13px; color: var(--ink-muted); }
.action-line .chev { color: var(--ink-faint); font-size: 20px; }
.action-line.bad .count { background: var(--late-soft); color: var(--late); }
.action-line.due .count { background: var(--due-soft); color: var(--due); }
details.more > summary { cursor: pointer; color: var(--teal-strong); font-weight: 500; margin-bottom: var(--space-3); }
details.more .table-wrap { margin: var(--space-3) 0; }

/* Phones and small tablets (rule 4): the menu slides in from the left; lists are cards; Save stays at the bottom */
@media (max-width: 900px) {
  .topbar { padding: 0 var(--space-4); gap: var(--space-2); }
  .topbar .menu-toggle:not([hidden]) { display: inline-flex; border: 1px solid var(--line-control); height: 40px; padding: 0 var(--space-3); }
  .topbar .where, .topbar .who .name, .wide-only { display: none; }
  .shell { display: block; }
  .side { position: fixed; top: 0; left: 0; bottom: 0; width: 290px; max-width: 86vw; z-index: 30; overflow-y: auto; border-right: 1px solid var(--line);
    transform: translateX(-105%); transition: transform .2s ease; display: flex; padding-top: var(--space-3); }
  .side.open { transform: none; }
  .side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-3) var(--space-2); }
  .side-close { font-size: 26px; height: 44px; width: 44px; }
  .side a, .side-head { min-height: 44px; }
  .phone-only { display: flex !important; }
  .desk-only { display: none !important; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(34, 49, 63, .35); z-index: 20; }
  .content { padding: var(--space-4); }
  .btn { height: 44px; }
  .btn.small, .btn.quiet { height: 40px; }
  .page-head > .actions, .page-head > .btn { width: 100%; }
  form .form-actions { position: sticky; bottom: 0; z-index: 5; background: var(--page); border-top: 1px solid var(--line);
    margin: var(--space-3) calc(-1 * var(--space-4)) 0; padding: var(--space-3) var(--space-4); }
  form .form-actions .btn:not(.secondary) { flex: 1; }
  .bank-actions select, .bank-actions input[type=text], .bank-actions input[type=file] { width: 100%; }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) { .card { padding: var(--space-4); } }

/* ---------- CRM-B: Engagement add-ons, Setup checklist ---------- */
.addon-group { margin-bottom: var(--space-4); }
.addon-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); margin: var(--space-3) 0 var(--space-2); }
.tick.addon { padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); }
.tick.addon .grow { display: flex; flex-direction: column; gap: 2px; }
.progress { height: 8px; background: var(--surface-muted); border-radius: var(--radius-pill); overflow: hidden; margin: var(--space-2) 0 var(--space-4); }
.progress span { display: block; height: 100%; background: var(--teal); }
.check-list { display: flex; flex-direction: column; gap: var(--space-2); }
.check-line { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); }
.check-line.done { background: var(--surface-muted); }
.check-mark { width: 20px; text-align: center; color: var(--teal-ink); font-weight: 600; }
.inline-form { display: inline-flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.inline-form input { width: 140px; }
@media (max-width: 900px) { .check-line { flex-wrap: wrap; } .inline-form input { width: 100%; } }

/* ---------- Screen rule 6: motion (CRM-B, 4 Nov 2026) – short, no bounce, off with "reduce motion" ---------- */
.enter-up { animation: enter-up .28s cubic-bezier(.2, .7, .2, 1) both; }
.enter-side { animation: enter-side .22s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes enter-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes enter-side { from { opacity: 0; transform: translateX(var(--dx, 16px)); } to { opacity: 1; transform: none; } }
.shell { overflow-x: clip; }   /* a screen sliding in never makes the page scroll sideways */
.tabs.ink { position: relative; }
.tabs.ink a.on { border-bottom-color: transparent; }
.tab-ink { position: absolute; bottom: 0; height: 2px; background: var(--teal); pointer-events: none; }
.tab-ink.move { transition: left .22s cubic-bezier(.2, .7, .2, 1), width .22s cubic-bezier(.2, .7, .2, 1); }
@media (prefers-reduced-motion: reduce) {
  .enter-up, .enter-side, .flash { animation: none !important; }
  .tab-ink.move, .side { transition: none !important; }
  .flash { box-shadow: 0 0 0 3px var(--teal-soft); }
}

/* ---------- Screen rule 7: menu icons and markers (CRM-B, 4 Nov 2026) – Tabler outline icons, public/icons.js ---------- */
.side { --guide: #c9e6e4; }
.side a { position: relative; }
.side .ico { width: 18px; height: 18px; flex: none; color: var(--ink-muted); order: -1; }
.side a.on .ico, .side-head.open .ico:not(.chev) { color: var(--teal-strong); }
.side-head .chev { order: 9; width: 16px; height: 16px; color: var(--line-control); transition: transform .2s cubic-bezier(.2, .7, .2, 1); }
.side-head.open .chev { transform: rotate(90deg); }
.side a.side-item, .side-head { gap: 10px; }
.side a.side-item.on::before { content: ""; position: absolute; left: calc(-1 * var(--space-3)); top: 6px; bottom: 6px; width: 3px; background: var(--teal-strong); border-radius: 0 3px 3px 0; }
.side-group-items { margin-left: 20px; border-left: 1px solid var(--guide); padding-left: var(--space-1); }
.side a.side-sub { padding-left: var(--space-3); }
.side a.side-sub.on::before { content: ""; position: absolute; left: calc(-1 * var(--space-1) - 2px); top: 4px; bottom: 4px; width: 3px; background: var(--teal-strong); border-radius: 3px; }
.side-client { display: flex; align-items: center; gap: 10px; }
.side-client .grow { min-width: 0; }
.side-badge { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--teal-soft); color: var(--teal-ink); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.side-section { font-size: 12px; color: var(--ink-faint); padding: var(--space-3) var(--space-3) var(--space-1); }
@media (prefers-reduced-motion: reduce) { .side-head .chev { transition: none; } }

/* ---------- Screen rule 6 change (CRM-B, 5 Nov 2026): another menu item fades in; deeper / back slides ---------- */
.enter-fade { animation: enter-fade .15s ease-out both; }
@keyframes enter-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .enter-fade { animation: none !important; } }

/* ---------- Screen rule 8: loading, saving, empty, error ---------- */
.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; }
.skel { background: var(--surface-muted); border-radius: var(--radius-sm); }
.skel-title { height: 30px; width: 260px; max-width: 70%; margin-bottom: var(--space-2); }
.skel-line { height: 16px; width: 380px; max-width: 85%; margin-bottom: var(--space-6); }
.skel-card { height: 132px; border-radius: var(--radius-md); margin-bottom: var(--space-4); }
.skel-rows { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }
.skel-row { height: 20px; }
.skel-row:first-child { height: 14px; width: 60%; }
.saved { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--paid); font-weight: 500; font-size: 14px; }
.saved .ico { width: 18px; height: 18px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-8) var(--space-6); text-align: center; color: var(--ink-muted); }
.empty-ico { width: 48px; height: 48px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-ink); display: inline-flex; align-items: center; justify-content: center; }
.empty-ico .ico { width: 24px; height: 24px; }
.empty-text { margin: 0; color: var(--ink); font-weight: 500; }
.empty .muted.small { margin: 0; }
.empty-actions { justify-content: center; margin-top: var(--space-2); }
.state-error { display: flex; align-items: center; gap: var(--space-3); }
.state-error .ico { width: 20px; height: 20px; flex: none; }

/* ---------- Screen rule 10: idle warning, leave-without-saving dialog, delete question ---------- */
.idle-warn { position: fixed; left: 50%; bottom: var(--space-6); transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: var(--space-4);
  width: min(560px, calc(100vw - 32px)); padding: var(--space-3) var(--space-4); background: var(--page); border: 1px solid var(--due); border-left-width: 4px;
  border-radius: var(--radius-md); }
.idle-warn .grow { flex: 1; }
.dialog-scrim { position: fixed; inset: 0; z-index: 50; background: rgba(34, 49, 63, .35); display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.dialog { background: var(--page); border-radius: var(--radius-md); border: 1px solid var(--line); padding: var(--space-6); width: min(440px, 100%); }
.dialog .actions { justify-content: flex-end; margin-top: var(--space-4); }
.confirm-q { font-size: 13px; color: var(--late); font-weight: 500; }

/* ---------- Screen rule 11: tables and keyboard ---------- */
:focus-visible { outline: 2px solid var(--teal-strong); outline-offset: 2px; }
.side a:focus-visible, .side-head:focus-visible, .tabs a:focus-visible { outline-offset: -2px; }
table.list tbody tr:hover td { background: #fafcfc; }
table.list tr.click:hover td { background: var(--surface-tint); }
table.list tr.total td { font-weight: 600; border-top: 1px solid var(--line-control); background: var(--surface-muted); }
@media (min-width: 761px) {
  .table-wrap.tall { max-height: calc(100vh - 200px); overflow: auto; }
  .table-wrap.tall table.list thead th { position: sticky; top: 0; z-index: 1; }
  .table-wrap.report table.list th:first-child, .table-wrap.report table.list td:first-child { position: sticky; left: 0; background: var(--page); z-index: 1; }
  .table-wrap.report table.list thead th:first-child { background: var(--surface-muted); z-index: 2; }
}

/* ---------- Smaller items (CRM-B, 5 Nov 2026) ---------- */
/* Sign-in: a light-teal panel with the wordmark beside the form on wide screens; no tagline */
.signin.split .signin-panel { display: none; }
@media (min-width: 901px) {
  .signin.split { max-width: 860px; display: grid; grid-template-columns: 1fr 400px; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; padding: 0; margin-top: 10vh; }
  .signin.split .signin-panel { display: flex; align-items: flex-end; padding: var(--space-8); background: var(--surface-tint); border-right: 1px solid var(--line);
    background-image: radial-gradient(circle at 88% 18%, var(--teal-soft) 0 90px, transparent 91px), radial-gradient(circle at 70% 40%, var(--teal-soft) 0 26px, transparent 27px); }
  .signin.split .card { border: 0; border-radius: 0; margin: 0; }
}
.wordmark.big { font-size: 34px; }
/* Headline amounts on Home cards: exact figure; on phones the short form with the exact one underneath */
.home-amt { display: inline-flex; flex-direction: column; color: var(--teal); font-size: 22px; font-weight: 600; line-height: 30px; }
.home-amt.neg { color: var(--late); }
.home-amt .amt-short { display: none; }
@media (max-width: 760px) {
  .home-amt .amt-short { display: block; order: -1; }
  .home-amt .amt-full { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--ink-faint); }
}
/* Phones: the fixed Save bar clears the iPhone home indicator */
@media (max-width: 900px) {
  form .form-actions { padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); }
  .idle-warn { flex-direction: column; align-items: stretch; bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); }
}
/* Print: reports and registers without the menu and buttons; header row on every page */
@media print {
  .topbar, .side, .scrim, .menu-toggle, .btn, .actions, .filters, .pager, .chips, .idle-warn, .toast, .dialog-scrim, .crumb a { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; }
  body { font-size: 11pt; line-height: 1.35; }
  .card { border: 0; padding: 0; break-inside: avoid; }
  .table-wrap, .table-wrap.tall { border: 0; max-height: none; overflow: visible; }
  table.list thead { display: table-header-group; }
  table.list tr { break-inside: avoid; }
  table.list th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-break { break-before: page; }
  .enter-up, .enter-side, .enter-fade { animation: none !important; }
}

/* Console 2-step (6 Nov 2026): QR code, set-up key and backup codes */
.signin .qr { display: block; margin: var(--space-4) auto; width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--line, #e2e8f0); border-radius: 8px; background: #fff; }
.signin code.secret { display: block; text-align: center; font-size: 15px; letter-spacing: .08em; word-break: break-all; padding: var(--space-2); background: var(--surface-2, #f6f8fa); border-radius: 6px; }
.signin ol.backup-codes { columns: 2; font-family: ui-monospace, monospace; font-size: 15px; letter-spacing: .06em; margin: var(--space-4) 0; }
.signin ol.backup-codes li { padding: 2px 0; }
@media print { .signin ol.backup-codes { columns: 1; } }

/* CRM-C: Letters box, Custom points tab, Settings › Engagement letter */
.inline-actions { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.card.inset { margin: 12px 0 0; background: var(--teal-soft); border-color: transparent; }
.sub-row.point { display: flex; gap: 12px; align-items: flex-start; }
.sub-row.point .grow { flex: 1; min-width: 0; }
.sub-row.point.excluded { border-style: dashed; opacity: .8; }
.sub-row.point[draggable="true"] .drag { cursor: grab; color: var(--muted, #6b7280); }
.sub-row.point.dragging { opacity: .45; }
@media (max-width: 640px) { .sub-row.point { flex-direction: column; } }

/* ---------- Stage 3 P&P Part A: Purchases & Payments ---------- */
/* the summary figures at the top of the bills list (Round 1 point 14): each one applies its filter */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.figure { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--ink); background: var(--page); min-height: 44px; }
.figure:hover { text-decoration: none; background: var(--surface-tint); border-color: var(--teal-soft); color: var(--ink); }
.figure-label { font-size: 13px; color: var(--ink-muted); font-weight: 500; }
.figure-value { font-size: 18px; line-height: 26px; font-weight: 600; }
.figure.warn .figure-value { color: var(--late); }
/* the bill / note form beside its live working-out */
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: var(--space-4); align-items: start; }
.split .grow { min-width: 0; }
.preview { position: sticky; top: var(--space-4); background: var(--surface-tint); }
.preview .facts { margin-top: var(--space-3); }
.note.warn { background: var(--due-soft); color: var(--due); }
.new-menu { position: relative; display: inline-block; }
.new-menu > summary { list-style: none; cursor: pointer; }
.new-menu > summary::-webkit-details-marker { display: none; }
.new-menu .menu-list { position: absolute; right: 0; z-index: 5; min-width: 180px; margin-top: var(--space-1); padding: var(--space-1); background: var(--page); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 6px 18px rgba(34, 49, 63, 0.10); }
.new-menu .menu-list a { display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--ink); }
.new-menu .menu-list a:hover { background: var(--teal-soft); text-decoration: none; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .preview { position: static; } }
/* the vendor dropdown with its search box (fix 7 Nov 2026) */
.picker-search { margin-bottom: var(--space-2); }

/* Stage 3 P&P Part B: amount boxes inside list tables (Pay vendor, refunds, set-off) */
table.list input.amount-in { min-width: 8.5em; }

/* Stage 3 tax area (public/tax.js) */
.export-inline { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.actions.tight { gap: var(--space-1); flex-wrap: wrap; justify-content: flex-start; }
.form-row.filters { align-items: flex-end; margin-bottom: var(--space-3); }
.month-lines .month-line { display: flex; gap: var(--space-2); align-items: flex-end; margin-bottom: var(--space-2); }
.nowrap { white-space: nowrap; }

/* Stage 3 P&P Part D – the review screen (Round 4 point 11): each field green (read and checked) / amber (check) / red
   (failed), the scan beside the form, the GST-rate rows as a small table */
.field.f-ok input, .field.f-ok select { border-left: 4px solid var(--paid); }
.field.f-check input, .field.f-check select { border-left: 4px solid var(--due); background: var(--due-soft); }
.field.f-bad input, .field.f-bad select { border-left: 4px solid var(--late); background: var(--late-soft); }
.field.f-check .hint, .field.f-check small { color: var(--due); }
.field.f-bad .hint, .field.f-bad small { color: var(--late); }
.field.wide { grid-column: 1 / -1; }
.rows-editor { overflow-x: auto; }
.rows-editor table { width: max-content; min-width: 100%; }
/* full amounts must show (₹12,34,567.00) – fix 3, 8 Nov 2026: the boxes were too narrow on the review screen */
.rows-editor input { width: 100%; min-width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.rows-editor td:nth-child(2) input { min-width: 64px; }
.review-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.scan-view { position: sticky; top: var(--space-4); }
/* Sales Part E (S-16 A): a sales proposal – the "From the app" card beside the form, narrower than a scan */
.review-split.app-split { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
.from-app .facts { margin: 0; grid-template-columns: 1fr; gap: 0; }
.from-app .facts dt { color: var(--ink-muted); font-size: 13px; }
.from-app .facts dd { margin: 0 0 var(--space-3); overflow-wrap: anywhere; }
/* Sales Part E: GSTR-1 data – a table's rows open under it; zero tables faded */
.gstr1-table tr.zero td { color: var(--ink-faint); }
.gstr1-table tr.gstr1-detail > td { padding: 0; border-top: 0; }
.gstr1-rows { padding: var(--space-2) 0 var(--space-3); }
.gstr1-checks { margin: 0; }
.scan-frame { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
@media (max-width: 900px) { .review-split, .review-split.app-split { grid-template-columns: 1fr; } .scan-view { position: static; } .scan-frame { height: 60vh; } }

/* P&P Part E – My expenses (phone first): the position card and one card per claim */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.my-position { margin: var(--space-4) 0; }
.figure-value.big { font-size: 26px; line-height: 34px; }
a.card.my-claim { display: block; color: var(--ink); text-decoration: none; margin-bottom: var(--space-3); padding: var(--space-3) var(--space-4); min-height: 44px; }
a.card.my-claim:hover, a.card.my-claim:focus-visible { border-color: var(--teal); }
a.card.my-claim .caption { margin-top: var(--space-1); }
.bad-text { color: var(--late); }

/* ---------- UI fix build 1 (UI pass 09 Nov 2026, claude/UI_PASS_REVIEW.md) ---------- */
/* UI-14: summary figures as small chips on one line – each still a filter; a figure at zero faded (hidden on phones) */
.chips.figs { margin-bottom: var(--space-3); }
.chip.fig { display: inline-flex; gap: 6px; align-items: baseline; }
.chip.fig strong { font-weight: 600; }
.chip.fig.warn strong { color: var(--late); }
.chip.fig.zero { opacity: .5; }
/* UI-10: summary lines that say what will be saved and open on tap */
details.sline { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: var(--space-2) 0; background: var(--page); }
details.sline > summary { list-style: none; cursor: pointer; display: flex; gap: var(--space-3); justify-content: space-between; align-items: center; padding: var(--space-2) var(--space-3); min-height: 44px; }
details.sline > summary::-webkit-details-marker { display: none; }
details.sline > summary .sl-title { font-weight: 600; color: var(--ink); }
details.sline > summary .sl-sum { color: var(--teal-strong); font-size: 14px; text-align: right; }
details.sline > summary .sl-sum::after { content: ' ›'; }
details.sline[open] > summary .sl-sum::after { content: ' ⌄'; }
details.sline > .sl-body { padding: 0 var(--space-3) var(--space-3); }
details.sline.has-error { border-color: var(--late); }
/* "More ▾" menus hold buttons as well as links */
.new-menu .menu-list button { display: block; width: 100%; text-align: left; padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-sm); background: none; font: inherit; color: var(--ink); cursor: pointer; }
.new-menu .menu-list button:hover, .new-menu .menu-list button:focus-visible { background: var(--teal-soft); }
.new-menu .menu-list button.danger-text { color: var(--late); }
/* UI-12 / UI-13: evidence kept in view while scrolling (desktop) */
.stick { position: sticky; top: var(--space-4); align-self: flex-start; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding: var(--space-3) 0; border-top: 1px solid var(--line); font-size: 16px; }
.total-line strong { font-size: 18px; }
.vline { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: var(--space-2) 0; }
.vline > summary { list-style: none; display: flex; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-3); cursor: pointer; min-height: 44px; }
.vline > summary::-webkit-details-marker { display: none; }
.vline > summary .grow { flex: 1; }
.vline > .sl-body { padding: 0 var(--space-3) var(--space-3); }
.dropzone { border: 2px dashed var(--teal-soft); border-radius: var(--radius-md); padding: var(--space-6) var(--space-4); text-align: center; background: var(--surface-tint); }
.dropzone.over { border-color: var(--teal); }
.file-list { margin: var(--space-2) 0; }
.file-list .file-row { display: flex; justify-content: space-between; align-items: center; padding: var(--space-2) 0; border-top: 1px solid var(--line); }
.decide { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); background: var(--page); }
@media (max-width: 720px) {
  .chip.fig.zero { display: none; }
  .stick { position: static; }
  .fixbar { position: sticky; bottom: 0; z-index: 4; background: var(--page); border-top: 1px solid var(--line); padding: var(--space-2) 0; display: flex; gap: var(--space-2); align-items: center; justify-content: space-between; }
  .phone-hide { display: none !important; }
}
@media (min-width: 721px) { .desk-hide { display: none !important; } }

/* UI fix 1 (UI-10): a rate row's Cess and "Tax on the bill, if different" show while the GST & dates line is open */
.rows .row-extra { display: none; }
.row-extra-on .rows .row-extra { display: block; }
.form-actions .bar-total { font-size: 16px; white-space: nowrap; }
/* UI fix 1 (UI-11): Pay now fits at 1280 px; the advance and total lines */
.pay-table .amount-in, .adv-line .amount-in { width: 9.5rem; max-width: 100%; text-align: right; }
.pay-table td.pay-now { width: 10rem; }
.adv-line label { font-weight: 500; }
.warn-text { color: var(--due); font-weight: 500; }
/* UI fix 1 (UI-18): a two-way switch with counts (Under review · Done) – the open one clearly marked */
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 2px; margin: var(--space-2) 0 var(--space-4); }
.switch .switch-opt { padding: var(--space-1) var(--space-4); border-radius: var(--radius-pill); color: var(--ink-muted); font-weight: 500; min-height: 36px; display: inline-flex; align-items: center; }
.switch .switch-opt:hover { text-decoration: none; color: var(--teal-ink); }
.switch .switch-opt.active { background: var(--teal); color: var(--on-teal); }
.dropzone .actions { justify-content: center; }
/* UI fix 1 (UI-12): To review – the decision under the form; phones switch between the scan and the details and keep the
   actions in a bar fixed at the bottom */
.review-side .decide { margin-top: var(--space-3); }
@media (max-width: 900px) {
  #review-body.view-details .scan-view { display: none; }
  #review-body.view-scan .review-side > .card, #review-body.view-scan .review-side > #review-status { display: none; }
}
@media (max-width: 720px) {
  .fixbar-phone { position: sticky; bottom: 0; z-index: 4; background: var(--page); border-top: 1px solid var(--line); padding: var(--space-2) 0; margin: 0; }
}
/* UI fix 1 (UI-13): the decision box stays in view beside the evidence */
.decide-split { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.decide-col .decide-card { position: sticky; top: var(--space-4); }
@media (max-width: 900px) { .decide-split { grid-template-columns: 1fr; } .decide-col .decide-card { position: static; } }
/* UI fix 1 (UI-19): bank sheet – one line per vendor; payees and total in a bar fixed at the bottom */
.vendor-line > summary .vl-head { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.vendor-line > summary .vl-head input[type=checkbox] { width: 20px; height: 20px; }
.sheet-bar { position: sticky; bottom: 0; z-index: 4; background: var(--page); border-top: 1px solid var(--line); padding: var(--space-2) 0; display: flex; gap: var(--space-2); align-items: center; justify-content: space-between; }
.sheet-bar p { margin: 0; font-weight: 600; }
/* UI fix 1 (UI-12): the review form's GST-rate rows fit the column – the Rate box fits, the row scrolls when it must */
.rows-editor { overflow-x: auto; }
.rows-editor table { width: 100%; }
.rows-editor td input { width: 100%; min-width: 5.5rem; }
.rows-editor td:nth-child(2) input { min-width: 3.5rem; }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }
/* UI fix 1 – Gate 2 (360 px): a summary line's words go under its title on phones instead of squeezing beside it */
@media (max-width: 720px) {
  details.sline > summary { flex-wrap: wrap; row-gap: 2px; }
  details.sline > summary .sl-sum { flex-basis: 100%; text-align: left; }
  .vendor-line > summary .vl-head { flex-basis: 100%; }
}
/* Sales Part B (S-5): the cancel box's checks – ✓ green, ✗ red, each with a word (rule 9 – never colour alone); notes Activity */
.check-list.cancel-checks, ul.check-list { list-style: none; padding: 0; margin: var(--space-2) 0; }
ul.check-list > li { display: grid; grid-template-columns: 22px 1fr; gap: 2px var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); }
ul.check-list > li > .mark { font-weight: 700; text-align: center; }
ul.check-list > li.ok > .mark { color: var(--paid); }
ul.check-list > li.bad > .mark { color: var(--late); }
ul.check-list > li > .small { grid-column: 2; }
ul.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.tick-table td:first-child input[type=checkbox] { width: 20px; height: 20px; }
.tick-table td input[type=text] { width: 8rem; text-align: right; }
@media (max-width: 720px) { .tick-table td input[type=text] { width: 100%; } }

/* Bank & Cash Part A: the pop-up forms (Transfer, Update balance, Drawing power, Loans) and the OD / CC used bar */
.dialog.form-dialog { width: min(560px, 100%); max-height: calc(100vh - 2 * var(--space-4)); overflow-y: auto; }
.dialog.form-dialog .form-actions { justify-content: flex-start; }
.progress.small-bar { height: 6px; margin: var(--space-1) 0 0 auto; width: 120px; max-width: 100%; }
.progress span.due { background: var(--due); }
.progress span.bad { background: var(--late); }
.bank-list .phone-only { display: none; }
.bank-alerts .pill { white-space: normal; text-align: left; }
@media (max-width: 760px) {
  .bank-list .phone-only { display: block; }
  .bank-list table.list td:empty { display: none; }   /* a card shows only the facts it has (In or Out, Alerts when any) */
  /* the card's title: the first fact shown (the account; the ledger's entry – its date column is desktop only) */
  .bank-list table.list td:first-child:not(.phone-off), .bank-list table.list td.phone-off:first-child + td { justify-content: flex-start; text-align: left; font-weight: 600; }
  .bank-list table.list td:first-child:not(.phone-off)::before, .bank-list table.list td.phone-off:first-child + td::before { content: none; }
  .bank-list table.list td .caption { font-weight: 400; }
  .dialog-scrim:has(.form-dialog) { align-items: flex-end; padding: 0; }
  .dialog.form-dialog { width: 100%; border-radius: var(--radius-md) var(--radius-md) 0 0; padding: var(--space-4); }
  .progress.small-bar { margin-left: 0; }
}

/* Bank & Cash Part B: Match columns, the Bank lines Showing line, the ticks of Find entries (44 px to tap) */
.match-cols td select { min-width: 13rem; }
.match-cols td.caption { word-break: break-word; max-width: 14rem; }
.row-form.showing { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; margin-bottom: var(--space-3); }
.bank-totals { margin: 0; }
.tick-hit { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -12px; cursor: pointer; }
.tick-hit input[type=checkbox] { width: 20px; height: 20px; }
@media (max-width: 760px) {
  .row-form.showing { grid-template-columns: 1fr 1fr; }
  .row-form.showing .actions { grid-column: 1 / -1; }
  .match-cols td select { min-width: 0; width: 100%; }
}

/* Bank & Cash Part C: "What is this line?" kind chips (buttons, 44 px to tap on phones), Save as a rule, the links line,
   the rule bar, fields fixed from a bank line */
.kind-chips button.chip { background: var(--page); cursor: pointer; font: inherit; font-size: 13px; min-height: 32px; }
.kind-chips button.chip.on { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-ink); }
.what-line .rule-box { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-3) 0; }
.what-line .rule-box input[type=text] { width: auto; min-width: 12rem; flex: 1 1 12rem; }
.line-links { margin: var(--space-3) 0 0; }
.rule-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: var(--space-3); }
input.from-line, select.from-line { background: var(--surface-tint); }
.from-line-note { margin-bottom: var(--space-3); }
@media (max-width: 760px) {
  .kind-chips button.chip { min-height: 44px; padding: 8px 14px; }
  .what-line .rule-box input[type=text] { min-width: 0; width: 100%; }
}

/* Bank & Cash Part D – the Reconciliation tab (S-15) and the month lock warning box (S-16) */
.lock-bar.phone-only[hidden] { display: none !important; }   /* the phone's Lock bar hidden while the warning box is open */
.recon-head { display: flex; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-3); }
.recon-head .field { margin: 0; min-width: 200px; }
.recon-pill { padding-bottom: 6px; }
.card.recon { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.recon-row, .recon-part > summary { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); padding: 10px 0; border-bottom: 1px solid #EDF0F3; }
.recon-row.total { font-weight: 600; }
.recon-part > summary { cursor: pointer; list-style: none; min-height: 44px; box-sizing: border-box; align-items: center; }
.recon-part > summary::-webkit-details-marker { display: none; }
.recon-part > summary .recon-label::before { content: '›'; display: inline-block; width: 1em; color: #5B6875; transition: transform .15s; }
.recon-part[open] > summary .recon-label::before { transform: rotate(90deg); }
.recon-part > .bank-list, .recon-part > p { padding: var(--space-2) 0 var(--space-3) 1em; }
.recon-amt { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.recon-label { min-width: 0; }
.lock-warn-month h3 { margin: var(--space-3) 0 var(--space-2); }
.lock-warn-acc { margin: 0 0 var(--space-2); }
.lock-warn-acc ul { margin: 4px 0 0; padding-left: 1.2em; list-style: none; }
.lock-warn-acc li { padding: 4px 0; }
.lock-warn-acc li a { display: inline-block; min-height: 24px; }
@media (max-width: 760px) {
  .recon-head .field { min-width: 0; width: 100%; }
  .recon-part > .bank-list, .recon-part > p { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .recon-part > summary .recon-label::before { transition: none; } }

/* Stock Part A: the Opening stock grid – the item picker wide enough to read, the figures right-aligned (rule 11);
   the statement's group heading and subtotal rows */
.opening-grid td:first-child select { min-width: 16rem; }
.opening-grid input.num-in { text-align: right; }
.stock-list tr.group-head td { background: var(--surface-tint); }
.stock-list tr.subtotal td { font-weight: 500; color: var(--ink-muted); }
@media (max-width: 900px) { .opening-grid td:first-child select { min-width: 0; } }

/* Stock Part B (S-5, S-6): "Enter by GST rates / by items" as one segmented choice (44 px taps); the bill's lines and the
   receipt grid – pickers wide enough to read, figures right-aligned (rule 11); the table scrolls inside its box on a
   narrow form and stacks as cards on a phone */
.seg { display: inline-flex; border: 1px solid var(--line-control); border-radius: var(--radius-sm); overflow: hidden; margin: var(--space-2) 0 var(--space-3); }
.seg-btn { min-height: 44px; padding: 0 var(--space-4); border: 0; background: var(--page); color: var(--ink); font: inherit; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-control); }
.seg-btn.on { background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; }
.seg-btn:disabled { color: var(--ink-faint); cursor: not-allowed; }
.seg-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.lines-grid table { min-width: 700px; }
.lines-grid th, .lines-grid td { padding-left: 6px; padding-right: 6px; }
.lines-grid td select[aria-label="Item"] { min-width: 11rem; max-width: 15rem; }
.lines-grid td select[aria-label="Godown"] { min-width: 6.5rem; max-width: 9rem; }
.lines-grid td select[aria-label="GST %"] { min-width: 4.5rem; }
.lines-grid td select[aria-label="Charge"] { min-width: 11rem; }
.lines-grid input.num-in { width: 5.5rem; text-align: right; }
.receipt-grid input.num-in { width: 7rem; text-align: right; }
.lines-grid .num-out { display: inline-block; min-width: 5rem; text-align: right; }
.receipt-grid td select { min-width: 9rem; }
.bill-lines .actions .tick { margin-left: var(--space-2); }
@media (max-width: 760px) {
  .lines-grid table { min-width: 0; }
  .lines-grid td select, .lines-grid input.num-in, .receipt-grid input.num-in, .receipt-grid td select { min-width: 0; width: 100%; }
  .seg { display: flex; } .seg-btn { flex: 1; }
}
/* Stock Part C – a scanned line not matched to an item yet (amber, rule 9) */
.bill-lines tr.line-unmatched td { background: var(--due-soft); }
.bill-lines tr.line-unmatched td:first-child { border-left: 4px solid var(--due); }
.bill-lines tr.line-unmatched .caption { color: var(--due); }
.review-lines .lines-count { font-weight: 500; }
.review-lines .rows-worked { margin-top: 6px; }
/* Stock Part C (Gate 2): beside the scan the review column is narrow – each line is a small card (Item and Godown on the
   first row, the figures under them), so every column shows without sideways scrolling */
@media (min-width: 761px) {
  .review-lines .lines-grid { overflow-x: visible; }
  .review-lines .lines-grid table { min-width: 0; }
  .review-lines table.list thead { display: none; }
  .review-lines table.list tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-1) var(--space-2); align-items: end;
    border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: var(--space-2); padding: var(--space-2) var(--space-3); }
  .review-lines table.list td { display: flex; flex-direction: column; gap: 2px; border: 0; padding: 0; text-align: left; }
  .review-lines table.list td::before { content: attr(data-label); color: var(--ink-muted); font-size: 12px; }
  .review-lines table.list td[data-label="Item"], .review-lines table.list td[data-label="Godown"] { grid-column: span 2; }
  .review-lines table.list td[data-label="Charge"] { grid-column: span 3; }
  .review-lines table.list td[data-label=""] { align-items: flex-end; }
  .review-lines table.list td[data-label=""]::before { content: none; }
  .review-lines .lines-grid td select, .review-lines .lines-grid input.num-in { min-width: 0; max-width: none; width: 100%; }
  .review-lines .lines-grid .num-out { min-width: 0; text-align: left; padding: 6px 0; }
  .review-lines table.list td[hidden] { display: none; }
  .review-lines table.list tr.line-unmatched { background: var(--due-soft); border-left: 4px solid var(--due); }
  .review-lines table.list tr.line-unmatched td, .review-lines table.list tr.line-unmatched td:first-child { background: none; border-left: 0; }
}

/* Stock Part D – the stock entry chooser, the invoice line's "In stock …" line, Lines to map */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card.choice { display: block; text-decoration: none; color: inherit; min-height: 44px; }
.card.choice:hover, .card.choice:focus-visible { border-color: var(--teal-strong); }
.card.choice strong { display: block; color: var(--teal-strong); margin-bottom: 4px; }
.stock-line { grid-column: 1 / -1; margin-top: -4px; }
.lines-to-map select { min-width: 220px; max-width: 100%; }
@media (max-width: 600px) { .lines-to-map select { min-width: 0; width: 100%; } }
.opening-form .row-form { align-items: flex-start; }

/* Stock Part E: the count grid (rows with a difference marked), the amber "beyond stock" figure, the printed count sheet */
.due-text { color: var(--due); }
.count-grid tr.diff td { background: var(--due-soft); }
@media print {
  body.print-count .book-qty, body.print-count .no-print, body.print-count .note, body.print-count .caption { display: none !important; }
  body.print-count .count-grid input { border: 0; border-bottom: 1px solid #000; color: transparent; background: none; }
  body.print-count .count-grid tr.diff td { background: none; }
}
.opening-form [role=radiogroup] .chip { min-height: 44px; }
.stock-list tr[hidden], .count-grid tr[hidden] { display: none !important; }

/* Salary Part B – the Pay salary box: held / not payable people greyed (with the reason beside them) */
tr.muted-row td { color: var(--ink-faint); }
tr.muted-row td strong { font-weight: 500; }

/* Salary Part C – the challan PDF attached in the Record challan box */
.ok-text { color: var(--paid); }

/* Stage 4 Part C – Books › Books feed (S-B2, S-B3, Show password – UI-74, UI-76) */
fieldset.field { border: 0; padding: 0; margin: 0 0 var(--space-3); min-width: 0; }
fieldset.field > legend { font-weight: 500; margin-bottom: var(--space-2); padding: 0; }
.books-search { display: flex; gap: var(--space-2); max-width: 420px; margin-bottom: var(--space-3); }
.books-search input[type=search] { flex: 1; min-width: 0; }
.books-last { margin: 0 0 var(--space-1); }
.more-details { margin-top: var(--space-1); }
.more-details > summary { cursor: pointer; font-size: 13px; color: var(--teal-strong); min-height: 24px; }
.more-details code { word-break: break-all; }
.password-line { margin: var(--space-3) 0 var(--space-2); }
.password-box { display: inline-block; font-size: 18px; letter-spacing: .04em; padding: var(--space-2) var(--space-3); background: var(--surface-tint); border: 1px solid var(--line); border-radius: var(--radius-md); user-select: all; word-break: break-all; }
@media (max-width: 900px) {
  #books-files .btn, #books-files summary.btn { min-height: 44px; }   /* rule 4: taps at least 44 px on phones (Gate 2 screen review) */
  .more-details > summary { min-height: 44px; display: flex; align-items: center; }
}

/* Stage 5 Part A (UI-78 S-P1 A): the public privacy notice – summary first, each section closed until opened */
.privacy-page { max-width: 720px; margin: var(--space-6) auto; padding: 0 var(--space-4); }
.privacy-page .card { padding: var(--space-6); }
.privacy-page h1 { font-size: 22px; margin: var(--space-2) 0 var(--space-1); }
.privacy-page .summary { margin: var(--space-4) 0; }
.privacy-page .summary .lead { margin: 0 0 var(--space-2); }
.privacy-section { border-top: 1px solid var(--line, #e2e8f0); padding: var(--space-3) 0; }
.privacy-section > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: var(--space-2); list-style: none; }
.privacy-section > summary::-webkit-details-marker { display: none; }
.privacy-section > summary::before { content: '›'; color: var(--teal); font-size: 20px; line-height: 1; width: 12px; transition: transform .15s; }
.privacy-section[open] > summary::before { transform: rotate(90deg); }
.privacy-section .facts + p { margin-top: var(--space-3); }
.privacy-section > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.privacy-section h3 { font-size: 15px; margin: var(--space-3) 0 var(--space-1); }
.privacy-section ul { padding-left: 1.2em; margin: var(--space-1) 0; }
.privacy-section li { margin: 4px 0; }
.privacy-line { margin-top: var(--space-2); }
.privacy-line a { white-space: nowrap; }
/* Stage 5 Part A (Gate 2): the add-on cell on a phone card – the words left-aligned under the add-on's name */
@media (max-width: 760px) { table.list td .addon-cell { text-align: left; flex: 1; min-width: 0; } }
.ai-consent { margin-top: var(--space-1); }

/* Stage 5 Part C – the watched demo login (S-D1 to S-D4) */
.demo-band { margin: 0 0 12px; }
.demo-section h2 { margin-top: 0; }
.card.verdict { border-left: 4px solid var(--neutral); }
.card.verdict.ok { border-left-color: var(--paid); }
.card.verdict.bad { border-left-color: var(--late); }
.card.verdict.due { border-left-color: var(--due); }
.card.verdict h2 { margin: 0 0 4px; font-size: 18px; }
.demo-section .actions { margin-top: 16px; }
