/* Finoice web app — shared design tokens and components (preview).
   Same world as the homepage and the iOS app: cream paper, periwinkle and gold silk,
   navy actions, Manrope. One file for every page, so a change here changes them all. */

:root {
  --white: #ffffff;
  --cream: #fcf6f0;
  --paper: #fffaf5;
  --peach-1: #f8ece2;
  --silk-blue: #7d9dd6;
  --silk-blue-deep: #3a5a99;
  --silk-blue-soft: #dbe5f6;
  --gold: #f1bf72;
  --gold-soft: #f8e2bf;
  --ink: #14161c;
  --ink-2: #3a3d46;
  --muted: #66625b;
  --line: #ece6de;
  --line-2: #e0d8cd;
  --navy: #1e2a4a;
  --navy-hover: #131c35;
  --emerald: #1f7a57;  --emerald-bg: #e3f2ea;
  --ochre: #a04a0c;    --ochre-bg: #fbeadb;
  --plum: #6b4380;     --plum-bg: #f1e8f5;
  --red: #b3261e;      --red-bg: #fbe6e4;
  --focus: #3b6aa5;

  --sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display: 30px; --fs-title: 20px; --fs-body: 15px; --fs-small: 13px; --fs-label: 12px; --fs-figure: 28px;
  --fw-title: 500; --fw-strong: 600; --fw-display: 400;
  --r-xs: 8px; --r-s: 12px; --r-m: 18px; --r-l: 24px;
  --e1: 0 1px 2px rgba(20, 22, 28, .05), 0 6px 18px rgba(20, 22, 28, .05);
  --e2: 0 1px 2px rgba(20, 22, 28, .06), 0 18px 44px rgba(20, 22, 28, .1);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: var(--cream); color: var(--ink); font: var(--fs-body)/1.55 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Silk behind frosted paper — the same backdrop as the homepage, still (no drifting inside the app) */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop i { position: absolute; left: -20vw; width: 140vw; height: 46vh; border-radius: 50%; filter: blur(60px); }
.backdrop i:nth-child(1) { top: -12vh; background: linear-gradient(100deg, rgba(241, 191, 114, 0), rgba(241, 191, 114, .7) 55%, rgba(241, 191, 114, 0)); transform: rotate(-6deg); }
.backdrop i:nth-child(2) { top: 18vh; background: linear-gradient(100deg, rgba(125, 157, 214, 0), rgba(125, 157, 214, .55) 60%, rgba(125, 157, 214, 0)); transform: rotate(-4deg); }
.backdrop::after { content: ""; position: absolute; inset: 0; background: rgba(252, 246, 240, .3); }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 999px; font: inherit; font-size: var(--fs-small); font-weight: var(--fw-strong); cursor: pointer; transition: background .2s, border-color .2s, transform .2s var(--ease); white-space: nowrap; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-hover); }
.btn-ghost { background: var(--white); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-block { width: 100%; min-height: 46px; font-size: var(--fs-body); }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-small); font-weight: var(--fw-strong); color: var(--ink-2); }
.input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--white); color: var(--ink); font: inherit; transition: border-color .2s, box-shadow .2s; }
.input::placeholder { color: #746e66; }
.input:focus { outline: none; border-color: var(--silk-blue-deep); box-shadow: 0 0 0 3px var(--silk-blue-soft); }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-label); font-weight: var(--fw-strong); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-paid { background: var(--emerald-bg); color: var(--emerald); }
.p-overdue { background: var(--red-bg); color: var(--red); }
.p-sent { background: var(--silk-blue-soft); color: var(--silk-blue-deep); }
.p-draft { background: var(--line); color: var(--muted); }
.p-bas { background: var(--plum-bg); color: var(--plum); }
.p-due { background: var(--ochre-bg); color: var(--ochre); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.lang { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--white); font-size: var(--fs-label); font-weight: var(--fw-strong); }
.lang button, .lang span { padding: 3px 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.lang .on, .lang button[aria-pressed="true"] { background: var(--navy); color: var(--white); }

/* ===== Login ===== */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-story { position: relative; display: flex; flex-direction: column; padding: 40px 56px; overflow: hidden; }
.login-story .brand { align-self: flex-start; }
.login-pitch { margin: auto 0; padding: 40px 0; }
.login-story h1 { max-width: 13em; margin: 0; font-size: clamp(34px, 3.6vw, 52px); font-weight: var(--fw-display); line-height: 1.06; letter-spacing: -.04em; }
.login-story p { max-width: 30em; margin: 18px 0 0; color: var(--ink-2); font-size: 17px; }
.login-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.login-facts li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-strong); }
.login-facts svg.i { width: 16px; height: 16px; color: var(--silk-blue-deep); }
.login-pane { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: min(420px, 100%); padding: 36px 32px 28px; border: 1px solid var(--line); border-radius: var(--r-l); background: rgba(255, 255, 255, .86); box-shadow: var(--e2); }
.login-card .top { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.login-card h2 { margin: 0; font-size: 26px; font-weight: var(--fw-title); letter-spacing: -.03em; }
.login-card .sub { margin: 6px 0 24px; color: var(--muted); }
.login-form { display: grid; gap: 16px; }
.pw { position: relative; }
.pw .input { padding-right: 44px; }
.pw button { position: absolute; right: 6px; top: 6px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.pw button:hover { background: var(--cream); color: var(--ink); }
.pw .eye-off, .pw button[aria-pressed="true"] .eye { display: none; }
.pw button[aria-pressed="true"] .eye-off { display: block; }
.input[aria-invalid="true"] { border-color: var(--red); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--red-bg); }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-s); background: var(--red-bg); color: var(--red); font-size: var(--fs-small); line-height: 1.45; }
.alert[hidden] { display: none; }
.alert svg.i { margin-top: 1px; }
.alert .link { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.btn:disabled { cursor: progress; opacity: .85; }
.btn .spin { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: var(--white); border-radius: 50%; animation: spin .8s linear infinite; }
.btn.is-loading .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn .spin { animation-duration: 2.4s; } }
.row-between { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-small); }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--navy); }
.link { color: var(--silk-blue-deep); font-weight: var(--fw-strong); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.login-foot { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); text-align: center; }
.login-legal { margin: 12px 0 0; color: var(--muted); font-size: var(--fs-label); text-align: center; }
.login-legal a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ===== App shell ===== */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px; border-right: 1px solid var(--line); background: rgba(255, 250, 245, .72); }
.side .brand { padding: 2px 10px 8px; }
.company { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--white); cursor: pointer; }
.company b { display: block; font-size: var(--fs-small); font-weight: var(--fw-strong); }
.company small { color: var(--muted); font-size: var(--fs-label); }
.company .av { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--navy); color: var(--white); font-size: var(--fs-small); font-weight: 700; }
.company svg.i { margin-left: auto; color: var(--muted); }
.nav-group { display: grid; gap: 2px; }
.nav-group > small { padding: 0 10px 6px; color: var(--muted); font-size: var(--fs-label); font-weight: var(--fw-strong); }
.nav-group a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-title); }
.nav-group a:hover { background: rgba(30, 42, 74, .05); color: var(--ink); }
.nav-group a.on { background: var(--white); color: var(--ink); box-shadow: var(--e1); font-weight: var(--fw-strong); }
.nav-group a .n { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--red-bg); color: var(--red); font-size: 11px; font-weight: 700; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.side-foot a { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-small); }

.main { min-width: 0; padding: 26px 36px 56px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.search { position: relative; flex: 1; max-width: 420px; }
.search .input { height: 40px; padding-left: 40px; border-radius: 999px; background: rgba(255, 255, 255, .8); }
.search svg.i { position: absolute; left: 14px; top: 11px; color: var(--muted); }
.search kbd { position: absolute; right: 12px; top: 10px; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--muted); font: 11px var(--sans); }
.topbar .spacer { flex: 1; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--white); color: var(--ink-2); cursor: pointer; }

.greet { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; }
.greet h1 { margin: 0; font-size: var(--fs-display); font-weight: var(--fw-display); letter-spacing: -.035em; line-height: 1.15; }
.greet p { margin: 6px 0 0; color: var(--muted); }
.greet .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel { border: 1px solid var(--line); border-radius: var(--r-m); background: rgba(255, 255, 255, .88); box-shadow: var(--e1); }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px 0; }
.panel-h h2 { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-title); letter-spacing: -.02em; }
.panel-h .link { font-size: var(--fs-small); }

/* Money summary: one panel, hairline-divided figures (not separate cards) */
.money { display: grid; grid-template-columns: repeat(4, 1fr); }
.money > div { padding: 20px 22px; border-left: 1px solid var(--line); }
.money > div:first-child { border-left: 0; }
.money small { display: block; color: var(--muted); font-size: var(--fs-small); }
.money b { display: block; margin: 6px 0 8px; font-size: var(--fs-figure); font-weight: var(--fw-strong); letter-spacing: -.03em; }
.money .meta { font-size: var(--fs-label); color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; margin-top: 20px; }
.grid-2 > * { min-width: 0; }

.todo { margin: 0; padding: 8px 10px 12px; list-style: none; }
.todo li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-s); }
.todo li:hover { background: var(--paper); }
.todo .ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; }
.todo .ic.red { background: var(--red-bg); color: var(--red); }
.todo .ic.ochre { background: var(--ochre-bg); color: var(--ochre); }
.todo .ic.plum { background: var(--plum-bg); color: var(--plum); }
.todo b { display: block; font-size: var(--fs-body); font-weight: var(--fw-strong); }
.todo span { color: var(--muted); font-size: var(--fs-small); }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); margin-bottom: 8px; }
.table th { padding: 14px 22px 10px; color: var(--muted); font-size: var(--fs-label); font-weight: var(--fw-strong); text-align: left; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 22px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--paper); }
.table .num { text-align: right; font-weight: var(--fw-strong); }
.table td b { font-weight: var(--fw-strong); }
.table td small { display: block; color: var(--muted); }

.bas-mini { padding: 6px 22px 20px; }
.bas-mini .r { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-small); }
.bas-mini .code { display: grid; place-items: center; height: 22px; border-radius: 6px; background: var(--silk-blue-soft); color: var(--silk-blue-deep); font-size: 11px; font-weight: 700; }
.bas-mini .tot { display: flex; justify-content: space-between; padding-top: 12px; font-weight: var(--fw-strong); }
.bas-mini .tot b { color: var(--red); }
.bas-mini .due { margin-top: 14px; padding: 10px 12px; border-radius: var(--r-s); background: var(--plum-bg); color: var(--plum); font-size: var(--fs-small); font-weight: var(--fw-strong); }

.chart { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 14px; height: 150px; padding: 18px 22px 6px; }
.chart div { display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; height: 100%; }
.chart i { display: block; border-radius: 6px 6px 3px 3px; }
.chart .paid { background: var(--silk-blue); }
.chart .owed { background: var(--gold); }
.chart-x { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; padding: 0 22px 18px; color: var(--muted); font-size: var(--fs-label); text-align: center; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: var(--fs-label); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--silk-blue); }
.legend span.owed::before { background: var(--gold); }

@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .money { grid-template-columns: repeat(2, 1fr); }
  .money > div:nth-child(3) { border-left: 0; }
  .money > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* The app pages are for computers and tablets. Phones use the iOS app, so there is no phone layout for them. */
.shell { min-width: 0; }
/* The login page still works on a phone, for someone who taps "Log in" on the homepage. */
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-story { padding: 28px 24px 8px; gap: 28px; }
  .login-card { padding: 28px 20px 22px; }
}

/* ===== Interaction layer (preview) ===== */

/* Odometer figures: each digit rolls to its value on a column of 0-9 */
.odo { display: inline-flex; align-items: baseline; }
.odo-d { display: inline-block; height: 1.15em; overflow: hidden; vertical-align: bottom; }
.odo-col { display: block; transition: transform .9s cubic-bezier(.22, 1, .36, 1); }
.odo-col span { display: block; height: 1.15em; line-height: 1.15em; text-align: center; }

/* Skeleton while data loads, replacing a "Loading data..." line */
.is-loading [data-skel] { position: relative; color: transparent !important; border-color: transparent !important; background: linear-gradient(90deg, #efe8df 25%, #f8f3ed 50%, #efe8df 75%) 0 0 / 200% 100% !important; border-radius: 8px; animation: shimmer 1.3s linear infinite; }
.is-loading [data-skel] * { visibility: hidden; }
.is-loading [data-skel]::before { display: none; }
@keyframes shimmer { to { background-position: -200% 0; } }
.chart i { transition: height .7s cubic-bezier(.22, 1, .36, 1); }
.is-loading .chart i { height: 4% !important; background: #ece5dc; }

/* Chart hover: one tooltip per month */
.chart div { position: relative; cursor: default; border-radius: 6px; }
.chart div:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.chart div:hover i, .chart div:focus-visible i { filter: brightness(.94); }
.tip { position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 2; min-width: 132px; padding: 8px 10px; border-radius: 10px; background: var(--navy); color: var(--white); font-size: var(--fs-label); line-height: 1.5; white-space: nowrap; opacity: 0; transform: translate(-50%, 4px); transition: opacity .15s, transform .15s; pointer-events: none; }
.tip b { display: block; margin-bottom: 2px; font-size: var(--fs-small); }
.tip span { display: flex; justify-content: space-between; gap: 14px; }
.tip::after { content: ""; position: absolute; left: 50%; top: 100%; border: 6px solid transparent; border-top-color: var(--navy); transform: translateX(-50%); }
.chart div:hover .tip, .chart div:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }

/* Status change: the pill eases to its new colour, a small PAID stamp lands */
.pill { transition: background-color .45s, color .45s; }
.row-act { opacity: 0; transition: opacity .15s; }
tr:hover .row-act, tr:focus-within .row-act { opacity: 1; }
.btn-xs { min-height: 28px; padding: 0 10px; font-size: var(--fs-label); }
.stamp-mini { display: inline-block; margin-left: 8px; padding: 1px 6px; border: 2px double #c0352b; border-radius: 5px; color: #c0352b; font-size: 10px; font-weight: 800; letter-spacing: .12em; transform: rotate(-10deg) scale(1.8); opacity: 0; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1), opacity .2s; }
.stamp-mini.on { transform: rotate(-10deg) scale(1); opacity: 1; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: var(--navy); color: var(--white); font-size: var(--fs-small); box-shadow: var(--e2); transform: translate(-50%, 16px); opacity: 0; transition: transform .3s cubic-bezier(.22, 1, .36, 1), opacity .3s; pointer-events: none; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }

/* Command palette (Cmd/Ctrl + K) */
.cmdk { position: fixed; inset: 0; z-index: 70; display: grid; justify-items: center; align-items: start; padding-top: 14vh; background: rgba(30, 42, 74, .18); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cmdk[hidden] { display: none; }
.cmdk-box { width: min(620px, calc(100vw - 32px)); overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--paper); box-shadow: 0 30px 80px rgba(20, 22, 28, .22); animation: pop .22s cubic-bezier(.22, 1, .36, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmdk-in svg.i { color: var(--muted); }
.cmdk-in input { flex: 1; border: 0; background: none; color: var(--ink); font: inherit; font-size: 17px; outline: none; }
.cmdk-in kbd, .cmdk-foot kbd { padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--white); color: var(--muted); font: 11px var(--sans); }
.cmdk-list { max-height: 360px; margin: 0; padding: 8px; overflow: auto; list-style: none; }
.cmdk-list .g { padding: 10px 10px 4px; color: var(--muted); font-size: var(--fs-label); font-weight: var(--fw-strong); }
.cmdk-list .it { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-s); color: var(--ink-2); cursor: pointer; }
.cmdk-list .it small { margin-left: auto; color: var(--muted); }
.cmdk-list .it[aria-selected="true"] { background: var(--white); color: var(--ink); box-shadow: var(--e1); }
.cmdk-empty { padding: 28px; color: var(--muted); text-align: center; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-label); }

/* Preview-only helper */
.demo { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; gap: 8px; padding: 8px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .9); box-shadow: var(--e2); }

@media (prefers-reduced-motion: reduce) {
  .odo-col, .chart i, .stamp-mini, .toast { transition: none; }
  .cmdk-box { animation: none; }
  .is-loading [data-skel] { animation-duration: 4s; }
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tip em { font-style: normal; font-weight: 700; }
.is-loading tr[data-skel] { background: none !important; animation: none; }
.is-loading tr[data-skel] td { position: relative; color: transparent; }
.is-loading tr[data-skel] td::after { content: ""; position: absolute; left: 22px; right: 22px; top: 12px; bottom: 12px; border-radius: 6px; background: linear-gradient(90deg, #efe8df 25%, #f8f3ed 50%, #efe8df 75%) 0 0 / 200% 100%; animation: shimmer 1.3s linear infinite; }
.is-loading tr[data-skel] td * { visibility: hidden; }
.is-loading .todo li[data-skel] { margin: 6px 0; }
.table th, .table td { padding-left: 16px; padding-right: 16px; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.grid-2.wide { grid-template-columns: 2fr 1fr; }

/* ===== v2: components chosen from the reference search ===== */

/* Buttons: layered navy primary, lifted white secondary, press and click ripple */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary { background: linear-gradient(180deg, #2b3b66 0%, var(--navy) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(20, 22, 28, .2), 0 6px 16px rgba(30, 42, 74, .22); }
.btn-primary:hover { background: linear-gradient(180deg, #32447a 0%, #1b2644 100%); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 2px 4px rgba(20, 22, 28, .2), 0 10px 22px rgba(30, 42, 74, .28); }
.btn-ghost { box-shadow: 0 1px 2px rgba(20, 22, 28, .06); }
.btn-ghost:hover { transform: translateY(-1px); border-color: var(--line-2); box-shadow: 0 2px 4px rgba(20, 22, 28, .06), 0 8px 18px rgba(20, 22, 28, .08); }
.btn:active { transform: translateY(0) scale(.985); }
.ripple { position: absolute; z-index: -1; border-radius: 50%; background: rgba(255, 255, 255, .35); transform: scale(0); animation: ripple .6s ease-out forwards; pointer-events: none; }
.btn-ghost .ripple { background: rgba(30, 42, 74, .12); }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* Login: full-screen drifting silk with one frosted-glass card */
.backdrop.live i { animation: silk-a 38s ease-in-out infinite alternate; }
.backdrop.live i:nth-child(2) { animation: silk-b 46s ease-in-out infinite alternate; }
.backdrop.live i:nth-child(3) { top: 52vh; background: linear-gradient(100deg, rgba(125, 157, 214, 0), rgba(125, 157, 214, .4) 45%, rgba(241, 191, 114, .35) 75%, rgba(241, 191, 114, 0)); animation: silk-a 52s ease-in-out infinite alternate-reverse; }
.backdrop.live::after { background: rgba(252, 246, 240, .12); }
@keyframes silk-a { from { transform: translate(-5vw, -2vh) rotate(-7deg); } to { transform: translate(6vw, 5vh) rotate(-2deg); } }
@keyframes silk-b { from { transform: translate(6vw, 3vh) rotate(-2deg) scaleY(1.1); } to { transform: translate(-6vw, -4vh) rotate(-8deg) scaleY(.9); } }
.auth { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; }
.auth-top { display: flex; justify-content: space-between; align-items: center; padding: 26px 32px; }
.auth-mid { display: grid; place-items: center; padding: 12px 20px 28px; }
.glass { width: min(440px, 100%); padding: 38px 36px 28px; border: 1px solid rgba(255, 255, 255, .75); border-radius: 30px; background: linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .42)); -webkit-backdrop-filter: blur(26px) saturate(1.35); backdrop-filter: blur(26px) saturate(1.35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(20, 22, 28, .05), 0 30px 70px rgba(58, 90, 153, .18); }
.glass .mark-lg { display: block; width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 14px; box-shadow: 0 8px 20px rgba(30, 42, 74, .22); }
.glass h1 { margin: 0; font-size: 28px; font-weight: var(--fw-title); letter-spacing: -.03em; text-align: center; }
.glass .sub { margin: 6px 0 26px; color: var(--ink-2); text-align: center; }
.auth-foot { padding: 0 20px 26px; color: var(--ink-2); font-size: var(--fs-label); text-align: center; }
.auth-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Floating-label fields */
.ff { position: relative; }
.ff .input { height: 54px; padding: 20px 14px 4px; border-color: rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .72); box-shadow: inset 0 0 0 1px var(--line-2); }
.ff .input::placeholder { color: transparent; }
.ff label { position: absolute; left: 15px; top: 17px; color: var(--muted); font-size: var(--fs-body); pointer-events: none; transform-origin: 0 0; transition: transform .2s var(--ease), color .2s; }
.ff .input:focus + label, .ff .input:not(:placeholder-shown) + label { transform: translateY(-10px) scale(.78); color: var(--silk-blue-deep); }
.ff .input:focus { box-shadow: inset 0 0 0 1px var(--silk-blue-deep), 0 0 0 4px rgba(125, 157, 214, .28); background: var(--white); }
.ff .input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--red); }
.ff.pw .input { padding-right: 46px; }
.ff.pw button { top: 11px; }
/* (entrance animation removed: fields must never start invisible) */

/* Collapsible sidebar */
.shell { transition: grid-template-columns .3s var(--ease); }
.shell.is-collapsed { grid-template-columns: 76px 1fr; }
.is-collapsed .side { align-items: center; padding-inline: 10px; }
.is-collapsed .side .brand { padding: 2px 0 8px; font-size: 0; gap: 0; }
.is-collapsed .company { padding: 6px; border-color: transparent; background: none; }
.is-collapsed .company > div, .is-collapsed .company svg.i, .is-collapsed .nav-group > small, .is-collapsed .nav-group .n, .is-collapsed .side-foot .lang { display: none; }
.is-collapsed .nav-group { justify-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.is-collapsed .nav-group:first-of-type { border-top: 0; padding-top: 0; }
.is-collapsed .nav-group a { width: 44px; height: 40px; padding: 0; justify-content: center; gap: 0; font-size: 0; position: relative; }
.is-collapsed .side-foot { padding: 0; } .is-collapsed .side-foot a { font-size: 0; gap: 0; }
.is-collapsed .nav-group a::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; z-index: 5; padding: 5px 9px; border-radius: 8px; background: var(--navy); color: var(--white); font-size: var(--fs-label); font-weight: var(--fw-strong); white-space: nowrap; opacity: 0; transform: translate(-4px, -50%); transition: opacity .15s, transform .15s; pointer-events: none; }
.is-collapsed .nav-group a:hover::after, .is-collapsed .nav-group a:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
.side { overflow: visible; z-index: 3; }

/* Tabs with a sliding indicator */
.tabs { position: relative; display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); }
.tabs button { position: relative; z-index: 1; padding: 5px 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: var(--fs-label); font-weight: var(--fw-strong); cursor: pointer; transition: color .2s; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button small { margin-left: 4px; color: var(--muted); font-weight: 500; }
.tabs .ind { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px; background: var(--white); box-shadow: 0 1px 2px rgba(20, 22, 28, .1); transition: transform .3s var(--ease), width .3s var(--ease); }

/* Data table: sortable header, row hover, empty state */
.table th button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.table th button:hover { color: var(--ink); }
.table th button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .5; transition: transform .2s, opacity .2s; }
.table th[aria-sort="ascending"] button svg { opacity: 1; transform: rotate(180deg); }
.table th[aria-sort="descending"] button svg { opacity: 1; }
.table tbody tr { transition: opacity .2s; }
.table tr[hidden] { display: none; }
.table .empty td { padding: 30px 22px; color: var(--muted); text-align: center; white-space: normal; }

@media (prefers-reduced-motion: reduce) {
  .backdrop.live i, .glass .login-form > *, .ripple { animation: none; }
  .btn:hover { transform: none; }
  .shell, .tabs .ind { transition: none; }
}
.table tbody tr:has(+ .empty[hidden]) td { border-bottom: 0; }

/* ===== Login card: three modes (log in, create account, reset password) ===== */
.login-card [hidden] { display: none !important; }
.alert.ok { background: var(--emerald-bg); color: var(--emerald); }
.alert.ok .link { color: var(--emerald); }
.strength { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.strength i { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--red); transition: width .3s var(--ease), background-color .3s; }
.reqs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--fs-label); }
.reqs li { display: flex; align-items: center; gap: 6px; transition: color .2s; }
.reqs li::before { content: ""; flex: none; width: 14px; height: 14px; border: 1.5px solid var(--line-2); border-radius: 50%; transition: background-color .2s, border-color .2s; }
.reqs li.met { color: var(--emerald); }
.reqs li.met::before { border-color: var(--emerald); background: var(--emerald) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path d='M3.5 7.2l2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 14px no-repeat; }
.pw-help { display: grid; gap: 10px; }
.btn-primary:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
.btn-primary:disabled:hover { transform: none; background: linear-gradient(180deg, #2b3b66 0%, var(--navy) 100%); }
.btn-primary.is-loading:disabled { cursor: progress; opacity: .85; }
.back { display: inline-flex; align-items: center; gap: 6px; }
.login-legal { text-wrap: balance; }
.login-card h2:has(+ .sub[hidden]) { margin-bottom: 24px; }
.login-legal a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }

/* Login: rotating feature lines under the headline */
.feat-loop { margin-top: 26px; max-width: 30em; }
.feat-stack { display: grid; }
.feat-item { grid-area: 1 / 1; display: grid; gap: 6px; align-content: start; opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); pointer-events: none; }
.feat-item.is-on { opacity: 1; transform: none; pointer-events: auto; }
.feat-item b { font-size: 22px; font-weight: var(--fw-title); letter-spacing: -.02em; color: var(--ink); }
.feat-item span { color: var(--ink-2); font-size: 17px; line-height: 1.5; }
.feat-dots { display: flex; gap: 4px; margin-top: 18px; }
.feat-dots button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.feat-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--line-2); transition: width .3s var(--ease), background-color .3s; }
.feat-dots button:hover::before { background: var(--silk-blue); }
.feat-dots button[aria-current="true"]::before { width: 24px; background: var(--navy); }
@media (prefers-reduced-motion: reduce) { .feat-item { transition: none; transform: none; } }
/* Login: headline and the four features share one rotating slot, all at headline size */
.login-pitch.feat-loop { margin-top: auto; max-width: none; }
.login-story .feat-item { gap: 16px; align-content: center; }
.login-story .feat-item h1, .login-story .feat-item .big { max-width: 13em; margin: 0; color: var(--ink); font-size: clamp(34px, 3.6vw, 52px); font-weight: var(--fw-display); line-height: 1.06; letter-spacing: -.04em; text-wrap: balance; }
.login-story .feat-item span { max-width: 30em; }

/* ===== Login: flowing gold and blue silk behind an Apple-style glass card ===== */
.silkbg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: linear-gradient(160deg, #fdf8f2 0%, var(--cream) 45%, #f6e9dc 100%); }
.silkbg svg { position: absolute; inset: -6%; width: 112%; height: 112%; }
.rb { transform-box: fill-box; transform-origin: 50% 50%; will-change: transform; }
.rb-1 { animation: flow-1 19s ease-in-out infinite alternate; }
.rb-2 { animation: flow-2 23s ease-in-out infinite alternate; }
.rb-3 { animation: flow-3 27s ease-in-out infinite alternate; }
@keyframes flow-1 { 0% { transform: translate(-3%, -4%) rotate(-3deg) scaleY(1.12); } 50% { transform: translate(2%, 3%) rotate(1.5deg) scaleY(.9); } 100% { transform: translate(4%, -2%) rotate(-1deg) scaleY(1.06); } }
@keyframes flow-2 { 0% { transform: translate(3%, 4%) rotate(2.5deg) scaleY(.9); } 50% { transform: translate(-2%, -3%) rotate(-2deg) scaleY(1.14); } 100% { transform: translate(-4%, 2%) rotate(1deg) scaleY(.96); } }
@keyframes flow-3 { 0% { transform: translate(-2%, 2%) rotate(-1.5deg); } 100% { transform: translate(3%, -5%) rotate(2deg) scaleY(1.1); } }

.login-card.glassy { border: 1px solid rgba(255, 255, 255, .7); border-radius: 30px; background: linear-gradient(160deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, .34)); -webkit-backdrop-filter: blur(30px) saturate(1.6); backdrop-filter: blur(30px) saturate(1.6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(20, 22, 28, .05), 0 30px 70px rgba(58, 90, 153, .2); }
.glassy .sub, .glassy .login-foot, .glassy .login-legal { color: var(--ink-2); }
.glassy .login-foot { border-top-color: rgba(255, 255, 255, .7); }
.glassy .input { border-color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .62); box-shadow: inset 0 0 0 1px rgba(30, 42, 74, .12); }
.glassy .input:focus { background: rgba(255, 255, 255, .92); box-shadow: inset 0 0 0 1px var(--silk-blue-deep), 0 0 0 4px rgba(125, 157, 214, .3); }
.glassy .input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--red); }
.glassy .input::placeholder { color: #5f5a53; }
.glassy .strength { background: rgba(30, 42, 74, .12); }
.glassy .reqs { color: var(--ink-2); }
/* Left text sits on the silk: keep it crisp */
.login-story .brand, .login-story .feat-item h1, .login-story .feat-item .big { text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
@media (prefers-reduced-motion: reduce) { .rb { animation: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .login-card.glassy { background: rgba(255, 255, 255, .88); } }
.login-story .feat-item span { color: var(--ink); }
/* Left copy sits level with the card heading instead of the vertical centre */
@media (min-width: 861px) {
  .login-story .login-pitch.feat-loop { position: absolute; left: 56px; right: 56px; top: 30vh; margin: 0; padding: 0; }
  .login-story .feat-item { align-content: start; }
}
/* Login headlines stay on one line on desktop */
@media (min-width: 861px) {
  .login-story .feat-item h1, .login-story .feat-item .big { max-width: none; font-size: clamp(28px, 3.3vw, 52px); white-space: nowrap; }
}

/* ===== Dashboard v3: fixes from the design rules ===== */
/* Top bar stays in view; content dissolves under it */
.topbar { position: sticky; top: 0; z-index: 6; margin: -26px -36px 22px; padding: 18px 36px 14px; background: linear-gradient(180deg, #fbf3ea 0%, #fbf3ea 78%, rgba(251, 243, 234, 0) 100%); }
/* Account menu */
.acct { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 248px; padding: 8px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--paper); box-shadow: var(--e2); }
.menu[hidden] { display: none; }
.menu-who { display: grid; gap: 2px; padding: 8px 10px 10px; }
.menu-who b { font-weight: var(--fw-strong); }
.menu-who span { color: var(--muted); font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; }
.menu a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 10px; color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-title); }
.menu a:hover, .menu a:focus-visible { background: var(--white); color: var(--ink); }
.menu hr { height: 1px; margin: 6px 4px; border: 0; background: var(--line); }
.menu #logout { color: var(--red); }
/* Key figures: a comparison under the status */
.money .cmp { display: block; margin-top: 8px; color: var(--muted); font-size: var(--fs-label); }
.money .cmp.up { color: var(--emerald); font-weight: var(--fw-strong); }
/* Row actions are always visible (tablets have no hover) */
.row-act { opacity: 1; }
[hidden].btn { display: none; }
/* Small links get a comfortable click area */
.panel-h .link, .side-foot a, .table th button { display: inline-flex; align-items: center; min-height: 28px; padding: 0 6px; border-radius: 8px; }
.panel-h .link { margin-right: -6px; } .table th.num button { margin-right: -6px; }
/* Chart with a value axis */
.chart-wrap { position: relative; }
.chart-wrap .chart { padding-left: 64px; }
.chart-wrap + .chart-x { padding-left: 64px; }
.chart-y span { position: absolute; left: 22px; right: 22px; bottom: calc(6px + var(--p) * 126px); height: 0; color: var(--muted); font-size: var(--fs-label); line-height: 0; }
.chart-y span::after { content: ""; position: absolute; left: 36px; right: 0; top: 0; border-top: 1px dashed var(--line-2); }
.chart-wrap .chart { position: relative; z-index: 1; }
/* Toast with Undo */
.toast { pointer-events: none; }
.toast.on { pointer-events: auto; }
.toast button { padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; background: none; color: var(--white); font: inherit; font-weight: var(--fw-strong); cursor: pointer; }
.toast button:hover { background: rgba(255, 255, 255, .14); }
.toast button[hidden] { display: none; }
.is-collapsed .side-foot a { justify-content: center; }
.demo { position: static; justify-content: flex-end; align-items: center; margin-top: 24px; padding: 4px 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--muted); font-size: var(--fs-label); }

/* Narrow windows and tablets (not phones): the sidebar becomes the icon rail and the page reflows instead of being cut off */
.shell { min-width: 0; }
@media (max-width: 1000px) {
  .shell, .shell.is-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .side { align-items: center; padding-inline: 10px; }
  .side .brand { padding: 2px 0 8px; font-size: 0; gap: 0; }
  .company { padding: 6px; border-color: transparent; background: none; }
  .company > div, .company svg.i, .nav-group > small, .nav-group .n { display: none; }
  .nav-group { justify-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
  .nav-group:first-of-type { border-top: 0; padding-top: 0; }
  .nav-group a { position: relative; width: 44px; height: 40px; padding: 0; justify-content: center; gap: 0; font-size: 0; }
  .nav-group a::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; z-index: 5; padding: 5px 9px; border-radius: 8px; background: var(--navy); color: var(--white); font-size: var(--fs-label); font-weight: var(--fw-strong); white-space: nowrap; opacity: 0; transform: translate(-4px, -50%); transition: opacity .15s, transform .15s; pointer-events: none; }
  .nav-group a:hover::after, .nav-group a:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
  .side-foot { padding: 0; } .side-foot a { font-size: 0; gap: 0; justify-content: center; }
  #sideToggle { display: none; }
  .side { gap: 14px; overflow-y: auto; }
  .main { padding: 20px 20px 48px; }
  .topbar { margin: -20px -20px 18px; padding: 14px 20px 12px; }
  .search kbd { display: none; }
  .greet { flex-direction: column; align-items: flex-start; gap: 14px; }
  .greet h1 { font-size: 26px; }
  .table .hide-s { display: none; }
  .panel-h { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .money { grid-template-columns: 1fr 1fr; }
  .todo li { grid-template-columns: 36px 1fr; }
  .todo li .btn { grid-column: 2; justify-self: start; }
  .table th, .table td { padding-left: 10px; padding-right: 10px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table td:nth-child(2), .table th:nth-child(2) { display: none; }
}
.main { overflow-x: clip; }

/* ===== Glass dashboard (preview variant, body.glass-app): the whole app sits in one glass window over the silk ===== */
.glass-app { --muted: #57524a; --emerald: #17634a; --glass: linear-gradient(160deg, rgba(255, 255, 255, .66), rgba(255, 255, 255, .5)); --glass-edge: rgba(255, 255, 255, .78); --inner-line: rgba(30, 42, 74, .09);
  --fs-display: 20px; --fs-title: 14px; --fs-body: 13px; --fs-small: 13px; --fs-label: 12px; --fs-figure: 22px; }
.glass-app { height: 100vh; overflow: hidden; line-height: 1.5; }
.glass-app .rb { animation-duration: 60s; }
.glass-app .silkbg::after { content: ""; position: absolute; inset: 0; background: rgba(252, 246, 240, .16); }
/* One window: the only blurred surface on the page */
.glass-app .shell { position: fixed; inset: 16px; min-height: 0; grid-template-columns: 228px minmax(0, 1fr); border: 1px solid var(--glass-edge); border-radius: 26px; background: var(--glass); -webkit-backdrop-filter: blur(34px) saturate(1.5); backdrop-filter: blur(34px) saturate(1.5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 18px 40px rgba(58, 90, 153, .16); overflow: hidden; }
.glass-app .shell.is-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
/* Sidebar: a column of the window, divided by a hairline */
.glass-app .side { position: relative; top: auto; z-index: 7; height: 100%; min-height: 0; gap: 16px; padding: 16px 10px; border-right: 1px solid var(--inner-line); background: rgba(255, 255, 255, .22); }
@media (max-height: 780px) { .glass-app .side { overflow-y: auto; } }
.glass-app .is-collapsed .side .brand { font-size: 0; }
.glass-app .side .brand { padding: 2px 10px 4px; font-size: 16px; }
.glass-app .side .brand img { width: 26px; height: 26px; }
.glass-app .company { padding: 8px 10px; border-color: transparent; background: none; }
.glass-app .company:hover { background: rgba(255, 255, 255, .45); }
.glass-app .company .av { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.glass-app .nav-group > small { padding-bottom: 4px; }
.glass-app .nav-group a { padding: 6px 10px; border-radius: 9px; color: var(--ink); }
.glass-app .nav-group a svg { width: 16px; height: 16px; }
.glass-app .nav-group a:hover { background: rgba(255, 255, 255, .5); }
.glass-app .nav-group a.on { background: linear-gradient(180deg, #2b3b66, var(--navy)); color: var(--white); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 4px 10px rgba(30, 42, 74, .22); }
.glass-app .is-collapsed .nav-group, .glass-app .nav-group { border-top-color: var(--inner-line); }
.glass-app .is-collapsed .nav-group a { padding: 0; width: 40px; height: 34px; }
/* Main column scrolls inside the window */
.glass-app .main { height: 100%; min-height: 0; padding: 0 24px 28px; overflow-y: auto; overflow-x: hidden; }
.glass-app .topbar { margin: 0 -24px 18px; padding: 12px 24px; border-bottom: 1px solid var(--inner-line); background: rgba(255, 252, 248, .82); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.glass-app .search { max-width: 360px; }
.glass-app .search .input { height: 34px; padding-left: 36px; border-color: var(--inner-line); background: rgba(255, 255, 255, .7); font-size: 13px; }
.glass-app .search svg.i { left: 12px; top: 9px; width: 16px; height: 16px; }
.glass-app .search kbd { top: 7px; }
.glass-app .icon-btn { width: 34px; height: 34px; }
.glass-app .btn { min-height: 34px; padding: 0 14px; }
.glass-app .btn-xs { min-height: 28px; padding: 0 10px; }
.glass-app .btn-ghost, .glass-app .icon-btn { border-color: var(--inner-line); background: rgba(255, 255, 255, .7); }
.glass-app .greet { align-items: center; margin-bottom: 18px; }
.glass-app .greet h1 { font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.glass-app .greet p { margin-top: 2px; color: var(--muted); font-size: 13px; }
/* Sections inside the window: light inner surfaces, no second blur */
.glass-app .panel { border: 1px solid rgba(255, 255, 255, .8); border-radius: 16px; background: rgba(255, 255, 255, .56); box-shadow: 0 1px 2px rgba(20, 22, 28, .04); }
.glass-app .panel-h { padding: 14px 18px 0; }
.glass-app .panel-h h2 { font-weight: 600; letter-spacing: -.005em; }
.glass-app .money > div { padding: 14px 18px 16px; }
.glass-app .money > div, .glass-app .money > div:nth-child(n) { border-color: var(--inner-line); }
.glass-app .money small { font-size: 12px; }
.glass-app .money b { margin: 4px 0 6px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.glass-app .money .cmp { margin-top: 6px; }
.glass-app .todo li { padding: 9px 10px; }
.glass-app .todo b { font-weight: 600; }
.glass-app .table th { padding: 12px 18px 8px; }
.glass-app .table td { padding-left: 18px; padding-right: 18px; }
.glass-app .table th, .glass-app .table td, .glass-app .bas-mini .r { border-bottom-color: var(--inner-line); }
.glass-app .table tbody tr:hover td, .glass-app .todo li:hover { background: rgba(255, 255, 255, .5); }
.glass-app .tabs { border-color: var(--inner-line); background: rgba(255, 255, 255, .4); }
.glass-app .bas-mini .due { background: rgba(107, 67, 128, .1); }
.glass-app .bas-mini .tot b { color: var(--ink); font-weight: 700; }
.glass-app .chart .paid { background: linear-gradient(180deg, #8fa9de, #5f84c8); }
.glass-app .chart .owed { background: linear-gradient(180deg, #f6d08f, #eeb35c); }
.glass-app .chart-y span::after { border-top-color: rgba(30, 42, 74, .12); }
.glass-app .link { color: #2f4a80; }
.glass-app .menu, .glass-app .cmdk-box { border-color: var(--glass-edge); background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(30px) saturate(1.5); backdrop-filter: blur(30px) saturate(1.5); }
.glass-app .cmdk-in input { font-size: 15px; }
.glass-app.is-loading [data-skel] { background: linear-gradient(90deg, rgba(30, 42, 74, .07) 25%, rgba(30, 42, 74, .13) 50%, rgba(30, 42, 74, .07) 75%) 0 0 / 200% 100% !important; }
.glass-app .demo { margin-top: 18px; }
@media (max-width: 1000px) {
  .glass-app .shell { inset: 10px; border-radius: 22px; }
  .glass-app .shell.is-collapsed { grid-template-columns: 56px minmax(0, 1fr); }
  .glass-app .shell { grid-template-columns: 228px minmax(0, 1fr); }
  .glass-app .greet { align-items: flex-start; }
  .glass-app .main { padding: 0 16px 24px; }
  .glass-app .topbar { margin: 0 -16px 16px; padding: 10px 16px; }
  .glass-app .greet h1 { font-size: 18px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass-app .shell { background: rgba(255, 252, 248, .94); } }
.search svg.i, .search kbd { z-index: 1; }
/* Glass window: no divider lines between sidebar, top bar and sections */
.glass-app .side { border-right: 0; background: none; }
.glass-app .topbar { border-bottom: 0; background: linear-gradient(180deg, rgba(255, 252, 248, .86) 70%, rgba(255, 252, 248, 0)); -webkit-backdrop-filter: none; backdrop-filter: none; padding-bottom: 18px; margin-bottom: 8px; }
.glass-app .panel { border: 0; }
.glass-app .money > div, .glass-app .money > div:nth-child(n) { border: 0; }
.glass-app .nav-group, .glass-app .is-collapsed .nav-group { border-top: 0; }
/* Glass window sidebar: collapses to an icon rail without anything jumping. Icons keep their x position; labels fade and shrink. */
.side-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.side-toggle { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, opacity .15s; }
.side-toggle:hover { background: rgba(30, 42, 74, .07); color: var(--ink); }
.side-toggle svg { width: 16px; height: 16px; }
.side-rail { position: absolute; top: 0; bottom: 0; right: -7px; z-index: 2; width: 14px; padding: 0; border: 0; background: none; cursor: w-resize; }
.side-rail::after { content: ""; position: absolute; top: 18px; bottom: 18px; left: 6px; width: 2px; border-radius: 2px; background: var(--navy); opacity: 0; transition: opacity .15s; }
.side-rail:hover::after { opacity: .28; }
.is-collapsed .side-rail { cursor: e-resize; }
.glass-app .lbl, .glass-app .company > div { display: block; max-width: 170px; overflow: hidden; white-space: nowrap; text-overflow: clip; opacity: 1; transition: max-width .3s var(--ease), opacity .2s; }
.glass-app .side .brand { gap: 10px; padding: 2px 5px 4px; }
.glass-app .company { padding: 8px 4px; gap: 10px; }
.glass-app .company .av { flex: none; }
.glass-app .nav-group a { position: relative; }
.glass-app .nav-group a svg, .glass-app .side-foot a svg { flex: none; }
.glass-app .nav-group > small { transition: opacity .2s; white-space: nowrap; }
.glass-app .side-foot { padding: 0 10px; }
.glass-app .side-foot a svg { width: 16px; height: 16px; }
.glass-app .nav-group a .n { transition: none; }
@media all {
  .glass-app .shell.is-collapsed { grid-template-columns: 56px minmax(0, 1fr); }
  .glass-app .is-collapsed .side { align-items: stretch; padding-inline: 10px; }
  .glass-app .is-collapsed .lbl, .glass-app .is-collapsed .company > div { display: block; max-width: 0; opacity: 0; }
  .glass-app .is-collapsed .side .brand { padding: 2px 5px 4px; font-size: 16px; gap: 0; }
  .glass-app .is-collapsed .company { padding: 8px 4px; gap: 0; }
  .glass-app .is-collapsed .company svg.i { display: none; }
  .glass-app .is-collapsed .nav-group { justify-items: stretch; padding-top: 0; border-top: 0; }
  .glass-app .is-collapsed .nav-group > small { display: block; opacity: 0; }
  .glass-app .is-collapsed .nav-group a { width: auto; height: auto; padding: 6px 10px; justify-content: flex-start; gap: 0; font-size: var(--fs-small); }
  .glass-app .is-collapsed .nav-group a .n { display: block; position: absolute; top: 4px; right: 5px; width: 8px; height: 8px; padding: 0; margin: 0; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); font-size: 0; }
  .glass-app .is-collapsed .side-foot { padding: 0 10px; }
  .glass-app .is-collapsed .side-foot a { font-size: var(--fs-small); gap: 0; justify-content: flex-start; }
  /* Collapsed: the logo becomes the expand button on hover or keyboard focus */
  .glass-app .is-collapsed .side-toggle { position: absolute; left: 4px; top: 1px; opacity: 0; background: rgba(255, 255, 255, .9); }
  .glass-app .is-collapsed .side-head:hover .side-toggle, .glass-app .is-collapsed .side-toggle:focus-visible { opacity: 1; }
  .glass-app .is-collapsed .side-foot a { position: relative; }
  .glass-app .is-collapsed .side-foot a::after { content: attr(data-tip); position: absolute; left: calc(100% + 16px); top: 50%; z-index: 5; padding: 5px 9px; border-radius: 8px; background: var(--navy); color: var(--white); font-size: var(--fs-label); font-weight: var(--fw-strong); white-space: nowrap; opacity: 0; transform: translate(-4px, -50%); transition: opacity .15s, transform .15s; pointer-events: none; }
  .glass-app .is-collapsed .side-foot a:hover::after, .glass-app .is-collapsed .side-foot a:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
  .glass-app .is-collapsed .nav-group a::after { left: calc(100% + 16px); }
}
@media (prefers-reduced-motion: reduce) { .glass-app .lbl, .glass-app .company > div, .glass-app .nav-group > small, .glass-app .shell { transition: none; } }
/* Sidebar toggle lives in the top bar: same place, always visible, whether the sidebar is open or closed */
.glass-app .topbar .side-toggle { position: static; width: 34px; height: 34px; margin-left: -6px; border-radius: 9px; opacity: 1; background: none; color: var(--ink-2); }
.glass-app .topbar .side-toggle:hover { background: rgba(30, 42, 74, .07); color: var(--ink); }
.glass-app .topbar .side-toggle svg { width: 18px; height: 18px; }
.glass-app .is-collapsed .topbar .side-toggle { position: static; opacity: 1; background: none; }
.glass-app .is-collapsed .topbar .side-toggle:hover { background: rgba(30, 42, 74, .07); }
/* Sidebar foot: Collapse sits above Settings, both styled as nav rows */
.glass-app .side-foot, .glass-app .is-collapsed .side-foot { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px; padding: 0; }
.glass-app .side-foot a, .glass-app .side-foot .side-toggle, .glass-app .is-collapsed .side-foot .side-toggle { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: auto; height: auto; margin: 0; padding: 6px 10px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: inherit; font-size: var(--fs-small); font-weight: var(--fw-title); text-align: left; opacity: 1; cursor: pointer; }
.glass-app .side-foot a:hover, .glass-app .side-foot .side-toggle:hover { background: rgba(255, 255, 255, .5); color: var(--ink); }
.glass-app .side-foot .side-toggle svg { width: 16px; height: 16px; flex: none; }
@media all {
  .glass-app .is-collapsed .side-foot a, .glass-app .is-collapsed .side-foot .side-toggle { gap: 0; }
  .glass-app .is-collapsed .side-foot .side-toggle::after { content: attr(data-tip); position: absolute; left: calc(100% + 16px); top: 50%; z-index: 5; padding: 5px 9px; border-radius: 8px; background: var(--navy); color: var(--white); font-size: var(--fs-label); font-weight: var(--fw-strong); white-space: nowrap; opacity: 0; transform: translate(-4px, -50%); transition: opacity .15s, transform .15s; pointer-events: none; }
  .glass-app .is-collapsed .side-foot .side-toggle:hover::after, .glass-app .is-collapsed .side-foot .side-toggle:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
}
/* Dashboard lower half: three charts in a row, then the invoice table at full width (the table no longer runs under its neighbour) */
.charts-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; margin-top: 20px; }
.charts-3 > *, .grid-1 > * { min-width: 0; }
.grid-1 { margin-top: 20px; }
.table-wrap { overflow-x: auto; }
.panel-fig { font-size: var(--fs-title); font-weight: 600; letter-spacing: -.01em; }
.panel-note { margin: 0; padding: 0 18px 16px; color: var(--muted); font-size: var(--fs-label); }
.glass-app .charts-3 .panel { display: flex; flex-direction: column; }
.glass-app .charts-3 .panel-note { margin-top: auto; }
/* Horizontal bars: unpaid invoices by due date */
.hbars { display: grid; gap: 12px; margin: 0; padding: 16px 18px 14px; list-style: none; }
.hbars li { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 6px 12px; font-size: var(--fs-small); }
.hbars span { color: var(--ink-2); }
.hbars b { font-weight: 600; }
.hbars i { grid-column: 1 / -1; grid-row: 2; display: block; height: 8px; border-radius: 4px; background: rgba(30, 42, 74, .07); position: relative; overflow: hidden; }
.hbars i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 4px; background: #5f84c8; transition: width .7s cubic-bezier(.22, 1, .36, 1); }
.hbars .late i::after { background: var(--red); }
.hbars .late span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--red); vertical-align: 1px; }
.hbars .zero span::before { background: var(--line-2); }
.hbars .zero b { color: var(--muted); font-weight: 500; }
/* Segmented bar: spending by account. Colours checked for colour-blind separation; "Other" is neutral */
.seg { display: flex; gap: 2px; height: 12px; margin: 18px 18px 4px; }
.seg i { display: block; width: var(--w); min-width: 4px; transition: width .7s cubic-bezier(.22, 1, .36, 1); }
.seg i:first-child { border-radius: 4px 0 0 4px; } .seg i:last-child { border-radius: 0 4px 4px 0; }
.c1 { background: #5f84c8; } .c2 { background: #e0a23c; } .c3 { background: #7a5aa6; } .c4 { background: #1f9a84; } .c5 { background: #b9b2a8; }
.seg-list { display: grid; gap: 0; margin: 0; padding: 6px 18px 12px; list-style: none; }
.seg-list li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--inner-line, var(--line)); font-size: var(--fs-small); }
.seg-list li:last-child { border-bottom: 0; }
.seg-list i { width: 10px; height: 10px; border-radius: 3px; }
.seg-list span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-list b { font-weight: 600; }
.is-loading .hbars i::after, .is-loading .seg i { width: 0; }
.is-loading .seg { background: rgba(30, 42, 74, .07); border-radius: 4px; }
.glass-app .chart-wrap { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .hbars i::after, .seg i { transition: none; } }
/* Chart row follows the width of the content column, not the window (the sidebar can be open or closed) */
.glass-app .main { container-type: inline-size; }
.glass-app .charts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.glass-app .charts-3 .chart { height: 196px; }
.glass-app .charts-3 .chart-y span { bottom: calc(6px + var(--p) * 172px); }
@container (max-width: 900px) {
  .glass-app .charts-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glass-app .charts-3 > :first-child { grid-column: 1 / -1; }
}
@container (max-width: 560px) { .glass-app .charts-3 { grid-template-columns: minmax(0, 1fr); } }

/* Sidebar audit fixes (19 Nov): one rail for both "collapsed" and narrow windows; quieter active item; labels never bleed over the content while the width animates */
.glass-app .lbl, .glass-app .company > div { transition: max-width .3s var(--ease), opacity .2s .1s; }
.glass-app .is-collapsed .lbl, .glass-app .is-collapsed .company > div { transition: max-width .3s var(--ease), opacity .08s; }
.glass-app .nav-group a.on { background: rgba(30, 42, 74, .09); color: var(--navy); box-shadow: none; font-weight: 600; }
.glass-app .nav-group a.on:hover { background: rgba(30, 42, 74, .12); }
.glass-app .nav-group a, .glass-app .side-foot a, .glass-app .side-foot .side-toggle { color: var(--ink-2); min-height: 32px; }
.glass-app .nav-group a:hover, .glass-app .side-foot a:hover, .glass-app .side-foot .side-toggle:hover { color: var(--ink); }
.glass-app .nav-group > small { padding: 0 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.glass-app .side .brand img { width: 28px; height: 28px; border-radius: 8px; }
.glass-app .side .brand { padding: 2px 4px 4px; }
.glass-app .is-collapsed .side .brand { padding: 2px 4px 4px; }
button.company { width: 100%; font: inherit; color: inherit; text-align: left; }
.glass-app .company svg.i { width: 16px; height: 16px; flex: none; }
.glass-app .company b { font-weight: 600; line-height: 1.3; }
.glass-app .company small { display: block; line-height: 1.3; }
.glass-app .nav-group a .n { font-size: 11px; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .glass-app .lbl, .glass-app .company > div, .glass-app .is-collapsed .lbl, .glass-app .is-collapsed .company > div { transition: none; } }
.glass-app .is-collapsed .company { position: relative; }
.glass-app .is-collapsed .company::after { content: attr(data-tip); position: absolute; left: calc(100% + 16px); top: 50%; z-index: 5; padding: 5px 9px; border-radius: 8px; background: var(--navy); color: var(--white); font-size: var(--fs-label); font-weight: var(--fw-strong); white-space: nowrap; opacity: 0; transform: translate(-4px, -50%); transition: opacity .15s, transform .15s; pointer-events: none; }
.glass-app .is-collapsed .company:hover::after, .glass-app .is-collapsed .company:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
.glass-app .is-collapsed .side-foot .side-toggle { left: auto; top: auto; }

/* ===== One-screen dashboard (glass window): everything right of the sidebar is visible without scrolling when the window is big enough ===== */
.glass-app .main { display: flex; flex-direction: column; container-type: size; container-name: main; }
.glass-app .topbar, .glass-app .greet, .glass-app .demo { flex: none; }
.glass-app .dash { display: grid; gap: 14px; flex: 1 0 auto; min-width: 0; }
.glass-app .dash .row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); min-width: 0; }
.glass-app .dash .row > .panel { min-width: 0; display: flex; flex-direction: column; }
.glass-app .dash .panel-note { margin-top: auto; }
.glass-app .dash .p-inv { container-type: inline-size; container-name: inv; }
.glass-app .dash .chart-wrap { flex: 1; min-height: 150px; display: flex; }
.glass-app .dash .chart { flex: 1; height: auto; }
.glass-app .dash .chart-y span { bottom: calc(6px + var(--p) * (100% - 24px)); }
@container inv (max-width: 640px) { .glass-app .p-inv .hide-s { display: none; } .glass-app .p-inv .table th, .glass-app .p-inv .table td { padding-left: 10px; padding-right: 10px; } .glass-app .p-inv .table th:first-child, .glass-app .p-inv .table td:first-child { padding-left: 16px; } .glass-app .p-inv .table th:last-child, .glass-app .p-inv .table td:last-child { padding-right: 14px; } }
@container inv (max-width: 585px) { .glass-app .p-inv .table td:nth-child(2), .glass-app .p-inv .table th:nth-child(2) { display: none; } .glass-app .p-inv .tabs button { padding: 4px 8px; } }

@container main (min-width: 770px) and (min-height: 590px) {
  .glass-app .greet { margin-bottom: 12px; }
  .glass-app .greet > div:first-child { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .glass-app .greet p { margin: 0; }
  .glass-app .dash { flex: 1 1 0; min-height: 0; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); }
  .glass-app .dash .row { min-height: 0; }
  .glass-app .dash .row-b { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); }
  .glass-app .dash .row-c { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); }
  .glass-app .dash .row > .panel { min-height: 0; overflow: hidden; }
  .glass-app .dash .panel-h { padding: 12px 16px 0; flex: none; }
  /* Key figures: label, then figure and status on one line, then the comparison */
  .glass-app .money { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .glass-app .money > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 10px; row-gap: 2px; padding: 10px 16px 12px; }
  .glass-app .money small, .glass-app .money .cmp { grid-column: 1 / -1; }
  .glass-app .money b { margin: 0; }
  .glass-app .money .pill { justify-self: start; }
  .glass-app .money .cmp { margin-top: 2px; }
  /* Panels share the remaining height; a list scrolls inside its own panel only if the window is very short */
  .glass-app .dash .todo, .glass-app .dash .bas-mini, .glass-app .dash .hbars, .glass-app .dash .seg-list, .glass-app .dash #invPanel { min-height: 0; overflow-y: auto; }
  .glass-app .dash .todo, .glass-app .dash #invPanel, .glass-app .dash .seg-list, .glass-app .dash .hbars, .glass-app .dash .bas-mini { flex: 1 1 auto; }
  .glass-app .dash .todo { padding: 6px 8px 8px; }
  .glass-app .dash .todo li { padding: 7px 8px; gap: 10px; grid-template-columns: 30px minmax(0, 1fr) auto; }
  .glass-app .dash .todo .ic { width: 30px; height: 30px; border-radius: 9px; }
  .glass-app .dash .todo .ic svg { width: 15px; height: 15px; }
  .glass-app .dash .todo li div > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .glass-app .dash .todo li div { min-width: 0; }
  .glass-app .dash .todo .btn { min-height: 28px; padding: 0 10px; font-size: var(--fs-label); }
  .glass-app .dash .bas-mini { padding: 4px 16px 12px; }
  .glass-app .dash .bas-mini .r { padding: 6px 0; }
  .glass-app .dash .bas-mini .tot { padding: 8px 0 0; }
  .glass-app .dash .bas-mini .due { margin-top: 8px; padding: 7px 10px; font-size: var(--fs-label); }
  .glass-app .dash .chart-wrap { min-height: 0; }
  .glass-app .dash .chart { padding: 14px 16px 6px 56px; gap: 10px; }
  .glass-app .dash .chart-wrap + .chart-x { padding: 0 16px 10px 56px; gap: 10px; }
  .glass-app .dash .chart-y span { left: 16px; right: 16px; bottom: calc(6px + var(--p) * (100% - 20px)); }
  .glass-app .dash .table th { padding-top: 8px; padding-bottom: 6px; }
  .glass-app .dash .table td { padding-top: 7px; padding-bottom: 7px; }
  .glass-app .dash .table { margin-bottom: 0; }
  .glass-app .dash .hbars { gap: 9px; padding: 10px 16px 8px; align-content: start; }
  .glass-app .dash .hbars i { height: 6px; }
  .glass-app .dash .seg { margin: 12px 16px 2px; height: 10px; flex: none; }
  .glass-app .dash .seg-list { padding: 4px 16px 6px; align-content: start; }
  .glass-app .dash .seg-list li { padding: 5px 0; }
  .glass-app .dash .panel-note { padding: 0 16px 10px; flex: none; }
  .glass-app .main { padding-bottom: 10px; overflow-y: hidden; }
}
/* One-screen fixes */
.glass-app .dash .chart { grid-template-rows: minmax(0, 1fr); }
.glass-app .dash .chart > div { min-height: 0; }
.glass-app .dash .panel-h { flex-wrap: nowrap; }
.glass-app .dash .panel-h h2 { white-space: nowrap; }
.glass-app .dash .todo li div span { display: block; }
@container main (min-width: 770px) and (min-height: 590px) {
  .glass-app .greet { flex-direction: row; align-items: center; }
  .glass-app .dash .row-c { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .glass-app .main { padding-bottom: 14px; }
}
@container main (min-width: 770px) and (min-height: 590px) and (max-height: 720px) {
  .glass-app .dash .panel-note { display: none; }
  .glass-app .dash .bas-mini .due { margin-top: 6px; padding: 5px 10px; }
  .glass-app .dash .money > div { padding: 8px 16px 10px; }
  .glass-app .dash, .glass-app .dash .row { gap: 12px; }
  .glass-app .topbar { margin-bottom: 10px; padding-bottom: 12px; }
  .glass-app .greet { margin-bottom: 10px; }
}
.glass-app .topbar .demo { margin: 0 4px 0 0; padding: 0; gap: 6px; }
.glass-app .topbar .demo span { display: none; }
@container main (min-width: 770px) and (min-height: 590px) { .glass-app .dash .row-c { grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr) minmax(0, 1fr); } }
.glass-app .side { scrollbar-width: none; } .glass-app .side::-webkit-scrollbar { display: none; }
.glass-app .dash .hbars span, .glass-app .dash .bas-mini .due { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glass-app .dash .hbars li { grid-template-columns: minmax(0, 1fr) auto; }
@container main (min-width: 770px) and (min-height: 590px) and (max-height: 720px) {
  .glass-app .dash .table td { padding-top: 4px; padding-bottom: 4px; }
  .glass-app .dash .table th { padding-top: 6px; padding-bottom: 4px; }
  .glass-app .dash .btn-xs { min-height: 24px; }
  .glass-app .dash .panel-h { padding-top: 10px; }
  .glass-app .dash .hbars { gap: 6px; padding-top: 8px; }
  .glass-app .dash .bas-mini .r { padding: 5px 0; }
  .glass-app .dash .seg-list li { padding: 4px 0; }
  .glass-app .dash .todo li { padding: 5px 8px; }
}
/* Profit and loss: income and expenses side by side per month. Hues differ from Money in so the two charts are not confused */
.chart.pl > div { flex-direction: row; align-items: flex-end; justify-content: center; gap: 2px; }
.chart.pl i { flex: 1 1 0; max-width: 16px; border-radius: 4px 4px 2px 2px; }
.chart .inc { background: #1f9a84; } .chart .exp { background: #7a5aa6; }
.legend span.inc::before { background: #1f9a84; } .legend span.exp::before { background: #7a5aa6; }
.chart-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0; padding: 8px 16px 0; font-size: var(--fs-label); color: var(--muted); flex: none; }
.chart-stat b { color: var(--ink); font-size: var(--fs-small); font-weight: 600; }
@container main (min-width: 770px) and (min-height: 590px) {
  .glass-app .dash .row-b { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .glass-app .dash .row-c { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 2fr); }
}
.glass-app .dash .bas-mini .r { grid-template-columns: 34px minmax(0, 1fr) auto; }
.glass-app .dash .bas-mini .r span:not(.code), .glass-app .dash .bas-mini .tot span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.glass-app .dash .bas-mini .tot { display: flex; justify-content: space-between; gap: 10px; }
.glass-app .dash .panel-h .link { white-space: nowrap; }
@container main (min-width: 770px) and (min-height: 590px) { .glass-app .dash .row-c { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.8fr); } }
@container main (min-width: 1050px) and (min-height: 590px) { .glass-app .dash .row-c { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.85fr); } }
/* Chart tooltips may rise above their panel */
@container main (min-width: 770px) and (min-height: 590px) { .glass-app .dash .row > .panel.p-pl, .glass-app .dash .row > .panel.p-in { overflow: visible; position: relative; } .glass-app .dash .row > .panel.p-pl:hover, .glass-app .dash .row > .panel.p-in:hover, .glass-app .dash .row > .panel.p-pl:focus-within, .glass-app .dash .row > .panel.p-in:focus-within { z-index: 3; } }

/* Narrow windows: the sidebar starts as the rail but the switch stays, so it can still be opened */
@media (max-width: 1000px) {
  .glass-app #sideToggle { display: flex; }
  .glass-app .side-rail { display: block; }
  .glass-app .shell:not(.is-collapsed) .side { align-items: stretch; }
  .glass-app .shell:not(.is-collapsed) .company { padding: 8px 4px; gap: 10px; }
  .glass-app .shell:not(.is-collapsed) .company svg.i, .glass-app .shell:not(.is-collapsed) .nav-group > small, .glass-app .shell:not(.is-collapsed) .nav-group a .n { display: block; }
  .glass-app .shell:not(.is-collapsed) .nav-group { justify-items: stretch; padding-top: 0; border-top: 0; }
  .glass-app .shell:not(.is-collapsed) .nav-group a { width: auto; height: auto; padding: 6px 10px; justify-content: flex-start; gap: 10px; font-size: var(--fs-small); }
  .glass-app .shell:not(.is-collapsed) .nav-group a::after { display: none; }
  .glass-app .shell:not(.is-collapsed) .side-foot { padding: 0; }
  .glass-app .shell.is-collapsed .company > div { display: block; }
}
/* Business switcher sits with the greeting, not in the sidebar */
.greet-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.greet-t { min-width: 0; }
.co-switch { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 3px 4px 3px 3px; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--muted); cursor: pointer; transition: background .15s, border-color .15s; }
.co-switch:hover { border-color: var(--inner-line, var(--line)); background: rgba(255, 255, 255, .6); color: var(--ink); }
.co-switch .av { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: var(--white); font-size: 13px; font-weight: 700; }
.co-switch svg { width: 14px; height: 14px; }
@container main (min-width: 770px) and (min-height: 590px) {
  .glass-app .greet > div:first-child { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
  .glass-app .greet-t { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
}
/* Money in: thin bars, same weight as Profit and loss */
.glass-app .dash #chart > div { align-items: center; }
.glass-app .dash #chart i { width: 100%; max-width: 18px; border-radius: 4px 4px 2px 2px; }
.glass-app .dash #chart i.owed { border-radius: 4px 4px 0 0; } .glass-app .dash #chart i.paid { border-radius: 0 0 2px 2px; }
.glass-app .dash #chart > div { gap: 2px; }
/* Bills to pay uses the gold of the silk so money going out is not confused with money coming in (blue) */
.hbars.out i::after { background: #d99a34; }
.hbars.out .late i::after { background: var(--red); }

/* ===== Home cards matching the iOS app: Collections, Profit & Loss, Owed to you (aged receivables) ===== */
.t-indigo { color: #3a5a99; } .t-emerald { color: var(--emerald); } .t-rose { color: var(--red); }
.face .period { color: var(--muted); font-size: var(--fs-label); font-weight: 500; white-space: nowrap; }
.face-fig { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 6px 16px 0; flex: none; }
.face-fig b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.face-fig span { color: var(--ink-2); font-size: var(--fs-small); font-weight: 600; }
.face-fig span.t-rose { color: var(--red); }
.metrics { display: flex; gap: 12px; padding: 8px 16px 0; flex: none; }
.metrics > div { flex: 1 1 0; min-width: 0; }
.metrics b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.metrics span { display: block; color: var(--ink-2); font-size: var(--fs-label); line-height: 1.3; }
.metrics em { display: block; font-size: 11px; font-style: normal; font-weight: 600; line-height: 1.3; white-space: nowrap; }
/* Six-month trend: slim bars, earlier months pale, this month in the card's colour */
.chart.trend > div { align-items: center; }
.chart.trend i { width: 14px; border-radius: 4px 4px 0 0; }
.chart.trend i.past { background: rgba(58, 90, 153, .3); }
.chart.trend i.now-indigo { background: #3a5a99; } .chart.trend i.now-emerald { background: var(--emerald); }
.chart-x .now { color: var(--ink); font-weight: 600; }
.glass-app .dash .face .chart-wrap { margin-top: 6px; }
/* Aged receivables */
.age-bar { display: flex; gap: 2px; height: 18px; margin: 10px 16px 6px; border-radius: 6px; overflow: hidden; flex: none; }
.age-bar i { display: block; width: var(--w); transition: width .7s cubic-bezier(.22, 1, .36, 1); }
.a0 { background: #3a5a99; } .a1 { background: #e3b6b2; } .a2 { background: #cf6b63; } .a3 { background: var(--red); } .a4 { background: #7a1a14; }
.age-rows { display: grid; margin: 0; padding: 0 16px 6px; list-style: none; flex: 1 1 auto; min-height: 0; align-content: start; overflow-y: auto; }
.age-rows li { display: grid; grid-template-columns: 58px minmax(0, 1fr) 64px; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid var(--inner-line, var(--line)); font-size: var(--fs-small); }
.age-rows li:first-child { border-top: 0; }
.age-rows span { font-weight: 500; }
.age-rows i { display: block; height: 8px; border-radius: 4px; background: none; position: relative; }
.age-rows i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 4px; background: inherit; transition: width .7s cubic-bezier(.22, 1, .36, 1); }
.age-rows i.a0::after { background: #3a5a99; } .age-rows i.a1::after { background: #e3b6b2; } .age-rows i.a2::after { background: #cf6b63; } .age-rows i.a3::after { background: var(--red); } .age-rows i.a4::after { background: #7a1a14; }
.age-rows i[class] { background: none; }
.age-rows b { font-weight: 600; text-align: right; }
.age-rows .none span { color: var(--ink-2); } .age-rows .none b { color: var(--muted); font-weight: 500; }
.is-loading .age-bar i, .is-loading .age-rows i::after { width: 0; }
.is-loading .age-bar { background: rgba(30, 42, 74, .07); }
@container main (min-width: 770px) and (min-height: 590px) {
  .glass-app .dash .row > .panel.p-col, .glass-app .dash .row > .panel.p-pl { overflow: visible; position: relative; }
  .glass-app .dash .row > .panel.p-col:hover, .glass-app .dash .row > .panel.p-pl:hover, .glass-app .dash .row > .panel.p-col:focus-within, .glass-app .dash .row > .panel.p-pl:focus-within { z-index: 3; }
}
@container main (min-width: 770px) and (min-height: 590px) and (max-height: 720px) {
  .face-fig { padding-top: 2px; } .face-fig b { font-size: 20px; }
  .metrics { padding-top: 4px; }
  .age-rows li { padding: 3px 0; } .age-bar { height: 14px; margin: 6px 16px 4px; }
}
@media (prefers-reduced-motion: reduce) { .age-bar i, .age-rows i::after { transition: none; } }
/* Profit & Loss: income and expenses side by side; the two figures above carry the colour key */
.face .chart.pl .inc { background: #5f84c8; } .face .chart.pl .exp { background: #e0a23c; }
.face .chart.pl i { max-width: 11px; border-radius: 3px 3px 0 0; }
.metrics .key::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; vertical-align: 0; }
.metrics .key.inc::before { background: #5f84c8; } .metrics .key.exp::before { background: #e0a23c; }

/* ===== Whole-page audit fixes (19 Nov) ===== */
/* 1. Both rows share the same three columns, so the gutters line up */
@container main (min-width: 770px) and (min-height: 590px) {
  .glass-app .dash .row-b, .glass-app .dash .row-c { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .glass-app .main { padding-bottom: 24px; }
}
@container main (min-width: 1050px) and (min-height: 590px) { .glass-app .dash .row-c { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* 2. Chart row gets more of the height when there is room; the list row no longer sits half empty */
@container main (min-width: 770px) and (min-height: 721px) { .glass-app .dash { grid-template-rows: auto minmax(0, 1.3fr) minmax(0, 1fr); } }
/* 3. Every card title sits on the same line, whatever sits beside it */
.glass-app .dash .panel-h { min-height: 40px; padding-top: 10px; padding-bottom: 0; align-items: center; }
.glass-app .dash .tabs button { min-height: 28px; }
/* 4. Weights: 600 for figures, 700 kept for the brand and tiny badges */
.glass-app .dash .bas-mini b, .glass-app .dash .bas-mini .tot b, .glass-app .tip b, .glass-app .tip em { font-weight: 600; }
/* 5. Customer under the invoice number when the Customer column is hidden */
.table td .cust { display: none; color: var(--muted); font-size: var(--fs-label); font-weight: 400; line-height: 1.3; }
@container inv (max-width: 585px) { .glass-app .p-inv .table td .cust { display: block; } .glass-app .p-inv .table td b { display: block; line-height: 1.3; } }
/* 6. Preview-only controls read as scaffolding, not product */
.glass-app .topbar .demo .btn { border-style: dashed; background: none; color: var(--muted); font-weight: 500; }
/* Audit follow-up: invoices card at one-third width */
.table td .cust { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container inv (max-width: 585px) { .glass-app .dash .p-inv .table td { padding-top: 4px; padding-bottom: 4px; } .glass-app .p-inv .table td b, .glass-app .p-inv .table td .cust { line-height: 1.25; } }
@container inv (max-width: 340px) {
  .glass-app .p-inv .tabs { display: none; }
  .glass-app .p-inv .panel-h .link { display: inline; }
  .glass-app .p-inv .table th, .glass-app .p-inv .table td { padding-left: 6px; padding-right: 6px; }
  .glass-app .p-inv .table th:first-child, .glass-app .p-inv .table td:first-child { padding-left: 14px; }
  .glass-app .p-inv .table th:last-child, .glass-app .p-inv .table td:last-child, .glass-app .p-inv .table th:nth-last-child(2), .glass-app .p-inv .table td:nth-last-child(2) { padding-right: 14px; }
}
@container main (min-width: 770px) and (min-height: 590px) and (max-height: 720px) {
  .glass-app .p-inv .table td .cust { display: none; }
  .glass-app .dash .age-rows li { padding: 2px 0; }
  .glass-app .dash .bas-mini .r { padding: 4px 0; }
  .glass-app .dash .bas-mini .tot { padding-top: 6px; }
  .glass-app .dash .panel-h { min-height: 36px; padding-top: 8px; }
}
@container inv (max-width: 445px) { .glass-app .p-inv .table td { position: relative; } .glass-app .p-inv .stamp-mini { position: absolute; right: 0; top: 50%; margin: -9px 0 0; } }
@container main (min-width: 770px) and (min-height: 590px) and (max-height: 720px) { .glass-app .dash .p-inv .table td { padding-top: 3px; padding-bottom: 3px; } .glass-app .dash .p-inv .table th { padding-top: 4px; padding-bottom: 3px; } }
/* Collapsed rail: the overdue dot sits on the top-right corner of the Invoices icon, wherever the row ends */
.glass-app .is-collapsed .nav-group a .n { display: block; position: absolute; left: 21px; right: auto; top: 3px; width: 8px; height: 8px; padding: 0; margin: 0; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px rgba(255, 255, 255, .95); font-size: 0; line-height: 0; overflow: hidden; }

/* ===== One header row: business + greeting on the left; search, actions and account on the right ===== */
.glass-app .topbar.greet { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; margin: 0 -24px 12px; padding: 12px 24px; }
.glass-app .topbar.greet .greet-id { flex: 0 1 auto; min-width: 0; }
.glass-app .topbar.greet .greet-t { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.glass-app .topbar.greet h1, .glass-app .topbar.greet p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.glass-app .topbar.greet .spacer { flex: 1 1 0; min-width: 0; }
.glass-app .topbar.greet .search { flex: 0 1 250px; min-width: 150px; max-width: 250px; }
.glass-app .topbar.greet .actions { flex: none; flex-wrap: nowrap; }
.glass-app .topbar.greet .acct { flex: none; }
@container main (max-width: 1080px) { .glass-app .topbar.greet .demo { display: none; } }
@container main (max-width: 960px) { .glass-app .topbar.greet #greetDate { display: none; } .glass-app .topbar.greet .search kbd { display: none; } .glass-app .topbar.greet .search { flex-basis: 190px; } }
@container main (max-width: 760px) { .glass-app .topbar.greet .search { flex: 0 0 34px; min-width: 34px; } .glass-app .topbar.greet .search .input { padding: 0; color: transparent; cursor: pointer; } .glass-app .topbar.greet .search .input::placeholder { color: transparent; } .glass-app .topbar.greet .search svg.i { left: 9px; } }
@container main (max-width: 620px) { .glass-app .topbar.greet .actions .btn-ghost { display: none; } }
@media (max-width: 1000px) { .glass-app .topbar.greet { margin: 0 -16px 12px; padding: 10px 16px; } }
.glass-app .topbar.greet .greet-t { flex-wrap: nowrap; }
@container main (max-width: 1260px) { .glass-app .topbar.greet .demo { display: none; } }
/* Collections: invoiced and paid side by side, same density as Profit & Loss */
.face .chart.pl.col .inv { background: #5f84c8; } .face .chart.pl.col .paid { background: #3f9a4a; }
.face-fig .key::before, .metrics .key::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; }
.key.inv::before { background: #5f84c8; } .key.paid::before { background: #3f9a4a; }
/* Bottom row: Recent invoices, Recent bills, GST & BAS */
.glass-app .dash .bl-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
@container inv (max-width: 400px) { .glass-app .p-inv .tabs { display: none; } .glass-app .p-inv .panel-h .link { display: inline; } }
@container inv (max-width: 340px) { .glass-app .p-bl .table th:nth-last-child(2), .glass-app .p-bl .table td:nth-last-child(2) { padding-right: 6px; } }
/* Header: the search box gives way before the greeting does */
.glass-app .topbar.greet .search { flex: 0 100 250px; min-width: 170px; }
.glass-app .topbar.greet .greet-id { flex: 0 1 auto; }
.glass-app .topbar.greet .spacer { flex: 1 1 0; min-width: 0; margin: 0 -5px; }
/* Recent bills at narrow widths: long supplier names shorten, no sideways scroll */
@container inv (max-width: 340px) { .glass-app .p-bl .table td:first-child b { display: block; max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .glass-app .p-bl .pill { padding: 2px 8px; } }
@container main (max-width: 1100px) { .glass-app .topbar.greet #greetDate { display: none; } }
@container inv (max-width: 340px) { .glass-app .p-bl .table td:first-child b { max-width: 90px; } }

/* ===== Whole-page audit, round 2 (19 Nov) ===== */
/* 1. The two charts start at the same height, so their gridlines line up across cards */
.glass-app .dash .face .metrics { min-height: 50px; }
/* 2. The table row is as tall as its content; the chart row takes everything else (no slack under the tables) */
@container main (min-width: 770px) and (min-height: 721px) {
  .glass-app .dash { grid-template-rows: auto minmax(200px, 1fr) auto; }
  .glass-app .dash .row-c > .panel { max-height: 300px; padding-bottom: 8px; }
}
/* 3. Search field shows the same focus ring as every other control */
.glass-app .search .input:focus-visible { outline: 2px solid var(--focus, #3b6aa5); outline-offset: 2px; }
/* Round 2 follow-up */
.glass-app .dash .face .face-fig { height: 32px; align-items: center; }
.glass-app .dash .face .metrics { height: 52px; min-height: 0; }
@container main (min-width: 770px) and (min-height: 590px) {
  .glass-app .dash { grid-template-rows: auto minmax(150px, 1fr) auto; }
  .glass-app .dash .row-c > .panel { max-height: 300px; padding-bottom: 8px; }
}
@container inv (max-width: 470px) { .glass-app .p-inv .tabs { display: none; } .glass-app .p-inv .panel-h .link { display: inline; } }
@container main (min-width: 770px) and (min-height: 590px) and (max-height: 720px) { .glass-app .dash .face .face-fig { height: 28px; } .glass-app .dash .face .metrics { height: 48px; } }
.glass-app .dash .face .metrics { height: 56px; }
@container main (min-width: 770px) and (min-height: 590px) and (max-height: 720px) { .glass-app .dash .face .metrics { height: 52px; } }
.glass-app .topbar.greet .search { min-width: 130px; }
/* Key-figure strip removed: two rows only */
@container main (min-width: 770px) and (min-height: 590px) { .glass-app .dash { grid-template-rows: minmax(150px, 1fr) auto; } }
/* Owed to you: who owes it, as in the iOS card. Shown when the card has the height for it */
.by-cust { display: none; padding: 4px 16px 0; flex: none; }
.by-h { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0 4px; border-top: 1px solid var(--inner-line, var(--line)); }
.by-h b { font-size: var(--fs-small); font-weight: 600; } .by-h span { color: var(--muted); font-size: var(--fs-label); }
.by-cust ul { margin: 0; padding: 0; list-style: none; }
.by-cust li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--inner-line, var(--line)); font-size: var(--fs-small); }
.by-cust li div { min-width: 0; } .by-cust li div b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.by-cust li div span { display: block; color: var(--muted); font-size: var(--fs-label); }
.by-cust li > b { font-weight: 600; }
.glass-app .dash .p-age .age-rows { flex: 0 0 auto; overflow: visible; }
@container main (min-height: 870px) { .glass-app .dash .p-age .by-cust { display: block; } }

/* ===== "Waiting for you" strip: counts that are not shown anywhere else on the page, each a link to its list ===== */
.nudges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px; }
.nudges a { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 9px 12px; border-radius: 11px; color: inherit; transition: background .15s; }
.nudges a:hover { background: rgba(255, 255, 255, .6); }
.nudges .ni { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: rgba(58, 90, 153, .1); color: #3a5a99; }
.nudges .ni svg { width: 16px; height: 16px; }
.nudges .nt { display: block; min-width: 0; }
.nudges small { display: block; color: var(--muted); font-size: var(--fs-label); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nudges b { display: block; font-size: var(--fs-small); font-weight: 600; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glass-app .nudges { border: 0; }
@container main (min-width: 770px) and (min-height: 590px) { .glass-app .dash { grid-template-rows: auto minmax(150px, 1fr) auto; } }
@container main (max-width: 769px) { .nudges { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container main (min-width: 770px) and (min-height: 590px) and (max-height: 720px) { .nudges { padding: 4px; } .nudges a { padding: 6px 10px; } .nudges .ni { width: 28px; height: 28px; } }
/* Overdue is a status, so its tile carries the status colour (with its label, never colour alone) */
.nudges a.late .ni { background: rgba(179, 38, 30, .1); color: var(--red); }

/* GST & BAS: the amount to pay leads, as on the other cards; Recent bills carries its total */
.glass-app .dash .p-gst .gst-fig { height: auto; padding: 4px 16px 0; align-items: baseline; }
.gst-due { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 16px 6px; color: var(--ink-2); font-size: var(--fs-label); flex: none; white-space: nowrap; overflow: hidden; }
.gst-due b { font-weight: 600; color: var(--ink); }
.gst-due > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.glass-app .dash .p-gst .bas-mini { padding-top: 0; flex: 0 0 auto; }
.glass-app .dash .p-gst .bas-mini .r:last-child { border-bottom: 0; }
.h-fig { margin-right: auto; color: var(--muted); font-size: var(--fs-label); white-space: nowrap; }
.h-fig b { color: var(--ink); font-size: var(--fs-small); font-weight: 600; }
.glass-app .dash .p-bl .panel-h { justify-content: flex-start; gap: 10px; }
@container main (min-width: 770px) and (min-height: 590px) and (max-height: 720px) { .glass-app .dash .p-gst .panel-note { display: none; } }
.gst-due { gap: 6px; } .gst-due .pill { padding: 2px 8px; flex: none; }

/* ===== Live figures: a changed number steps to its new value and flashes once ===== */
@keyframes bump { 0% { background: rgba(58, 90, 153, .18); } 100% { background: rgba(58, 90, 153, 0); } }
.bump { animation: bump .9s ease-out; border-radius: 6px; box-shadow: 0 0 0 3px transparent; }
.glass-app .dash .chart i { transition: height .6s cubic-bezier(.22, 1, .36, 1); }
.nav-group a .n[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .bump { animation: none; } .glass-app .dash .chart i { transition: none; } }
/* Trial: the glass window takes 95% of the browser window (was full size less a 16px margin) */
.glass-app .shell { inset: 2.5vh 2.5vw; }
@media (max-width: 1000px) { .glass-app .shell { inset: 2.5vh 2.5vw; } }
@container inv (max-width: 300px) { .glass-app .p-inv .table th, .glass-app .p-inv .table td { padding-left: 4px; padding-right: 4px; } .glass-app .p-inv .table th:first-child, .glass-app .p-inv .table td:first-child { padding-left: 12px; } .glass-app .p-inv .table th:last-child, .glass-app .p-inv .table td:last-child, .glass-app .p-inv .table th:nth-last-child(2), .glass-app .p-inv .table td:nth-last-child(2) { padding-right: 12px; } .glass-app .p-bl .table td:first-child b { max-width: 78px; } .glass-app .p-inv .pill { padding: 2px 7px; } }
/* Glass window at 90% of the browser window */
.glass-app .shell { inset: 5vh 5vw; }
@media (max-width: 1000px) { .glass-app .shell { inset: 5vh 5vw; } }

/* Glass window at 90%: the one-screen layout holds down to a narrower content column */
@container main (max-width: 830px) { .glass-app .topbar.greet .search { flex: 0 0 34px; min-width: 34px; max-width: 34px; } .glass-app .topbar.greet .search .input { padding: 0; color: transparent; cursor: pointer; } .glass-app .topbar.greet .search .input::placeholder { color: transparent; } .glass-app .topbar.greet .search svg.i { left: 9px; } .glass-app .topbar.greet .search kbd { display: none; } }
@container inv (max-width: 270px) { .glass-app .p-inv .table th, .glass-app .p-inv .table td { padding-left: 3px; padding-right: 3px; font-size: 12px; } .glass-app .p-inv .table th:first-child, .glass-app .p-inv .table td:first-child { padding-left: 10px; } .glass-app .p-inv .table th:last-child, .glass-app .p-inv .table td:last-child, .glass-app .p-inv .table th:nth-last-child(2), .glass-app .p-inv .table td:nth-last-child(2) { padding-right: 10px; } .glass-app .p-bl .table td:first-child b { max-width: 70px; } .glass-app .p-inv .pill { padding: 2px 6px; font-size: 11px; gap: 4px; } .glass-app .p-inv .panel-h { padding-left: 12px; padding-right: 12px; } .h-fig { display: none; } }
.glass-app .dash .p-bl .panel-h .link { margin-left: auto; }
@container main (max-width: 830px) { .gst-due { flex-wrap: wrap; row-gap: 2px; } .gst-due > span:last-child { overflow: visible; } }

/* ===== Sheet: a glass window that opens over the dashboard. The sidebar stays; the dashboard behind is fogged ===== */
.glass-app .shell > .side { grid-column: 1; grid-row: 1; }
.glass-app .shell > .main { grid-column: 2; grid-row: 1; }
.sheet-layer { grid-column: 2; grid-row: 1; position: relative; z-index: 8; min-width: 0; min-height: 0; }
.sheet-layer[hidden] { display: none; }
.sheet-fog { position: absolute; inset: 0; background: rgba(252, 246, 240, .42); -webkit-backdrop-filter: blur(0) saturate(1); backdrop-filter: blur(0) saturate(1); opacity: 0; transition: opacity .22s ease, backdrop-filter .28s ease, -webkit-backdrop-filter .28s ease; }
.sheet-layer.on .sheet-fog { opacity: 1; -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15); }
.sheet { position: absolute; inset: 20px 22px 22px 22px; display: flex; flex-direction: column; min-height: 0; border: 1px solid rgba(255, 255, 255, .9); border-radius: 22px; background: linear-gradient(165deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .74)); -webkit-backdrop-filter: blur(30px) saturate(1.5); backdrop-filter: blur(30px) saturate(1.5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 24px 60px rgba(30, 42, 74, .18), 0 2px 6px rgba(20, 22, 28, .06); opacity: 0; transform: translateY(14px) scale(.985); transition: opacity .22s ease, transform .3s cubic-bezier(.22, 1, .36, 1); outline: none; overflow: hidden; }
.sheet-layer.on .sheet { opacity: 1; transform: none; }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; flex: none; }
.sheet-title { margin-right: auto; min-width: 0; }
.sheet-title h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.sheet-title p { margin: 1px 0 0; color: var(--muted); font-size: var(--fs-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-search { flex: 0 1 260px; min-width: 150px; max-width: 260px; }
.sheet-search .input { height: 34px; padding-left: 36px; border-color: rgba(30, 42, 74, .1); background: rgba(255, 255, 255, .8); font-size: 13px; cursor: text; }
.sheet-search svg.i { left: 12px; top: 9px; width: 16px; height: 16px; }
.sheet-h .btn { min-height: 34px; padding: 0 14px; flex: none; }
.sheet-h .icon-btn { width: 34px; height: 34px; flex: none; border-color: rgba(30, 42, 74, .1); background: rgba(255, 255, 255, .8); }
/* Status tabs double as the summary: count and total for each */
.sheet-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 0 18px 12px; flex: none; }
.sheet-tabs button { display: block; padding: 9px 12px; border: 1px solid rgba(30, 42, 74, .08); border-radius: 12px; background: rgba(255, 255, 255, .5); color: var(--ink-2); font: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
.sheet-tabs button:hover { background: rgba(255, 255, 255, .85); }
.sheet-tabs span { display: flex; align-items: center; gap: 6px; font-size: var(--fs-label); font-weight: 500; }
.sheet-tabs em { padding: 0 6px; border-radius: 999px; background: rgba(30, 42, 74, .07); font-size: 11px; font-style: normal; font-weight: 600; line-height: 1.6; }
.sheet-tabs b { display: block; margin-top: 2px; color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.sheet-tabs button[aria-selected="true"] { border-color: var(--navy); background: #fff; box-shadow: 0 0 0 1px var(--navy); color: var(--ink); }
.sheet-tabs button.warn em { background: var(--red-bg); color: var(--red); }
.sheet-tabs button.warn b { color: var(--red); }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; border-top: 1px solid rgba(30, 42, 74, .08); }
.sheet-table { margin: 0; }
.sheet-table thead th { position: sticky; top: 0; z-index: 1; background: rgba(252, 249, 245, .96); padding-top: 9px; padding-bottom: 8px; }
.sheet-table td { padding-top: 8px; padding-bottom: 8px; border-bottom-color: rgba(30, 42, 74, .07); }
.sheet-table th:first-child, .sheet-table td:first-child { padding-left: 18px; }
.sheet-table th:last-child, .sheet-table td:last-child { padding-right: 18px; }
.sheet-table tbody tr:hover td { background: rgba(255, 255, 255, .7); }
.sheet-table tr.empty td { padding: 28px 18px; color: var(--muted); text-align: center; }
.sheet-f { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 18px; border-top: 1px solid rgba(30, 42, 74, .08); color: var(--muted); font-size: var(--fs-label); flex: none; }
.sheet-hint kbd { padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 6px; font: 11px var(--sans); }
@container main (max-width: 900px) { .sheet-tabs b { font-size: 13px; } .sheet-tabs button { padding: 7px 9px; } .sheet-table th:nth-child(3), .sheet-table td:nth-child(3) { display: none; } .sheet { inset: 14px; } }
@media (max-width: 1100px) { .sheet-table th:nth-child(3), .sheet-table td:nth-child(3) { display: none; } .sheet-search { flex-basis: 180px; } }
@media (max-width: 900px) { .sheet { inset: 12px; } .sheet-tabs { gap: 6px; padding: 0 12px 10px; } .sheet-tabs b { font-size: 13px; } .sheet-tabs button { padding: 7px 8px; } .sheet-h { padding: 12px 12px 10px; } .sheet-title p { display: none; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-fog { transition: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .sheet-fog { background: rgba(252, 246, 240, .86); } .sheet { background: #fff; } }
/* The sheet covers most of the dashboard, not all: a band of the fogged dashboard stays visible around it */
.sheet { inset: 44px 46px 40px 46px; }
@container main (max-width: 900px) { .sheet { inset: 26px 24px 24px 24px; } }
@media (max-width: 900px) { .sheet { inset: 18px 14px 16px 14px; } }

/* ===== Real web app additions ===== */
.load-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--red-bg); color: var(--red); font-size: var(--fs-small); }
.load-error[hidden] { display: none; }
.table .row-link { color: inherit; }
.table .row-link, .table .row-link:hover, .table .row-link:hover b { text-decoration: none; }   /* codes in tables: no underline on hover (the row opens it) */
.table tr.empty td { padding: 18px 16px; color: var(--muted); text-align: left; white-space: normal; }
a.co-switch { text-decoration: none; }
.glass-app.is-loading .dash .table tbody tr[data-skel] td { height: 34px; }
.glass-app .metrics b { color: var(--ink); }
.glass-app .metrics b.t-emerald { color: var(--emerald); } .glass-app .metrics b.t-indigo { color: #3a5a99; } .glass-app .metrics b.t-rose { color: var(--red); }
.sheet-table tbody tr[data-id] { cursor: pointer; }
.sheet-table .btn[disabled] { opacity: .5; cursor: default; }
.toast.err { background: var(--red); }
/* Sheet table: long customer names shorten instead of pushing the table sideways */
.sheet-table td:nth-child(2) { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.sheet-table { table-layout: auto; }
@container main (max-width: 900px) { .sheet-table td:nth-child(2) { max-width: 150px; } .sheet-table th, .sheet-table td { padding-left: 10px; padding-right: 10px; } .sheet-table th:first-child, .sheet-table td:first-child { padding-left: 14px; } .sheet-table th:last-child, .sheet-table td:last-child { padding-right: 14px; } }
@media (max-width: 1150px) { .sheet-table td:nth-child(2) { max-width: 150px; } .sheet-table th, .sheet-table td { padding-left: 10px; padding-right: 10px; } .sheet-table th:first-child, .sheet-table td:first-child { padding-left: 14px; } .sheet-table th:last-child, .sheet-table td:last-child { padding-right: 14px; } .sheet { inset: 26px 24px 24px 24px; } }
/* Overdue tab: same weight as the others. Only the small count badge is red; the amount stays in normal ink */
.sheet-tabs button.warn b { color: var(--ink); }
.sheet-table th.act { text-align: right; }
/* Sheet: on wide screens it stays a compact window in the middle instead of stretching, so the columns sit close together */
.sheet { max-width: 1040px; margin-inline: auto; }
.sheet-table th:nth-child(1), .sheet-table td:nth-child(1) { width: 15%; }
.sheet-table th:nth-child(3), .sheet-table td:nth-child(3), .sheet-table th:nth-child(4), .sheet-table td:nth-child(4) { width: 10%; white-space: nowrap; }
.sheet-table th:nth-child(5), .sheet-table td:nth-child(5) { width: 13%; }
.sheet-table th:nth-child(6), .sheet-table td:nth-child(6) { width: 14%; }
.sheet-table th:nth-child(7), .sheet-table td:nth-child(7) { width: 13%; }
/* Sheet, revised: the fog covers the whole screen (sidebar and the silk around the glass window included), and the window is a little larger */
.sheet-layer { position: fixed; inset: 0; z-index: 50; grid-column: auto; grid-row: auto; }
.sheet-fog { background: rgba(252, 246, 240, .5); }
.sheet-layer.on .sheet-fog { -webkit-backdrop-filter: blur(18px) saturate(1.1); backdrop-filter: blur(18px) saturate(1.1); }
.sheet { inset: 6vh 32px; max-width: 1140px; margin-inline: auto; }
@media (max-width: 1150px) { .sheet { inset: 5vh 24px; } }
@media (max-width: 900px) { .sheet { inset: 3vh 12px; } }
/* New / edit invoice window: a framed page inside the glass sheet */
.sheet-frame { max-width: 1060px; }
.sheet-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: light; }

/* ===== Sheet performance (19 Nov): measured ~53ms a frame while opening. The blur radius is no longer animated,
   the sheet itself no longer blurs (the fog behind it already does), and the silk stops moving while a sheet is open ===== */
.sheet-fog, .sheet-layer.on .sheet-fog { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); transition: opacity .2s ease; will-change: opacity; }
.sheet { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 253, 250, .94); transition: opacity .18s ease, transform .24s cubic-bezier(.22, 1, .36, 1); will-change: transform, opacity; transform: translateY(10px); }
.sheet-layer.on .sheet { transform: none; }
body.sheet-open .rb { animation-play-state: paused; }
body.sheet-open .shell { pointer-events: none; }
.sheet-frame iframe { opacity: 0; transition: opacity .18s ease; }
.sheet-frame.ready iframe { opacity: 1; }
.sheet-frame::before { content: ""; position: absolute; left: 20px; right: 20px; top: 18px; height: 30px; border-radius: 10px; background: linear-gradient(90deg, rgba(30, 42, 74, .06) 25%, rgba(30, 42, 74, .11) 50%, rgba(30, 42, 74, .06) 75%) 0 0 / 200% 100%; animation: shimmer 1.3s linear infinite; }
.sheet-frame.ready::before { display: none; }
@media (prefers-reduced-motion: reduce) { .sheet { transform: none; transition: none; } .sheet-fog { transition: none; } .sheet-frame::before { animation: none; } }
/* Work pages: the silk stays still. Measured on the dashboard: 43ms a frame while it drifted behind the glass window
   (every frame re-blurred the whole window), 8ms with it still. The login page keeps its moving silk. */
/* (22 Nov 2026) The owner asked for the slow drift back: the silk moves again on work pages, one sweep a minute (the
   60s set above). It still pauses while a window is open over the page (body.sheet-open, above), where the cost was worst. */
/* Sheet motion: a soft fade in and fade out, with a very slight settle. No slide. */
.sheet { transform: scale(.985); transition: opacity .2s ease, transform .2s ease; }
.sheet-layer.on .sheet { transform: none; transition: opacity .32s ease, transform .36s cubic-bezier(.22, 1, .36, 1); }
.sheet-fog { transition: opacity .2s ease; }
.sheet-layer.on .sheet-fog { transition: opacity .32s ease; }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-layer.on .sheet { transform: none; transition: none; } .sheet-fog, .sheet-layer.on .sheet-fog { transition: none; } }

/* Invoices window: wider on large screens, same height. The New invoice window keeps its own width. */
.sheet:not(.sheet-frame) { max-width: 1480px; top: 10vh; bottom: 10vh; }
@media (max-height: 760px) { .sheet:not(.sheet-frame) { top: 6vh; bottom: 6vh; } }

/* Action column: every button is the same width and sits centred under the "Action" header */
.sheet-table th:nth-child(7), .sheet-table td:nth-child(7) { width: 124px; padding-left: 18px; padding-right: 18px; text-align: center; }
.sheet-table th.act { text-align: center; }
.sheet-table td:nth-child(7) .btn { min-width: 86px; justify-content: center; }

/* Invoices window: as tall as its rows need, so the whole list shows without scrolling when it fits; it only scrolls once it would pass 94% of the window height */
.sheet-layer { display: grid; place-items: center; }
.sheet:not(.sheet-frame) { position: relative; inset: auto; top: auto; bottom: auto; width: calc(100% - 64px); max-width: 1480px; margin: 0; height: auto; min-height: min(420px, 94vh); max-height: 94vh; }
@media (max-width: 900px) { .sheet:not(.sheet-frame) { width: calc(100% - 24px); } }
@media (max-height: 760px) { .sheet:not(.sheet-frame) { top: auto; bottom: auto; } }
@media (min-width: 1300px) { .sheet-table td:nth-child(2) { max-width: 460px; } }

/* Tighter rows in the Invoices window so more of the list fits before it has to scroll */
.sheet:not(.sheet-frame) { max-height: 96vh; }
.sheet-table td { padding-top: 4px; padding-bottom: 4px; }
.sheet-table td .btn { min-height: 26px; height: 26px; }

/* New invoice window: as tall as the form inside it (the form reports its height), not a fixed tall box with empty space below */
.sheet.sheet-frame { position: relative; inset: auto; width: calc(100% - 64px); max-width: 1060px; margin: 0; height: var(--nw-h, 620px); min-height: min(480px, 94vh); max-height: 94vh; }
/* No height animation: the window opens at its final size and changes size at once when a line is added */
@media (max-width: 900px) { .sheet.sheet-frame { width: calc(100% - 24px); } }
@media (prefers-reduced-motion: reduce) { .sheet-layer.on .sheet.sheet-frame { transition: none; } }

/* ===== Type weight: half a step heavier across the app =====
   Manrope 400 at 13px reads thin on the glass surface. Body text, table data and form text go to 500;
   card titles to 600; the greeting from 400 to 500. Figures and buttons keep their 600. */
.glass-app { font-weight: 500; --fw-display: 500; --fw-title: 600; }
.glass-app input, .glass-app select, .glass-app textarea { font-weight: 500; }
.glass-app .table td .cust { font-weight: 500; }

/* Home on taller windows: the chart row no longer takes all the spare height (it shares it with the row below),
   and the prompts at the top are larger. Shorter windows keep the compact layout. */
@container main (min-width: 770px) and (min-height: 721px) {
  .glass-app .dash { grid-template-rows: auto minmax(150px, 1.1fr) minmax(auto, 1fr); }
  .nudges { padding: 8px; gap: 6px; }
  .nudges a { gap: 14px; padding: 12px 14px; border-radius: 13px; }
  .nudges .ni { width: 40px; height: 40px; border-radius: 11px; }
  .nudges .ni svg { width: 19px; height: 19px; }
  .nudges small { font-size: 13px; }
  .nudges b { font-size: 15px; letter-spacing: -.01em; }
}
@container main (min-height: 870px) and (max-height: 1039px) { .glass-app .dash .p-age .by-cust { display: none; } }   /* the shorter chart row only has room for the customer list on very tall windows */

/* ===== Home prompts as four separate white cards (more noticeable than one quiet strip) ===== */
.glass-app .panel.nudges { gap: 10px; padding: 0; border: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; overflow: visible; }
.nudges a { position: relative; padding: 10px 34px 10px 12px; border: 1px solid rgba(255, 255, 255, .95); border-radius: 14px; background: rgba(255, 255, 255, .84); box-shadow: 0 1px 2px rgba(20, 22, 28, .05), 0 6px 16px rgba(30, 42, 74, .08); transition: background .15s, box-shadow .15s, transform .15s; }
.nudges a:hover { background: #fff; box-shadow: 0 1px 2px rgba(20, 22, 28, .06), 0 10px 24px rgba(30, 42, 74, .13); transform: translateY(-1px); }
.nudges a::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-right: 2px solid #8b8f9c; border-top: 2px solid #8b8f9c; transform: rotate(45deg); transition: border-color .15s, right .15s; }
.nudges a:hover::after { right: 13px; border-color: var(--navy); }
.nudges .ni { background: rgba(58, 90, 153, .14); }
.nudges b { color: var(--ink); font-weight: 700; }
.nudges a.late .ni { background: rgba(179, 38, 30, .13); }
.nudges a.late b { color: var(--red); }
@container main (min-width: 770px) and (min-height: 590px) and (max-height: 720px) { .glass-app .panel.nudges { padding: 0; gap: 8px; } .nudges a { padding: 7px 30px 7px 10px; } }
@container main (min-width: 770px) and (min-height: 721px) {
  .glass-app .panel.nudges { gap: 10px; padding: 0; }
  .nudges a { gap: 10px; padding: 13px 28px 13px 12px; border-radius: 15px; }
  .nudges a::after { right: 13px; }
  .nudges .ni { width: 36px; height: 36px; border-radius: 10px; }
  .nudges .ni svg { width: 18px; height: 18px; }
  .nudges small { font-size: 12px; }
  .nudges b { font-size: 14px; }
}
/* Wide enough for the larger prompt cards */
@container main (min-width: 1300px) and (min-height: 721px) {
  .glass-app .panel.nudges { gap: 12px; }
  .nudges a { gap: 14px; padding: 14px 38px 14px 16px; border-radius: 16px; }
  .nudges a::after { right: 16px; }
  .nudges .ni { width: 42px; height: 42px; border-radius: 12px; }
  .nudges .ni svg { width: 20px; height: 20px; }
  .nudges small { font-size: 13px; }
  .nudges b { font-size: 16px; }
}
/* Tall windows: charts take a smaller share of the height; the lists below use the rest for extra rows */
@container main (min-width: 770px) and (min-height: 860px) { .glass-app .dash { grid-template-rows: auto minmax(150px, .85fr) minmax(auto, 1fr); } }
@media (prefers-reduced-motion: reduce) { .nudges a, .nudges a::after { transition: none; } .nudges a:hover { transform: none; } }
/* Recent invoices and bills: four rows by default, a fifth and sixth when the window is tall enough to hold them */
.row-c .p-inv tbody tr:nth-child(n+5) { display: none; }
@container main (min-width: 770px) and (min-height: 790px) { .row-c .p-inv tbody tr:nth-child(5) { display: table-row; } }
@container main (min-width: 770px) and (min-height: 860px) { .row-c .p-inv tbody tr:nth-child(6), .row-c .p-inv tbody tr:nth-child(7) { display: table-row; } }
@container main (min-width: 770px) and (min-height: 930px) { .row-c .p-inv tbody tr:nth-child(8) { display: table-row; } }
/* The lower cards fill their row (they were capped at 300px, which left empty space under them on tall windows) */
@container main (min-width: 770px) and (min-height: 721px) { .glass-app .dash .row-c > .panel { max-height: none; } }

/* ===== Home charts: more room for the plot, wider bars, the current month stands out ===== */
/* The note sits on the figure line instead of taking a row of its own under the chart */
.fig-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; flex: none; }
.fig-row .face-fig { flex: none; }
.glass-app .dash .fig-row .panel-note { display: block; flex: 0 1 auto; min-width: 0; margin: 0; padding: 0 16px 0 0; color: var(--muted); font-size: var(--fs-label); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Paid / Outstanding / Margin on one line */
.glass-app .dash .p-col .metrics, .glass-app .dash .p-pl .metrics { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; height: auto; min-height: 0; padding-top: 2px; }
.glass-app .dash .p-col .metrics > div, .glass-app .dash .p-pl .metrics > div { display: flex; flex: 0 0 auto; align-items: baseline; gap: 6px; white-space: nowrap; }
.glass-app .dash .p-col .metrics b, .glass-app .dash .p-pl .metrics b { display: inline; font-size: 13px; }
.glass-app .dash .p-col .metrics span, .glass-app .dash .p-pl .metrics span, .glass-app .dash .p-col .metrics em { display: inline; }
.glass-app .dash .p-col .chart-x, .glass-app .dash .p-pl .chart-x { padding-bottom: 12px; }
/* Bars: wider, closer pairs; earlier months step back so this month reads first */
.face .chart.pl > div { gap: 3px; }
.face .chart.pl i { max-width: 20px; border-radius: 4px 4px 0 0; }
.face .chart.pl > div:not(:last-child) i { opacity: .5; transition: height .6s cubic-bezier(.22, 1, .36, 1), opacity .15s; }
.face .chart.pl > div:not(:last-child):hover i, .face .chart.pl > div:not(:last-child):focus-visible i { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .face .chart.pl > div:not(:last-child) i { transition: none; } }

/* ===== Home header actions: larger targets, clearer order of importance ===== */
.icon-btn .acct-av { font-size: 13px; font-weight: 700; color: var(--navy); line-height: 1; }
.icon-btn .acct-av:empty { display: none; }
.icon-btn .acct-av:not(:empty) + svg { display: none; }
.glass-app .topbar.greet .acct .icon-btn { background: rgba(58, 90, 153, .12); border-color: transparent; }
.glass-app .topbar.greet .acct .icon-btn:hover { background: rgba(58, 90, 153, .2); }
.glass-app .topbar.greet .actions .btn-ghost { background: transparent; border-color: rgba(30, 42, 74, .18); }
.glass-app .topbar.greet .actions .btn-ghost:hover { background: rgba(255, 255, 255, .7); border-color: rgba(30, 42, 74, .3); }
.glass-app .topbar.greet .search .input { padding-right: 54px; text-overflow: ellipsis; }
@container main (min-width: 1000px) and (min-height: 721px) {
  .glass-app .topbar.greet .search { flex: 0 100 300px; max-width: 300px; }
  .glass-app .topbar.greet .search .input { height: 38px; padding-left: 38px; }
  .glass-app .topbar.greet .search svg.i { top: 11px; left: 13px; }
  .glass-app .topbar.greet .search kbd { top: 9px; }
  .glass-app .topbar.greet .actions .btn { min-height: 38px; height: 38px; padding: 0 16px; }
  .glass-app .topbar.greet .actions { gap: 10px; }
  .glass-app .topbar.greet .acct .icon-btn { width: 38px; height: 38px; }
}
@container main (max-width: 960px) { .glass-app .topbar.greet .search .input { padding-right: 12px; } }

/* ===== Owed to you: buckets with nothing in them share one line, which leaves room for the customer list ===== */
.glass-app .dash .p-age .age-rows { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; }
.glass-app .dash .p-age .age-rows li:not(.none) { flex: 0 0 100%; }
.glass-app .dash .p-age .age-rows li.none { order: 2; display: block; flex: 0 0 auto; padding: 6px 0 2px; border: 0; color: var(--muted); font-size: var(--fs-label); }
.glass-app .dash .p-age .age-rows li.none i, .glass-app .dash .p-age .age-rows li.none b { display: none; }
.glass-app .dash .p-age .age-rows li.none span { color: var(--muted); font-weight: 500; }
.glass-app .dash .p-age .age-rows:has(li.none)::before { content: "Nothing in"; order: 1; flex: 0 0 auto; padding: 6px 0 2px; color: var(--muted); font-size: var(--fs-label); }
.glass-app .dash .p-age .age-rows:has(li.none)::after { content: ""; order: 0; flex: 0 0 100%; border-top: 1px solid var(--inner-line, var(--line)); }
/* "includes GST" now sits beside "Today" in the card header, so the footnote is not needed */
.glass-app .dash .p-age > .panel-note { display: none; }
/* Mid-height windows: show the customer list when at least three buckets are empty (otherwise it would not fit) */
@container main (min-height: 870px) and (max-height: 1039px) {
  .glass-app .dash .p-age:has(.age-rows li.none ~ li.none ~ li.none) .by-cust { display: block; }
  .glass-app .dash .p-age .by-cust li:nth-child(n+3) { display: none; }
  .glass-app .dash .p-age .by-cust li { padding: 5px 0; }
}
/* Tighter customer list on mid-height windows so it fits under the buckets */
@container main (min-height: 870px) and (max-height: 1039px) {
  .glass-app .dash .p-age .by-cust { padding-top: 0; }
  .glass-app .dash .p-age .by-h { padding: 6px 0 3px; }
  .glass-app .dash .p-age .by-cust li { padding: 2px 0; }
  .glass-app .dash .p-age .age-rows li.none, .glass-app .dash .p-age .age-rows:has(li.none)::before { padding: 4px 0 0; }
}
/* Short windows: every gridline stays, every second label is dropped so the figures do not crowd */
@container main (min-width: 770px) and (max-height: 760px) { .glass-app .dash .chart-y span:nth-child(even) { color: transparent; } }
/* Owed to you: the customer list is always the two largest balances, with no "+ more" row under it */
.glass-app .dash .p-age .by-cust li:nth-child(n+3) { display: none; }
.by-h span { white-space: nowrap; }

/* ===== Recent invoices / Bills to pay: the script decides how many rows fit (see fitRows) ===== */
.rows-fit .row-c .p-inv tbody tr { display: table-row; }
.rows-fit .row-c .p-inv tbody tr[hidden] { display: none; }

/* ===== GST & BAS card =====
   Top: what is owed and when. Middle: where today falls in the BAS period. Then the working (G1, 1A, 1B, result),
   and a foot row with the source and a link to the BAS worksheet. */
.glass-app .dash .p-gst { display: flex; flex-direction: column; }
.gst-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px; padding: 4px 16px 0; flex: none; }
.gst-lab { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: var(--fs-label); font-weight: 500; line-height: 1.5; white-space: nowrap; }
.gst-lab .pill { padding: 1px 8px; }
.gst-amt { min-width: 0; }
.gst-amt b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; }
.gst-when { text-align: right; }
.gst-when .gst-lab { justify-content: flex-end; }
.gst-when > b { display: block; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.gst-when em { display: block; color: var(--muted); font-size: var(--fs-label); font-style: normal; line-height: 1.4; white-space: nowrap; }
.gst-when em b { color: var(--ink-2); font-weight: 600; }
.gst-when em.t-rose, .gst-when em.t-rose b { color: var(--red); }
.gst-prog { height: 6px; margin: 12px 16px 0; border-radius: 3px; background: rgba(30, 42, 74, .09); overflow: hidden; flex: none; }
.gst-prog i { display: block; width: var(--w, 0%); height: 100%; border-radius: 3px; background: #3a5a99; transition: width .7s cubic-bezier(.22, 1, .36, 1); }
.is-loading .gst-prog i { width: 0; }
.gst-prog-l { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 5px 16px 0; color: var(--muted); font-size: var(--fs-label); line-height: 1.4; flex: none; white-space: nowrap; }
.gst-prog-l span:nth-child(2) { color: var(--ink-2); font-weight: 600; }
.glass-app .dash .p-gst .gst-calc { flex: 0 0 auto; margin-top: 8px; padding: 0 16px; overflow: visible; }
.glass-app .dash .p-gst .gst-calc .r { padding: 7px 0; }
.glass-app .dash .p-gst .gst-calc .r.tot { border-top: 1px solid rgba(30, 42, 74, .28); border-bottom: 0; font-weight: 600; }
.glass-app .dash .p-gst .gst-calc .r:nth-last-child(2) { border-bottom: 0; }
.gst-calc .code.eq { background: var(--navy); color: #fff; font-size: 13px; }
.gst-calc .r.tot b { color: #3a5a99; font-weight: 700; }
.gst-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding: 8px 16px 12px; flex: none; }
.glass-app .dash .gst-foot .panel-note { display: block; margin: 0; padding: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gst-foot .btn { flex: none; }
@media (prefers-reduced-motion: reduce) { .gst-prog i { transition: none; } }
/* Short windows: the card is small, so it keeps the amount, the due date and the three BAS lines */
@container main (min-width: 770px) and (max-height: 859px) {
  .p-gst .gst-prog, .p-gst .gst-prog-l, .p-gst .gst-foot, .p-gst .gst-calc .r.tot { display: none; }
  .glass-app .dash .p-gst .gst-calc .r:nth-last-child(2) { border-bottom: 0; }
  .glass-app .dash .p-gst .gst-calc .r { padding: 5px 0; }
  .gst-amt b { font-size: 22px; }
}
@container main (min-width: 770px) and (max-height: 720px) { .gst-amt b { font-size: 20px; } .gst-top { padding-top: 0; } .glass-app .dash .p-gst .gst-calc { margin-top: 4px; } .glass-app .dash .p-gst .gst-calc .r { padding: 4px 0; } }
/* Tall windows: the working gets more air instead of leaving a gap under it */
@container main (min-width: 770px) and (min-height: 860px) { .glass-app .dash .p-gst .gst-calc .r { padding: 9px 0; } .glass-app .dash .p-gst .gst-calc { margin-top: 12px; } }
@container main (max-width: 769px) { .gst-foot { margin-top: 8px; } }
.glass-app .dash .p-gst .gst-calc .r.tot { display: grid; justify-content: normal; padding-top: 9px; }
@container main (min-width: 770px) and (max-height: 859px) { .glass-app .dash .p-gst .gst-calc .r.tot { display: none; } }
@container main (min-width: 770px) and (min-height: 721px) and (max-height: 859px) { .p-gst .gst-prog { display: block; } .p-gst .gst-prog-l { display: flex; } }   /* mid-height windows have room for the period bar */

/* New invoice window: the form is shown 10% larger. The frame is zoomed, so the layout inside is unchanged;
   the window is 10% wider to match (finoice-home.js scales the reported height by the same factor). */
.sheet.sheet-frame { max-width: 1166px; }
.sheet-frame iframe { zoom: 1.1; }

/* ===== Invoices window: audit pass (2026-11-20) ===== */
/* Header controls match the rest of the app */
.sheet-h .btn { min-height: 38px; height: 38px; padding: 0 16px; }
.sheet-h .icon-btn { width: 38px; height: 38px; }
.sheet-search .input { height: 38px; padding-left: 38px; }
.sheet-search svg.i { top: 11px; left: 13px; }
/* Status filters: one line each (name and count on the left, amount on the right), so the list gets the height */
.sheet-tabs button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; min-height: 40px; }
.sheet-tabs b { margin: 0; font-size: 14px; white-space: nowrap; }
.sheet-tabs em { font-size: 12px; }
.sheet-hint kbd { font-size: 12px; }
@media (max-width: 900px) { .sheet-tabs button { flex-direction: column; align-items: flex-start; gap: 0; } }
/* Sortable headings */
.th-sort { display: inline-flex; align-items: center; gap: 4px; margin: -4px -6px; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-weight: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
.th-sort:hover { background: rgba(30, 42, 74, .07); color: var(--ink); }
.th-sort:focus-visible { outline: 2px solid #3b6aa5; outline-offset: 1px; }
.th-sort svg { width: 12px; height: 12px; opacity: 0; transition: opacity .15s, transform .15s; }
.th-sort:hover svg { opacity: .45; }
.th-sort.on { color: var(--ink); font-weight: 600; }
.th-sort.on svg { opacity: 1; }
.th-sort.asc svg { transform: rotate(180deg); }
.sheet-table th.num .th-sort { flex-direction: row-reverse; }
@media (prefers-reduced-motion: reduce) { .th-sort svg { transition: none; } }
/* The invoice number is a link, so the keyboard can reach and open every row */
.sheet-table .row-link { color: inherit; border-radius: 4px; }
.sheet-table .row-link:hover b { text-decoration: none; }
.sheet-table .row-link:focus-visible { outline: 2px solid #3b6aa5; outline-offset: 2px; }
/* Overdue: the due date is red, with how late it is */
.sheet-table td.late { color: var(--red); font-weight: 600; white-space: nowrap; }
.sheet-table td.late small { margin-left: 4px; font-size: var(--fs-label); font-weight: 500; }
@media (max-width: 1250px) { .sheet-table td.late small { display: none; } }
.sheet-table th:nth-child(3), .sheet-table td:nth-child(3) { width: 9%; }
.sheet-table th:nth-child(4), .sheet-table td:nth-child(4) { width: 13%; }
.glass-app .sheet-search .input { height: 38px; padding-left: 38px; }
.glass-app .sheet-search svg.i { top: 11px; left: 13px; }
.sheet-table td.late small { display: inline; }
/* Sortable headings show a faint arrow as a hint; the active one is solid */
.sheet-table .th-sort svg.i { width: 12px; height: 12px; opacity: .28; }
.sheet-table .th-sort:hover svg.i { opacity: .6; }
.sheet-table .th-sort.on svg.i { opacity: 1; }

/* Dates in lists are dd/mm/yyyy: fixed-width figures so the columns line up */
.sheet-table td:nth-child(3), .sheet-table td:nth-child(4), .row-c .p-inv td { font-variant-numeric: tabular-nums; }
.sheet-table th:nth-child(3), .sheet-table td:nth-child(3), .sheet-table th:nth-child(4), .sheet-table td:nth-child(4) { width: 10%; }

/* Invoices window: narrower, and the two date columns sit closer to the customer (the customer column no longer
   swallows the spare width; the amount column takes a little more instead). */
.sheet:not(.sheet-frame) { max-width: 1280px; }
.sheet-table th:nth-child(1), .sheet-table td:nth-child(1) { width: 13%; }
.sheet-table th:nth-child(3), .sheet-table td:nth-child(3), .sheet-table th:nth-child(4), .sheet-table td:nth-child(4) { width: 11%; }
.sheet-table th:nth-child(5), .sheet-table td:nth-child(5) { width: 14%; }
.sheet-table th:nth-child(6), .sheet-table td:nth-child(6) { width: 15%; }
@media (min-width: 1300px) { .sheet-table td:nth-child(2) { max-width: 340px; } }

/* Dates one step closer to the customer: the customer column is fixed at 22% and the amount column takes the rest */
.sheet-table th:nth-child(2), .sheet-table td:nth-child(2) { width: 22%; }
.sheet-table th:nth-child(5), .sheet-table td:nth-child(5) { width: 15%; }
.sheet-table th:nth-child(6), .sheet-table td:nth-child(6) { width: auto; }
@media (min-width: 1300px) { .sheet-table td:nth-child(2) { max-width: 270px; } }

/* Invoices window sized to its content: with the dates pulled in, the spare width on the right is removed rather
   than left as a gap before Amount. The status filters sit in the same narrower frame, so they tighten with it. */
.sheet:not(.sheet-frame) { max-width: 1120px; }
.sheet-table th:nth-child(1), .sheet-table td:nth-child(1) { width: 14%; }
.sheet-table th:nth-child(2), .sheet-table td:nth-child(2) { width: 25%; }
.sheet-table th:nth-child(3), .sheet-table td:nth-child(3), .sheet-table th:nth-child(4), .sheet-table td:nth-child(4) { width: 12%; }
.sheet-table th:nth-child(5), .sheet-table td:nth-child(5) { width: 13%; }
.sheet-table th:nth-child(6), .sheet-table td:nth-child(6) { width: auto; }
.sheet-table th:nth-child(7), .sheet-table td:nth-child(7) { width: 118px; padding-left: 14px; padding-right: 18px; }
.sheet-tabs { gap: 6px; }
.sheet-tabs button { padding: 7px 12px; }
.sheet-search { flex-basis: 240px; max-width: 240px; }

/* Status filters: each one is as wide as its own content, with the name, count and amount kept together
   (no stretched boxes with the label at one end and the figure at the other). */
.sheet-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-tabs button { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: flex-start; gap: 10px; min-height: 36px; padding: 0 14px; border-radius: 999px; }
.sheet-tabs span { gap: 6px; font-size: var(--fs-small); font-weight: 600; color: var(--ink-2); }
.sheet-tabs b { margin: 0; padding-left: 10px; border-left: 1px solid rgba(30, 42, 74, .14); font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.sheet-tabs button[aria-selected="true"] span { color: var(--ink); }
@media (max-width: 900px) { .sheet-tabs button { flex-direction: row; align-items: center; gap: 8px; padding: 0 10px; } .sheet-tabs b { padding-left: 8px; } }
.sheet-tabs b { padding-left: 0; border-left: 0; }   /* no divider between the name and the amount */
@media (max-width: 900px) { .sheet-tabs b { padding-left: 0; } }

/* Invoices window, top area: title, search and close on the first line; status filters on the second with
   "New invoice" at its right end, above the Action column. */
.sheet-bar { display: flex; align-items: center; gap: 12px; padding: 0 18px 12px; flex: none; }
.sheet-bar .sheet-tabs { flex: 1 1 auto; min-width: 0; padding: 0; }
.sheet-bar .btn { flex: none; min-height: 36px; height: 36px; padding: 0 16px; margin-left: auto; }
.sheet-h .sheet-search { flex: 0 1 260px; max-width: 260px; }
@media (max-width: 900px) { .sheet-bar { padding: 0 12px 10px; gap: 8px; align-items: flex-start; } }

/* ===== Invoice window (2026-11-20): the document at the left, status and actions at the right ===== */
.sheet.sheet-inv { max-width: 1180px; height: min(1120px, 95vh); max-height: 95vh; min-height: 0; }   /* as tall as the window allows: the taller it is, the larger the fitted page */
.iv-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 12px; flex: none; }
.iv-head h2 { display: flex; align-items: center; gap: 10px; margin: 0 auto 0 0; min-width: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.iv-head h2 small { color: var(--muted); font-size: var(--fs-small); font-weight: 500; letter-spacing: 0; }
.iv-pager { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-label); font-variant-numeric: tabular-nums; }
.iv-pager span { padding: 0 6px; white-space: nowrap; }
.iv-head .icon-btn { width: 38px; height: 38px; flex: none; border-color: rgba(30, 42, 74, .1); background: rgba(255, 255, 255, .8); }
.iv-head .icon-btn:disabled { opacity: .4; cursor: default; }
.iv-body { display: grid; grid-template-columns: minmax(0, 1fr) 312px; flex: 1 1 auto; min-height: 0; border-top: 1px solid rgba(30, 42, 74, .08); }

/* Left: the document, on a quiet desk so the white page reads as paper */
.iv-desk { position: relative; min-width: 0; overflow: hidden; padding: 16px; background: rgba(30, 42, 74, .045); }
.iv-desk.actual { overflow: auto; }
/* The page is laid out at a fixed A4 size and scaled as a whole to fit the space (see fit() below), like a PDF viewer's
   "fit page". The whole invoice is visible without scrolling; "Actual size" switches to full size with scrolling. */
.iv-zoom { position: absolute; right: 14px; bottom: 14px; z-index: 2; min-height: 30px; padding: 0 12px; border: 1px solid rgba(30, 42, 74, .14); border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink-2); font: inherit; font-size: var(--fs-label); font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(20, 22, 28, .1); }
.iv-zoom:hover { color: var(--ink); border-color: rgba(30, 42, 74, .3); }
.iv-desk.actual .iv-zoom { position: sticky; float: right; margin: -6px -6px 0 0; bottom: 14px; }
.iv-paper { position: relative; display: flex; flex-direction: column; box-sizing: border-box; width: 720px; min-height: 1018px; margin: 0 auto; padding: 46px 48px 36px; border-radius: 4px; background: #fff; color: #14161c; box-shadow: 0 1px 2px rgba(20, 22, 28, .08), 0 14px 34px rgba(30, 42, 74, .13); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.iv-paper .p-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 2em; }
.iv-paper .p-logo { display: grid; place-items: center; width: 4.4em; height: 4.4em; border-radius: .9em; background: var(--navy); color: #fff; font-size: 1.25em; font-weight: 700; letter-spacing: .02em; }
.iv-paper .p-doc { text-align: right; }
.iv-paper .p-doc h3 { margin: 0 0 .5em; font-size: 2em; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.iv-paper .p-doc div { color: #3a3d46; }
.iv-paper .p-doc b { color: #14161c; font-weight: 600; }
.iv-paper .p-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 2em; margin-top: 3em; }
.iv-paper .p-lab { margin-bottom: .45em; color: #66625b; font-size: .86em; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.iv-paper .p-parties b { display: block; font-size: 1.12em; font-weight: 600; }
.iv-paper .p-parties .r { text-align: right; }
.iv-paper table { width: 100%; margin-top: 2.6em; border-collapse: collapse; }
.iv-paper th { padding: .7em 0; border-bottom: 1.5px solid #14161c; color: #3a3d46; font-size: .86em; font-weight: 600; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.iv-paper td { padding: .85em 0; border-bottom: 1px solid #e7e3dc; vertical-align: top; }
.iv-paper th.n, .iv-paper td.n { text-align: right; white-space: nowrap; }
.iv-paper td.n { padding-left: 1.4em; }
.iv-paper .p-tot { width: 46%; margin: 1.6em 0 0 auto; }
.iv-paper .p-tot div { display: flex; justify-content: space-between; padding: .35em 0; color: #3a3d46; }
.iv-paper .p-tot div.t { margin-top: .5em; padding-top: .8em; border-top: 1.5px solid #14161c; color: #14161c; font-size: 1.3em; font-weight: 600; }
.iv-paper .p-pay { margin: 3em 0 2.6em; padding-top: 1.4em; border-top: 1px solid #e7e3dc; }
.iv-paper .p-pay b { font-weight: 600; }
.iv-paper .p-pay p { margin: .35em 0 0; color: #3a3d46; }
.iv-paper .p-bank { display: grid; grid-template-columns: auto 1fr; gap: .15em 1.2em; margin-top: .9em; }
.iv-paper .p-bank span { color: #66625b; }
.iv-paper .p-advice { margin-top: auto; padding-top: 1.6em; border-top: 1.5px dashed #b9b3a8; }
.iv-paper .p-advice h4 { margin: 0 0 .9em; font-size: 1.05em; font-weight: 600; }
.iv-paper .p-advice .g { display: grid; grid-template-columns: 1fr 1.1fr; gap: 2em; }
.iv-paper .p-advice .row { display: flex; justify-content: space-between; gap: 1em; padding: .3em 0; border-bottom: 1px solid #eeeae3; }
.iv-paper .p-advice .row span:first-child { color: #66625b; }
.iv-paper .p-stamp { position: absolute; left: 36%; top: 6%; padding: .42em .9em; border: 2.5px solid var(--emerald); border-radius: .45em; color: var(--emerald); font-size: 1.9em; font-weight: 700; letter-spacing: .12em; transform: rotate(-9deg); opacity: .78; }
.iv-paper .p-draft { position: absolute; left: 50%; top: 44%; color: rgba(30, 42, 74, .07); font-size: 8em; font-weight: 700; letter-spacing: .12em; transform: translate(-50%, -50%) rotate(-24deg); pointer-events: none; }

/* Right: what this invoice needs from you */
.iv-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; border-left: 1px solid rgba(30, 42, 74, .08); background: rgba(255, 255, 255, .55); }
.iv-sec { padding: 18px 18px 16px; border-bottom: 1px solid rgba(30, 42, 74, .08); }
.iv-sec:last-child { border-bottom: 0; }
.iv-sec h3 { margin: 0 0 10px; color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.iv-amt { display: block; margin-top: 10px; font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.iv-amt-l { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--fs-small); }
.iv-amt-l.late { color: var(--red); font-weight: 600; }
.iv-acts { display: grid; gap: 8px; margin-top: 16px; }
.iv-acts .btn { width: 100%; min-height: 40px; height: 40px; justify-content: center; }
.iv-acts .btn-ghost { background: transparent; border-color: rgba(30, 42, 74, .18); }
.iv-acts .btn-ghost:hover { background: rgba(255, 255, 255, .8); border-color: rgba(30, 42, 74, .3); }
.iv-acts .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.iv-undo { margin: 10px 0 0; color: var(--muted); font-size: var(--fs-label); }
.iv-undo button { padding: 0; border: 0; background: none; color: #2f4a80; font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.iv-time { margin: 0; padding: 0; list-style: none; }
.iv-time li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 0 0 14px 20px; font-size: var(--fs-small); }
.iv-time li:last-child { padding-bottom: 0; }
.iv-time li::before { content: ""; position: absolute; left: -2px; top: 3px; width: 9px; height: 9px; border: 2px solid rgba(30, 42, 74, .28); border-radius: 50%; background: #fff; }
.iv-time li::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: -3px; width: 1px; background: rgba(30, 42, 74, .18); }
.iv-time li:last-child::after { display: none; }
.iv-time li.done::before { background: var(--navy); border-color: var(--navy); }
.iv-time li.late::before { background: var(--red); border-color: var(--red); }
.iv-time li.paid::before { background: var(--emerald); border-color: var(--emerald); }
.iv-time li.todo { color: var(--muted); }
.iv-time span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.iv-time li.late span:last-child { color: var(--red); font-weight: 600; }
.iv-cust b { display: block; font-size: 14px; font-weight: 600; }
.iv-cust span { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--fs-small); }
.iv-cust a { display: inline-block; margin-top: 8px; color: #2f4a80; font-size: var(--fs-small); font-weight: 600; }
/* Narrow windows: the actions come first, then the document, in one scrolling column */
@media (max-width: 940px) { .iv-body { display: flex; flex-direction: column; overflow-y: auto; } .iv-desk, .iv-desk.actual { order: 2; flex: none; overflow: visible; } .iv-zoom { display: none; } .iv-side { order: 1; flex: none; overflow: visible; border-left: 0; border-bottom: 1px solid rgba(30, 42, 74, .08); } .iv-pager span { display: none; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-fog { transition: none; } }

/* Printing (and "Save as PDF"): only the invoice goes out, as one A4 page. The window, the action panel and the
   dashboard behind are left out. The page is laid out 720px wide; 210mm is 794px, so it is scaled by 794/720. */
@page invoice { size: A4; margin: 0; }   /* a named page, so printing any other screen keeps the browser's normal margins */
@media print {
  /* Only while the invoice window is open (body.iv-open); printing the dashboard itself is not affected */
  html:has(body.iv-open), body.iv-open { height: auto !important; overflow: visible !important; background: #fff !important; }
  body.iv-open > *:not(#viewLayer), #viewLayer .sheet-fog, .iv-head, .iv-side, .iv-zoom { display: none !important; }
  #viewLayer, .sheet.sheet-inv, .iv-body, .iv-desk { position: static !important; display: block !important; inset: auto !important; width: auto !important; height: auto !important; max-width: none !important; max-height: none !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; overflow: visible !important; transform: none !important; opacity: 1 !important; }
  body.iv-open .iv-paper { page: invoice; zoom: 1.1027 !important; width: 720px !important; min-height: 1004px !important; margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .iv-paper .p-draft { color: rgba(30, 42, 74, .09); }
  .iv-paper .p-advice, .iv-paper .p-pay, .iv-paper .p-tot, .iv-paper tr { break-inside: avoid; }
  /* A little less air at the foot, so the page stays inside one A4 sheet */
  body.iv-open .iv-paper { padding-bottom: 22px !important; }
  .iv-paper .p-pay { margin-bottom: 1.6em; }
}
.iv-paper .p-logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.iv-paper .p-logo.has-img { width: auto; max-width: 13em; height: 4.4em; border-radius: 0; background: none; }
.iv-paper .p-empty { padding: 1.4em 0; color: #66625b; }

/* Invoice window: the document is the original Invoice.html in a frame (locked PDF layout, not restyled here).
   The frame is given the page's own size and scaled as a whole to fit. */
.iv-frame { display: block; width: 760px; height: 1040px; margin: 0 auto; border: 0; border-radius: 4px; background: #fff; box-shadow: 0 1px 2px rgba(20, 22, 28, .08), 0 14px 34px rgba(30, 42, 74, .13); color-scheme: light; }

/* Invoice window showing a preview from the form: no previous / next, no timeline */
#viewLayer.is-preview .iv-pager, #viewLayer.is-preview .iv-side .iv-sec:nth-child(2) { display: none; }
#viewLayer.is-preview .iv-amt-l { margin-top: 6px; line-height: 1.45; }
.iv-cust a[hidden] { display: none; }

/* ---------- Quotes window: six status filters on one line ---------- */
#quoSheetTabs { gap: 6px; }
#quoSheetTabs button { padding: 0 11px; gap: 8px; }

/* Quotes window sits higher on the screen than the centred Invoices window (owner's choice, 20 Nov 2026) */
#quoLayer { place-items: start center; }
#quoLayer .sheet { margin-top: 18.5vh; max-height: calc(100vh - 18.5vh - 24px); }
@media (max-height: 560px) { #quoLayer .sheet { margin-top: 6vh; max-height: calc(94vh - 24px); } }

/* The form window holds two frames (invoice, quote); only the one in use shows */
.sheet-frame iframe[hidden] { display: none; }

/* New / Edit Quote window sits one row higher than centre (owner, 20 Nov 2026), as far as there is room above it */
.sheet.sheet-frame[data-kind="quo"] { top: calc(-1 * min(40px, max(0px, (100vh - var(--nw-h, 620px)) / 2 - 12px))); }

/* New / Edit Invoice window sits two rows higher than centre (owner, 20 Nov 2026), as far as there is room above it */
.sheet.sheet-frame[data-kind="inv"] { top: calc(-1 * min(80px, max(0px, (100vh - var(--nw-h, 620px)) / 2 - 12px))); }

/* ---------- Customers window: split view (list at the left, the chosen customer's account at the right) ---------- */
/* Height is set by cuFitH (finoice-home.js) to fit the content; it sits two rows above centre while there is room. */
.sheet.sheet-cus { position: relative; inset: auto; width: calc(100% - 64px); max-width: 1220px; height: var(--cu-h, min(720px, 92vh)); max-height: calc(100vh - 24px); min-height: 0; margin: 0; top: calc(-1 * min(80px, max(0px, (100vh - var(--cu-h, 720px)) / 2 - 12px))); }
.sheet-cus .sheet-h .btn { flex: none; min-height: 36px; height: 36px; padding: 0 16px; }
.cu-split { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); border-top: 1px solid rgba(30, 42, 74, .08); }
.cu-left { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid rgba(30, 42, 74, .08); }
/* Filters: three equal parts across the list, the same chip as the Invoices and Quotes windows (36px, count in a badge) */
.cu-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 10px 10px 8px; flex: none; }
.cu-chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 36px; padding: 0 8px; border: 1px solid rgba(30, 42, 74, .08); border-radius: 999px; background: rgba(255, 255, 255, .6); color: var(--ink-2); font: inherit; font-size: var(--fs-small); font-weight: 500; white-space: nowrap; cursor: pointer; }
.cu-chip:hover { border-color: rgba(30, 42, 74, .22); }
.cu-chip[aria-pressed="true"] { border-color: var(--navy); background: #fff; box-shadow: 0 0 0 1px var(--navy); color: var(--ink); font-weight: 600; }
.cu-chip:focus-visible { outline: 2px solid #3b6aa5; outline-offset: 2px; }
.cu-chip em { min-width: 20px; padding: 0 6px; border-radius: 999px; background: rgba(30, 42, 74, .07); color: var(--ink-2); font-size: 12px; font-style: normal; font-weight: 600; line-height: 1.6; text-align: center; font-variant-numeric: tabular-nums; }
.cu-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 8px 8px; }
.cu-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 12px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cu-row:hover { background: rgba(30, 42, 74, .05); }
.cu-row[aria-current="true"] { background: rgba(30, 42, 74, .09); }
.cu-row:focus-visible { outline: 2px solid #3b6aa5; outline-offset: -2px; }
.cu-av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(30, 42, 74, .08); color: var(--navy); font-size: 12px; font-weight: 700; }
.cu-nm { flex: 1 1 auto; min-width: 0; }
.cu-nm b { display: block; font-size: var(--fs-small); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-nm span { font-size: var(--fs-label); color: var(--muted); }
.cu-amt { flex: none; text-align: right; font-size: var(--fs-small); font-weight: 600; font-variant-numeric: tabular-nums; }
.cu-amt small { display: block; font-size: 11px; font-weight: 600; }
.cu-amt.none { color: var(--muted); font-weight: 500; }
.cu-late { color: var(--red); }
.cu-det { min-width: 0; min-height: 0; overflow-y: auto; padding: 18px 22px 22px; }
.cu-empty { padding: 28px 10px; color: var(--muted); font-size: var(--fs-small); }
.cu-top { display: flex; align-items: flex-start; gap: 12px; }
.cu-top .cu-av { width: 44px; height: 44px; font-size: 15px; }
.cu-top h3 { margin: 0; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.cu-top p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-small); }
.cu-acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cu-acts .btn { min-height: 34px; padding: 0 14px; font-size: var(--fs-small); }
.cu-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.cu-tile { padding: 12px 14px; border: 1px solid rgba(30, 42, 74, .09); border-radius: 14px; background: rgba(255, 255, 255, .7); }
.cu-tile span { display: block; color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.cu-tile b { display: block; margin-top: 2px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cu-tile small { color: var(--ink-2); font-size: var(--fs-label); }
.cu-contact { display: grid; gap: 5px; padding: 10px 12px; border: 1px solid rgba(30, 42, 74, .09); border-radius: 12px; background: rgba(30, 42, 74, .03); font-size: var(--fs-small); }
.cu-contact div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
.cu-contact span { color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.cu-contact b { font-weight: 500; white-space: pre-line; overflow-wrap: anywhere; }
.cu-tabs { position: relative; display: inline-flex; margin: 16px 0 8px; padding: 3px; border-radius: 999px; background: rgba(30, 42, 74, .06); }
.cu-tabs button { position: relative; z-index: 1; min-height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.cu-tabs button[aria-selected="true"] { color: var(--ink); }
.cu-ind { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(20, 22, 28, .14); transition: transform .28s cubic-bezier(.22, 1, .36, 1), width .28s cubic-bezier(.22, 1, .36, 1); }
.cu-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.cu-table th { padding: 8px 10px; text-align: left; color: var(--muted); font-size: var(--fs-label); font-weight: 600; border-bottom: 1px solid rgba(30, 42, 74, .1); white-space: nowrap; }
.cu-table td { padding: 9px 10px; border-bottom: 1px solid rgba(30, 42, 74, .06); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cu-table th.num, .cu-table td.num { text-align: right; }
.cu-table tbody tr { cursor: pointer; }
.cu-table tbody tr:hover { background: rgba(30, 42, 74, .04); }
.cu-table a { color: inherit; text-decoration: none; }
.cu-table a:focus-visible { outline: 2px solid #3b6aa5; outline-offset: 2px; border-radius: 4px; }
/* New / edit customer */
.cu-form { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; border-radius: inherit; background: rgba(252, 246, 240, .72); }
.cu-form[hidden] { display: none; }
.cu-card { width: min(520px, 100%); max-height: 100%; overflow-y: auto; padding: 20px 22px; border: 1px solid rgba(30, 42, 74, .12); border-radius: 18px; background: #fff; box-shadow: 0 24px 60px rgba(30, 42, 74, .2); display: grid; gap: 12px; }
.cu-card h3 { margin: 0 0 2px; font-size: 17px; font-weight: 600; }
.cu-field label { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: var(--fs-label); font-weight: 600; }
.cu-field .input { width: 100%; }
.cu-field textarea.input { height: auto; min-height: 60px; padding: 9px 12px; line-height: 1.45; resize: vertical; }
.cu-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cu-err { margin: 6px 0 0; color: var(--red); font-size: var(--fs-label); font-weight: 600; }
.cu-id { margin: 0; color: var(--muted); font-size: var(--fs-label); }
.cu-form-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.cu-form-foot .spacer { flex: 1 1 auto; }
.cu-form-foot .btn, .cu-confirm .btn { min-height: 36px; padding: 0 16px; }
.cu-del { color: var(--red); }
.cu-confirm { padding: 12px 14px; border: 1px solid var(--red); border-radius: 12px; background: var(--red-bg); }
.cu-confirm[hidden] { display: none; }
.cu-confirm p { margin: 0 0 10px; color: var(--ink); font-size: var(--fs-small); line-height: 1.45; }
.cu-confirm div { display: flex; justify-content: flex-end; gap: 8px; }
.cu-danger { background: var(--red); border-color: var(--red); color: #fff; }
@media (prefers-reduced-motion: reduce) { .cu-ind { transition: none; } }
@media (max-width: 900px) { .sheet.sheet-cus { width: calc(100% - 24px); height: 94vh !important; max-height: 94vh; top: 0; } .cu-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(120px, 34%) minmax(0, 1fr); } .cu-left { border-right: 0; border-bottom: 1px solid rgba(30, 42, 74, .08); } .cu-tiles, .cu-two { grid-template-columns: minmax(0, 1fr); } .cu-acts { margin-left: 0; justify-content: flex-start; } .cu-top { flex-wrap: wrap; } .sheet-cus .sheet-search { display: none; } }

/* Customer list: the figure is the total owed; the small line under it says how much of that is overdue */
.cu-amt small.cu-ok { color: var(--muted); font-weight: 500; }
.cu-amt .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Sidebar legibility (owner, 22 Nov 2026) ----------
   Before: labels 13px in mid-grey (#3a3d46), 16px icons at 1.6 stroke, and the current page the same weight as the rest.
   Now: 14px in the main ink colour, 18px icons at 1.9, 36px rows, and the current page is bolder on a stronger tint. */
.glass-app .side .nav-group a, .glass-app .side .side-foot a, .glass-app .side .side-foot .side-toggle { min-height: 36px; padding-top: 7px; padding-bottom: 7px; color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.glass-app .side .nav-group a .i, .glass-app .side .side-foot .i { width: 18px; height: 18px; stroke-width: 1.9; color: var(--ink-2); flex: none; }
.glass-app .side .nav-group a:hover { background: rgba(30, 42, 74, .06); }
.glass-app .side .nav-group a.on { background: rgba(30, 42, 74, .12); color: var(--navy); font-weight: 700; }
.glass-app .side .nav-group a.on .i { color: var(--navy); stroke-width: 2.1; }
/* Group headings are labels, not items: smaller than the 14px links on purpose, but 12.5px so they do not look shrunken beside them */
.glass-app .side .nav-group small { margin-bottom: 2px; color: var(--ink-2); font-size: 12.5px; font-weight: 700; letter-spacing: .07em; }
.glass-app .side .brand .lbl { font-size: 17px; }

/* Sidebar counts beside Quotes and Bills (the red one on Invoices was already there).
   Blue-grey = waiting on someone else; amber = due soon; red = overdue. */
.glass-app .side .nav-group a .n.n-info { background: rgba(30, 42, 74, .1); color: var(--navy); }
.glass-app .side .nav-group a .n.n-warn { background: #fdf0d5; color: #8a5a00; }
.glass-app .side .nav-group a .n[hidden] { display: none; }
.glass-app .is-collapsed .nav-group a .n.n-info { background: var(--navy); }
.glass-app .is-collapsed .nav-group a .n.n-warn { background: #d9940a; }

/* ---------- No empty space when there is little data (owner, 22 Nov 2026) ---------- */
/* Dashboard: a card marked is-short (finoice-home.js, shrinkCards) is as tall as its content, not as its slot */
.glass-app .dash .panel.is-short { align-self: start; height: auto; min-height: 0; }
.glass-app .dash .panel.is-short > * { flex-grow: 0; }
/* List windows (Invoices, Quotes): no minimum height, so two rows make a two-row window */
.sheet:not(.sheet-frame):not(.sheet-inv):not(.sheet-cus) { min-height: 0; }

/* Recent invoices on a narrow card: the long status reads "Awaiting" so the amount stays in view */
.pill .st-short { display: none; }
.p-inv.tight .pill .st-full { display: none; }
.p-inv.tight .pill .st-short { display: inline; }

/* Collapsed sidebar: the hidden group headings ("PURCHASES") were still as wide as their text and stretched every link
   in the group past the 56px sidebar, so the pointer and hover reacted well outside the icons. Nothing in a collapsed
   group may be wider than the sidebar. */
.glass-app .is-collapsed .side .nav-group { grid-template-columns: minmax(0, 1fr); }
.glass-app .is-collapsed .side .nav-group > small { min-width: 0; overflow: hidden; white-space: nowrap; }
.glass-app .is-collapsed .side .nav-group a, .glass-app .is-collapsed .side .side-foot a, .glass-app .is-collapsed .side .side-foot .side-toggle { min-width: 0; max-width: 100%; }

/* Customers window changes height with the chosen customer: its top edge stays where it is and it grows downward.
   (Only when it is too tall to fit below that point does it move up, to stay centred on the screen.) */
.people-layer { place-items: start center; }
.sheet.sheet-cus { top: 0; margin-top: max(12px, min(8vh, calc((100vh - var(--cu-h, 720px)) / 2))); }
@media (max-width: 900px) { .sheet.sheet-cus { margin-top: 3vh; } }

/* ---------- Upper limit for the list windows (owner, 22 Nov 2026): with a lot of data they stop short of the bottom of
   the screen and scroll inside, instead of running to the page edge. ---------- */
/* Customers: 8% above, at least 8% below */
.sheet.sheet-cus { max-height: 84vh; margin-top: max(12px, 8vh); }
/* Invoices: centred, at most 86% of the screen (7% above and below) */
.sheet:not(.sheet-frame):not(.sheet-inv):not(.sheet-cus) { max-height: 86vh; }
/* Quotes: starts 18.5% down, leaves 8% below */
#quoLayer .sheet { max-height: calc(100vh - 18.5vh - 8vh); }
@media (max-height: 560px) { #quoLayer .sheet { max-height: 86vh; } }
@media (max-width: 900px) { .sheet.sheet-cus { max-height: 94vh; margin-top: 3vh; } }

/* ---------- New / Edit Customer: a panel over the right side of the Customers window (22 Nov 2026) ----------
   Before: a small card floating in the middle over a dimmed window. Now it takes the place of the customer's page, the
   list stays in view at the left, and the fields are grouped (Business, Contact, Address) with the actions at the foot. */
.cu-split { position: relative; }
.cu-form { position: absolute; inset: 0 0 0 340px; z-index: 5; display: block; padding: 0; border-radius: 0 0 21px 0; background: rgba(255, 253, 250, .985); overflow: hidden; }
.cu-form[hidden] { display: none; }
.cu-card { width: auto; max-width: none; height: 100%; max-height: none; overflow-y: auto; padding: 18px 22px 0; border: 0; border-radius: 0; background: none; box-shadow: none; display: flex; flex-direction: column; gap: 14px; }
.cf-head { display: flex; align-items: center; gap: 12px; }
.cf-head .cu-av { width: 44px; height: 44px; font-size: 15px; }
.cf-who { flex: 1 1 auto; min-width: 0; }
.cf-who h3 { margin: 0; font-size: 18px; font-weight: 600; }
.cf-who p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-sec { margin: 0; padding: 14px 16px 16px; min-width: 0; border: 1px solid rgba(30, 42, 74, .09); border-radius: 14px; background: rgba(255, 255, 255, .7); display: grid; gap: 12px; }
.cf-sec legend { float: left; width: 100%; padding: 0; margin: 0 0 -2px; color: var(--ink); font-size: var(--fs-small); font-weight: 700; }
.cf-sec legend + * { clear: both; }
.cf-row { display: grid; gap: 12px; }
.cf-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cf-row.two-a { grid-template-columns: minmax(0, 1fr) 170px; }
.cf-lbl { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: var(--fs-label); font-weight: 600; }
.cf-static { margin: 0; min-height: 38px; display: flex; align-items: center; padding: 0 12px; border: 1px dashed rgba(30, 42, 74, .16); border-radius: 10px; color: var(--ink-2); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.cf-hint { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-label); }
.cu-form .cu-form-foot { position: sticky; bottom: 0; margin: auto -22px 0; padding: 12px 22px; border-top: 1px solid rgba(30, 42, 74, .1); background: rgba(252, 249, 245, .96); }
.cu-form .cu-confirm { margin-top: auto; margin-bottom: 14px; }
.cu-form .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) { .cu-form { inset: 0; border-radius: 0 0 21px 21px; } .cf-row.two, .cf-row.two-a { grid-template-columns: minmax(0, 1fr); } }

/* The panel's form fills the panel (a general form rule elsewhere centres forms at their content width); the fields
   themselves stop at a comfortable line length and sit at the left, under the title. */
.cu-form .cu-card { width: 100%; margin: 0; box-sizing: border-box; align-items: stretch; }
.cu-form .cu-card > .cf-head, .cu-form .cu-card > .cf-sec, .cu-form .cu-card > .cu-confirm { width: 100%; max-width: 660px; box-sizing: border-box; }

/* A little tighter, so the whole panel fits a 900px-high screen without scrolling */
.cu-form .cu-card { gap: 12px; padding-top: 16px; }
.cu-form .cf-sec { padding: 12px 14px 14px; gap: 10px; }
.cu-form .cu-field textarea.input { min-height: 52px; }

/* Edit customer: a small pencil beside the name (as in the iOS app), in place of an Edit button in the action row */
.cu-who { min-width: 0; }
.cu-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cu-pen { flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(30, 42, 74, .08); color: var(--navy); cursor: pointer; }
.cu-pen:hover { background: rgba(30, 42, 74, .15); }
.cu-pen:focus-visible { outline: 2px solid #3b6aa5; outline-offset: 2px; }
.cu-pen .i { width: 15px; height: 15px; stroke-width: 2; }

/* ---------- New / Edit Customer as a pop-up (owner, 22 Nov 2026) ----------
   A dialog centred on the screen over the Customers window, which is dimmed behind it. Same grouped fields as before. */
.people-layer > .cu-form { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 24px; border-radius: 0; background: rgba(250, 245, 238, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); overflow: auto; }
.people-layer > .cu-form[hidden] { display: none; }
.people-layer > .cu-form .cu-card { width: min(600px, 100%); height: auto; max-height: min(88vh, 760px); margin: 0; padding: 18px 22px 0; border: 1px solid rgba(30, 42, 74, .12); border-radius: 20px; background: #fffdfa; box-shadow: 0 28px 70px rgba(30, 42, 74, .26); overflow-y: auto; }
.people-layer > .cu-form .cu-card > .cf-head, .people-layer > .cu-form .cu-card > .cf-sec, .people-layer > .cu-form .cu-card > .cu-confirm { max-width: none; }
.people-layer > .cu-form .cu-form-foot { margin-top: 2px; border-radius: 0 0 19px 19px; background: #faf6f0; }
.people-layer > .cu-form .cu-confirm { margin-top: 0; }
@media (max-width: 900px) { .people-layer > .cu-form { padding: 12px; } }

/* Customer address in four boxes */
.cf-row.three { grid-template-columns: minmax(0, 1.6fr) minmax(0, .8fr) minmax(0, .8fr); }
.cu-field select.input { width: 100%; }
.cu-form .cf-hint { margin: 0; }
@media (max-width: 900px) { .cf-row.three { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Customer pop-up, slimmer (owner: "a bit fat", 22 Nov 2026) ----------
   600 x 734 before. Now 480 wide: the three boxed groups lose their boxes (a small heading and a hairline instead),
   the header and the spacing are tighter, and the read-only ID takes less room. */
.people-layer > .cu-form .cu-card { width: min(480px, 100%); padding: 16px 20px 0; gap: 0; border-radius: 18px; }
.people-layer > .cu-form .cf-head { gap: 10px; padding-bottom: 12px; }
.people-layer > .cu-form .cf-head .cu-av { width: 36px; height: 36px; font-size: 13px; }
.people-layer > .cu-form .cf-who h3 { font-size: 16px; }
.people-layer > .cu-form .cf-who p { margin-top: 1px; font-size: var(--fs-label); }
.people-layer > .cu-form .cf-sec { padding: 12px 0 14px; border: 0; border-top: 1px solid rgba(30, 42, 74, .09); border-radius: 0; background: none; gap: 10px; }
.people-layer > .cu-form .cf-sec legend { margin: 0; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.people-layer > .cu-form .cf-row { gap: 10px; }
.people-layer > .cu-form .cf-row.two-a { grid-template-columns: minmax(0, 1fr) 132px; }
.people-layer > .cu-form .cf-row.three { grid-template-columns: minmax(0, 1.5fr) 92px 96px; }
.people-layer > .cu-form .cu-field label, .people-layer > .cu-form .cf-lbl { margin-bottom: 4px; }
.people-layer > .cu-form .cu-field .input, .people-layer > .cu-form .cf-static { height: 36px; min-height: 36px; }
.people-layer > .cu-form .cf-static { padding: 0 10px; font-size: var(--fs-label); }
.people-layer > .cu-form .cf-hint { font-size: 11.5px; }
.people-layer > .cu-form .cu-form-foot { margin: 0 -20px; padding: 10px 20px; border-radius: 0 0 17px 17px; }
.people-layer > .cu-form .cu-form-foot .btn, .people-layer > .cu-form .cu-confirm .btn { min-height: 34px; padding: 0 14px; }
.people-layer > .cu-form .cu-confirm { margin: 0 0 12px; }
@media (max-width: 900px) { .people-layer > .cu-form .cf-row.three, .people-layer > .cu-form .cf-row.two-a { grid-template-columns: minmax(0, 1fr); } }

/* The read-only Customer ID stays on one line */
.cf-static { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Suppliers window: uses the Customers window's styles (.sheet-cus, .cu-*). Only its bills heading is new. */
.cu-h4 { margin: 18px 0 8px; font-size: var(--fs-small); font-weight: 700; color: var(--ink); }
.cu-h4 span { margin-left: 6px; padding: 0 7px; border-radius: 999px; background: rgba(30, 42, 74, .07); color: var(--ink-2); font-size: 12px; font-weight: 600; }

/* ---------- Bills window (22 Nov 2026) ---------- */
.bl-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 18px 12px; flex: none; }
.bl-kpi { padding: 11px 14px; border: 1px solid rgba(30, 42, 74, .1); border-radius: 14px; background: rgba(255, 255, 255, .72); text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.bl-kpi:hover { border-color: rgba(30, 42, 74, .26); }
.bl-kpi[aria-pressed="true"] { border-color: var(--navy); background: #fff; box-shadow: 0 0 0 1px var(--navy); }
.bl-kpi:focus-visible { outline: 2px solid #3b6aa5; outline-offset: 2px; }
.bl-kpi span { display: block; color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.bl-kpi b { display: block; margin-top: 2px; font-size: 19px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bl-kpi small { color: var(--ink-2); font-size: var(--fs-label); }
.bl-kpi.k-late b { color: var(--red); }
.bl-fbar { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 18px 12px; flex-wrap: wrap; flex: none; }
.bl-tagwrap { position: relative; }
.bl-tag { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px dashed rgba(30, 42, 74, .32); border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.bl-tag:hover { border-color: var(--navy); color: var(--ink); }
.bl-tag.on { border-style: solid; border-color: var(--navy); background: #fff; color: var(--ink); }
.bl-tag .v { color: var(--navy); }
.bl-tag .clr { margin-left: 2px; padding: 0 2px; color: var(--muted); font-weight: 700; }
.bl-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 6; min-width: 220px; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid rgba(30, 42, 74, .12); border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(30, 42, 74, .18); }
.bl-pop button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font: inherit; font-size: var(--fs-small); color: var(--ink); cursor: pointer; }
.bl-pop button:hover, .bl-pop button:focus-visible { background: rgba(30, 42, 74, .07); outline: none; }
.bl-bulk { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; padding: 4px 5px 4px 12px; border-radius: 999px; background: var(--navy); color: #fff; font-size: var(--fs-small); font-weight: 600; }
.bl-bulk[hidden] { display: none; }
.bl-bulk button { min-height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: #fff; color: var(--navy); font: inherit; font-size: var(--fs-label); font-weight: 700; cursor: pointer; }
.bl-table { width: 100%; }
.bl-table th, .bl-table td { white-space: nowrap; }
.bl-table th.num, .bl-table td.num { text-align: right; }
.bl-table .bl-ck { width: 34px; padding-right: 0; }
.bl-table .bl-clip { width: 30px; color: var(--ink-2); }
.bl-table .bl-clip .i { width: 15px; height: 15px; vertical-align: -3px; }
.bl-table .ck { width: 16px; height: 16px; accent-color: var(--navy); }
.bl-table tbody tr { cursor: pointer; }
.bl-table tbody tr.sel { background: rgba(30, 42, 74, .06); }
.bl-table td.late { color: var(--red); }
.bl-sup { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.due-bar { display: inline-block; width: 52px; height: 5px; margin-left: 8px; border-radius: 999px; background: rgba(30, 42, 74, .08); vertical-align: middle; overflow: hidden; }
.due-bar i { display: block; height: 100%; border-radius: 999px; }
.bl-table .row-link, .bl-table .row-link:hover, .bl-table .row-link:hover b { color: inherit; text-decoration: none; }   /* bill number: no underline on hover (the whole row is clickable) */
.sheet-bills .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) { .bl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 12px 10px; } .bl-fbar { padding: 0 12px 10px; } }
/* Bill form window: wider when the supplier's file is shown beside the form */
.sheet.sheet-frame.doc-wide { max-width: min(1480px, calc(100vw - 48px)); }
.sheet.sheet-frame[data-kind="bil"] { top: calc(-1 * min(60px, max(0px, (100vh - var(--nw-h, 620px)) / 2 - 12px))); }

/* Bills window, Action column: every button the same width (Mark Paid / Edit / View), centred, with its header centred over them */
.bl-table th.bl-act, .bl-table td.bl-act { width: 1%; text-align: center; }
.bl-table td.bl-act .btn { min-width: 84px; justify-content: center; }
/* Pop-up windows move by their title bar (finoice-home.js, end) */
.win-drag { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.win-drag.dragging { cursor: grabbing; }
.win-drag input, .win-drag button, .win-drag a, .win-drag select, .win-drag textarea { cursor: auto; }
.win-drag button, .win-drag a { cursor: pointer; }
.win-drag input, .win-drag textarea { cursor: text; user-select: text; -webkit-user-select: text; }

/* ---------- Receipts window (same frame as Bills) ---------- */
.sheet.sheet-frame[data-kind="rec"] { top: calc(-1 * min(60px, max(0px, (100vh - var(--nw-h, 620px)) / 2 - 12px))); }
.rc-table .rc-m { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; }
.rc-table .rc-m b { overflow: hidden; text-overflow: ellipsis; }
.rc-ico { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(30, 42, 74, .06); }
.rc-ico .i { width: 15px; height: 15px; color: var(--navy); stroke-width: 1.8; }
.rc-table .pill.p-cat { background: rgba(30, 42, 74, .06); color: var(--ink-2); }
.rc-table .pill.p-cat::before { display: none; }
.rc-none { color: var(--muted); font-size: var(--fs-label); }
.rc-table tbody tr { cursor: pointer; }

/* ---------- GST & BAS window ---------- */
.sheet-bas { max-width: 1120px; }
.sheet-bas .sheet-h { flex-wrap: wrap; }
.bas-seg { display: inline-flex; padding: 3px; border: 1px solid rgba(30, 42, 74, .1); border-radius: 999px; background: rgba(255, 255, 255, .7); margin-left: auto; }
.bas-seg button { min-height: 30px; padding: 0 13px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.bas-seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.bas-per { display: inline-flex; align-items: center; gap: 4px; }
.bas-per .icon-btn:disabled { opacity: .35; cursor: default; }
.bas-cur { min-width: 170px; text-align: center; line-height: 1.25; }
.bas-cur b { display: block; font-size: var(--fs-small); font-weight: 600; }
.bas-cur small { color: var(--muted); font-size: var(--fs-label); }
.bas-body { padding: 0 18px 8px; overflow-y: auto; }
.bas-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; margin-bottom: 14px; }
.bas-card { padding: 14px 16px; border: 1px solid rgba(30, 42, 74, .1); border-radius: 14px; background: rgba(255, 255, 255, .75); min-width: 0; }
.bas-card h3 { margin: 0 0 6px; color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.bas-lbl { color: var(--ink-2); font-size: var(--fs-small); font-weight: 600; }
.bas-big { font-size: 32px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.bas-due { margin-top: 6px; color: var(--ink-2); font-size: var(--fs-small); }
.bas-due b { color: var(--ink); }
.bas-due span { color: var(--muted); }
.bas-prog { margin-top: 12px; }
.bas-prog[hidden] { display: none; }
.bas-prog .bar { height: 6px; border-radius: 999px; background: rgba(30, 42, 74, .08); overflow: hidden; }
.bas-prog .bar i { display: block; height: 100%; border-radius: 999px; background: var(--navy); }
.bas-prog .lbls { display: flex; justify-content: space-between; margin-top: 5px; color: var(--muted); font-size: var(--fs-label); }
.bas-leg { display: flex; gap: 14px; margin-top: 14px; color: var(--ink-2); font-size: var(--fs-label); }
.bas-leg i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }
.bas-leg .s, .bas-chart .s { background: var(--navy); }
.bas-leg .p, .bas-chart .p { background: #c9a35c; }
.bas-chart { display: flex; align-items: flex-end; gap: 12px; height: 112px; padding-top: 6px; }
.bas-chart .c { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bas-chart .bars { display: flex; flex-direction: row; align-items: flex-end; gap: 4px; height: 86px; }
.bas-chart .bars i { display: block; width: 14px; border-radius: 4px 4px 0 0; }
.bas-chart span { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.bas-chart .c.now span { color: var(--ink); font-weight: 700; }
.bas-brk > div { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid rgba(30, 42, 74, .06); font-size: var(--fs-small); }
.bas-brk code { font: inherit; font-size: var(--fs-label); font-weight: 700; color: var(--navy); }
.bas-brk small { color: var(--muted); font-size: var(--fs-label); }
.bas-brk b { font-weight: 600; font-variant-numeric: tabular-nums; }
.bas-brk .net { margin-top: 4px; padding-top: 10px; border-top: 1px solid rgba(30, 42, 74, .16); border-bottom: 0; font-weight: 600; }
.bas-brk .net b { font-size: 17px; }
.bas-fn { margin: 10px 0 0; color: var(--muted); font-size: var(--fs-label); }
.bas-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.bas-tabs button { min-height: 30px; padding: 0 12px; border: 1px solid rgba(30, 42, 74, .12); border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.bas-tabs button[aria-selected="true"] { border-color: var(--navy); background: #fff; color: var(--ink); }
.bas-table tbody tr { cursor: pointer; }
.sheet-bas .sheet-f { display: flex; align-items: center; gap: 8px; }
.sheet-bas .sheet-f .sp { flex: 1 1 auto; }
.sheet-bas .sheet-f .btn { min-height: 34px; }
@media (max-width: 900px) { .bas-top { grid-template-columns: minmax(0, 1fr); } .bas-seg { margin-left: 0; } }
.bl-bulk button.bl-bulk-del { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); }
.bl-bulk button.bl-bulk-del:hover { background: rgba(255, 255, 255, .14); }

/* The "new" action sits at the right end of the filter row (Bills, Receipts), not in the title bar beside search and close */
.bl-fbar .bl-new { margin-left: auto; min-height: 34px; }
.bl-fbar .bl-bulk:not([hidden]) ~ .bl-new { margin-left: 8px; }
/* Customers / Suppliers: "+ New …" as the first row of the name list */
.cu-addrow { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 10px 6px; min-height: 36px; border: 1px dashed rgba(30, 42, 74, .3); border-radius: 12px; background: none; color: var(--navy); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; flex: none; }
.cu-addrow:hover { border-style: solid; border-color: var(--navy); background: #fff; }
.cu-addrow:focus-visible { outline: 2px solid #3b6aa5; outline-offset: 2px; }
.cu-addrow .i { width: 15px; height: 15px; stroke-width: 2.2; }

/* "+ New Customer / New Supplier": on hover it fills deep navy with white text (owner chose no moving light) */
.cu-addrow { transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
.cu-addrow:hover, .cu-addrow:focus-visible { color: #fff; border-style: solid; border-color: var(--navy); background: var(--navy); }

/* Bills and Receipts open three rows (120px) higher than centre, never closer than 12px to the top of the screen */
#billLayer .sheet, #rcLayer .sheet { top: calc(-1 * min(120px, max(0px, (100vh - var(--sh, 640px)) / 2 - 12px))); }

/* GST & BAS keeps one size while periods change (the list of documents scrolls inside), so nothing jumps */
.sheet.sheet-bas:not(.sheet-frame) { height: min(780px, calc(100vh - 40px)); }
.sheet-bas .bas-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.sheet-bas .bas-top { flex: none; }
.sheet-bas .bas-src { flex: 1 1 auto; min-height: 140px; display: flex; flex-direction: column; }
.sheet-bas .bas-src .bas-tabs { flex: none; }
.sheet-bas .bas-tablewrap { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.sheet-bas .bas-tablewrap thead th { position: sticky; top: 0; z-index: 1; background: rgba(255, 253, 250, .98); }
.bas-prog.off { visibility: hidden; }
.bas-cur { min-width: 190px; }
.bas-due { min-height: 1.5em; white-space: nowrap; }

/* GST & BAS: the figures to type into the BAS (whole dollars), and the notes on what is and isn't counted */
.bas-report { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: rgba(30, 42, 74, .05); font-size: var(--fs-small); }
.bas-report span { flex: 1 0 100%; color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.bas-report b { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.bas-notes { flex: none; margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 4px; font-size: var(--fs-label); color: var(--ink-2); }
.bas-notes li { position: relative; padding-left: 14px; line-height: 1.45; }
.bas-notes li::before { content: ""; position: absolute; left: 3px; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: rgba(30, 42, 74, .35); }
.bas-notes li.warn { color: #7a5214; }
.bas-notes li.warn::before { background: #d9940a; }
.bas-due { white-space: normal; }
.bas-report { display: block; margin-top: 8px; padding: 0; background: none; color: var(--muted); font-size: var(--fs-label); }

/* BAS statement preview (Export PDF): the pages on grey, Download PDF / Print at the top */
#basPvLayer { z-index: 60; }
.sheet.sheet-baspv:not(.sheet-frame) { width: min(940px, calc(100% - 48px)); max-width: none; height: calc(100vh - 48px); }
.sheet-baspv .sheet-h .sp { flex: 1 1 auto; }
.baspv-frame { flex: 1 1 auto; min-height: 0; width: 100%; border: 0; border-top: 1px solid rgba(30, 42, 74, .08); background: #eef0f4; border-radius: 0 0 22px 22px; }

/* GST & BAS chart: $ scale on the left, light gridlines, two bars per period (colours checked for colour-blind separation) */
.bas-chart { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: 112px auto; column-gap: 8px; row-gap: 6px; height: auto; padding-top: 10px; align-items: stretch; }
.bc-axis { position: relative; grid-column: 1; grid-row: 1; }
.bc-axis span { position: absolute; right: 0; transform: translateY(50%); color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.bc-plot { position: relative; grid-column: 2; grid-row: 1; display: flex; align-items: stretch; gap: 12px; }
.bc-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid rgba(30, 42, 74, .07); }
.bc-grid.base { border-top-color: rgba(30, 42, 74, .28); }
.bc-col { position: relative; flex: 1 1 0; display: flex; justify-content: center; align-items: flex-end; min-width: 0; border-radius: 6px; outline: none; }
.bc-col:hover, .bc-col:focus-visible { background: rgba(30, 42, 74, .04); }
.bc-col:focus-visible { box-shadow: 0 0 0 2px #3b6aa5; }
.bc-col .bars { display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.bc-col .bars i { display: block; width: 14px; min-height: 0; border-radius: 4px 4px 0 0; }
.bas-chart .s, .bas-leg .s { background: #3d6bb3; }
.bas-chart .p, .bas-leg .p { background: #b7802a; }
.bc-x { grid-column: 2; grid-row: 2; display: flex; gap: 12px; }
.bc-x span { flex: 1 1 0; min-width: 0; text-align: center; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.bc-x span.now { color: var(--ink); font-weight: 700; }
.bc-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 3; display: none; min-width: 170px; padding: 8px 10px; border: 1px solid rgba(30, 42, 74, .12); border-radius: 10px; background: #fff; box-shadow: 0 8px 22px rgba(30, 42, 74, .16); font-size: var(--fs-label); color: var(--ink-2); pointer-events: none; }
.bc-col:hover .bc-tip, .bc-col:focus-visible .bc-tip { display: grid; gap: 4px; }
.bc-tip b { color: var(--ink); font-size: var(--fs-small); }
.bc-tip span { display: flex; align-items: center; gap: 6px; }
.bc-tip span i { width: 8px; height: 8px; border-radius: 2px; }
.bc-tip em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.bc-col:first-child .bc-tip { left: 0; transform: none; }
.bc-col:last-child .bc-tip { left: auto; right: 0; transform: none; }
.baspv-frame { background: #cfd4dc; }

/* ---------- Reports window ---------- */
.sheet.sheet-rp:not(.sheet-frame) { width: min(1180px, calc(100% - 48px)); max-width: none; height: min(880px, calc(100vh - 40px)); }
.sheet-rp .sheet-h .sp { flex: 1 1 auto; }
.rp-bar { display: flex; align-items: center; gap: 12px; padding: 0 18px 12px; flex: none; flex-wrap: wrap; }
.rp-tabs { display: inline-flex; gap: 6px; }
.rp-tabs button { min-height: 34px; padding: 0 14px; border: 1px solid rgba(30, 42, 74, .12); border-radius: 999px; background: rgba(255, 255, 255, .6); color: var(--ink-2); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.rp-tabs button[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.rp-range { margin-left: auto; }
.rp-range[hidden] { display: none; }
.rp-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.rp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; flex: none; }
.rp-kpi { padding: 12px 14px; border: 1px solid rgba(30, 42, 74, .1); border-radius: 14px; background: rgba(255, 255, 255, .75); }
.rp-kpi span { display: block; color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.rp-kpi b { display: block; margin-top: 2px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.rp-kpi small { color: var(--ink-2); font-size: var(--fs-label); }
.rp-kpi.neg b { color: var(--red); }
.rp-card { flex: none; padding: 14px 16px 16px; border: 1px solid rgba(30, 42, 74, .1); border-radius: 14px; background: rgba(255, 255, 255, .78); min-width: 0; }
.rp-card > header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.rp-card h3 { margin: 0; font-size: var(--fs-small); font-weight: 700; color: var(--ink); }
.rp-card > header p { margin: 0; color: var(--muted); font-size: var(--fs-label); }
.rp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; flex: none; }
.rp-leg { display: flex; gap: 16px; margin-bottom: 6px; color: var(--ink-2); font-size: var(--fs-label); }
.rp-leg i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.rp-leg i.ln { height: 3px; width: 14px; border-radius: 2px; vertical-align: 2px; }
/* column chart */
.rc-chart { display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: var(--h) auto; column-gap: 8px; row-gap: 6px; padding-top: 8px; }
.rc-axis { position: relative; }
.rc-axis span { position: absolute; right: 0; transform: translateY(-50%); color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-plot { position: relative; }
/* chart gridlines (renamed from rc-grid: the receipt form uses that name for its fields) */
.rc-gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid rgba(30, 42, 74, .07); }
.rc-gl.zero { border-top-color: rgba(30, 42, 74, .3); }
.rc-col { position: absolute; top: 0; bottom: 0; border-radius: 6px; outline: none; }
.rc-col:hover, .rc-col:focus-visible { background: rgba(30, 42, 74, .045); }
.rc-col:focus-visible { box-shadow: 0 0 0 2px #3b6aa5; }
.rc-bars { position: absolute; inset: 0; display: flex; justify-content: center; gap: 2px; }
.rc-bars i { position: relative; display: block; border-radius: 4px 4px 0 0; }
.rc-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.rc-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.rc-x { grid-column: 2; display: flex; }
.rc-x span { flex: 1 1 0; min-width: 0; text-align: center; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-x span.now { color: var(--ink); font-weight: 700; }
.rc-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 4; display: none; min-width: 180px; padding: 8px 10px; border: 1px solid rgba(30, 42, 74, .12); border-radius: 10px; background: #fff; box-shadow: 0 8px 22px rgba(30, 42, 74, .16); font-size: var(--fs-label); color: var(--ink-2); pointer-events: none; }
.rc-col:hover .rc-tip, .rc-col:focus-visible .rc-tip { display: grid; gap: 4px; }
.rc-tip b { color: var(--ink); font-size: var(--fs-small); }
.rc-tip span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.rc-tip span i { width: 8px; height: 8px; border-radius: 2px; }
.rc-tip span i.ln { height: 3px; }
.rc-tip em { margin-left: auto; padding-left: 10px; font-style: normal; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.rc-col:first-child .rc-tip { left: 0; transform: none; }
/* horizontal bars */
.rp-hbars { display: grid; gap: 8px; }
.rp-hb { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto 38px; align-items: center; gap: 10px; font-size: var(--fs-small); }
.rp-hb .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.rp-hb .t { height: 10px; border-radius: 0 4px 4px 0; background: rgba(30, 42, 74, .05); overflow: hidden; }
.rp-hb .t i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.rp-hb b { font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-hb small { color: var(--muted); font-size: var(--fs-label); text-align: right; }
.rp-empty { margin: 14px 0; color: var(--muted); font-size: var(--fs-small); text-align: center; }
/* aged */
.rp-stack { display: flex; gap: 2px; height: 16px; margin: 4px 0 10px; border-radius: 6px; overflow: hidden; }
.rp-stack i { display: block; height: 100%; }
.rp-aged-leg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.rp-aged-leg div { display: grid; gap: 2px; }
.rp-aged-leg span { color: var(--ink-2); font-size: var(--fs-label); }
.rp-aged-leg span i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; vertical-align: -1px; }
.rp-aged-leg b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-aged-leg small { color: var(--muted); font-size: var(--fs-label); }
.rp-table { width: 100%; }
.rp-table th, .rp-table td { white-space: nowrap; }
.rp-table td.late { color: var(--red); }
.rp-table tbody tr { cursor: pointer; }
.rp-table tfoot td { font-weight: 700; border-top: 1px solid rgba(30, 42, 74, .16); }
.rp-dash { color: var(--muted); }
@media (max-width: 900px) { .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rp-two { grid-template-columns: minmax(0, 1fr); } .rp-aged-leg { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Reports: the title stands out (no description line under it) */
.sheet-rp .rp-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--ink); }
.sheet-rp .sheet-h { padding-top: 18px; padding-bottom: 14px; }

/* Aged Receivables: radial bar chart (one ring per age group) with the list beside it */
.rp-radial { display: grid; grid-template-columns: var(--rr, 240px) minmax(0, 1fr); gap: 22px; align-items: center; }
.rp-radial svg { width: var(--rr, 240px); height: var(--rr, 240px); display: block; overflow: visible; }
.rr-trk { fill: none; stroke: rgba(30, 42, 74, .07); stroke-linecap: round; }
.rr-arc { fill: none; stroke-linecap: round; transition: opacity .15s ease; }
.rr-arc.dim { opacity: .22; }
.rr-lbl { font-size: 10.5px; fill: var(--muted); text-anchor: end; }
.rr-c1 { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.rr-c2 { font-size: 16px; font-weight: 700; fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; }
.rr-list { display: grid; gap: 2px; max-width: 460px; }
.rr-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 46px; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; font-size: var(--fs-small); }
.rr-row[data-k]:hover { background: rgba(30, 42, 74, .05); }
.rr-row i { width: 12px; height: 12px; border-radius: 3px; }
.rr-row b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.rr-row small { color: var(--muted); font-size: var(--fs-label); text-align: right; }
.rr-row.tot { margin-top: 4px; padding-top: 10px; border-top: 1px solid rgba(30, 42, 74, .12); border-radius: 0; font-weight: 700; }
.rp-agedrow { display: flex; flex-direction: column; gap: 12px; flex: none; }
.rp-agedrow.rp-split { flex-direction: row; align-items: flex-start; }
.rp-agedrow.rp-split > * { flex: 1 1 0; min-width: 0; }
.rp-agedrow.rp-split .rp-radial { grid-template-columns: var(--rr, 150px) minmax(0, 1fr); gap: 14px; }
.rp-agedrow.rp-split .rp-table th, .rp-agedrow.rp-split .rp-table td { padding-left: 6px; padding-right: 6px; font-size: 12px; }
/* Aged table: never wider than its card (names wrap, "days" dropped from the heads when side by side) */
.rp-card.rp-tablecard { overflow-x: auto; }   /* only the customer table may scroll sideways; charts never make a card scroll */
.rp-table td:first-child { white-space: normal; min-width: 90px; }
.rp-agedrow.rp-split .rp-table th small { display: none; }
/* P&L: every month's figures under the chart */
.rp-mtab { width: 100%; margin-top: 10px; border-collapse: collapse; table-layout: fixed; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.rp-mtab th, .rp-mtab td { padding: 5px 2px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid rgba(30, 42, 74, .07); }
.rp-mtab thead th { border-top: 0; color: var(--muted); font-weight: 600; font-size: 10.5px; }
.rp-mtab tbody th { width: 92px; text-align: left; color: var(--ink-2); font-weight: 600; }
.rp-mtab tbody th i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; }
.rp-mtab tbody tr:last-child td, .rp-mtab tbody tr:last-child th { font-weight: 700; color: var(--ink); }
.rp-mtab td[data-neg] { color: var(--red); }
.rp-mtab .z { color: rgba(30, 42, 74, .3); }
.rp-mtab .now { background: rgba(30, 42, 74, .04); color: var(--ink); }
.rp-mtab .tot { width: 64px; font-weight: 700; color: var(--ink); background: rgba(30, 42, 74, .03); }
/* the month table lines up with the chart: its first column is the chart's $ axis (52px + 8px gap) */
.rp-mtab tbody th { width: 60px; padding-right: 0; font-size: 10.5px; overflow: hidden; text-overflow: clip; }
.rp-mtab thead th:first-child { width: 60px; }
.rp-mtab th, .rp-mtab td { text-align: center; }
.rp-mtab tbody th { text-align: left; }
.rp-mtab tbody th i { margin-right: 4px; }
/* P&L card: a wider axis column so the table's row names fit, and the table's first column matches it */
.rp-pnl .rc-chart { grid-template-columns: 74px minmax(0, 1fr); }
.rp-pnl .rp-mtab tbody th { width: 82px; font-size: 11px; }
.rp-pnl .rp-mtab tbody tr:first-child td, .rp-pnl .rp-mtab tbody tr:first-child th { border-top: 1px solid rgba(30, 42, 74, .12); }

/* Chart hover box: opens inside the plot (from its top), on the column's side towards the middle, so it never leaves the card */
.rc-tip { top: 2px; bottom: auto; }
.rc-col.tl .rc-tip { left: calc(50% - 10px); right: auto; transform: none; }
.rc-col.tr .rc-tip { left: auto; right: calc(50% - 10px); transform: none; }

/* Reports header: title, report tabs and range on one row */
.sheet-rp .rp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px 12px; }
.sheet-rp .rp-head .rp-title { margin: 0 6px 0 0; }
.sheet-rp .rp-head .rp-range { margin-left: 0; }
/* compact figure cards */
.rp-kpi { padding: 9px 13px; }
.rp-kpi b { font-size: 20px; margin-top: 0; }
/* P&L on short screens: the two small cards beside the chart */
.rp-body.rp-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 30%); align-items: start; align-content: start; }
.rp-body.rp-side > .rp-kpis { grid-column: 1 / -1; }
.rp-body.rp-side > .rp-pnl { grid-column: 1; grid-row: 2; }
.rp-body.rp-side > .rp-pnl-low { grid-column: 2; grid-row: 2; grid-template-columns: minmax(0, 1fr); }
.rp-body.rp-side .rp-pnl-low .rp-hb { grid-template-columns: minmax(70px, 38%) minmax(0, 1fr) auto; }
.rp-body.rp-side .rp-pnl-low .rp-hb small { display: none; }

/* Every list window opens with its top at the same place as Quotes (18.5% down the screen) and never runs past 8% from
   the bottom; a long list scrolls inside. GST & BAS and Reports keep their own (taller) frames. */
#invLayer, #cusLayer, #supLayer, #billLayer, #rcLayer { place-items: start center; }
#invLayer .sheet, #billLayer .sheet, #rcLayer .sheet, #cusLayer .sheet.sheet-cus, #supLayer .sheet.sheet-cus { top: 0; margin-top: 18.5vh; max-height: calc(100vh - 18.5vh - 8vh); }
@media (max-height: 560px) { #invLayer .sheet, #billLayer .sheet, #rcLayer .sheet, #cusLayer .sheet.sheet-cus, #supLayer .sheet.sheet-cus { margin-top: 6vh; max-height: 86vh; } }
@media (max-width: 900px) { #cusLayer .sheet.sheet-cus, #supLayer .sheet.sheet-cus { margin-top: 3vh; max-height: 94vh; } }
.sheet-rp .rp-pdf { min-height: 34px; }
.sheet-rp .rp-pdf[hidden] { display: none; }
/* Reports footer: Export PDF at the bottom left (as the other windows' footers), "esc to close" at the right */
.sheet-rp .rp-foot { display: flex; align-items: center; gap: 12px; flex: none; }
.sheet-rp .rp-foot .rp-pdf { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 13px 0 10px; border: 1px solid rgba(30, 42, 74, .14); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; transition: border-color .15s, background-color .15s, color .15s; }
.sheet-rp .rp-foot .rp-pdf:hover { border-color: var(--navy); background: var(--navy); color: #fff; }
.sheet-rp .rp-foot .rp-pdf:focus-visible { outline: 2px solid #3b6aa5; outline-offset: 2px; }
.sheet-rp .rp-foot .rp-pdf .i { width: 16px; height: 16px; }
.sheet-rp .rp-foot .rp-pdf[hidden] { display: none; }
.sheet-rp .rp-foot-note { flex: 1 1 auto; color: var(--muted); font-size: var(--fs-label); }
/* PDF preview: a reading size, not full screen — portrait pages about 700px wide, landscape about 920px */
.sheet.sheet-baspv:not(.sheet-frame) { width: min(640px, calc(100% - 48px)); height: min(820px, calc(100vh - 12vh)); }
.sheet.sheet-baspv.land:not(.sheet-frame) { width: min(880px, calc(100% - 48px)); height: min(700px, calc(100vh - 12vh)); }
/* the preview window's width is set from the page (pvFit); its height is the screen's */
.sheet.sheet-baspv:not(.sheet-frame), .sheet.sheet-baspv.land:not(.sheet-frame) { max-width: calc(100vw - 48px); height: min(900px, calc(100vh - 10vh)); }
.sheet.sheet-baspv.land:not(.sheet-frame) { height: min(720px, calc(100vh - 10vh)); }
.baspv-frame { overflow-x: hidden; }
.sheet-baspv .sheet-h { flex-wrap: nowrap; }
.sheet-baspv .sheet-title { min-width: 0; flex: 1 1 auto; }
.sheet-baspv .sheet-title h2, .sheet-baspv .sheet-title p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-baspv .sheet-h .btn { flex: none; }

/* PDF preview toolbar (as Acrobat): page ‹ n / N ›, zoom − % +, Fit page / Fit width */
.sheet-baspv .pv-tools { flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 12px; border-top: 1px solid rgba(30, 42, 74, .08); background: rgba(250, 248, 245, .95); }
.pv-grp { display: inline-flex; align-items: center; gap: 2px; }
.pv-ib { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; }
.pv-ib:hover:not(:disabled) { background: rgba(30, 42, 74, .07); color: var(--ink); }
.pv-ib:disabled { opacity: .35; cursor: default; }
.pv-ib:focus-visible { outline: 2px solid #3b6aa5; outline-offset: 1px; }
.pv-ib .i { width: 16px; height: 16px; }
.pv-pg, .pv-zm { min-width: 54px; text-align: center; font-size: var(--fs-small); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.pv-sep { width: 1px; height: 18px; background: rgba(30, 42, 74, .14); }
.pv-seg { display: inline-flex; padding: 2px; border: 1px solid rgba(30, 42, 74, .12); border-radius: 999px; background: #fff; }
.pv-seg button { min-height: 26px; padding: 0 11px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-size: var(--fs-label); font-weight: 600; cursor: pointer; }
.pv-seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.sheet-baspv .baspv-frame { overflow-x: auto; }

/* Report preview: portrait window sits near the top of the screen (owner) */
#basPvLayer { place-items: start center; }
#basPvLayer .sheet.sheet-baspv.land { align-self: center; }
#basPvLayer .sheet.sheet-baspv:not(.land) { margin-top: 20px; }

/* Report preview window: resizable from its bottom-right corner (owner) */
#basPvLayer .sheet.sheet-baspv { resize: both; overflow: hidden; min-width: 640px; min-height: 360px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); }

/* Chart hover: only the tooltip shows, no band and no guide line (owner) */
.rc-col { cursor: pointer; }
.rc-col:hover, .rc-col:focus-visible { background: none; }

/* Up and down columns (P&L): income above the zero line, expenses below it, in one column */
.rc-chart.ud .rc-bars i { position: absolute; left: 50%; transform: translateX(-50%); }

/* Between two months the tooltip is hidden (owner) */
.rc-col.gap { cursor: default; }
.rc-col.gap:hover .rc-tip { display: none; }

/* ---------- Settings window (owner chose the card design, web-app-preview/settings-preview.html version B) ----------
   Sections at the left; each group of settings is a card with its own note and Save. Every section fits without scrolling. */
.sheet.sheet-st:not(.sheet-frame) { width: min(1040px, calc(100% - 48px)); height: min(680px, 94vh); min-height: 0; }
.st-wrap { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); border-top: 1px solid rgba(30, 42, 74, .08); }
.st-nav { padding: 12px 10px; border-right: 1px solid rgba(30, 42, 74, .08); background: rgba(250, 248, 245, .7); overflow: auto; border-bottom-left-radius: 22px; }
.st-nav h3 { margin: 12px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.st-nav h3:first-child { margin-top: 2px; }
.st-nav button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: inherit; font-size: var(--fs-small); font-weight: 600; text-align: left; cursor: pointer; }
.st-nav button:hover { background: rgba(30, 42, 74, .05); }
.st-nav button[aria-current="true"] { background: var(--navy); color: #fff; }
.st-nav button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.st-nav .i { width: 17px; height: 17px; flex: none; }
.st-nav .st-out { margin-top: 14px; color: var(--red); }
.st-pane { min-width: 0; overflow: auto; padding: 18px 22px; background: rgba(244, 241, 236, .6); border-bottom-right-radius: 22px; }
.st-cols { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.st-cols.one { grid-template-columns: minmax(0, 700px); }
.st-card { margin: 0 0 14px; border: 1px solid rgba(30, 42, 74, .1); border-radius: 14px; background: #fff; overflow: hidden; }
.st-card:last-child { margin-bottom: 0; }
.st-cb { padding: 14px 18px 16px; }
.st-card h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.st-cd { margin: 3px 0 12px; color: var(--muted); font-size: var(--fs-small); }
.st-cf { display: flex; align-items: center; gap: 12px; padding: 7px 18px; border-top: 1px solid rgba(30, 42, 74, .08); background: rgba(250, 248, 245, .8); }
.st-note { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; }
.st-note.dirty { color: var(--ochre); font-weight: 600; }
.st-note.err { color: var(--red); font-weight: 600; }
.st-cf .btn { min-height: 34px; padding: 0 16px; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.st-grid .full { grid-column: 1 / -1; }
.st-f { display: grid; gap: 6px; align-content: start; }
.st-f label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.st-f input, .st-f select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid rgba(30, 42, 74, .16); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: var(--fs-small); }
.st-f input:focus, .st-f select:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.st-f input[aria-invalid="true"] { border-color: var(--red); }
.st-with-pic { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; align-items: start; }
.st-pic { display: grid; justify-items: center; gap: 8px; }
.st-box { display: grid; place-items: center; width: 72px; height: 72px; padding: 0; border: 0; border-radius: 16px; background: var(--navy); color: #fff; font: 600 26px var(--sans); overflow: hidden; cursor: pointer; }
.st-box.round { border-radius: 50%; background: var(--silk-blue-deep); }
.st-box.has { background: #fff; box-shadow: inset 0 0 0 1px rgba(30, 42, 74, .12); }
.st-box img { width: 100%; height: 100%; object-fit: contain; }
.st-box.round img { object-fit: cover; }
.st-box:hover { filter: brightness(1.12); }
.st-box:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.st-pic .btn { width: 100%; min-height: 34px; padding: 0 8px; }
.st-lnk { border: 0; background: none; padding: 0 6px; color: var(--muted); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.st-lnk:hover { color: var(--red); text-decoration: underline; }
.st-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(30, 42, 74, .06); }
.st-seg button { min-height: 32px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.st-seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 22, 28, .14); }
.st-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 0; border-top: 1px solid rgba(30, 42, 74, .08); }
.st-row:first-of-type { border-top: 0; padding-top: 0; }
.st-row:last-child { padding-bottom: 0; }
.st-row .t { flex: 1; min-width: 0; }
.st-row .t b { display: block; font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
.st-row .t span { color: var(--muted); font-size: var(--fs-small); overflow-wrap: anywhere; }
.st-row .btn { min-height: 34px; padding: 0 13px; }
.st-edit { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.st-edit[hidden] { display: none; }
.st-edit .act { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.st-edit .st-note { flex: 1; }
.st-side { position: sticky; top: 0; }
.st-cap { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.st-doc { padding: 16px 16px 14px; border: 1px solid rgba(30, 42, 74, .1); border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(20, 22, 28, .08); }
.st-doc .lh { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1.5px solid var(--navy); }
.st-doc .lg { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 600; overflow: hidden; }
.st-doc .lg.has { background: none; border-radius: 0; }
.st-doc .lg img { width: 100%; height: 100%; object-fit: contain; }
.st-doc b { display: block; font-size: 14px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.st-doc small { display: block; color: var(--muted); font-size: 10.5px; line-height: 1.45; overflow-wrap: anywhere; }
.st-doc .ln { height: 7px; margin-top: 10px; border-radius: 4px; background: rgba(30, 42, 74, .07); }
.st-doc .ln.s { width: 55%; }
.st-doc .pay { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(30, 42, 74, .1); }
.st-doc .pay i { display: block; margin-bottom: 3px; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.icon-btn .acct-av.pic { width: 28px; height: 28px; border-radius: 50%; background-size: cover; background-position: center; font-size: 0; }
@media (max-width: 900px) { .st-cols { grid-template-columns: 1fr; } .st-side { position: static; } }
@media (max-width: 760px) { .st-wrap { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); } .st-nav { display: flex; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid rgba(30, 42, 74, .08); border-radius: 0; } .st-nav h3 { display: none; } .st-nav button { width: auto; white-space: nowrap; } .st-nav .st-out { margin-top: 0; } .st-grid, .st-with-pic, .st-edit { grid-template-columns: 1fr; } .st-pane { padding: 14px; } }
.st-f textarea { width: 100%; height: 58px; padding: 9px 12px; border: 1px solid rgba(30, 42, 74, .16); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: var(--fs-small); line-height: 1.4; resize: none; }
.st-f textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.st-edit .full { grid-column: 1 / -1; }
/* a little tighter, so Payment details (two cards) fits a 700px-tall screen without scrolling */
.st-pane { padding: 14px 22px; }
.st-card { margin-bottom: 12px; }
.st-cb { padding: 12px 18px 14px; }
.st-cd { margin: 3px 0 10px; }
.st-eg { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 10px; background: rgba(30, 42, 74, .06); color: var(--ink); font-size: var(--fs-small); font-weight: 600; font-variant-numeric: tabular-nums; }
/* No all-caps labels in Settings: Title Case as written (owner) */
.st-nav h3, .st-cap, .st-doc .pay i { text-transform: none; letter-spacing: 0; font-size: 12px; }
/* Settings opens with its top where Quotes opens (18.5% down the screen), as every list window does (owner) */
#stLayer { place-items: start center; }
#stLayer .sheet.sheet-st { top: 0; margin-top: 18.5vh; height: min(680px, calc(100vh - 18.5vh - 24px)); max-height: none; }
@media (max-height: 560px) { #stLayer .sheet.sheet-st { margin-top: 6vh; height: calc(94vh - 24px); } }

/* ---------- Stronger type (owner: the whole design read soft and thin, nothing bold) ----------
   Three clear levels instead of everything at 500–600: page and window titles 800, card titles / figures / amounts /
   buttons 700, labels and notes stay 500. Sizes unchanged. */
.glass-app { --fw-strong: 700; --fw-title: 700; --fw-display: 800; }
.glass-app .greet h1, .glass-app .sheet-title h2, .glass-app .rp-title { font-weight: 800; }
.glass-app .panel-h h2, .glass-app .st-card h3, .glass-app .rp-card h3 { font-weight: 700; }
.glass-app .face-fig > b, .glass-app .gst-amt b, .glass-app .rp-kpi b { font-weight: 800; }
.glass-app .shell b, .glass-app .sheet b, .glass-app td.num, .glass-app .sheet-table td.num { font-weight: 700; }
.glass-app .btn { font-weight: 700; }
.glass-app .side a .lbl { font-weight: 600; }
.glass-app .side a.on .lbl { font-weight: 800; }
.glass-app .shell .face-fig > b, .glass-app .shell .gst-amt b { font-weight: 800; }
/* Sidebar collapse / expand, smoothed (owner: the interaction felt stiff), and the toggle button moved to the top bar
   (owner agreed, 24 Nov): it sits at the far left of the top bar, right beside the sidebar's edge, in the same place
   whether the sidebar is open or collapsed, and slides with that edge. It never touches the Finoice icon. */
.glass-app .shell { transition: grid-template-columns .32s var(--ease); }
.glass-app .topbar .side-toggle, .glass-app .is-collapsed .topbar .side-toggle { display: grid; position: static; flex: none; width: 32px; height: 32px; margin: 0 2px 0 -8px; border-radius: 9px; opacity: 1; background: none; color: var(--ink-2); transition: background .15s, color .15s, transform .12s; }
.glass-app .topbar .side-toggle:hover, .glass-app .is-collapsed .topbar .side-toggle:hover { background: rgba(30, 42, 74, .07); color: var(--ink); }
html.night .glass-app .topbar .side-toggle:hover { background: rgba(255, 255, 255, .1); }
.glass-app .topbar .side-toggle svg { width: 17px; height: 17px; transition: transform .32s var(--ease); }
.glass-app .is-collapsed .topbar .side-toggle svg { transform: scaleX(-1); }
.glass-app .topbar .side-toggle:active { transform: scale(.92); }
.glass-app .lbl, .glass-app .company > div { transition: max-width .32s var(--ease), opacity .22s .08s; }
.glass-app .is-collapsed .lbl, .glass-app .is-collapsed .company > div { transition: max-width .32s var(--ease), opacity .12s; }
.glass-app .nav-group > small { transition: opacity .2s; }
.glass-app .nav-group a, .glass-app .side-foot a { transition: background .15s, color .15s, padding .32s var(--ease); }
@media (prefers-reduced-motion: reduce) { .glass-app .shell, .glass-app .topbar .side-toggle, .glass-app .topbar .side-toggle svg, .glass-app .nav-group > small, .glass-app .nav-group a, .glass-app .side-foot a { transition: none; } }

/* Business badge beside the greeting (owner, 24 Nov 2026): fixed, not a switcher. The logo from Settings when there is
   one, otherwise the initials on a navy tile with a soft inner light. */
.co-badge { display: inline-grid; flex: none; place-items: center; }
.co-badge .av { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border-radius: 11px; background: linear-gradient(155deg, #34477a 0%, var(--navy) 70%); color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .02em; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .06), 0 2px 6px rgba(30, 42, 74, .22); }
.co-badge .av.has-logo { background: #fff; box-shadow: inset 0 0 0 1px rgba(30, 42, 74, .1), 0 2px 6px rgba(30, 42, 74, .12); }
.co-badge .av img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }

/* ---------- Statements window (24 Nov 2026) ----------
   Customers at the left (the Customers window's list), the statement at the right on a desk, at 90% and full A4: it is
   never shrunk to squeeze the page in; the desk scrolls for the rest. The window's bottom edge sits a little higher (owner). */
#soaSheet.sheet-soa { inset: auto; top: 20px; margin: 0; width: min(1240px, calc(100% - 64px)); max-width: none; height: calc(100vh - 86px); max-height: none; }   /* top edge where it was first built; bottom 40px lower (owner, 25 Nov). An id, so it beats the 86vh cap set on all windows */
.soa-split { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); border-top: 1px solid rgba(30, 42, 74, .08); }
.soa-right { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.soa-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid rgba(30, 42, 74, .08); flex: none; }
.soa-who { flex: 1 1 180px; min-width: 0; }
.soa-who b { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soa-who small { color: var(--muted); font-size: var(--fs-label); }
.soa-per { margin-left: 0; }
.soa-per button { min-height: 28px; padding: 0 11px; font-size: 12px; }
.soa-tools .btn { min-height: 34px; height: 34px; padding: 0 15px; }
.soa-desk { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 18px; background: #dfe2e8; border-bottom-right-radius: 21px; }
.soa-desk iframe { display: block; margin: 0 auto; width: 794px; border: 0; background: transparent; }
.soa-desk .cu-empty { margin: 40px auto; text-align: center; }
#soaList .cu-amt small.cu-late { color: #b3261e; }
@media (max-width: 1100px) { .soa-split { grid-template-columns: 260px minmax(0, 1fr); } }
@media (max-width: 900px) { #soaSheet.sheet-soa { top: 0; width: calc(100% - 24px); height: 94vh; } .soa-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(120px, 30%) minmax(0, 1fr); } .soa-split .cu-left { border-right: 0; border-bottom: 1px solid rgba(30, 42, 74, .08); } }
